nvazquez commented on a change in pull request #4021:
URL: https://github.com/apache/cloudstack/pull/4021#discussion_r419383256
##########
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:
Looks good. I can think of a way to test this:
What about adding a config key to control the delay as described here?
(bootDelay param)
https://vdc-download.vmware.com/vmwb-repository/dcr-public/b50dcbbf-051d-4204-a3e7-e1b618c1e384/538cf2ec-b34f-4bae-a332-3820ef9e7773/vim.vm.BootOptions.html
Will need testing but as it expects a long value, sending a negative delay
may cause VM config to throw an exception
----------------------------------------------------------------
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]