autostart of vm's in a HA environment

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 ?

Thanks.
.
ndidomenicoAsked:
Who is Participating?
 
Andrew Hancock (VMware vExpert / EE MVE^2)Connect With a Mentor VMware and Virtualization ConsultantCommented:
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
0
 
ndidomenicoAuthor Commented:
Any documentation or examples you could provide me on how to do it with PowerCLI ?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
# 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.

http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli

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

http://powergui.org/index.jspa

and

VMware Community Pack
http://www.virtu-al.net/featured-scripts/vmware-powerpack/
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
ndidomenicoAuthor Commented:
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 ?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
No, any computer with access to vCenter, and the PowerCLI and PowerGUI installed on your LAN!
0
 
ndidomenicoAuthor Commented:
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 ?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Yes, it can do.
0
 
ndidomenicoAuthor Commented:
You mean that it could or might interfere with HA ?

Would you personnaly recommend or not trying to autostart using PowerCLI ?
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
0
 
ndidomenicoAuthor Commented:
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.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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!
0
 
ndidomenicoAuthor Commented:
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.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
No problems.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.