VMware tagging not being applied

In our catalog we have metadata entry for costcode.

“metadata”: [
{
“name”: “cost code”,
“value”: “<%= customOptions.input_vm_costcode %>”
}
],

When VMware system is created, the tag gets created in vcentre but does not get automatically assigned to the VM.

Within the catalog history of the VM you can also see the tag assigned:

Should the tag be automatically assigned to the VM?

Cheers
Jon

I believe you also have to have that input assigned to the layout.

Hi,

Can you explain more please? Within the layouts I cannot see anything about metadata/tags.

Cheers
Jon

To get mine to tag, I simply had to add the customOptions under:

"config": {
     "customOptions": {
      "password": "<%=customOptions.password%>",
      "steamBackup": "<%=customOptions.steamBackup%>",
      "world": "<%=customOptions.world%>",
      "steamPort": "<%=customOptions.steamPort%>",
      "optionList": "<%=customOptions.optionList%>",
      "nfs": "<%=customOptions.nfs%>",
      "newSteamBackup": "<%=customOptions.newSteamBackup%>"
    }
}

And I made sure that I have ‘export as tag’ checked on the input in my form.

image

Sadly it’s not working for me.

I have added:

  1. Add the metadata entry to the catalog

“metadata”: [
{
“name”: “cost code”,
“value”: “<%= customOptions.input_vm_costcode %>”
}
],

  1. then add to the customoptions:

“cost code”: “<%= customOptions.input_vm_costcode %>”

So apart from those two steps nothing else is required?

I check the box on the inputs for “Export as Tag”.

That said, if it’s creating in vCenter and not associating there should be an event/error in vCenter on what’s happening. Are you setting invalid values with your key? Are you trying to do multi-cardinality tags?

I’m experiencing a similar thing. I have export as tag selected on the option but the tag doesn’t get set in VMware. Don’t see any obvious errors on VMware.

Yours is creating the Key / Value in vCenter but not applying to the VM as well?

Correct - I think I found out the issue. In my case the field name case did not match the vCenter tag category (BackupSchedule category name vs backupSchedule field name). I had to update everything to match, including some fields that aren’t displayed on the option edit form.

UPDATE option_type SET field_set_name = 'BackupSchedule', field_get_name = 'BackupSchedule' WHERE id = 1;