cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sate...@apache.org
Subject [1/2] git commit: updated refs/heads/vmware-storage-motion to b3337df
Date Thu, 23 May 2013 10:56:25 GMT
Updated Branches:
  refs/heads/vmware-storage-motion f531da4f4 -> b3337dfe9


CLOUDSTACK-659

Fixing migrate volume.


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

Branch: refs/heads/vmware-storage-motion
Commit: 987fe8ea3a70b766660532fa66b4f5c27ca06cb5
Parents: b837fae
Author: Sateesh Chodapuneedi <sateesh@apache.org>
Authored: Thu May 23 16:23:09 2013 +0530
Committer: Sateesh Chodapuneedi <sateesh@apache.org>
Committed: Thu May 23 16:23:09 2013 +0530

----------------------------------------------------------------------
 .../hypervisor/vmware/resource/VmwareResource.java |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/987fe8ea/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 b674f21..4adc9e3 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
@@ -3551,11 +3551,13 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
 
         String srcDiskName = "";
         String srcDsName = "";
+        String tgtDsName = "";
 
         try {
             srcHyperHost = getHyperHost(getServiceContext());
             morDc = srcHyperHost.getHyperHostDatacenter();
             srcDsName = mgr.getStoragePoolOfVolume(cmd.getVolumeId());
+            tgtDsName = poolTo.getUuid().replace("-", "");
 
             // find VM through datacenter (VM is not at the target host yet)
             vmMo = srcHyperHost.findVmOnPeerHyperHost(vmName);
@@ -3564,6 +3566,12 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
                 s_logger.error(msg);
                 throw new Exception(msg);
             }
+            morDs = HypervisorHostHelper.findDatastoreWithBackwardsCompatibility(srcHyperHost,
tgtDsName);
+            if (morDs == null) {
+                String msg = "Unable to find the mounted datastore with name " + tgtDsName
+ " to execute MigrateVolumeCommand";
+                s_logger.error(msg);
+                throw new Exception(msg);
+            }
 
             srcDiskName = String.format("[%s] %s.vmdk", srcDsName, volumePath);
             diskLocator = new VirtualMachineRelocateSpecDiskLocator();
@@ -3577,7 +3585,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource,
Vmwa
             if (!vmMo.changeDatastore(relocateSpec)) {
                 throw new Exception("Change datastore operation failed during volume migration");
             } else {
-                s_logger.debug("Successfully migrated volume " + vmName + " to target datastore");
+                s_logger.debug("Successfully migrated volume " + volumePath + " to target
datastore " + tgtDsName);
             }
 
             return new MigrateVolumeAnswer(cmd, true, null, volumePath);


Mime
View raw message