Solved

Script to shutdown ESXi host

Posted on 2010-09-21
3
1,868 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
ID: 33728192
0
 
LVL 4

Author Comment

by:jschweg
ID: 33728315
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
ID: 33728532
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VNX5300 vs Unity 400F AFA - performance difference? 5 88
esx multi vlans 3 53
Esxi time zone 5 55
virtualization 6 57
If we need to check who deleted a Virtual Machine from our vCenter. Looking this task in logs can be painful and spend lot of time, so the best way to check this is in the vCenter DB. Just connect to vCenter DB(default DB should be VCDB and using…
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…
Teach the user how to use vSphere Update Manager to update the VMware Tools and virtual machine hardware version Open vSphere Client: Review manual processes for updating VMware Tools and virtual hardware versions: Create a new baseline group in vSp…

919 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

20 Experts available now in Live!

Get 1:1 Help Now