diff --git a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java index 0fd718fef42..6567f9d0ac0 100644 --- a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -881,7 +881,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa boolean datastoreChangeObserved = false; boolean volumePathChangeObserved = false; - if (cmd.getContextParam(DiskTO.PROTOCOL_TYPE) != null && cmd.getContextParam(DiskTO.PROTOCOL_TYPE).equalsIgnoreCase("DatastoreCluster")) { + if (cmd.getContextParam(DiskTO.PROTOCOL_TYPE) != null && cmd.getContextParam(DiskTO.PROTOCOL_TYPE).equalsIgnoreCase(Storage.StoragePoolType.DatastoreCluster.toString())) { VirtualMachineDiskInfoBuilder diskInfoBuilder = vmMo.getDiskInfoBuilder(); VirtualMachineDiskInfo matchingExistingDisk = getMatchingExistingDiskWithVolumeDetails(diskInfoBuilder, path, chainInfo, managed, cmd.get_iScsiName(), poolUUID, hyperHost, context); if (diskInfoBuilder != null && matchingExistingDisk != null) { @@ -957,7 +957,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa ResizeVolumeAnswer answer = new ResizeVolumeAnswer(cmd, true, "success", newSize * 1024); if (datastoreChangeObserved) { - answer.setContextParam("datastoreName", poolUUID); + answer.setContextParam("datastoreUUID", poolUUID); answer.setContextParam("chainInfo", chainInfo); } @@ -1954,7 +1954,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa s_logger.error(msg); throw new Exception(msg); } - if (rootDisk.getDetails().get(DiskTO.PROTOCOL_TYPE) != null && rootDisk.getDetails().get(DiskTO.PROTOCOL_TYPE).equalsIgnoreCase("DatastoreCluster")) { + if (rootDisk.getDetails().get(DiskTO.PROTOCOL_TYPE) != null && rootDisk.getDetails().get(DiskTO.PROTOCOL_TYPE).equalsIgnoreCase(Storage.StoragePoolType.DatastoreCluster.toString())) { if (diskInfoBuilder != null) { DatastoreMO diskDatastoreMofromVM = getDataStoreWhereDiskExists(hyperHost, context, diskInfoBuilder, rootDisk, diskDatastores); if (diskDatastoreMofromVM != null) { diff --git a/plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java b/plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java index 1f8d3761b21..9960bfb2a1f 100644 --- a/plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java +++ b/plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/driver/CloudStackPrimaryDataStoreDriverImpl.java @@ -425,13 +425,13 @@ public class CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDri vol.update(); VolumeVO volumeVO = volumeDao.findById(vol.getId()); - String datastoreName = answer.getContextParam("datastoreName"); - if (datastoreName != null) { - StoragePoolVO storagePoolVO = primaryStoreDao.findByUuid(datastoreName); + String datastoreUUID = answer.getContextParam("datastoreUUID"); + if (datastoreUUID != null) { + StoragePoolVO storagePoolVO = primaryStoreDao.findByUuid(datastoreUUID); if (storagePoolVO != null) { volumeVO.setPoolId(storagePoolVO.getId()); } else { - s_logger.warn(String.format("Unable to find datastore %s while updating the new datastore of the volume %d", datastoreName, vol.getId())); + s_logger.warn(String.format("Unable to find datastore %s while updating the new datastore of the volume %d", datastoreUUID, vol.getId())); } }