You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2013/05/25 05:20:52 UTC
[19/24] git commit: updated refs/heads/vmware-storage-motion to
985435d
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/91433170
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/91433170
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/91433170
Branch: refs/heads/vmware-storage-motion
Commit: 91433170d917518b066478747490996dd18df967
Parents: 6b1b7ef
Author: Sateesh Chodapuneedi <sa...@apache.org>
Authored: Thu May 23 16:23:09 2013 +0530
Committer: Sateesh Chodapuneedi <sa...@apache.org>
Committed: Sat May 25 00:09:26 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/91433170/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 3c9319e..ca2a519 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
@@ -3608,11 +3608,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);
@@ -3621,6 +3623,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();
@@ -3634,7 +3642,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);