This came up recently on the VMware Virtualization group on LinkedIn. The question was essentially: “In the event of a host hardware issue, can I VMotion my VMs off the host and send a notification?” The answer is: “Most Certainly!” This can be done by setting up a vSphere vCenter Alarm and corresponding action. Let’s explore:
Fire up the vCenter client. Select the level you want to be alerted from then select “Alarms”:
Note, there are quite a few default alarms, one of them may work for you:
For ours, we want something a bit more generic, so right click somewhere in the empty space, and choose “New Alert”:
Fill in the details with something that makes sense for your environment. I went with “Generic Host Health Alert”. Make sure to select “Hosts” and the second radio button. Done? Then we’re ready to move on to the “Triggers” tab.
Select Add, then “Hardware Health Changed”, then change the “Status”. I went with “Alert”, like this:
Got that so far? Awesome! Next we move onto the actions:
For this you will configure the “Send a notification email” to an address of your choice. Then you’ll add “Enter maintenance mode”
And with that, select “OK”. You’ve now configured your vSphere vCenter to notify you of a hardware failure, and to migrate your VMs to another host. Note: This will only work if you have clustered hosts, and then only within the capacity of the cluster. Further, depending on the hardware issue, VMotion may not be an option, and you are then dependant on VMware HA. If this was helpful or you have any questions, drop us a line in the comments.
Nice post.
Great use of the Alarm.
And now for the automation. A PowerCLI script to create the same alarm 😉
Go for it! With this particular one, it depends on where in the hierarchy
that it's setup as to how many times you'll need to set it.
-C
Here you go http://lucd.info/?p=1624
Wow! Nice!
I was sure Chris Steffen was wrong again (http://blogs.technet.com/virtualization/archive…) when he suggested that VMware could not evacuate guests upon a malfuctioning piece of the host's hardware. Thx to clarify that issue and showing us it's definitely feasible…
Oh indeed. There are plenty of these you can monitor for and setup an
automatic “maintenance mode” or so.
-C
I really like this Cody. I've been using Alarms a lot lately to run various scripts and this is something else I think I will push to implement.
Simon
Cool!
This alram system for coding is really good.