Using Active Directory to Identify and Track Virtual Machines

  

As many organizations deploy more and more virtualization platforms, it becomes increasingly difficult to distinguish between physical and virtual servers. Some administrators add “_vm” to the host name of each virtual machine to show the difference. However, many companies don't like this approach because any change in name affects how users and applications access virtual machine data. After the server is turned into a virtual machine, changing the name of the server may also affect the applications and services installed locally on the server. If an administrator renames a server that follows a migration from physical platform to virtual platform (P2V), they typically use the CNAME record in DNS to ensure the transparency of name resolution. However, this approach adds extra complexity to server resource management. Another way to identify server objects (whether virtual or physical) is to use the Description property in each computer object's Active Directory. Some companies have used the Description attribute to identify the location, department, or role of a computer. With this in mind, using the Description attribute may require the user to succinctly identify whether it is a physical platform or a virtual platform. For example, you can use the following naming convention:

Ps – Physical server

Vesx – VMware ESX VM

Vms – Microsoft Virtual Server VM

Vxen – Xen VM

Vvi – Virtual Iron VM

Vvz – SWsoft Virtuozzo virtual private server

Vscon – Solaris Container

Of all the Description attributes, I prefer to use “P” as a prefix for the physical platform, "V” as a prefix for the virtual platform. Doing so allows the user to perform query operations on all virtual machines using script statements, for example, querying only the first letter of the Description property of each computing object through a script. Figure 1 and Figure 2 show two ways to identify a virtual machine through the Description property of a computer object:
Figure 1: Identifying a Xen virtual machine using the Description attribute
Figure 2: Identifying a physics using the Description attribute Servers, as well as their locations, departments, and roles


With these appropriate naming conventions, by using Active Directory Users and Computers and sorting these objects (using the Description property), you can Quickly locate virtual machine objects in any Active Directory container. You can do this by clicking on the Description column in Active Directory Users and Computers. If you double click, you can sort them in descending order. Figure 3 is an example of sorting computer objects by Description:




Figure 3: Sorting virtual machine computer objects in Active Directory Users and Computers
< Figure 3: Sorting Virtual Machine Computer Objects in Active Directory Users and Computers

In large enterprises, many administrators find Active Directory query properties useful. For example, to locate the member computers in the domain you use (these are all ESX virtual machines), the following steps are necessary: ​​

1. In the Active Directory Users and Computers window, right click on “Domain Object&rdquo ;, select “Find” 2. In the “Find” dialog box, click on the “Find Drop-down” menu and select “Computers”. 3. Next, click on the “Advanced” property page. Under the “Advanced” property page, click the “Field” button and select “Description” in the composite drop-down menu. 4. In the “Condition Drop-down” menu, select “Starts With”. Enter “Vesx” in the "Value" attribute, note that if you need to search all virtual machines, just enter “V” 6. Next, click the “Add” button 7. Now you can click “Start” (Figure 4), you can display the computer objects whose Description attribute starts with "Vesx"
Figure 4: ESX virtual machine Active Directory query

Of course, use Active Directory Users and Computers GUI Only these tasks can be done. In large environments, users may wish to use the scripting language to populate the Description property of each computer object. The following SetDescription.vbs script
can read a list of computers from a text file, or modify these existing Description attributes to ensure they have a physical or virtual identifier as a prefix.

'SetDescription.vbs 'Adds virtual or physical descriptor to 'computer description attribute.

'set variables

'strPrefix -- physical or virtual identifier prefix ' Prefix values: ' Ps – Physical server ' Vesx – VMware ESX VM ' Vms – Microsoft Virtual Server VM ' Vxen – Xen VM ' Vvi – Virtual Iron VM ' Vvz – SWsoft Virtuozzo virtual private server

Copyright © Windows knowledge All Rights Reserved