harikrishna-patnala commented on a change in pull request #5650:
URL: https://github.com/apache/cloudstack/pull/5650#discussion_r740718564



##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -928,34 +926,33 @@ private Answer execute(ResizeVolumeCommand cmd) {
                     vmMo.destroy();
                 }
             } catch (Throwable e) {
-                s_logger.info("Failed to destroy worker VM: " + vmName);
+                s_logger.error(String.format("Failed to destroy worker VM 
[name: %s] due to: [%s].", vmName, e.getMessage()), e);
             }
         }
     }
 
     private VirtualDisk getDiskAfterResizeDiskValidations(VirtualMachineMO 
vmMo, String volumePath) throws Exception {
         Pair<VirtualDisk, String> vdisk = vmMo.getDiskDevice(volumePath);
         if (vdisk == null) {
-            if (s_logger.isTraceEnabled()) {
-                s_logger.trace("resize volume done (failed)");
-            }
-            throw new Exception("No such disk device: " + volumePath);
+            String errorMsg = String.format("Resize volume of VM [name: %s] 
failed because disk device [path: %s] doesn't exist.", vmMo.getVmName(), 
volumePath);
+            s_logger.error(errorMsg);
+            throw new Exception(errorMsg);
         }
 
         // IDE virtual disk cannot be re-sized if VM is running
         if (vdisk.second() != null && vdisk.second().contains("ide")) {
-            throw new Exception("Re-sizing a virtual disk over an IDE 
controller is not supported in the VMware hypervisor. " +
-                    "Please re-try when virtual disk is attached to a VM using 
a SCSI controller.");
+            String errorMsg = String.format("Re-sizing a virtual disk over an 
IDE controller is not supported in the VMware hypervisor. "
+                    + "Please re-try when virtual disk is attached to VM 
[name: %s] using a SCSI controller.", vmMo.getVmName());
+            s_logger.error(errorMsg);
+            throw new Exception(errorMsg);
         }
 
-        if (vdisk.second() != null && 
!vdisk.second().toLowerCase().startsWith("scsi")) {

Review comment:
       I think we have to keep a counter check for IDE controller here, instead 
of just removing the SCSI check.
   I see we are checking it in UserVMManagerImpl but there are other places 
where resize volume is initiated. So it is better to keep a check in resource 
layer. Can you please add that.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to