I'm attempting to set the BootOrder of a Virtual Machine. I want to get the current BootOrder and modify it:
final VirtualMachineBootOptionsBootableDevice[] bootOrder =
vm.getConfig().getBootOptions().getBootOrder();
bootOrder is null. When looking in the BIOS for the VM, there is a list of choices, so obviously such a list exist - how do I get it?
To answer the question in the subject "Why is BootOrder null?" its because it can be, and likely because you havent set additional options. The bootOrder is an optional property that "Need not be set" according to the docs. Based on the description in the docs it sounds like this would be something extra that isnt in the bios "After list is exhausted, default BIOS boot device algorithm is used for booting" and since the bootOptions are part of a config spec that tells me its something you can set.
As for your other question of how do you get the list from the bios, Im not sure, but if you want the list of valid things you could add to your spec using bootOptions take a look at the BootableDevice docs.