Skip to content

vsphere-iso: vm_name must be unique within the folder and not the entire cluster #8936

@rgl

Description

@rgl

Overview of the Issue

NB This is a migration of the issue jetbrains-infra/packer-builder-vsphere#244 to this repository, as it also applies.

I have a vm with a vm_name example in the folder vagrant-templates, but when I try to create another one with the same vm_name inside the empty folder vagrant-templates/packer, packer 1.5.4 refuses to start with:

example already exists, you can use -force flag to destroy it: <nil>

This is a bug that should be fixed by making sure vm_name is only unique within the folder and not the entire cluster.

It seems the calls to find_vm, err := d.FindVM(s.Location.VMName) as in

vm, err := d.FindVM(s.Location.VMName)
need to be changed to find_vm, err := d.FindVM(fmt.Sprintf("%s/%s", s.Location.Folder, s.Location.VMName)).

The PR at jetbrains-infra/packer-builder-vsphere#245 was migrated to this packer repository at #8938.

Packer version

Packer v1.5.4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions