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



##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -3950,6 +3970,25 @@ protected Answer execute(RebootCommand cmd) {
         }
     }
 
+    private void checkAndSetEnableSetupConfig(VirtualMachineMO vmMo, 
VirtualMachineTO virtualMachine) {
+        if (virtualMachine.isEnterHardwareSetup()) {
+            VirtualMachineBootOptions bootOptions = new 
VirtualMachineBootOptions();
+            VirtualMachineConfigSpec vmConfigSpec = new 
VirtualMachineConfigSpec();
+            if (s_logger.isDebugEnabled()) {
+                s_logger.debug(String.format("configuring VM '%s' to reboot 
into hardware setup menu.",virtualMachine.getName()));
+            }
+            
bootOptions.setEnterBIOSSetup(virtualMachine.isEnterHardwareSetup());
+            vmConfigSpec.setBootOptions(bootOptions);
+            try {
+                if (!vmMo.configureVm(vmConfigSpec)) {
+                    throw new Exception("Failed to configure VM to boot into 
hardware setup menu: " + vmMo.getName());
+                }
+            } catch (Exception e) {
+                s_logger.error(String.format("failed to reconfigure VM '%s' to 
boot into hardware setup menu",virtualMachine.getName()),e);

Review comment:
       no, the rest of the reboot process can still proceed normally and it is 
an unlikely event that implies an error in Vsphere.




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