You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mt...@apache.org on 2014/12/08 22:41:38 UTC
git commit: updated refs/heads/4.5 to be38b97
Repository: cloudstack
Updated Branches:
refs/heads/4.5 d276c0faa -> be38b9706
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/4.5
Commit: be38b9706615d5ab0cc9959577b0fff9a36a9fc6
Parents: d276c0f
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Dec 8 13:40:52 2014 -0700
Committer: Mike Tutkowski <mi...@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;