packer-builder-vsphere icon indicating copy to clipboard operation
packer-builder-vsphere copied to clipboard

template tags

Open DarrenRatcliffe opened this issue 6 years ago • 11 comments

Not really an issue more of a question

Is there any way to assign tags to the templates in a similar way that you can with the AWS builder using this plug in?

DarrenRatcliffe avatar Mar 13 '18 18:03 DarrenRatcliffe

Do you actually use tags in vSphere? they do exist but require additional permissions.

mkuzmin avatar Mar 13 '18 19:03 mkuzmin

@DarrenRatcliffe simple answer is no this plugin does not currently support assigning tags to templates. I use labels for Google Compute Engine images with packer in my environment, so I think I understand your use case. You want to be able to assign some sort of metadata to your VMWare templates, right?

@mkuzmin what do you think about adding the PR Welcomed label to this issue?

seanmalloy avatar Mar 14 '18 04:03 seanmalloy

I want to hear a real use case first. Are you already using tags outside of Packer? What kind of values do they contain?

mkuzmin avatar Mar 14 '18 07:03 mkuzmin

I want to use tags for assigning info about user whom created template and build date. Probably not a bad idea to add build number id to tags and git commit hash.

freeseacher avatar May 26 '18 11:05 freeseacher

My point is tags in vSphere is not what you usually expect from such a feature. They require to be an administrator of the whole vCenter.

That’s why I’m asking for more detailed use cases.

mkuzmin avatar May 26 '18 16:05 mkuzmin

Oh. I see. That's make sense. Maybe structured notes can help ?

сб, 26 мая 2018 г., 19:51 Michael Kuzmin [email protected]:

My point is tags in vSphere is not what you usually expect from such a feature. They require to be an administrator of the whole vCenter.

That’s why I’m asking for more detailed use cases.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jetbrains-infra/packer-builder-vsphere/issues/60#issuecomment-392273657, or mute the thread https://github.com/notifications/unsubscribe-auth/AARp_dOXgoTuKnumMPu59hhiyXAEvSYbks5t2YgFgaJpZM4SpOlo .

-- С уважением, Алексей Широких.

freeseacher avatar May 26 '18 18:05 freeseacher

In vSphere, we typically use custom attributes or the notes section for templates to track build date, who created it, etc. That would be very useful. We also use vSphere tags pretty heavily to assign certain metadata, but you wouldn’t really use them for this type of data. For any of these things, you don’t have to be a full admin in vcenter, just need the necessary privs. So in summary - having the ability to add notes (or set custom attribute value) to a VM/template during the build process would work for the use case mentioned above, and it’s something we currently do all the time when building templates in vCenter.

stacycarter avatar May 26 '18 19:05 stacycarter

configuration_parameters are already supported.

For notes please file a separate issue. Also, this would be a very simple PR like #46.

mkuzmin avatar May 26 '18 20:05 mkuzmin

https://docs.ansible.com/ansible/latest/plugins/inventory/vmware_vm_inventory.html

Ansible's Dynamic inventory has support for making "host groups" based on tags. It would be nice to have default tags set on the template, but this is a different use-case then the original ask.

I also agree on using custom attributes for versioning.

bhundven avatar Feb 12 '19 19:02 bhundven

Hey Guys, we really looking forward to this feature. We use packer and Terraform for deploying ec2 instances in AWS and use tags for searching the right image in the given version. Now we try to use the same process to deploy in VSphere. Therefor we need to tag the vsphere image we create with packer. When we use custom labels for the process so we can search for the custom labels in vsphere.

zieglerjens avatar Mar 19 '19 09:03 zieglerjens

Looks like two things should be implemented for metadata.

  • custom attributes which are called custom fields in the govmomi package
  • tags https://github.com/vmware/govmomi/blob/master/govc/tags/create.go#L75

Does look fairly simple to implement! I'm looking for custom attributes more than tags too. Should I create a separate ticket for that?

Great plugin btw @mkuzmin ! Thank you for all the work you've put in.

nitrocode avatar Aug 03 '19 13:08 nitrocode