VMware Communities > Blogs > Manual Automation > 2008 > November > 24

Blog Posts

Manual Automation

Previous Next
2

In a previous blog post, Virtualizing Virtual Center, I discussed the benefits of virtualizing Virtual Center and why I done this in my environment. I recently heard another argument against this decision from my VMware SE. The argument is that if all of the ESX hosts in the cluster where the Virtual Center VM is in crashes, then you have to logon to each host to find where it’s at to power it back up. The recommendation is to then configure DRS such that it keeps the VM on the same host so you know where it’s at. Let’s consider this a little further…

For those environments that have multiple ESX hosts and are using HA, the VC VM should be powered-on to another host if there are enough hosts left standing. So this argument really only applies to a scenario where all hosts have crashed, in which case you may have a bigger problem on your hands anyway(!).

But let’s say this does happen. How can I find out where any particular VM was when my DRS/HA cluster crashed? Well besides logging on to every host you could just query the Virtual Center database. Here’s a quick little query that will give you a list of VMs and the host they’re currently on.

SELECT VPX_VM.DNS_NAME AS
VirtualMachine, VPX_HOST.DNS_NAME AS Host
FROM VPX_VM INNER JOIN
VPX_HOST ON VPX_VM.HOST_ID = VPX_HOST.ID

You could set this up as a scheduled task and save the results to a text file (or better yet, a SharePoint server if you’re organization uses that for document sharing/management – this is a little further down my task list). Of course you should save this information on a system “outside” your virtual infrastructure such as a NAS-based CIFS share.

I’m sure you could do something similar with PowerShell and the “get-vm” command but I haven’t really looked into it. There are other tools that can help you track VMs as well such as Veeam Reporter.

The bottom line is that if you remove your VC VM from DRS it will not enjoy the load-balancing benefits that DRS brings to the table in the first place. I’m not running the Distributed Power Management (DPM) feature but I’d also have to wonder how this might impact environments where this feature is enabled.

As with many technical decisions, I think this is largely a matter of personal preference and what you’re comfort zone will allow. We VI admins have notoriously large comfort zones so I’m guessing many are virtualizing their Virtual Center instances! If you’re okay with downsides previously mentioned, by all means assign the VM to a specific host. I’ve lived through enough hardware and power-outages that crashed my VI over the years so I’ve learned that hard way: track your VMs regularly regardless of how you’ve implemented Virtual Center. You’ll thank me for it someday.



Add a comment Leave a comment on this blog post.
Jan 12, 2009 2:36 AM Reply Anne Jan Elsinga

I saw this post after I cooked up a little PowerShell script to search for my VM:

The script searches all ESX hosts for the VM. It probably isn't the most efficient PowerShell script, but it does what it has to do :)

$searchservers = @(’host1′,’host2′,’host3′)
$SearchVM=’S-VC’

foreach ($vmhost in $searchservers)
{
connect-viserver $vmhost > out-null
if (get-vm | where {$_.Name -eq $SearchVM})
{
write-host $SearchVM " found on host " $vmhost
}
}

The article I posted it in: http://www.vmguru.nl/wordpress/2009/01/searching-for-a-vm/

Jan 13, 2009 5:34 AM Reply Virtual_JTW in response to: Anne Jan Elsinga

Powershell is definitely the way to go.

Thanks,
Jerry

Click to view Virtual_JTW's profile

Virtual_JTW

Member since: Nov 1, 2004

I am a senior IT professional that has designed, implemented and managed the operations of several VI environments. This blog will detail design rationale, testing results and technical tips with a heavy focus on VI/vSphere, storage and cloud computing.

View Virtual_JTW's profile