cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [41/50] [abbrv] git commit: updated refs/heads/reporter to b26f3fc
Date Fri, 02 Jan 2015 14:36:33 GMT
CLOUDSTACK-8123. VM re-install fails.
While moving root disk into VM folder during restore, look for folder based on vCenter name.


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

Branch: refs/heads/reporter
Commit: 1c0bf321707b55e1502dd3d102ec192b00a83c19
Parents: a5a65c7
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Fri Dec 5 18:47:38 2014 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Wed Dec 24 14:01:20 2014 +0530

----------------------------------------------------------------------
 .../com/cloud/storage/resource/VmwareStorageProcessor.java  | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1c0bf321/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
index ba2255b..247c220 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
@@ -487,9 +487,12 @@ public class VmwareStorageProcessor implements StorageProcessor {
                 dsMo.deleteFile(srcFile, dcMo.getMor(), true);
             }
             // restoreVM - move the new ROOT disk into corresponding VM folder
-            String vmInternalCSName = volume.getVmName();
-            if (dsMo.folderExists(String.format("[%s]", dsMo.getName()), vmInternalCSName))
{
-                VmwareStorageLayoutHelper.syncVolumeToVmDefaultFolder(dcMo, vmInternalCSName,
dsMo, vmdkFileBaseName);
+            VirtualMachineMO restoreVmMo = dcMo.findVm(volume.getVmName());
+            if (restoreVmMo != null) {
+                String vmNameInVcenter = restoreVmMo.getName(); // VM folder name in datastore
will be VM's name in vCenter.
+                if (dsMo.folderExists(String.format("[%s]", dsMo.getName()), vmNameInVcenter))
{
+                    VmwareStorageLayoutHelper.syncVolumeToVmDefaultFolder(dcMo, vmNameInVcenter,
dsMo, vmdkFileBaseName);
+                }
             }
 
             VolumeObjectTO newVol = new VolumeObjectTO();


Mime
View raw message