cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtutkow...@apache.org
Subject git commit: updated refs/heads/master to 3ac8f8d
Date Mon, 08 Dec 2014 21:39:37 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master dd700be26 -> 3ac8f8d60


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/3ac8f8d6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3ac8f8d6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3ac8f8d6

Branch: refs/heads/master
Commit: 3ac8f8d601cb2969cc61eedac978becb09950634
Parents: dd700be
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:26:31 2014 -0700

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3ac8f8d6/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 7e1b7cc..edcd9eb 100644
--- 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