VMware Cloud Community
StephenMoll
Expert
Expert

Is it possible to set the value of a custom attribute on a VM template?

I can create a custom attribute and can happily set the value of the custom attribute for a VM.

I would like to set the value of a custom attribute for a template as well, but can't seem to make it work.

Is it even possible?

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership

This seems to work for me

Get-Template -Name MyVM | 
Set-Annotation -CustomAttribute 'CAName' -Value 'Anything'


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

StephenMoll
Expert
Expert

Yes that works. Thanks.

 

Why doesn't this work:

Set-Annotation -CustomAttribute 'CAName' -Value 'Anything' -Entity 'Template Name'

Whereas this works for a VM:

Set-Annotation -CustomAttribute 'CAName' -Value 'Anything' -Entity 'VM Name'

Reply
0 Kudos
LucD
Leadership
Leadership

I suspect that OBN for a template doesn't work on the Entity parameter


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos