Steps to edit an OVF file after exporting a Virtual Machine to a OVF template
search cancel

Steps to edit an OVF file after exporting a Virtual Machine to a OVF template

book

Article ID: 393287

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

These steps can be used to edit the contents of an OVF file in order to make changes to the VM metadata.

Environment

  • vSphere 7.x
  • vSphere 8.x

Cause

There may be situations where the VM metadata in an .ovf file needs to be modified in order for an OVF import to complete successfully.  For example:

  • When attempting to import an OVF with a VM using a virtual hardware version higher that what is supported on the vCenter Server.

Resolution


  • When a VM is exported as an OFV template, three files will be created including:
    • .ofv: The VM metadata
    • .vmdk: The virtual disk file
    • .mf: The manifest file which contains a checksum of the OVF and MF files
  • Make the necessary changes to the .ovf file
    • For example, change the virtual hardware version of the VM
  • The manifest file will contain the SHA256 checksum of the .vmdk and .ovf files.  For example:
    • SHA256(Example-VM.vmdk)= #########################################
      SHA256(Example-VM.ovf)= #########################################
  • Update the manifest file with the updated checksum of the updated .ovf file
  • In order to calculate the SHA265 checksum of a file:
    • Windows Powershell
      • Get-FileHash .\Example-VM.ovf -Algorithm SHA256
    • Linux terminal:
      • sha256sum ./Example-VM.ovf
    • Mac terminal:
      • shasum -a 256 ./Example-VM.ovf
  • Copy the new hash value, and replace the old hash value of the .ovf file in the .mf file
  • Import the OVF into vSphere