From 76fb811e08b2e4e48bb310df4f0b2b12f82203a7 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 31 Jan 2020 10:44:35 +0100 Subject: [PATCH 1/3] 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 --- agent/bindir/libvirtqemuhook.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agent/bindir/libvirtqemuhook.in b/agent/bindir/libvirtqemuhook.in index 27e07119ccc..894d68c7b0b 100755 --- a/agent/bindir/libvirtqemuhook.in +++ b/agent/bindir/libvirtqemuhook.in @@ -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()) From 75aa6e36598d211c6aef385d916d14e3b93303c7 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 31 Jan 2020 10:53:11 +0100 Subject: [PATCH 2/3] ui: fix cannot assign vms to internal lb in VPC (#3832) This fixes the issue that cannot assign VMs in Internal LB in VPC. listView is overwritten due to commit 2e2b670 (#3161) Fixes: #3827 --- ui/scripts/ui/widgets/listView.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js index 91578148e28..48e4bcc50cd 100644 --- a/ui/scripts/ui/widgets/listView.js +++ b/ui/scripts/ui/widgets/listView.js @@ -88,9 +88,9 @@ // Make sure the master checkbox is unselected if (multiSelect) { - var $listView = $instanceRow.closest('.list-view'); - $listView.find('input.multiSelectMasterCheckbox').prop('checked', false); - toggleMultiSelectActions($listView, false); + var $listView2 = $instanceRow.closest('.list-view'); + $listView2.find('input.multiSelectMasterCheckbox').prop('checked', false); + toggleMultiSelectActions($listView2, false); } var externalLinkAction = action.externalLink; From a71874682c4c94eed3f17216d260cc3d57214a85 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 31 Jan 2020 15:24:26 +0530 Subject: [PATCH 3/3] server: fix checking disk offering access for snapshot volume (#3791) Fixes #3783 As reported in the issue, creating volumes from pure snapshot fails with NPE. This is due to order of calls where disk offering access is checked before checking disk offering value. This PR fixes the same. Signed-off-by: Abhishek Kumar --- .../src/main/java/com/cloud/storage/VolumeApiServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java index ddd84137ad9..e6022513508 100644 --- a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java @@ -673,8 +673,6 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic zoneId = snapshotCheck.getDataCenterId(); } - _configMgr.checkDiskOfferingAccess(null, diskOffering, _dcDao.findById(zoneId)); - if (diskOffering == null) { // Pure snapshot is being used to create volume. diskOfferingId = snapshotCheck.getDiskOfferingId(); diskOffering = _diskOfferingDao.findById(diskOfferingId); @@ -689,6 +687,8 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic } } + _configMgr.checkDiskOfferingAccess(null, diskOffering, _dcDao.findById(zoneId)); + // check snapshot permissions _accountMgr.checkAccess(caller, null, true, snapshotCheck);