Running ESXi v6.5u1.
I would like to shutdown all running VM's except for one.
Running /sbin/shutdown.sh will shutdown all running VM's (auto started vm's with vmware tools installed, that is) but I need one VM to stay alive.
Is there a way to accomplish this?
What license do you have?
Use this below blog for shutting down multiple VM. Good Information provided
Using PowerShell to Gracefully Shut Down Multiple Virtual Machines in VMware | Pipe2Text.com
or
Easy and Effective solution in PowerCLI to Shutdown VMs with one click:
First LOGON into the vCenter from locally/remotely PowerCLI
Connect-VIServer -server YouvCenterServerName
PASTE,
get-content c:\cli\vm.txt | foreach-object { shutdown-vmguest $_ }
Press ENTER > DONE!
EXAMPLE:
C: Is your local C:\ Drive
CLI: You need to create a folder in the C: Drive & name it "cli" or anything you want
VM.TXT: then create a txt file & input all the VM names in it. EX:
VM01
VM02
Vm03
Regards,
Randhir
If you found my answers useful please consider marking them as Correct OR Helpful
The PowerShell method looks good but requires a Windows machine to do the shutdown.
I would like to be able to shutdown all VM's except one from the ESXi host through cli or script.
Hi,
Please find the below link having a script where you can mention your specified VM's for shutdown.
Script: Gracefully Shut Down all VMs on a Given Set of Hosts (VMware/XenDesktop) • Helge Klein
I am going to test Cli command on my lab ESXI host and let you know output.......
Regards,
Randhir
Thanks! Looking forward to the results.
Power Cli command is working fine for me . I am able to shutdown group of VM machine from host .
Regards,
Randhir