From 3f8d0dd4871932b874ce615f54380f25539551d6 Mon Sep 17 00:00:00 2001 From: Will Stevens Date: Tue, 2 Dec 2014 18:24:16 -0500 Subject: [PATCH 1/6] CLOUDSTACK-7959: fixed 'qemu-img convert' compat issue --- tools/appliance/build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index 51abb38b861..a2b5957636d 100755 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -90,7 +90,14 @@ set -e # Export for KVM vboxmanage internalcommands converttoraw -format vdi "$hdd_path" raw.img +set +e qemu-img convert -o compat=0.10 -f raw -c -O qcow2 raw.img $appliance-$branch-kvm.qcow2 +qemuresult=$? +set -e +if [ ${qemuresult} != 0 ]; then + log INFO "'qemu-img convert' failed, trying without compat option" + qemu-img convert -f raw -c -O qcow2 raw.img $appliance-$branch-kvm.qcow2 +fi rm raw.img bzip2 $appliance-$branch-kvm.qcow2 echo "$appliance exported for KVM: dist/$appliance-$branch-kvm.qcow2.bz2" From ad59970d37dfbdda8abdb7096a5b02621fbb9714 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Mon, 8 Dec 2014 15:40:39 +0100 Subject: [PATCH 2/6] specifying MinVRVersion as 4.5.0 for the 4.5 branch --- api/src/com/cloud/network/VirtualNetworkApplianceService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/com/cloud/network/VirtualNetworkApplianceService.java b/api/src/com/cloud/network/VirtualNetworkApplianceService.java index a9d9c527f40..2984e3fa34e 100644 --- a/api/src/com/cloud/network/VirtualNetworkApplianceService.java +++ b/api/src/com/cloud/network/VirtualNetworkApplianceService.java @@ -69,5 +69,5 @@ public interface VirtualNetworkApplianceService { List upgradeRouterTemplate(UpgradeRouterTemplateCmd cmd); - public static final String MinVRVersion = "4.3.0"; + public static final String MinVRVersion = "4.5.0"; } From d276c0faab0ac4d200714d8eb2081ed1c47f13aa Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Mon, 8 Dec 2014 21:54:31 +0530 Subject: [PATCH 3/6] developer: increase disable thresholds global settings for developers - Increases the disable thresholds for developers - Removes the use local storage for systemvms Signed-off-by: Rohit Yadav (cherry picked from commit 314e2daceeeecccdbdc34973d039d16817d2d166) Signed-off-by: Rohit Yadav --- developer/developer-prefill.sql | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/developer/developer-prefill.sql b/developer/developer-prefill.sql index 7534cefa995..c2d4f4357d8 100644 --- a/developer/developer-prefill.sql +++ b/developer/developer-prefill.sql @@ -64,7 +64,19 @@ INSERT INTO `cloud`.`configuration` (category, instance, component, name, value) INSERT INTO `cloud`.`configuration` (category, instance, component, name, value) VALUES ('Advanced', 'DEFAULT', 'management-server', - 'system.vm.use.local.storage', 'true'); + 'cluster.cpu.allocated.capacity.disablethreshold', '0.95'); + +INSERT INTO `cloud`.`configuration` (category, instance, component, name, value) + VALUES ('Advanced', 'DEFAULT', 'management-server', + 'cluster.memory.allocated.capacity.disablethreshold ', '0.95'); + +INSERT INTO `cloud`.`configuration` (category, instance, component, name, value) + VALUES ('Advanced', 'DEFAULT', 'management-server', + 'pool.storage.allocated.capacity.disablethreshold ', '0.95'); + +INSERT INTO `cloud`.`configuration` (category, instance, component, name, value) + VALUES ('Advanced', 'DEFAULT', 'management-server', + 'pool.storage.capacity.disablethreshold ', '0.95'); -- Add developer configuration entry; allows management server to be run as a user other than "cloud" INSERT INTO `cloud`.`configuration` (category, instance, component, name, value) From be38b9706615d5ab0cc9959577b0fff9a36a9fc6 Mon Sep 17 00:00:00 2001 From: Mike Tutkowski Date: Mon, 8 Dec 2014 13:40:52 -0700 Subject: [PATCH 4/6] Fixing an issue related to figuring out the name of a datastore that is backed by managed storage --- .../vmware/resource/VmwareResource.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index b0aaa7fddd3..f55ca67cb40 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -2035,15 +2035,31 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa if (diskInfoBuilder != null) { VolumeObjectTO volume = (VolumeObjectTO)vol.getData(); - ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, volume.getDataStore().getUuid()); - DatastoreMO dsMo = new DatastoreMO(context, morDs); - String dsName = dsMo.getName(); + String dsName = null; + String diskBackingFileBaseName= null; Map details = vol.getDetails(); boolean isManaged = details != null && Boolean.parseBoolean(details.get(DiskTO.MANAGED)); + if (isManaged) { + String iScsiName = details.get(DiskTO.IQN); + + // if the storage is managed, iScsiName should not be null + dsName = VmwareResource.getDatastoreName(iScsiName); + + diskBackingFileBaseName = new DatastoreFile(volume.getPath()).getFileBaseName(); + } + else { + ManagedObjectReference morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(hyperHost, volume.getDataStore().getUuid()); + DatastoreMO dsMo = new DatastoreMO(context, morDs); + + dsName = dsMo.getName(); + + diskBackingFileBaseName = volume.getPath(); + } + VirtualMachineDiskInfo diskInfo = - diskInfoBuilder.getDiskInfoByBackingFileBaseName(isManaged ? new DatastoreFile(volume.getPath()).getFileBaseName() : volume.getPath(), dsName); + diskInfoBuilder.getDiskInfoByBackingFileBaseName(diskBackingFileBaseName, dsName); if (diskInfo != null) { s_logger.info("Found existing disk info from volume path: " + volume.getPath()); return diskInfo; From 0af15e4a2cc7ead3764856567b35d8dddcc09d8e Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 8 Dec 2014 15:18:01 -0800 Subject: [PATCH 5/6] CLOUDSTACK-8047: UI > zone wizard > add primary storage step: (zone-wide-primary-storage) fix a bug that failed to get cluster's hypervisor value if previous step (e.g. add host step) has ever failed. --- ui/scripts/zoneWizard.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 2c90f2b084e..4ce4efbf9be 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -4458,8 +4458,16 @@ array1.push("&scope=" + todb(args.data.primaryStorage.scope)); //zone-wide-primary-storage is supported only for KVM and VMWare - if (args.data.primaryStorage.scope == "zone") { - array1.push("&hypervisor=" + todb(args.data.cluster.hypervisor)); //hypervisor type of the hosts in zone that will be attached to this storage pool. KVM, VMware supported as of now. + if (args.data.primaryStorage.scope == "zone") { //hypervisor type of the hosts in zone that will be attached to this storage pool. KVM, VMware supported as of now. + if(args.data.cluster.hypervisor != undefined) { + array1.push("&hypervisor=" + todb(args.data.cluster.hypervisor)); + } else if(args.data.returnedCluster.hypervisortype != undefined) { + array1.push("&hypervisor=" + todb(args.data.returnedCluster.hypervisortype)); + } else { + cloudStack.dialog.notice({ + message: "Error: args.data.cluster.hypervisor is undefined. So is args.data.returnedCluster.hypervisortype (zone-wide-primary-storage)" + }); + } } var server = args.data.primaryStorage.server; From 016d009adfa7e12b7d5c2c43b946fc93ad07aa9d Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Tue, 9 Dec 2014 11:46:45 +0530 Subject: [PATCH 6/6] CLOUDSTACK-7994: Network rules are not configured in VR after out-of-band movement due to host crash The last commit 513adab51b53ba1acdea908225cfffab90ca1595 didn't fully fix it. Scenario #1 was not handled, only #2 was handled. Fixed #1 as part of this commit. 1. If VM is in stopped state in CS due to 'PowerMissing' report from old host (hostId is null) and then there is a 'PowerOn' report from new host 2. If VM is in running state in CS and there is a 'PowerOn' report from new host --- .../VirtualNetworkApplianceManagerImpl.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index f4e83ac4c38..fb39c0a2998 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -4461,16 +4461,23 @@ VirtualMachineGuru, Listener, Configurable, StateListener if (opaque != null && opaque instanceof Pair) { Pair pair = (Pair)opaque; Object first = pair.first(); Object second = pair.second(); - if (first != null && second != null && first instanceof Long && second instanceof Long) { - Long hostId = (Long)first; + // powerHostId cannot be null in case of out-of-band VM movement + if (second != null && second instanceof Long) { Long powerHostId = (Long)second; - // If VM host known to CS is different from 'PowerOn' report host, then it is out-of-band movement - if (hostId.longValue() != powerHostId.longValue()) { - s_logger.info("Schedule a router reboot task as router " + vo.getId() + " is powered-on out-of-band. we need to reboot to refresh network rules"); + Long hostId = null; + if (first != null && first instanceof Long) { + hostId = (Long)first; + } + // The following scenarios are due to out-of-band VM movement + // 1. If VM is in stopped state in CS due to 'PowerMissing' report from old host (hostId is null) and then there is a 'PowerOn' report from new host + // 2. If VM is in running state in CS and there is a 'PowerOn' report from new host + if (hostId == null || (hostId.longValue() != powerHostId.longValue())) { + s_logger.info("Schedule a router reboot task as router " + vo.getId() + " is powered-on out-of-band, need to reboot to refresh network rules"); _executor.schedule(new RebootTask(vo.getId()), 1000, TimeUnit.MICROSECONDS); } }