Solved

Script to shutdown ESXi host

Posted on 2010-09-21
3
1,879 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

In this article, I show you step by step with screenshots to assist you - HOW TO: Deploy and Install the VMware vCenter Server Appliance 6.5 (VCSA 6.5), with some helpful tips along the way.
When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
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 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…

803 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