-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot recreate template if old one (with same name) still exists #75
Comments
We could even add a config option, "remove_old_templates=true" to remove the old templates with the same name before converting the successful VM to a template. Or, a unique tag could be applied only to the latest template, such as "latest". In other words, when a new template of the same name is created, and "unique_template_tag=latest", then any other template of the same name with the tag "latest" has the tag removed, and the new template is created such that it is the only one with the tag "latest". |
Hey @DesignsWithDavid, thanks for opening this issue and I think allowing the "golden template" workflow you described sounds really useful. Are you consuming these templates via the xen orchestra terraform provider? I ask because if the packer plugin applied the "latest" unique template tag, it would be nice if the How would you feel if this was implemented with the two additional config settings you mentioned above: |
I've been hitting this same issue and I do use TF to deploy things. If you were to implement In my workflow, I don't feel it's necessary for me to keep multiple templates (assuming it's not going to break anything by deleting the existing ones; I am very new to this) so my use-case would just entail wanting to replace the existing template with the new one from Packer. This might mean
As for the TF stuff, having some way to identify which template would be considered the latest would be very helpful when multiple templates of the same name are available (such as with This also mirrors AWS very well when choosing an AMI through Terraform as there is a |
I want to use this packer plugin to create a golden template such that the same of the template is "ubuntu-golden". This template creation fails if a template of the same name already exists. However, XCP-NG does allow multiple templates of the same name to exist. In other words, this limitation (while it may or may not be good practice) is imposing a limitation that XCP-NG does not impose.
My suggestion is to change line 46 of https://github.com/ddelnano/packer-plugin-xenserver/blob/main/builder/xenserver/common/step_type_boot_command.go to find the VM by the UUID instead of by name. The UUID is already used in pausing and unpausing the VM (like on line 24 of https://github.com/ddelnano/packer-plugin-xenserver/blob/main/builder/xenserver/common/step_start_vm_paused.go).
If people still want to avoid allowing this by default, we could introduce a new config flag, such as, "allow_duplicate_templates=false".
The text was updated successfully, but these errors were encountered: