Objective 5.3 – Manage vCenter inventory

  • Apply vSphere Tags

vSphere Tagging information from the Documentations Center

Tagging is done in the vSphere web client and allows any object to become searchable based on the applied Tag.

A use case for tagging maybe that you want to search for all Virtual Machines, Switches and Storage that’s been provisioned for development from within the vSphere client.

A tag needs to be a member of a Tag “Category” The Category defines what the Tag can be associated with. EG all Tags in this Category can be assigned to all objects, or all Tags in this Category can only be assigned to Datastores.

For example you could create a “Datastore” Category, you can then limit tag association to Datastores only. Within the Tag Catergory you would define Tags. You could define a iSCSI Tag, NFS Tag, Fibre Tag. If you then assigned the tags to datastores that have been provisioned using the specified method you could then either search for the “Datastore” category which would return all datastores with the following tags iSCSI Tag, NFS Tag, Fibre Tag, or you could search for just the NFS Tag which would return only datastores that have been tagged with the NFS tag.

You can find the Tags option from within the web client

Tags

First step is to create a New Category. In my example below I am creating a Category called “Devlopment”

category

As you can see by the screen shot, this is where you identify the associable objects. In my case as I want to identify all objects (Virtual Machines, Storage, Switches) that are provisioned for development purposes I am going to leave the associable object type to all Objects.

I’m also only going to allow an object to have one tag associated with it. There maybe instances, defined by an end users search criteria, that an object will need two tags associated with it.

The next step is to create the tags. As my criteria is to be able to search for all development objects, as well as searching just for Development VMS, Development Switches & Development Datastores, I will create 3 Tags similar to that below. Make sure you associate the Tag with the Category you’ve just created.

tag

You will see all tags created from the “tag Tab”

all tags

You will then need to associate the tag to an object. Find the object you wish to tag, right click and select “assign tag”

assign tag

From the list of tags displayed, select the tag and select Assign.

As the tags we created are members of a category that doesn’t limit the object type association we will see all our 3 tags here.

Once we have assigned all the tags they’re now searchable from within the vSphere inventory

  • Search vSphere inventory

This seems like quiet a basic objective to have on the VCAP-DCA exam, however my suspicion is that they also expect you to search the inventory using powercli to return more specific criteria.

I’ll try and cover both.

First I’ll go through searching using the VI Client.

As per the objective above. Once you create tags you can now search them in the vSphere client.

If we search for the “Development” Category we just created it will return all objects associated with that Category. So all tags we created and assigned to that category and all objects we have tagged with those tags

development search

search dev

We can then search just for a Tag rather than a tag Category which will return all objects associated to that tag only

vm search

virtual machine search

In addition to this, you can search the inventory using the PowerCli. For instance, say you wanted to find all Virtual Machines with a connected CD-ROM drive you could run the following command

Get-VM | where { $_ | Get-CDdrive | where { $_.ConnectionState.Connected -eq “true” } } | select Name

More examples are listed in the using PowerCLI section 7.1

  • Troubleshoot the vSphere inventory infrastructure

This is an experienced based skill that can only be obtained through experience and exposure

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s