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/03/22 03:38:16 UTC

[GitHub] [cloudstack] nvazquez commented on a change in pull request #4758: vmware: fix stopped VM volume migration

nvazquez commented on a change in pull request #4758:
URL: https://github.com/apache/cloudstack/pull/4758#discussion_r598406184



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -1898,10 +1900,14 @@ protected StartAnswer execute(StartCommand cmd) {
                                 }
                             }
                             tearDownVm(vmMo);
-                        } else if (!hyperHost.createBlankVm(vmNameOnVcenter, vmInternalCSName, vmSpec.getCpus(), vmSpec.getMaxSpeed().intValue(), getReservedCpuMHZ(vmSpec),
-                                vmSpec.getLimitCpuUse(), (int) (vmSpec.getMaxRam() / ResourceType.bytesToMiB), getReservedMemoryMb(vmSpec), guestOsId, rootDiskDataStoreDetails.first(), false,
-                                controllerInfo, systemVm)) {
-                            throw new Exception("Failed to create VM. vmName: " + vmInternalCSName);
+                        } else {
+                            boolean blankVmCreated = hyperHost.createBlankVm(vmNameOnVcenter, vmInternalCSName, vmSpec.getCpus(), vmSpec.getMaxSpeed().intValue(), getReservedCpuMHZ(vmSpec),
+                                    vmSpec.getLimitCpuUse(), (int) (vmSpec.getMaxRam() / ResourceType.bytesToMiB), getReservedMemoryMb(vmSpec), guestOsId, rootDiskDataStoreDetails.first(), false,
+                                    controllerInfo, systemVm);
+                            if (!blankVmCreated) {
+                                throw new Exception("Failed to create VM. vmName: " + vmInternalCSName);
+                            }
+                            deployAsIs = false;

Review comment:
       Can you please include a log line explaining why not deploying-as-is in this case? Otherwise will look confusion as the StartCommand may receive deployAsIs = true and not honouring it




-- 
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:
users@infra.apache.org