We are enabling the parameter 'devices.hotplug=false" on roughly 5000 Windows server VMs ( 2008,2012,2016 ..) in a 6.u3e host environment through the script.
We have groups of Vms that going through Os patch cycles every week.
Can a script be prepared to enable this parameter when the VMs are getting rebooted during their OS patch cycle ? Is this even possible.
I read somewhere that Vms need to be powered off to modify changes in vmx ?
Or if the above is not possible, then i believe our only option is to prepare a script to power-off,enable the parameter, power it back on ? Is that right ? In that case any idea how many VMs cna be powered on at once?
Yes, the VM needs to be powered off to set this option.
And no, I don't think you can schedule this "at next reboot".
The basic script is like this
$extra = New-Object VMware.Vim.OptionValue
$extra.Key = 'devices.hotplug'
$extra.Value = $false
$spec.ExtraConfig += $extra
Get-VM | %{
$_.ExtensionData.ReconfigVM($spec)
}
In theory you can power on all the VMs in a relatively short timespan by using Start-VM with the RunAsync switch.
But that might put a serious load on your environment.
I would suggest to stop/start the VMs in batches.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes, the VM needs to be powered off to set this option.
And no, I don't think you can schedule this "at next reboot".
The basic script is like this
$extra = New-Object VMware.Vim.OptionValue
$extra.Key = 'devices.hotplug'
$extra.Value = $false
$spec.ExtraConfig += $extra
Get-VM | %{
$_.ExtensionData.ReconfigVM($spec)
}
In theory you can power on all the VMs in a relatively short timespan by using Start-VM with the RunAsync switch.
But that might put a serious load on your environment.
I would suggest to stop/start the VMs in batches.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD Thanks a ton !! I'm so happy i got the answer real quick.