mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
kvm: Fix router migration issue when router has control/public nics on other physical network than guest (#3855)
In VM migration on KVM, libvirt qemu hook script will change the bridge name to bridges for guest networks. It works for user vm. However for virtual router, it has nics on control network and public network. If control/public use different physical networks than guest network, virtual router cannot be migrated. Fixes: #2783
This commit is contained in:
parent
9d105b6546
commit
76fb811e08
@ -65,11 +65,15 @@ def handleMigrateBegin():
|
||||
bridge = source.getAttribute("bridge")
|
||||
if isOldStyleBridge(bridge):
|
||||
vlanId = bridge.replace("cloudVirBr", "")
|
||||
phyDev = getGuestNetworkDevice()
|
||||
elif isNewStyleBridge(bridge):
|
||||
vlanId = re.sub(r"br(\w+)-", "", bridge)
|
||||
phyDev = re.sub(r"-(\d+)$", "" , re.sub(r"^br", "" ,bridge))
|
||||
netlib = networkConfig()
|
||||
if not netlib.isNetworkDev(phyDev):
|
||||
phyDev = getGuestNetworkDevice()
|
||||
else:
|
||||
continue
|
||||
phyDev = getGuestNetworkDevice()
|
||||
newBrName = "br" + phyDev + "-" + vlanId
|
||||
source.setAttribute("bridge", newBrName)
|
||||
print(domain.toxml())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user