[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


autostart of vm's in a HA environment

Posted on 2012-08-17
Medium Priority
Last Modified: 2012-08-17
With the latest versions of Esxi 5.x and VCenter, is the autostart of vm's on clustered hosts configured with HA still not possible ? We are running Esxi 5.0.0 623860 on each esxi host, and vCenter Server 5.0.0, 755629. The autostart properties are greyed out when in vCenter Server.

As taken from the Vmware 5.0 documentation at : http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.vsphere.vm_admin.doc_50%2FGUID-6CA3CCF8-71A7-4167-AA5D-86BB67CF060D.html

"... The Virtual Machine Startup and Shutdown (automatic startup) feature is disabled for all virtual machines residing on hosts that are in (or moved into) a vSphere HA cluster. Automatic startup is not supported when used with vSphere HA."

We mostly need the vm's to start automatically in the event of a power failure, where the ups will gracefully shutdown the vm's and the esx hosts. When power is restored, the vm's won't start automatically, unless done manually in vSphere client. And often these situations occur during the weekend (building maintenance, etc) when no IT staff is present, and people need to work on the servers, locally or remotely.

If not possible with vmware, are there any other options ?

Question by:ndidomenico
  • 7
  • 6
LVL 124

Accepted Solution

Andrew Hancock (VMware vExpert / EE MVE^2) earned 2000 total points
ID: 38304891
It's possible but Not Recommended, because Auto Starting of VMs would then conflict with VMware HA functions, of starting VMs.

You could script it with PowerCLI

Author Comment

ID: 38304913
Any documentation or examples you could provide me on how to do it with PowerCLI ?
LVL 124
ID: 38304940
# filtering machines by name and start those that are not started
Get-VM <name-filter> | where { $_.PowerState –eq "PoweredOff" } | Start-VM

# stopping virtual machine, defining that we do not want to confirm
# each stop operation
Get-VM <name-filter> | Stop-VM –confirm:$false

I would recommend using the following, also VMware recommends the use of PowerCLI, which is PowerShell interface with vSphere-specific additions.


One of the simplest PowerCLI examples, and something which is actually extremely useful on its own, is the Get-VM cmdlet. Which lists VMs.

PowerCLI can be a bit overwhelming to use,  But it can be enhanced with a nice toolset and a library of preconfigured scripts to jump-start your mass changes, which is possible with PowerGUI



VMware Community Pack
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.


Author Comment

ID: 38305049
Thanks hanccocka. Will go through these links and samples and will try to get familiar with PowerCLI in order to configure this shutdown.

Does the script have to be run from the vCenter Server machine ? Because if so, our vCenter Server is running in one of the vm's (that would be shut down in this case). We don't have any other server where to install vCenter Server on. Can it be launched from a PC on the network ?
LVL 124
ID: 38305220
No, any computer with access to vCenter, and the PowerCLI and PowerGUI installed on your LAN!

Author Comment

ID: 38305296
One last thing: is it a "not-recommended" practice to try to autostart the vm's using this method with PowerCLI ? Would I be interfering with the normal mechanisms of HA ?
LVL 124
ID: 38305340
Yes, it can do.

Author Comment

ID: 38305454
You mean that it could or might interfere with HA ?

Would you personnaly recommend or not trying to autostart using PowerCLI ?
LVL 124
ID: 38305687
It will interfere with VMware HA, hence why it's not recommended to use Auto Start in combination with HA.

I would test

1. what happens to your VMs, if you pull the plug? HA will auto start them, at power on, like magic - do they come up fine do you have any issues?

2. do you need to shutdown cleanly? if so you will need a way to bring them up. If so you will need to use Auto Start/PowerCLI

Author Comment

ID: 38305882
I did test HA on the 2 hosts and HA kicks in fine. If I pull the plug on HostA, then HostB starts properly the vm's that were running on HostA. So no problem there concerning an unplanned failure.

But my problem is that I would like to have my Ups to shutdown cleanly each host and its vm's in case of power failure. This works fine too, except that when power comes back on later on, the hosts reboot but none of my vm's start. So when users come in the morning, no one can work until someone goes in vSphere Client to start them manually. Not very practical for a small office that does not have dedicated IT staff , or if this happens during the weekend and people have to work.

On a previous call with Vmware, they told me that when the hosts reboot, they will put back the vm's in their last known state. Meaning that if I let the vm's die as the battery runs out of power (instead of triggering a proper shutdown from the ups), then the hosts will automatically power on the vm's when power is restored, since they were in a "running" state when everything crashed. I'm not too crazy about this option in order to get autorestart running ... I will try to test this to see if it works in my environment.
LVL 124
ID: 38306010
What I meant was Test the VMs are OKAY for you, when restarting from crash conditions!

You need to make a decision about using HA or AutoStart, or Both (unsupported!), and do you VMs come back cleanly!

Author Comment

ID: 38306064
Ok. So far, they come back ok. So I think we will stick with standard HA features, and no automatic shutdown of vm's in case of power failure.

Thanks again.
LVL 124
ID: 38306081
No problems.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
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 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:
Suggested Courses

873 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