From 23177a72ad527453131dcafe2010c7649a8108bf Mon Sep 17 00:00:00 2001 From: Matt Kaar Date: Mon, 2 May 2022 21:44:08 -0400 Subject: [PATCH] Improve OVF compatibility with VMware ESXi --- .github/workflows/build.yml | 23 +++++++++++++++++++++-- variables.pkr.hcl | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 418975d..50def4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,10 @@ jobs: path: ~/.cache/packer key: ${{ runner.os }}-packer + - name: Install Dependencies + run: | + brew install xmlstarlet + - name: Build VirtualBox OVF image uses: nick-invision/retry@v2 env: @@ -34,8 +38,23 @@ jobs: run: echo "build_name=$(sh -c "find . -name '*.ovf' | xargs basename -s '.ovf'")" >> $GITHUB_ENV working-directory: ./output-virtualbox - - name: Change virtual hardware version - run: sed -i '' 's/virtualbox-2.2/vmx-13/' ${{ env.build_name }}.ovf + - name: Improve OVF VMware compatibility + run: | + xml ed --inplace \ + -N ns='http://schemas.dmtf.org/ovf/envelope/1' \ + -N vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" \ + -u "//ns:System/vssd:VirtualSystemType" \ + -v "vmx-13" \ + ${{ env.build_name }}.ovf + xml ed --inplace \ + -N ns='http://schemas.dmtf.org/ovf/envelope/1' \ + -N rasd='http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData' \ + -d "//ns:Item[rasd:ResourceSubType[contains(text(), 'PIIX4')]]" \ + ${{ env.build_name }}.ovf + xml ed --inplace \ + -N ns='http://schemas.dmtf.org/ovf/envelope/1' \ + -d "//ns:StorageController[@type='PIIX4']" \ + ${{ env.build_name }}.ovf working-directory: ./output-virtualbox - name: Create OVA manifest diff --git a/variables.pkr.hcl b/variables.pkr.hcl index 93e74e3..4d7ec6f 100644 --- a/variables.pkr.hcl +++ b/variables.pkr.hcl @@ -46,7 +46,7 @@ variable "vsphere_network" { locals { boot_command = [ - " ", + " ", "net.ifnames=0 biosdevname=0 autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/", "", ""