VMware Cloud Community
thierry_ma
Contributor
Contributor
Jump to solution

Changing boot order in esxi 5.1

Hi, I'm using successfully the following code to change boot order as describe in the message 1707558 ()Re: CHange boot order with PowerCLI

Unfortunaly, this doesn't work in esxi 5.1, the powercli returns with no error but the boot order don't update. I try hdd, cdrom and i have the same symptom.

As anyone able to do this in 5.1 version?

Regards.

$spec = New-Object VMware.Vim.VirtualMachineConfigSpec

$spec.extraConfig += New-Object VMware.Vim.OptionValue

$spec.extraConfig[0].key = "bios.bootOrder"

$spec.extraConfig[0].value = "ethernet0"

(Get-View (Get-VM -Name <vmname>).ID).ReconfigVM_Task($spec)



Reply
0 Kudos
1 Solution

Accepted Solutions
mattboren
Expert
Expert
Jump to solution

Hello, -

There is another way.  We wrote about it at vNugglets.com a while back in the Change VM Boot Order via PowerShell post.  I just verified that this method still works against a v5.1 environment.  You might have a look at that post.

And, as noted at the bottom of that post, adjusting the VM boot order in that scripted manner seems to make it such that that particular VM's boot order can only be changed be script thereafter.  So, something to consider.

Anyway -- how does that do for you?

View solution in original post

Reply
0 Kudos
7 Replies
thierry_ma
Contributor
Contributor
Jump to solution

Hum... This seems there is a bug with the 5.1 version, not only using powercli to change the bootorder value, using the vi client as describe in 2011654 it doesn't work anymore....

I put the value using the options, general, Configuration parameter, I enter the value but it doesn't put the value in the vmx and so doesn't work. Returning in the configuration parameter the added line disappeared

The only way i'm able to change the bootorder is to set directly the value in the vmx. If i put it in the vmx, it works but the value not appear or can be change using the vi client......

Tomorrow, we apply the last patchs, if the problem persists, we are going to open a ticket.

Reply
0 Kudos
mattboren
Expert
Expert
Jump to solution

Hello, -

There is another way.  We wrote about it at vNugglets.com a while back in the Change VM Boot Order via PowerShell post.  I just verified that this method still works against a v5.1 environment.  You might have a look at that post.

And, as noted at the bottom of that post, adjusting the VM boot order in that scripted manner seems to make it such that that particular VM's boot order can only be changed be script thereafter.  So, something to consider.

Anyway -- how does that do for you?

Reply
0 Kudos
thierry_ma
Contributor
Contributor
Jump to solution

Hello Mattboren, ok ok, i'm going to make further tests using scripts mentioned in your link, However, without talking about script, when creating new vm on Vcenter 5.1.0 (1235232) environment, esx 5.1.0 1065491, the KB 1707558 doesn't seems to work..

Regards.

Reply
0 Kudos
thierry_ma
Contributor
Contributor
Jump to solution

Hello Matt, using the script mentioned at vNugglets.com i'm able to put the cdrom on top of the boot sequence.

The script work for me only i i put $oBootableCDRom on the BootOrder line.

if i put on the BootOrder line the $oBootableHdisk or $oBootableNIC i get the error “A specified parameter was not correct. configSpec.bootOptions.bootOrder”

Regards

Reply
0 Kudos
thierry_ma
Contributor
Contributor
Jump to solution

Hi, you are well, i'm able to use the scripts to do what i want, cdrom, hdd, ethernet

My error was due to language spécification ....

Best regards

Reply
0 Kudos
MCioe
Enthusiast
Enthusiast
Jump to solution

Just a little heads up, but if you apply the VMX settings recommended in the ESXi Hardening Guide (there are roughly 40 of them), then the solution on the vNugglets website won't work.  I had to rip out all of the VMX settings (ESXi 5.0) in order for this script to work.  Maybe, someday I'll go back and figure out which one broke it ...

These guys look like they may be potential culprits, unfortunately the Hardening Guide doesn't say what the settings do, just what the values should be.

     isolation.device.connectable.disable True

     isolation.device.edit.disable True

     isolation.bios.bbs.disable True

Fortunately, I also scripted the settings, so I just have to make sure I do things in the right order.

Maureen

Reply
0 Kudos
Saturnous
Enthusiast
Enthusiast
Jump to solution

Just in case someone has to change the boot order for very similar VMs (like Citrix Provisioning Server targets in my case), check with md5sum if the *.nvram files are identical in first place, if yes change one VM manualy and just replace all the nvram files. I am sure this is doable with PS too.

Reply
0 Kudos