Exporting a VM as an OVF fails when using OVFtool.
search cancel

Exporting a VM as an OVF fails when using OVFtool.

book

Article ID: 431355

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

  • Executing the ovftool export C:\Program Files\VMware\VMware OVF Tool>ovftool.exe -- noSSLVerify vi://<ESXi host/VM path> "<Target file path (local)>" shows the following:
    Enter login information for source vi://<ESXi host>
    Username: root
    Password: ****************
    Opening VI source: vi://root@<ESXi host/VM path>
    Opening OVF target: <Target file path (local)>
    Writing OVF package: <Target file path/filename.ovf>
    Disk progress: 24%
    Removing temporary objects and files
    Transfer Failed
    Error: Execution aborted
    Deleting directory tree below: <Target file path (local)>
    Completed with errors
  • From ESXi /var/run/log/hostd.log,we see the following messages:
    Db(167) Hostd[2099496] [Originator@6876 sub=Vigor.Vmsvc.vm:<Datastore file path for the VM/VMname.vmx] Is device present on HBA message: Device 'scsi0:6' does not exist.

  • The vmx file contains no reference of the missing device  'scsi0:6' 
    scsi0:0.fileName = "VMname_6.vmdk"
    scsi0:1.fileName = "VMname_8.vmdk"
    scsi0:2.fileName = "VMname_7.vmdk"
    scsi0:3.fileName = "VMname_1.vmdk"
    scsi0:4.fileName = "VMname_2.vmdk"
    scsi0:5.fileName = "VMname_3.vmdk"
    scsi0:8.fileName = "VMname_4.vmdk"
  • There is an orphaned disk identified from the datastore with the name "VMname.vmdk"

Environment

VMware vSphere 8.x

Cause

The VM files on the datastore show orphaned disks which indicates the disk/device references were deleted/manipulated. OVFTool then failed to export the VM as an OVF as the disk exists but not the device.

Resolution

To resolve the issue, one of the following options can be carried out:

  • Download the whole datastore with ALL the files excluding the orphaned vmdk file. Then upload it to the target vCenter.
  • Remove the incorrect disk reference and then export using ovftool by following the Resolution section in Delete Orphaned Virtual Disks from a VM.