Using the VI api, I can do the following
- add a custom field definition
- rename a custom field definition
- delete a custom field definition
- set the value of a custom field on a particular managed object
but I can't find any way to clear a custom field from a particular
managed object. Once you set a value you can't clear it anymore (ie
remove the value on the object without removing the global definition).
Am I missing something or is there a non obvious way to do this?
I tried that with null and the call doesn't go through, I get a soap exception
failed: System.Web.Services.Protocols.SoapException : value
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object parameters)
(I also tried the empty string. But it doesn't remove the custom field.)
Then the only option is to remove the def, but it will also remove all the other values that you don't want to remove. You can save the "other" values and then add them back after you recreate the def. It seems to me too much work.
What is the big deal for let it be there? Just try to find other alternatives.
Steve JIN, VMware Engineering
Yep, it works by removing the definition, but if you have a VC with hundreds of VMs, it becomes a huge performance impact to remove a custom value from one single VM (you need to issue hundreds of calls).
The API is obviously missing this functionality.