mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-9752: [Vmware] Optimization of volume attachness to vm
(cherry picked from commit 49dadc5505)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
120ac33d7a
commit
1d25582ed6
|
|
@ -1571,11 +1571,15 @@ public class VmwareStorageProcessor implements StorageProcessor {
|
|||
}
|
||||
|
||||
synchronized (this) {
|
||||
// s_logger.info("Delete file if exists in datastore to clear the way for creating the volume. file: " + volumeDatastorePath);
|
||||
VmwareStorageLayoutHelper.deleteVolumeVmdkFiles(dsMo, volumeUuid.toString(), dcMo);
|
||||
|
||||
vmMo.createDisk(volumeDatastorePath, (int)(volume.getSize() / (1024L * 1024L)), morDatastore, vmMo.getScsiDeviceControllerKey());
|
||||
vmMo.detachDisk(volumeDatastorePath, false);
|
||||
try {
|
||||
vmMo.createDisk(volumeDatastorePath, (int)(volume.getSize() / (1024L * 1024L)), morDatastore, vmMo.getScsiDeviceControllerKey());
|
||||
vmMo.detachDisk(volumeDatastorePath, false);
|
||||
}
|
||||
catch (Exception e) {
|
||||
s_logger.error("Deleting file " + volumeDatastorePath + " due to error: " + e.getMessage());
|
||||
VmwareStorageLayoutHelper.deleteVolumeVmdkFiles(dsMo, volumeUuid.toString(), dcMo);
|
||||
throw new CloudRuntimeException("Unable to create volume due to: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
VolumeObjectTO newVol = new VolumeObjectTO();
|
||||
|
|
|
|||
Loading…
Reference in New Issue