shwstppr commented on a change in pull request #4548:
URL: https://github.com/apache/cloudstack/pull/4548#discussion_r547091474



##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -7239,7 +7239,9 @@ private static File fetchSystemVmKeyFile() {
                                     
instanceDisk.setController(DiskControllerType.getType(device.getClass().getSimpleName()).toString());
                                     
instanceDisk.setControllerUnit(((VirtualSCSIController) device).getBusNumber());
                                 } else {
-                                    
instanceDisk.setController(DiskControllerType.none.toString());
+                                    String msg = String.format("Abort ingest 
process because controller of volume %s is unsupported", 
instanceDisk.getLabel());

Review comment:
       ```suggestion
                                       String msg = String.format("Controller 
of disk %s is unsupported", instanceDisk.getLabel());
   ```

##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -7274,9 +7274,7 @@ public int compare(final UnmanagedInstanceTO.Disk disk1, 
final UnmanagedInstance
                 }
 
                 int extractInt(UnmanagedInstanceTO.Disk disk) {
-                    String num = disk.getLabel().replaceAll("\\D", "");
-                    // return 0 if no digits found
-                    return num.isEmpty() ? 0 : Integer.parseInt(num);
+                    return disk.getPosition() + (disk.getControllerUnit() * 
100);

Review comment:
       I think IDE and generic SCSI (VirtualSCSIController) will cover all disk 
controllers. If we are getting any other type of VirtualController as a disk, 
an exception seems correct to me. However, the error message needs to be a bit 
more generic there as the same method is used for listing unmanaged isntances




----------------------------------------------------------------
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.

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


Reply via email to