VMware Cloud Community
James_McCartin
Contributor
Contributor
Jump to solution

Converting Tags

I've converted all of my custom attributes in vCenter to Tags.  After converting, some custom attribute data has been modified.  If I try to convert those attributes to tags, it appends a 1 to the category name.  For instance, I have a custom attribute named "OS Support Engineer".  If I add a name to this attribute on a new VM and try to convert it to a tag, the category of the tag is "OS Support Engineer(1)".  It will not let me convert the attribute to the correct named tag. 

Should I just delete all of my tags and do a new import?

With custom attributes, I can view a list of all VMs and their associated custom attributes.  With this view, I can see if VMs are missing data for certain attributes. 

How can I get a list of all VMs and their associated tags? How can I find VMs with tags?

0 Kudos
1 Solution

Accepted Solutions
RyanH84
Expert
Expert
Jump to solution

You can get a list of VM's with an engineer tag name because they are tagged directly to a VM. You probably want to do a search for the Category of "OS Support Engineer".  You probably want to put together a quick Power-CLI script using the Get-TagCategory , Get-TagAssignment and Get-Tag cmdlets.


You can probably search for a blank "" field on VM's with no TagCategory of "OS Support Engineer". If you need help with the powershell I can give it a go, but it's not my strongest skill. You could ask in the Power-CLI forum?

With the cardinality, I'm not sure once it's set you can change it. I think you'd have to get rid of the Category and re-import it. I'm not 100% on this one, it would require a little testing!

------------------------------------------------------------------------------------------------------------------------------------------------- Regards, Ryan vExpert, VCP5, VCAP5-DCA, MCITP, VCE-CIAE, NPP4 @vRyanH http://vRyan.co.uk

View solution in original post

0 Kudos
3 Replies
RyanH84
Expert
Expert
Jump to solution

Hi,

What version of vSphere are you on? If you login to the web console, and navigate to the "Tags" section, you will have an "Items" tab where you will see "Tags" and "Categories". As I have come to understand it in my head, the conversion/migration from vSphere C# client is an Attribute becomes a Category and the Value of that Attribute becomes a Tag. A Category is like a group. For example:


"OS Support Engineer". When you create it, you would want to create a category and then give it a description such as "Members of the OS Support Engineers" and then give it the cardinatlity of "Many Tags per Object" and associated to all object. (As you might want to tag an engineer to anything, such as a host, cluster, folder, etc).

You might have 3 OS Support Engineer users named "Bill", "Ted" and "Rufus". You would create  Tags for the users and then assign them to the category (group) of "OS Support Engineers".  If you wanted to assign an engineer to a host/vm you can assign that tag, from the existing group "OS Support Engineers". You can't have more than one group named "OS Support Engineers". Which seems to be what is happening in your conversion? So you might have  "OS Support Engineer" and then "Bill" under one annotation, but then "OS Support Engineer" and "Ted". When you have migrated, I think you might have set "ONE TAG PER OBJECT" as seen here:

Migrating OS Support Engineer Bill and Ted (Bill is VM1 value and Ted is on VM2 value)

Enabling many tags per object  (If you don't do this, you will have OS Support Engineer category and Bill tag created. Then OS Support Engineer(1) category and Ted Tag created). Like this

Under the tags menu, you should be able to select a tag and then have a view of all related objects to that tag. If you wanted a quick way of getting all VM's and tags, I'd recommend PowerCLI to do this. There is a good VMware Blog Post about getting started with that!


I hope that makes some sense? Happy to help more!

------------------------------------------------------------------------------------------------------------------------------------------------- Regards, Ryan vExpert, VCP5, VCAP5-DCA, MCITP, VCE-CIAE, NPP4 @vRyanH http://vRyan.co.uk
0 Kudos
James_McCartin
Contributor
Contributor
Jump to solution

I see how I can get a list of VMs that are tagged with a certain engineer, but how can I get a list of all VMs with an "OS Support Engineer" tag? How can I get a list of all VMs without an "OS Support Engineer" so that I can update those?

Also, I accidentally changed the Multiple Cardinality of a category to Yes and now I cannot change it back.  The options are now greyed out.  Is it impossible to change this back?  Thanks!

0 Kudos
RyanH84
Expert
Expert
Jump to solution

You can get a list of VM's with an engineer tag name because they are tagged directly to a VM. You probably want to do a search for the Category of "OS Support Engineer".  You probably want to put together a quick Power-CLI script using the Get-TagCategory , Get-TagAssignment and Get-Tag cmdlets.


You can probably search for a blank "" field on VM's with no TagCategory of "OS Support Engineer". If you need help with the powershell I can give it a go, but it's not my strongest skill. You could ask in the Power-CLI forum?

With the cardinality, I'm not sure once it's set you can change it. I think you'd have to get rid of the Category and re-import it. I'm not 100% on this one, it would require a little testing!

------------------------------------------------------------------------------------------------------------------------------------------------- Regards, Ryan vExpert, VCP5, VCAP5-DCA, MCITP, VCE-CIAE, NPP4 @vRyanH http://vRyan.co.uk
0 Kudos