Commit 3fc2defb6 altered the directory structure associated with an
exported VM. The changes mean that the export process now stores the
exported machine files and folders under a folder with name 'vm_name' in
the output directory.
This commit restores the previous behaviour whereby the exported machine
files and folders were stored directly in the output directory. This
allows us to keep the efficiency improvements introduced with 3fc2defb6
while maintaining backward compatibility.
By default the Export-VM command creates three folders in the specified
export directory - 'Virtual Hard Disks', 'Virtual Machines' and
'Snapshots'. When a machine with no associated snapshots is exported the
'Snapshots' directory is empty.
Prior to 3fc2defb6 the Snapshots folder was not copied/incorporated into
the output directory at all. This was a bug.
This commit preserves the legacy behaviour by not including an empty
Snapshots directory in the export. However, if there *are* Snapshots
associated with the VM, they are now moved into the output directory
along with the usual directories containing disks and VM metadata. This
prevents warnings/errors on import due to missing snapshots.
* Fixes a bug that caused the build to error if users did not
explicitly set `skip_compaction:true` when setting `skip_export:
true`. See #6392.
* Improves the efficiency of the compaction and export process by
reordering the compaction and export steps.
* Further improves the efficiency of the compacting step through
compacting the vmd* file directly rather than creating and then
operating on a copy.
* The changes mean the export process now stores the exported machine
files and folders under a folder with name 'vm_name' in the output
directory. Previously the exported machine files and folders were
stored directly in the output directory.
This adds a new parameter to the EBS builders named `spot_tags'. This
parameter accepts a map of tags, much like `tags'. These tags will be
applied to a spot request that is created.
Improve visibility.
The value in the Name field returned by 'esxcli network vm list'
actually returns the VMs `displayName`. As such, we need to match
against `displayName` to discover the VMs 'WorldID'.
'WorldId' is ultimately used/needed as an argument in the command that
returns the VMs IP.
The value of displayName is needed by later steps:
* When determining the IP address of the build VM
* When exporting the VM using ovftool
By default Packer will configure the VMX so `displayName` is equal to
the value defined for `vm_name` in the build template. However, it is
possible (and sometimes desirable) to set a custom value for
`displayName`.
Users can set a custom `displayName` through use of the `vmx_data`
option in their template.