Hi
We have added some custom properties to VM in build phase pre using VMaddupdatepropeties ..
How do we retrieve this custom property value in post phase ....enumerating the value by getter on specific name is giving a blank
Please advise
Thanks in advance
I suppose I don't fully understand your question, I took it this way:
You have a list of custom properties that you applied to the virtualmachine pre-build that you would like to access post build.
Questions for you:
Are you cloning from a template? If so how are you applying properties 'pre-build' to me that would mean applying them to the template which you are cloning from. Or are you applying them to the recently cloned server sometime during the build?
I would recommend tagging the server with the properties that you would like to retrieve later, I am not familiar with VMaddupdateproperties..
This link should provide more instruction on how to do that:
Here is a tagging link:
How to associate a tag using vAPI
Here is a link to the ManagedEntity object all vmware objects extend it's attributes, note the customValue field array that you may be able to push values to and reference later (not tested or tried)
Have a look at the action items in vRealize Orchestrator under com.vmware.library.vcac, assuming you have the vCAC plugin installed and configured.
You have some examples to get custom properties for a virtual machine, either getPropertiesFromVirtualMachine or getPropertyFromVirtualMachine action items.
Oli
I am using a blocking event subscription that ties into a workflow that updates VM properties using
virtualMachineAddOrUpdateProperties = new Properties () ;
virtualMachineAddOrUpdateProperties.put("name", value) ;
Im trying to retrieve the same property [post build using a
var vRAVmProperties = machine.get("properties") ;
if (vRAVmProperties != null) {
var log = "";
log += "vRA VM properties :\n";
var array = new Array();
for each (var key in vRAVmProperties.keys) {
array.push(key + " : " + vRAVmProperties.get(key));
}
array.sort();
for each (var line in array) {
log += "\t" + line + "\n";
}
System.log(log);
}
variable =vRAVmProperties.get("name");
what is 'machine'? A full copy of your code would be beneficial.
var machine = payload.get("machine") ;
payload is the VM properties bag input of type proprties that IaaS passes to vRO