Solved

Script to shutdown ESXi host

Posted on 2010-09-21
3
1,932 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

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.
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Teach the user how to edit .vmx files to add advanced configuration options Open vSphere Web Client: Edit Settings for a VM: Choose VM Options -> Advanced: Add Configuration Parameters:
Teach the user how to install log collectors and how to configure ESXi 5.5 for remote logging Open console session and mount vCenter Server installer: Install vSphere Core Dump Collector: Install vSphere Syslog Collector: Open vSphere Client: Config…

696 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