cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [1/2] git commit: updated refs/heads/master to bf2f441
Date Fri, 17 Feb 2017 06:42:56 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 12497d04b -> bf2f44121


CLOUDSTACK-9752: [Vmware] Optimization of volume attachness to vm


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

Branch: refs/heads/master
Commit: 49dadc5505d85323b0864f50a2a8e36dd05805e5
Parents: e02003d
Author: nvazquez <nicolas.m.vazquez@gmail.com>
Authored: Fri Jan 20 13:20:37 2017 -0300
Committer: nvazquez <nicovazquez90@gmail.com>
Committed: Fri Feb 10 11:02:44 2017 -0300

----------------------------------------------------------------------
 .../storage/resource/VmwareStorageProcessor.java      | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/49dadc55/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
index e790d47..1d33b16 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java
@@ -1577,11 +1577,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();


Mime
View raw message