So i’m currently working on a script that syncs particular manageiq and vcenter tags.
I’m calling the script after the vm is provisioned because i need the id of the vm in vcenter for the script.
But the thing I’m struggling with is retrieving the tags and name from the provisioning wizard.
I’m also planning to do it with a service dialog in the future but now (for testing purposes) I’m just doing it with the vm provisioning wizard.
This is what i got at the moment to retrieve the tags and vm name. The portion to retrieve the vm name works but the portion for the tags doesn’t.
prov = $evm.root['miq_provision'] vm_target_name = prov.get_option(:vm_target_name) tagcodename = prov.get_tags(:cat_code) tagbackupname = prov.get_tags(:cat_backup) tagreplicationname = prov.get_tags(:cat_replication)
Is there anyone who can help me? i’ve already read the cloudforms automation guide but can’t find out how to retrieve the tags.
Thanks in advance.