Skip to content

vsphere-template: vm incorrectly detected as existing template #728

@karelvanhecke

Description

@karelvanhecke

Code of Conduct

  • I have read and agree to the Code of Conduct.
  • Vote on this issue by adding a 👍 reaction to the original issue description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Packer Version

1.15.4

Packer Plugin Version

2.1.2

Plugin Builder

  • vsphere-iso
  • vsphere-clone
  • vsphere-supervisor

Plugin Post-Processor

  • vsphere
  • vsphere-template

vSphere Version

8.0.3

Description

#560 introduced a bug where the VM that should be marked as a template is incorrectly detected as an existing template when the VM name is used as the template name.

Packer Configuration

post-processor "vsphere-template" {
      host                = "vcenter.example.org"
      username            = var.username
      password            = var.password
      datacenter          = "DC"
      folder              = "/Templates"
}

Debug Output

N/A

Panic Output

No response

Expected Behavior

When the VM name and template name are the same, the VM should be converted to a template.

Actual Behavior

When the VM name and template name are the same, the VM is detected as an existing template. This causes the post-processor to fail.

Steps to Reproduce

Use vsphere-template to mark a VM as a template.
Make sure the VM name is used as the template name.

Environment Details

No response

Screenshots

No response

References

No response

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions