You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/08/13 07:33:51 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #5311: [VMware] Start VM with deploy-as-is template having multiple controller types

DaanHoogland commented on a change in pull request #5311:
URL: https://github.com/apache/cloudstack/pull/5311#discussion_r688305857



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -2632,6 +2632,15 @@ private void mapSpecDisksToClonedDisksAndTearDownDatadisks(VirtualMachineMO vmMo
             s_logger.debug("Mapping spec disks information to cloned VM disks for VM " + vmInternalCSName);
             if (vmMo != null && ArrayUtils.isNotEmpty(specDisks)) {
                 List<VirtualDisk> vmDisks = vmMo.getVirtualDisks();
+                Collections.sort(vmDisks, new Comparator<VirtualDisk>() {
+                    @Override
+                    public int compare(VirtualDisk disk1, VirtualDisk disk2) {
+                        Integer controllerKey1 = disk1.getControllerKey();
+                        Integer controllerKey2 = disk2.getControllerKey();
+                        return controllerKey1.compareTo(controllerKey2);
+                    }
+                });
+

Review comment:
       can you extract this utility?




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org