Error: "java.lang.NullPointerException" at ImportOvfToVcPhase during OVF upload in VMware Cloud Director
search cancel

Error: "java.lang.NullPointerException" at ImportOvfToVcPhase during OVF upload in VMware Cloud Director

book

Article ID: 425411

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

When attempting to upload an OVF or OVA file into a VMware Cloud Director (VCD) Catalog, the task fails consistently at approximately 60% completion. While the Cloud Director UI may not display a descriptive error, the vcloud-container-debug.log on the cell handling the request records a stack trace involving a NullPointerException during the handoff to vCenter.

Symptoms:

  • OVF/OVA upload stalls at 60%.

  • Logs show com.vmware.ssdc.util.LMException: Error followed by Caused by: java.lang.NullPointerException.

  • The trace specifically references com.vmware.vcloud.val.internal.impl.ImportVAppFromOvfActivity$ImportOvfToVcPhase.invoke.

Environment

10.x

Cause

The issue is caused by a hardware configuration mismatch in the OVF descriptor, specifically involving Latency Sensitivity settings without the required CPU Reservations.

vSphere requires that any Virtual Machine with Latency Sensitivity set to "High" must have a 100% CPU reservation (matching the full MHz/GHz value of the configured vCPUs). If the OVF descriptor enables this flag but does not define the corresponding reservation, the vCenter API rejects the ImportVApp specification with a spec.cpuAllocation error. VCD fails to handle this specific API rejection gracefully, resulting in a null object reference (NPE) during the activity invocation.

Resolution

To resolve this issue, the OVF descriptor must be modified to align with vSphere hardware requirements:

  1. Extract the OVF: If using an OVA, extract the contents using a tool like 7-Zip or tar.

  2. Edit the .ovf file: Open the .ovf file in a text editor.

  3. Identify the Latency Setting: Search for the string latencySensitivity.

  4. Apply the Fix:

    • Option A (Recommended): If latency sensitivity is required, add a CPU reservation section within the <VirtualHardwareSection> that matches 100% of the CPU speed.

    • Option B (Simplification): Remove the latencySensitivity attribute/property from the descriptor if it is not strictly required for the workload.

  5. Update Manifest (Optional): If the OVF has an associated .mf file, either update the SHA hash for the edited .ovf or delete the .mf file before retrying the upload.

  6. Retry Upload: Upload the modified OVF via the VCD tenant portal.

Additional Information

For large uploads, ensure that the VCD transfer spool (/opt/vmware/vcloud-director/data/transfer) has enough free space to accommodate the uncompressed size of the OVF and its disks. Lack of space in this directory can also lead to failures, typically at the 50% mark.