Posted by: Eric Siebert
Eric Siebert, vCenter Server, Virtual Machines, VMware
In vCenter Server you can display certain views that will show listings of your hosts and virtual machines (VMs). These views are useful for displaying the configuration and status of all your hosts and VMs, and they are also customizable so you can either display or hide predefined columns to control what is displayed. But what if you want more information besides what you can see with the predefined columns? You can use custom attributes. This feature is unique to vCenter Server. You can display additional information in the columns or annotations section of the host/VM summary page. For example, you could add columns that display information about the OS or function. You can also sort by the custom attribute columns so you can group information together.
As mentioned this is only a feature of vCenter Server, so if you connect to a host directly using the VMware Infrastructure Client (VI Client) you will not see these attributes. They are stored inside in the vCenter Server database in two different tables. The attributes themselves are stored in the VPX_FIELD_DEF table and the attribute values are stored in the VPX_FIELD_VAL table. Because this data is custom if something happens to your database these attributes will be lost as they do not repopulate like some of the other tables do when hosts are added to vCenter Server.
You can create these attributes in two different ways; either be selecting Administration then Custom Attributes from the top menu, or by selecting a host or VM in the left pane and in the right pane selecting the summary tab and, under Annotations, clicking the edit link. VMs will have a notes field built in to the vCenter Server database — this field is not considered a custom attribute. The note field is useful for documenting information about the VM, but custom attributes provide more fields so you can split information up into multiple fields rather than putting it all together in the notes field.
Now let’s walk through how to add custom attributes.
You can add or remove attributes once you have the Custom Attributes window open:
When you add a new attribute, you have a choice of three different types; Host, Virtual Machine or Global:
You may or may not see Host/Virtual Machine If you select the machines individually and click the Edit link instead of using the top menu option. Host and Virtual Machine attributes only apply to those objects and will only be displayed for each one. Global attributes are displayed for either object type.
Once you add the attribute it will be displayed in the Annotations section for the host/VM and will also be available as a column to be displayed in the Host/VM views.
Now that you have your custom attributes defined you can start setting the values for each VM or host. To do this, first select the host or VM, then click the edit link on the summary tab in the annotations section. You can also set this in the view screens by clicking under the column that you want to update on the host or VM that you want to update, as shown below. This method is faster than setting them individually on host or VM.
If you want to further customize the columns, simply right-click on the column heading and you can check or uncheck columns that are displayed, including the predefined columnsn and your custom columns.
Using these custom attributes is a great way of documenting your hosts and VMs inside the VI Client so you know more about them. Often times VM names are not descriptive, so having these extra fields can provide more information to anyone who uses the VI Client. This can be useful as it can prevent certain things from happening, such as accidentally rebooting the wrong VM.