Solved

Script to shutdown ESXi host

Posted on 2010-09-21
3
1,856 Views
Last Modified: 2012-05-10
I'm looking for a script that will shutdown the ESXi host that I can tie to my UPS agent from a Windows VM. I found some command line tools that will allow me to do what I want, but here lies the dilemma:

vmcontrol.pl lets me cleanly shutdown the VM's, but has no way to shut the host down

vicfg-hostops lets me shutdown the host, but only gives me an option to either power off or suspend the VMs

I can't really use one after the other because after issuing vmcontrol, my VM will probably be shutdown before it can issue the host shutdown from vicfg-hostops

At the end of the day, I just need command that I can issue to the host that will cleanly shutdown the guests, then power off the host. Any advice on how you guys are doing this?
0
Comment
Question by:jschweg
  • 2
3 Comments
 
LVL 16

Expert Comment

by:Bryan Butler
Comment Utility
0
 
LVL 4

Author Comment

by:jschweg
Comment Utility
I have a paid version, however I need to do this via a Windows box, so VMA is out.
0
 
LVL 16

Accepted Solution

by:
Bryan Butler earned 500 total points
Comment Utility
And you say:
"my VM will probably be shutdown before it can issue the host shutdown from vicfg-hostops"
Did you mean it "will probably NOT be shutdown before it can issue the host shutdown..."


And what about vmware-cmd:
http://www.petri.co.il/virtual_script_startup_shutdown_vmware_servers.htm
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
Last article we focus in how to VMware: How to create and use VMs TAGs – Part 1 so before follow this article and perform the next tasks, you should read the first article how to create the TAG before using them in Veeam Backup Jobs.
Teach the user how to install and configure the vCenter Orchestrator virtual appliance Open vSphere Web Client: Deploy vCenter Orchestrator virtual appliance OVA file: Verify vCenter Orchestrator virtual appliance boots successfully: Connect to the …
Teach the user how to join ESXi hosts to Active Directory domains Open vSphere Client: Join ESXi host to AD domain: Verify ESXi computer account in AD: Configure permissions for domain user in ESXi: Test domain user login to ESXi host:

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now