VMware Cloud Community
DexG83
Enthusiast
Enthusiast

VM tagging in Cloud Template

Hello Community,

I want to tag a VM during deployment with tags I collected in the input form. There are between 5 and 10 tags I want to tag to a new VM.

The format I collected is an array of string e.g.

 

Location:London
OS:Debian

 

Now the question is how can I process this in Cloud Template

  VM:
    type: Cloud.vSphere.Machine
    properties:
      customizeGuestOs: false
      awaitIp: false
      name: '${input.servername}'
      tags: 
        - key: 
        - value: 
  [...]

 

Many thanks,

Dex

Labels (1)
Reply
0 Kudos
3 Replies
DexG83
Enthusiast
Enthusiast

Hi,

thanks for your reply. In my case I don't want to use tags for constraints or capabilities. I need to tag the vm object in vCenter. There are several vCenter tags used for reporting and so on. 

So I actually stuck because I have an array of tags in format:

 

Location:London
OS:Debian

 

and Cloud Assembly seems to accept just one key-value pair:

 

[...]
  VM:
    type: Cloud.vSphere.Machine
    properties:
      customizeGuestOs: false
      awaitIp: false
      name: '${input.servername}'
      tags: 
        - key: 
        - value: 
  [...]

 

 

How can I add more than one key value pair here?

Thanks and kind regards,

Dex 

Reply
0 Kudos
hawks76
Enthusiast
Enthusiast

[...]
  VM:
    type: Cloud.vSphere.Machine
    properties:
      customizeGuestOs: false
      awaitIp: false
      name: '${input.servername}'
      tags: 
        - key: 
        - value:
        - key: 
        - value:
        - key: 
        - value: 
  [...]

See code.  It's pretty simple.

Reply
0 Kudos