Author : Alyc Helms
Topic Name : Edit a Custom Attribute in the vSphere Web Client
Publication Name : vCenter Server and Host Management
Product/Version : VMware vSphere/6.5
Is it possible to restore custom attributes that have been deleted?
I have not done much work with custom attributes; but from the the little I do know, I can tell you I've never encountered a method for restoring deleted custom attributes. There's always the option of restoring a backup of course. But I'm sure you've already thought of that.
Unfortunately, that's an all-or-none proposition at this point in time. I'd love for a selective, granular restore capability of CAs or vSphere tags, so if anyone reading this has developed something like that it would be great to have. This is one of my big gripes with vSphere tags which also plagues CAs.
IIRC the "tags" are more tight to the PSC (but not 100% sure) which makes it more worth compared to the vCenter DB.
We set/overide the custom attributes with Powershell. So with some work you can read all infos and store them localy in *.csv or some kind of serialized array, minimalistic DB or similar. But out of the box there is nothing and in all the years i have never see backup product which save these informations.
They are but they both suffer the same fate if, for example, you remove a VM (or any other object) from inventory that had such metadata assigned and then re-add it. Once re-added, none of the CAs or Tags are present with no way to restore them. The one solution I've built is to do what you describe and have a PowerShell script or vRO workflow crawl across vCenter and store them into a file or resource element. It's ugly but it can possibly work with enough development time.