Adds support to export a virtual machine image to either to the default Open Virtualization Format (ovf) or convert to Open Virtualization Archive (.ova).
[!NOTE]
To use the ova format option, VMware ovftool must be installed on the Packer host and accessible in either the system PATH or the user's PATH. This is noted in the documentation.
Testing
Standard Build and Tests:
➜ packer-plugin-vsphere git:(feat/export-to-ova) ✗ make generate
2024/04/18 15:30:19 Copying "docs" to ".docs/"
2024/04/18 15:30:19 Replacing @include '...' calls in .docs/
Compiling MDX docs in '.docs' to Markdown in '.web-docs'...
➜ packer-plugin-vsphere git:(feat/export-to-ova) make build
➜ packer-plugin-vsphere git:(feat/export-to-ova) make test
? github.com/hashicorp/packer-plugin-vsphere [no test files]
? github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common/testing [no test files]
? github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/examples/driver [no test files]
ok github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/clone 2.655s
ok github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/common 4.941s
? github.com/hashicorp/packer-plugin-vsphere/version [no test files]
ok github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/driver 11.917s
ok github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/iso 5.328s
ok github.com/hashicorp/packer-plugin-vsphere/builder/vsphere/supervisor 8.156s
ok github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere 2.179s
ok github.com/hashicorp/packer-plugin-vsphere/post-processor/vsphere-template 3.547s
Additional Tests
✅ PASS: Export without setting Format. Defaults to ovf.
✅ PASS: Export without setting Format. Defaults to ovf. Expected error for existing ovf file found.
✅ PASS: Export without setting Format with force = true. Defaults to ovf. Existing ovf overwritten.
✅ PASS: Export setting Format to ova without ovftool installed or in PATH. Expected error.
✅ PASS: Export setting Format to ova.
✅ PASS: Export setting Format to ova. Expected error for existing ova file found and intermediate files removed.
✅ PASS: Export setting Format to ova with force = true. Existing ova overwritten and intermediate files removed.
Summary
Adds support to export a virtual machine image to either to the default Open Virtualization Format (
ovf
) or convert to Open Virtualization Archive (.ova).Testing
Standard Build and Tests:
Additional Tests
✅ PASS: Export without setting
Format
. Defaults toovf
. ✅ PASS: Export without settingFormat
. Defaults toovf
. Expected error for existingovf
file found. ✅ PASS: Export without settingFormat
withforce = true
. Defaults toovf
. Existingovf
overwritten. ✅ PASS: Export settingFormat
toova
withoutovftool
installed or inPATH
. Expected error. ✅ PASS: Export settingFormat
toova
. ✅ PASS: Export settingFormat
toova
. Expected error for existingova
file found and intermediate files removed. ✅ PASS: Export settingFormat
toova
withforce = true
. Existingova
overwritten and intermediate files removed.Reference
Closes #17
VMware Open Virtualization Format Tool (
ovftool
).