What are custom attributes?
Custom Attributes are attributes that a administrator can define for all Virtual Machines and Hosts in vCenter. The attributes are then displayed in the “Annotations” box for each VM. The custom attributes are also displayed alongside the VM Name, Status, State, CPU Usage, etc, when listing virtual machines in the Datacenter, cluster, host, and resource pool views.
Why use them?
Daily, we receive lots of clone requests for VMs. Clones are very good for application development and application troubleshooting. When an application on a VM goes pear shaped, the application vendor may request a clone for a system. They can then work on the clone system to try and fix some issues while the production system (if not broken completely) may in some cases still remain partially available to the end users. Once they are confident that they have resolved the issue, they can then implement the fix in the production environment.
This is all good and well, but here’s the problem. Clones are a drain on your resources. As administrator, you should be very careful to simply hand out clones as the requests come in. Virtual Machine clones can create a nightmare for administrators as they use huge amounts of additional disk space. Some of the clones we have today are in excess of 420GB. When creating clones, we need to make sure that the following information is recorded somewhere in vCenter:
· Who requested the clone;
· The requestor’s contact number/email address
· The date that the clone was made;
· The size of the clone on disk (all vDisk sizes combined + the amount of RAM assigned to the VM);
· Does it need to be backed up (Yes / No);
· Reason for the clone;
Specifying your own Custom Attributes
Creating custom attributes is very simple. In the VI (or vSphere) client on the menu bar, click “Administration” >> “Custom Attributes...”
You’ll now be presented with the Custom Attributes dialog:
Once you’ve created your attributes, you’ll see them in each VM’s annotation’s box on the summary page.
When you click on the "edit" label in the annotations box, you get:
Fill out the information for each attribute:
When looking at the annotations box on the summary page of the VM, the custom attributes will be recorded and displayed for that VM:
The cluster view will also now display all the custom attributes. They can be filtered like any other VM attribute: