cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sate...@apache.org
Subject git commit: updated refs/heads/master to 41f2c75
Date Mon, 19 Aug 2013 05:55:49 GMT
Updated Branches:
  refs/heads/master 66d761506 -> 41f2c75ae


CLOUDSTACK-4385 : [ZWPS]Across the cluster live migration of VM on zone wide primary storage
pool fails

If all the VM's volumes are on zone wide primary storage pool then live migration of the VM
would not involve storage migration. Hence MigrateVM API would be called against MigrateVMWithVolume.
So far PrepareForMigrationCommand handled scenarios of VM moving across hosts within a cluster,
but with zone wide primary storage in picture this command need to handle scenarios of VM
moving across clusters. Try to find the VM in datacenter if not found within cluster.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/41f2c75a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/41f2c75a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/41f2c75a

Branch: refs/heads/master
Commit: 41f2c75aee69dc15de2acd0199ac7318ab3f291e
Parents: 66d7615
Author: Sateesh Chodapuneedi <sateesh@apache.org>
Authored: Mon Aug 19 05:52:13 2013 +0530
Committer: Sateesh Chodapuneedi <sateesh@apache.org>
Committed: Mon Aug 19 05:55:17 2013 +0530

----------------------------------------------------------------------
 .../hypervisor/vmware/resource/VmwareResource.java      | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/41f2c75a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
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 1438111..5ab2216 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
@@ -3723,9 +3723,15 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
             // find VM through datacenter (VM is not at the target host yet)
             VirtualMachineMO vmMo = hyperHost.findVmOnPeerHyperHost(vmName);
             if (vmMo == null) {
-                String msg = "VM " + vmName + " does not exist in VMware datacenter";
-                s_logger.error(msg);
-                throw new Exception(msg);
+                s_logger.info("VM " + vmName + " was not found in the cluster of host " +
hyperHost.getHyperHostName() + ". Looking for the VM in datacenter.");
+                ManagedObjectReference dcMor = hyperHost.getHyperHostDatacenter();
+                DatacenterMO dcMo = new DatacenterMO(hyperHost.getContext(), dcMor);
+                vmMo = dcMo.findVm(vmName);
+                if (vmMo == null) {
+                    String msg = "VM " + vmName + " does not exist in VMware datacenter";
+                    s_logger.error(msg);
+                    throw new Exception(msg);
+                }
             }
 
             NicTO[] nics = vm.getNics();


Mime
View raw message