vsphere-clone
: Unwanted behavior using -force
flag when source virtual machine doesn't exist
#490
Open
1 of 2 tasks
Overview of the Issue
Currently, when running
packer build -force
with thevsphere-clone
builder, if the specified source virtual machine is missing, Packer proceeds to delete the target virtual machine before verifying that the source is available. This behavior risks data loss, especially in cases where the target VM is unique and has no backup or proper build configuration.One of the use cases is when Packer is used to regularly update legacy virtual machine templates that are unique and cannot be recreated. Running
packer build -force
without verifying the source VM can lead to data loss, especially when human error or misconfiguration occurs.Reproduction Steps
template
set to non-existing virtual machinepacker build -force
Expected Behavior
vsphere-clone
builder should first check if the source VM exists before force-deleting the target VM.Packer Version
Packer v1.11.2
Plugin Version and Builders
Plugin version 1.4.2
vsphere-iso
vsphere-clone
VMware vSphere Version
Please provide the VMware vSphere version.
Guest Operating System
Any
Simplified Packer Buildfile
Basic
vsphere-clone
configuration;template
option is set to a non-existing virtual machine.Operating System and Environment Details
Any
Log Fragments and
crash.log
FilesThe text was updated successfully, but these errors were encountered: