cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject [5/8] git commit: updated refs/heads/master to ef9830d
Date Tue, 09 Dec 2014 09:30:02 GMT
Fixing an issue related to figuring out the name of a datastore that is backed by managed storage


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

Branch: refs/heads/master
Commit: be38b9706615d5ab0cc9959577b0fff9a36a9fc6
Parents: d276c0f
Author: Mike Tutkowski <mike.tutkowski@solidfire.com>
Authored: Mon Dec 8 13:40:52 2014 -0700
Committer: Mike Tutkowski <mike.tutkowski@solidfire.com>
Committed: Mon Dec 8 14:40:49 2014 -0700

----------------------------------------------------------------------
 .../vmware/resource/VmwareResource.java         | 24 ++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be38b970/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 b0aaa7f..f55ca67 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<String, String> 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;


Mime
View raw message