jawad
Contributor
Contributor

Powercycle on VM reboot

Hi, does anyone here have a way of getting VMs to do a powercycle on next reboot instead of just a reboot?

The reason is that powering off and power on VMs in the thousand is a bit hard and boring manual laber. The only solution I have found so far is to use vRealize Orchestrator and script a VMX version upgrade on next boot. But that only fixes VMs that doesn't have VMX-13 already.

Anyone have a better solution?

In the shadows...
0 Kudos
7 Replies
daphnissov
Immortal
Immortal

What exactly are you trying to achieve here?

0 Kudos
jawad
Contributor
Contributor

The OS of a VM has to do a cold boot to detect the new microcode for the Meltdown/Spectre patch.

So what you have to do then is to shutdown the VM and then power on. Doing this on 2500 VMs manually is a bit of a pain in the ass.

So I want to automate it. How?

Better description?

In the shadows...
0 Kudos
MBreidenbach0
Hot Shot
Hot Shot

You mean the Microcode that Intel has just confirmed that it isn't just crap for Haswell/Broadwell ?

I'd script that with PowerCLI. When there are microcode updates that are safe.

"As part of this, we have determined that similar behavior occurs on other products in some configurations, including Ivy Bridge-, Sandy Bridge-, Skylake-, and Kaby Lake-based platforms. We have reproduced these issues internally and are making progress toward identifying the root cause. In parallel, we will be providing beta microcode to vendors for validation by next week."Firmware Updates and Initial Performance Data for Data Center Systems

0 Kudos
jawad
Contributor
Contributor

Yeah that. When the microcode is ready. We installed it before it was pulled. Both BIOS from HPE and microcode patch from VMWare. Haven't had any problems with Intel E5 v4 CPUs so far (knock on wood).

How would you script it? A loop that powers on VMs that is powered off.

In the shadows...
0 Kudos
MBreidenbach0
Hot Shot
Hot Shot

In my lab here I frequently shut down/power up all VMs so I've got some PowerCLI scripts which automate that task. The power on script also powers on ProLiants via iLO PowerShell cmdlets. I defined three stages; I start all VMs of one stage then wait or VMware tools then start VMs of the next stage.

You say you've got 2500 VMs... doing this manually takes some time so it makes sense to spend some time to automate this. Just shutting down + powering on everything is easy (well skip at least one DC and vCenter) but that doesn't consider dependenecies (first SQL server then application server then web frontend in DMZ etc). And I probably don't want to do this with 2500 VMs in one batch. Maybe do this per cluster ? Maybe create a blacklist of VMs that will not be managed by that script, then for each VM check that it isn't blacklisted then shut down / power on ? And log output to file - we want to know what didn't work.

There's a PowerCLI community forum and probably you're not the only one with that problem so maybe somebody there already has a solution.

0 Kudos
mkfm
Enthusiast
Enthusiast

I know this is an old thread, but for every future visitor looking for this: There's a new config option in 6.7U3 released yesterday.

vmx.reboot.powerCycle = TRUE

VMware ESXi 6.7 Update 3 Release Notes

0 Kudos
rwallace612am
Contributor
Contributor

Is there a way to verify if the VM actually power cycled after you apply that advanced setting and issue a restart?

 

I can get it to apply the advanced setting no problem, but when I imitate a restart either from the windows guest OS, or through VMtools, there are no events in vCenter that show it "powering off" or "powering on " .

 

Thanks!

0 Kudos