Within vSphere 5.1 a new feature called Tags has been introduced by VMware. Tags are an enhancement of Custom Attributes and enables users to categorize inventory objects. They are a great approach for organizing or reporting tasks. Tags can be associated to the following object types:
- Distributed Port Group
- Distributed Switch
- Resource Pool
- Datastore Cluster
- Virtual Machine
- vCO Scheduled Workflow
- vCO Workflow
Tags are classified in categories and there are two types of categories. Categories where you can only assign 1 tag per object, and categories with multiple tags per object.
Create Categories and Tags
Use case 1: Virtual Machine Cost Centre
Of course, a virtual machine can be assigned to only one cost centre. The first category can only be applied once per Object.
- Open vSphere Web Client
- Navigate to Tags
- Open Categories
- Click New Category
- Enter a Name, select 1 tag per object and choose object type Virtual Machine
- Open Tags
- Click New Tag
- Enter a Name and select category Cost Centre
- Repeat Step 7 and 8 until you have a few Cost Centres
- Navigate to Virtual Machine Summary Screen to Assign a Tag
- Assign the Virtual Machine to the Sales Department
Use case 2: Applications running on a Virtual Machine
The second category applications can be a assigned many times to a virtual machine. Use the same procedure to create the category, tags and assign it to a bunch of virtual machines.
To find all objects that have a specific tag assigned, just have to click the Tag Name in the Tags overview:
vSphere 5.1 Tags with API, SDK or PowerCLI
Unfortunately the tag feature is only available through the webclient at the moment. You can neither set, nor work with tags by any other tool or API. But i am sure that this will be changed in an upcoming release.