Cruicer
Enthusiast
Enthusiast

Looking for a way to reboot several VMs at once via "Scheduled Tasks"

Is there a way I can create a Scheduled Task to reboot 20+ VMs? I know I can reset a VM individually but was looking for a way to reboot groups of VMs.

Reason I ask is:

I need to push MS patches to about 85 VMs via Update Manager and wanted to schedule a reboot in the event someone is logged into the VMs when the patches are deployed. From what I understand the VM will give the user the option to reboot in which chances are they will not. I want to force a reboot at either the conclusing of the patch or at a later time. Any ideas? I am trying NOT to reboot the host.

Thanks in advance.

0 Kudos
6 Replies
Luckybob
Enthusiast
Enthusiast

In vSphere you can setup a vApp. This will allow you to reboot multiple VMs in a designated order. I am not sure if you can schedule this within Vcenter.

0 Kudos
vmroyale
Immortal
Immortal

Hello.

You could use

shutdown \\computer -r -t 0

in a batch file from any Windows box - that might be easier. You could also stagger the reboots, so that they don't all happen at the same time.

Good Luck!

Brian Atkinson | vExpert | VMTN Moderator | Author of "VCP5-DCV VMware Certified Professional-Data Center Virtualization on vSphere 5.5 Study Guide: VCP-550" | @vmroyale | http://vmroyale.com
0 Kudos
Cruicer
Enthusiast
Enthusiast

Ummmm vSphere...trying to get there!!!

0 Kudos
Cruicer
Enthusiast
Enthusiast

Vmroyale...I would still need to hit each VM. Trying to group these together...

0 Kudos
uttam_choudhary
Contributor
Contributor

Use vmware-cmd utility and you can power off/ reboot any number of machies.

For more information on how to use:

0 Kudos
jb12345
Enthusiast
Enthusiast

Have you looked at PowerCLI and the scripts in the forum? You can use the restart-vmguest cmdlet to restart a VM and you can schedule the script to run.

0 Kudos