Skip to content

Cannot recreate template if old one (with same name) still exists #75

Description

@DesignsWithDavid

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions