The image build process failed for RHEL 9 in the exporting OVA phase.
Official Document - Linux Custom Machine Images
==> vsphere-iso.vsphere: Downloading spec file and debug info
vsphere-iso.vsphere: Downloading Goss specs from, /tmp/goss-spec.yaml and /tmp/debug-goss-spec.yaml to current dir
==> vsphere-iso.vsphere: Executing shutdown command...
==> vsphere-iso.vsphere: Deleting Floppy drives...
==> vsphere-iso.vsphere: Eject CD-ROM drives...
vsphere-iso.vsphere: Starting export...
vsphere-iso.vsphere: Downloading: rhel-9-kube-v1.30.13_vmware.1-disk-0.vmdk
vsphere-iso.vsphere: Exporting file: rhel-9-kube-v1.30.13_vmware.1-disk-0.vmdk
vsphere-iso.vsphere: Writing ovf...
==> vsphere-iso.vsphere: Clear boot order...
==> vsphere-iso.vsphere: Running post-processor: packer-manifest (type manifest)
==> vsphere-iso.vsphere: Running post-processor: vsphere (type shell-local)
==> vsphere-iso.vsphere (shell-local): Running local shell script: /tmp/packer-shell3719358139
vsphere-iso.vsphere (shell-local): image-build-ova: cd ./output/rhel-9-kube-v1.30.13_vmware.1
==> vsphere-iso.vsphere (shell-local): Traceback (most recent call last):
==> vsphere-iso.vsphere (shell-local): File "/home/imagebuilder/./hack/image-build-ova.py", line 274, in <module>
==> vsphere-iso.vsphere (shell-local): main()
vsphere-iso.vsphere (shell-local): image-build-ova: loaded rhel-9-kube-v1.30.13+vmware.1
==> vsphere-iso.vsphere (shell-local): File "/home/imagebuilder/./hack/image-build-ova.py", line 129, in main
==> vsphere-iso.vsphere (shell-local): 'OS_ID': OS_id_map[build_data['guest_os_type']]['id'],
==> vsphere-iso.vsphere (shell-local): ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
==> vsphere-iso.vsphere (shell-local): KeyError: 'rhel9_64Guest'
==> vsphere-iso.vsphere: Running post-processor: custom-post-processor (type shell-local)
==> vsphere-iso.vsphere (shell-local): Running local shell script: /tmp/packer-shell2976451295
Build 'vsphere-iso.vsphere' errored after 18 minutes 24 seconds: 1 error(s) occurred:
Tanzu Kubernetes Grid v2.5.4
As a temporary workaround, replace the value of “guest_os_type” from “rhel9-64” to “rhel8-64” in the rhel-9.json.