You can create, edit, and delete tag categories and vSphere tags. You can also assign vSphere tags to objects in the vCenter Server inventory and manage the user privileges for working with tags and categories.

A tag is a label that you can apply to objects in the vSphere inventory. When you create a tag, you assign that tag to a category. Categories allow you to group related tags together. When you define a category, you can specify the object types for its tags, and whether more than one tag in the category can be applied to an object.

For example, if you wanted to tag your virtual machines by guest operating system type, you can create a category called operating system. You can specify that it applies to virtual machines only and that only a single tag can be applied to a virtual machine at any time. The tags in this category might be Windows, Linux, and Mac OS.

Tags and categories can span multiple vCenter Server instances:

  • If multiple on-premises vCenter Server instances are configured to use Enhanced Linked Mode, tags and tag categories are replicated across all these vCenter Server instances.
  • When you use Hybrid Linked Mode, tags and tag categories are maintained across your linked domain. That means the on-premises SDDC and the VMware Cloud on AWS SDDC share tags and tag attributes.

How Do You Create and Edit a vSphere Tag Category

You use categories in your vSphere environment to group tags together and define how tags can be applied to objects. You create and edit a tag category from the vSphere Client.

You can create a tag category explicitly, as explained here, or as part of the tag creation process. Each tag has to belong to at least one tag category.

Prerequisites

The required privilege depends on the task that you want to perform.
Task Privilege
Create a tag category vSphere Tagging.Create vSphere Tag Category on any vCenter Server inventory object.
Edit a tag category vSphere Tagging.Edit vSphere Tag Category on any vCenter Server inventory object.

Procedure

  1. From the vSphere Client Home menu, click Tags & Custom Attributes.
  2. Click the Tags tab and click Categories
  3. Start the task that you want to perform.
    Task Steps to perform
    Create a tag category Click New.
    Edit a tag category Select a category and click Edit.
  4. Edit the category settings.
    Setting Description
    Category Name The category name must be unique to the currently selected vCenter Server system.
    Description You can provide text in the description to describe the purpose or use of the category.
    Tags Per Object
    • If you select One Tag, you can apply only one tag from this category to an object.

      Use this option for categories whose tags are mutually exclusive. For example, if you have a category called Priority with tags High, Medium, and Low, then each object should have only one tag because an object can have only one priority.

    • If you select Many tags, you can apply more than one tag from the category to an object.

      Use this option for categories whose tags are not mutually exclusive.

    After you have set Tags Per Object, you can change from One Tag to Many Tags, but not from Many Tags to One Tag.

    Associable Object Types

    Select whether tags in this category can be assigned to all objects or only to a specific type of object, such as a virtual machine or a datastore.

    Changes to the associable object type are limited.
    • If you initially selected a single object type, you can later change the category to work for all object types.
    • If you initially selected All Objects, you cannot restrict the category later.
  5. Click Create or Save.

How Do You Delete a vSphere Tag Category

Learn how to remove a vSphere tag category from your vSphere environment.

Deleting a category also deletes all tags associated with the category.

Prerequisites

Required privilege: vSphere Tagging.Delete vSphere Tag Category on any vCenter Server inventory object.

Procedure

  1. From the vSphere Client Home menu, click Tags & Custom Attributes.
  2. Click the Tags tab and click Categories
  3. Select a category from the list and click Delete.
    The Delete Category dialog opens.
  4. To confirm the operation, click Delete.

Results

The category and all associated tags are deleted.

How Do You Create and Edit a vSphere Tag

Read how to create or edit a vSphere tag. After you create a tag, you can use it to add metadata to inventory objects.

You can use tags to add metadata to inventory objects. You can also record information about your inventory objects in tags, and you can use the tags in searches. For information about creating and editing a tag category, see How Do You Create and Edit a vSphere Tag Category.

Prerequisites

The required privilege depends on the task that you want to perform.
Task Privilege
Create a tag vSphere Tagging.Create vSphere Tag on any vCenter Server inventory object.
Edit a tag vSphere Tagging.Edit vSphere Tag on any vCenter Server inventory object.

Procedure

  1. From the vSphere Client Home menu, click Tags & Custom Attributes.
  2. Select the Tags tab and click Tags.
  3. Start the task that you want to perform.
    Task Steps to perform
    Create a tag Click New.
    Edit a tag Select a tag and click Edit.
  4. In the dialog box, enter or edit the name for the tag.
    You can use up to 256 characters for the name of the tag.
  5. Enter or edit the description of the tag.
  6. If you create a tag, specify the tag category.
    • Select an existing category from the Category drop-down menu.
    • Click Create New Category and select the newly created category.
  7. Click Create or Save.

How Do You Delete a vSphere Tag

You can delete an existing vSphere tag when you no longer need it by using the vSphere Client.

Procedure

  1. From the vSphere Client Home menu, click Tags & Custom Attributes.
  2. Select the Tags tab and click Tags.
  3. Select one or more tags from the list and click Delete.
  4. To confirm the operation, click Delete.

Results

The selected tags are deleted.

How Do You Assign or Remove a vSphere Tag

After you create vSphere tags, you can apply or remove them as metadata to objects in the vCenter Server inventory.

Prerequisites

Required privilege: vSphere Tagging.Assign or Unassign vSphere Tag on any vCenter Server inventory object.

Procedure

  1. In the vSphere Client, navigate to an inventory tree.
  2. Select an object from the list and click Actions.
  3. From the drop-down menu, select Tags and Custom Attributes.
  4. Select the required action.
    • To assign a tag, select Assign Tag.
    • To remove a tag, select Remove tag.
  5. Select a tag from the list and click Assign.
    In the Assign Tag dialog box, you can also create new tags with Add tag. For information about creating a tag, see How Do You Create and Edit a vSphere Tag.

How Do You Add Permissions for vSphere Tags and Tag Categories

You can manage the user privileges for working with tags and categories. The procedure for assigning permissions to tags is the same as the procedure for assigning permissions to tag categories.

When you create a tag, you can specify which users and groups can operate with that tag. For example, you can grant administrative rights only to administrators and set read-only permissions for all other users or groups. You must have vSphere administrator credentials to set and manage permissions for tags.

Permissions for tags work similar to permissions for vCenter Server inventory objects. For more information, see the vSphere Security documentation.

Procedure

  1. From the vSphere Client Home menu, click Tags & Custom Attributes.
  2. On the Tags tab, click the Tags or Categories button.
    Depending on the button that you click, you see the list of tags or the list of tag categories.
  3. Select an item from the list and click Add Permission.
  4. In the Add Permission dialog box, select a domain from the drop-down menu.
  5. Search for a user or a group to add.
  6. Select a role to add from the drop-down menu.
  7. To enable permission inheritance, select the Propagate to children check box.
  8. Click OK.

vSphere Tagging Best Practices

Incorrect tagging can lead to replication errors. To avoid these errors, diligently follow best practices when tagging objects in your vSphere environment.

When working with tags in multiple node situations, expect replication delays between the nodes (generally 30 seconds to 2 minutes depending on your setup).

Follow these best practices to avoid replication errors:

  • After creating a tag, if you immediately assign that tag to a local object, assign it from the management node where you created the tag.
  • After creating a tag, if you immediately assign that tag to a remote object, assign it from the management node to which the object is local. Depending on your environment setup, allow for replication time to propagate the new tag before you use the tag.
  • Avoid simultaneously creating categories and tags from different management nodes before categories and tags across nodes can finish the replication process. If duplicate categories or tags are created from different nodes at the same time, the duplicates might not be detected and will appear. If you see these results, manually delete duplicates from one management node.
  • Before you remove an object from the vCenter Server inventory that is not a virtual machine or a host, first remove the tags from the object.

For more information about tagging performance best practices, see the blog post titled vSphere 7.0 U1 Tagging Performance Best Practices at https://blogs.vmware.com/performance.