About Me

Monday, March 8, 2010

How to determine a VM's management operating system (Hyper-V)?

I recently came across a VM while generating a server list. I have a script that queries Active Directory for all server-based operating systems. I take that script and query the servers for the make/model info. Recently, I saw a VM in the list and was curious because I wasn't familiar with it. My script uses WMI to query two items:

SystemManufacturer
SystemProductName (AKA Model)

For Hyper-V VM's, the SystemManufacturer is Microsoft Corporation.
For Hyper-V VM's, the SystemProductName is Virtual Machine.

There are a number of ways to get the values. WMI using VBScript. PowerShell. Or just reading the values from the registry via REGEDIT.

Generally speaking, the BIOSReleaseDate for Hyper-V VM's will be 2008 and later while everything else will be older (2006, etc.). This isn't that concrete but it's a starting point. But now what? Even if you determine that you have a Hyper-V VM, how do you determine which Hyper-V host it resides on? Where is the management operating system?

Here is where I finally found the concrete answer. Once you have the host name, you can quickly manage it and get the rest of the details you need. I haven't had a chance to compare this data with that of Virtual Server. But I think I'll build some of this data into my scripts.

For those asking for the same thing but for VMWare (ESX or VSphere) - I cross checked this against both and while the make/model info is valid, the rest isn't. I will have to dive into determine your host ESX/VSphere server from a VMWare VM another time.