Virtualization Pro

Mar 19 2009   2:17PM GMT

Using custom attributes with vCenter Server

Eric Siebert Eric Siebert Profile: Eric Siebert

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:

Custom Attributes Window

When you add a new attribute, you have a choice of three different types; Host, Virtual Machine or Global:

Adding a Custom Attribute

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.

Annotations Section

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.

Setting an Attribute

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.

Choosing Columns to Display

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.

1  Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Sbeaver
    Hey Eric, Good post!! Sometimes we forget how important things like this are. In my last environment I created a lot of custon attributes to the point that is had more information then the server database. We listed backup times, any RDM paths, Application Owner, serever dependency, ect. My point being this is a great area to go nuts because it will give everyone on your team a central location to get information from where you would do the work. Steve Beaver
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: