WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / vSphere / Custom Attributes != vSphere Tags

Custom Attributes != vSphere Tags

01.13.2015 by William Lam // 21 Comments

A common question that I see frequently asked by customers is whether Custom Attributes in vCenter Server can be completely replaced by vSphere Tags? Both Custom Attributes and vSphere Tags provide metadata capabilities, but there are some underlying differences between the two and depending on how you use Custom Attributes today, you may or may not be able to completely migrate over to using vSphere Tags, at least in the short term.

UPDATE (11/16/16): vSphere 6.5 now allows you to fully view and manage Custom Attributes directly from the vSphere Web Client.

Custom Attributes allows you to specify custom "keys" associated with either a Virtual Machine or an ESXi host object using the vSphere C# Client. which are the only supported objects When using the vSphere API, you can apply Custom Attributes it across variety of vSphere Objects and for more details, please have a look at this post here. Once enabled for either a VM or an ESXi host, you will be able to assign an object-specific metadata "value" to these objects. An example would be a Custom Attribute called "Application Owner" and for VM1 I have a value of "Duncan Epping" and for VM2 I have a value of "Alan Renouf".

vsphere-custom-attributes-are-not-equal-to-vsphere-tags-1
vSphere Tags also provides a metadata capability, but it goes beyond just VMs and ESXi host. vSphere Tags can be applied to all objects within the vSphere Inventory. A major distinction between Custom Attributes and vSphere Tags which will help answer our initial question is that vSphere Tags can not be used to store object-specific metadata, it is used for categorizing or logically organizing various objects together. An example would be a Tag called "Production" which can then be assigned to VM1 and VM2 for organizational purposes but you would not be able to assign a specific value for each of the VMs.

vsphere-custom-attributes-are-not-equal-to-vsphere-tags-0
This distinction of not being able to assign object-specific metadata is the key difference between vSphere Tags and Custom Attributes. If you currently rely on this capability of Custom Attributes, you will not be able to completely migrate over to using vSphere Tags. A good way to think about vSphere Tags today is that they are similar to vSphere Folders but much more dynamic and search across all vSphere Objects. The lack of object-specific metadata for vSphere Tags is something that VMware Engineering is aware of today and hopefully they will be able to enhance in the future to support the Custom Attributes use case, so that vSphere Tags can be used exclusively.

In fact, I also hope to see vSphere Tags get enhanced so that permissions can also be applied onto Tags which would then propagate to the underlying associated vSphere Objects. I know this is another common request from customers that have looked at using vSphere Tags. I would like to also see a proper API exposed for Tags so that they can be managed and accessed programmatically, which can be quite handy for CMDB or provisioning systems. Today, there are no vSphere APIs for Tags, but you can manage them using PowerCLI Tagging cmdlet. Searchability is also another area that vSphere Tags can get further enhancements on. Today you can only search on objects by Tag name, but in the future I hope to see support for more complex queries which include searching through the values of the Tags assigned.

In summary, Custom Attributes are not going away anytime soon, at least until their capabilities are on-par with vSphere Tags. You will be able to continue accessing Custom Attributes which is available today in the vSphere C# Client or using the vSphere API. Custom Attributes are currently not visible in the vSphere Web Client, but you can use this custom vSphere Web Client plugin which makes the Custom Attributes available in the vSphere Web Client. Going forward, the future will be vSphere Tags, but in the mean time you may want to use both sets of metadata capabilities depending on your use case.

More from my site

  • Applying Custom Attributes beyond just Host & Virtual Machine Objects
  • vSphere Web Client Plugin for Custom Attributes
  • Cool browser plugin for Dark Theme vSphere H5 Client 
  • ESXi on Intel NUC 12 Pro (Wall Street Canyon)
  • Big updates to the vCenter Event Broker Appliance (VEBA) Fling

Categories // vSphere Tags // custom attributes, metadata, tagging

Comments

  1. *protectedSchorschi Decker says

    01/15/2015 at 5:51 am

    Does PowerCLI not expose creation and management of custom attributes?

    Reply
    • William Lam says

      01/15/2015 at 9:05 pm

      Correct, today it only allows you to query for the information but not actually perform create/delete tags.

      Reply
  2. *protectedWarren Legg says

    01/16/2015 at 11:02 am

    Many thanks for this, it completely clarifies the distinction and capability for these similar managed object types... Agreed that the ubiquitous tags should be extended so that they allow value(s)* to to be stored against managed objects - that would provide some serious power for us automators out there!

    * Note that being able to store many values for an object/tag combination could also be useful.

    Reply
  3. *protectedGanesh says

    07/22/2015 at 8:49 pm

    Thanks much for the explanation. Very helpful!!

    Reply
  4. *protectedFranz Lao says

    08/07/2015 at 2:47 am

    ≈

    Reply
    • *protectedFranz Lao says

      08/07/2015 at 2:53 am

      my apologies for the "≈" typo...I have some questions on another mechanism for associating custom attributes with a VM--using the VM config advanced option (extra config) where [key, value] pairs can be added (VM needs to be powered off if entered via vSphere Web Client). My questions are 1) how does this mechanism compare to the two discussed in this article? 2) does vSphere 6.0 continue to provide API support for user to define these extra config as VM an advanced config option? Thanks!

      Reply
  5. *protectedCarlos says

    10/13/2015 at 11:25 pm

    Looking at the VS6 administration guide, the permissions hierarchy shows "tag category" and "tags" as descendant of the global root. That is like someone likes your suggestion of assigning permissions to tags!

    Reply
  6. *protectedpizzaops says

    01/07/2016 at 9:55 am

    Hi William. Thanks for the excellent and informative article.

    I've been reading through the vSphere API documentation for vSphere 5.5, and I haven't actually found a way to interact with attributes via the API. Is this something that's limited to vSphere 6.0? Am I just missing something? I'd appreciate any guidance you could offer.

    Reply
    • William Lam says

      01/07/2016 at 7:28 pm

      Custom Attributes are available within the Custom Fields Manager - http://pubs.vmware.com/vsphere-60/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvim.CustomFieldsManager.html

      Here's a sample that exercises that API using the vSphere SDK for Perl https://github.com/lamw/vghetto-scripts/blob/master/perl/addVMCustomField.pl

      Reply
      • *protectedpizzaops says

        01/07/2016 at 9:57 pm

        Thanks William! That's the vSphere 6.0 API documentation, though. I haven't been able to find it anywhere in the 5.5 documentation. Any ideas?

        Reply
        • William Lam says

          01/08/2016 at 7:25 am

          The API has existed since 3.x, I only used the vSphere 6.0 doc as a reference. If you browse the 4.x/5.x version of the documentation, you'll find the exact same API 🙂

          Reply
          • *protectedPizzaOps says

            01/08/2016 at 12:59 pm

            Doh! Thanks for the spoon-feeding. Hah.

  7. *protectedZiad says

    03/04/2016 at 5:03 pm

    Is this correct? I was able to add custom attribute to a datastore through both mob and vim api.

    "Custom Attributes allows you to specify custom "keys" associated with either a Virtual Machine or an ESXi host object, which are the only supported objects"

    Reply
    • William Lam says

      03/04/2016 at 8:01 pm

      Interesting, I just took a look and it looks like the API does in fact accept any Managed Object and just tested this myself on Datastore object and it does seem to work. Historically this feature had only supported VM/Host (https://pubs.vmware.com/vsphere-60/index.jsp?topic=%2Fcom.vmware.vsphere.hostclient.doc%2FGUID-0E69C0F6-9EDD-47E8-8F1D-200B394F54C1.html) which is what the UI limits but perhaps that was merely a UI limitation. I guess you could use Custom Attributes like Tags on the various Managed Objects. Nice find

      Reply
      • William Lam says

        03/09/2016 at 9:17 am

        Ziad,

        I've updated the article to reflect this new info and I've also just published a new article on this topic here http://www.virtuallyghetto.com/2016/03/applying-custom-attributes-beyond-just-host-virtual-machine-objects.html Thanks for sharing this info!

        Reply
  8. *protectedmichaelnagar says

    03/31/2017 at 8:56 am

    Hi William,
    Would you if there is a way to move from "Annotations" to "Tags"?
    Thanks,
    Michael

    Reply
  9. *protectedGeorge E Sullivan says

    07/20/2017 at 10:06 am

    I have vSphere Client 6.5. I need to add some Tags and Categories. I don't see the New Category button. How do I get that to appear?

    Reply
  10. *protectedGeorge E Sullivan says

    07/20/2017 at 10:16 am

    Never mind. 🙂 I was using the HTML5 version. I found it with the Flash Version.

    Reply
  11. *protectedGouri Potadar says

    07/25/2019 at 6:20 am

    Is there a way that customer attribute and tags both can be worked together if yes then how can they achive this ?

    Reply
    • *protectedGouri Potadar says

      07/25/2019 at 6:22 am

      Apologies for the typo ... can we use custom attributes and tags together ?

      Reply
  12. *protectedjekir says

    05/15/2020 at 9:19 am

    Hi! your blog is amazing!

    Did you know if its possible to use Rest Api to manage or retrieve the custom attributes?

    if not, did you know if is on the current roadmap?

    Thank you!

    Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...