vMotion fails with " Error: Migration failed after VM memory precopy." for virtual machines with svga security hardening enabled.
search cancel

vMotion fails with " Error: Migration failed after VM memory precopy." for virtual machines with svga security hardening enabled.

book

Article ID: 408397

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vCenter Server

Issue/Introduction

  • Compute vMotion task fails after progress reaches 100%.

    Error stack:
    Migration failed after VM memory precopy. Please check vmkernel log for true error.
    YYYY-MM-DDTHH:MM:SS
    Remote connection failure
    Failed to establish transport connection.
    Cannot open file "/vmfs/volumes/<datastore>/<vm_name>/<vm_name>.vmx": 16 (Device or resource busy).
    Unable to load configuration file '/vmfs/volumes/<datastore>/<vm_name>/<vm_name>.vmx'.
    Disconnected from virtual machine

  • Destination ESXI host vmkernel logs /var/run/log/vmkernel.log show: 

    YYYY-MM-DDTHH:MM:SS ... vmx: Dumping cartel ... to file /var/core/vmx-zdump.003 YYYY-MM-DDTHH:MM:SS ... vmx: Userworld(vmx) coredump complete. YYYY-MM-DDTHH:MM:SS ... Migration cleanup initiated, the VMX has exited unexpectedly.


  • In vmware.log /vmfs/volumes/<datastore>/<vm_name>/ you will see entries similar to,

    YYYY-MM-DDTHH:MM:SS In(05) vmx - SVGA-GFB: Config settings: autodetect=0, numDisplays=1, maxWidth=2560, maxHeight=1600
    YYYY-MM-DDTHH:MM:SS In(05) vmx - SVGA-GFB: Desired maximum display topology: wh(2560, 1600)
    YYYY-MM-DDTHH:MM:SS In(05) vmx - SVGA-GFB: Autodetected target gfbSize = 16777216
    YYYY-MM-DDTHH:MM:SS In(05) vmx - SVGA-GFB: Using Initial gfbSize = 0
    YYYY-MM-DDTHH:MM:SS Cr(01) vmx - PANIC: SVGA Framebuffer size invalid (size=0)
    YYYY-MM-DDTHH:MM:SS Wa(03) vmx - A core file is available in "/var/core/vmx-zdump.003"
    YYYY-MM-DDTHH:MM:SS In(05) vmx - Backtrace:

Environment

vSphere 8.x

vSphere 7.x

Cause

  • VGA framebuffer size becomes zero instead of expected 16MB during vMotion restore, causing VMX crash in SVGAGFB_PowerOn()

    Evidence:
    - Logs shows YYYY-MM-DDTHH:MM:SS In(05) vmx - SVGA-GFB: Autodetected target gfbSize = 16777216
    - Reviewing VMX config: svga.vramSize = 8MB

  • Presence of svga.vgaOnly=FALSE in the VM configuration file is suspected as, SVGA framebuffer size will be zero if this option was set to TRUE when the VM was powered on initially but was later set to FALSE in the current config, leading to a mismatch in framebuffer size calculation between the checkpoint file and the VMX on the destination.

    Note:

    1. By default, value of svga.vgaOnly is "False", value cannot be changed while VM is running, or we will get vMotion/checkpoint failures.

    2. The only way we see that the SVGA GFB size could be zero is if that option was TRUE when the VM powered on, and it was now FALSE in the config file, which would cause the destination VMX to calculate a different size than would be present in the checkpoint file.

  • This mismatch causes the VMX process to crash during migration restore.

Resolution

To resolve the issue,

  1. Shut down the VM.
    • To ensure migration success, verify that the svga.vgaOnly value is set to "False".

  1. Power the VM back on.

  2. Check if the VM migrates successfully.

If you require svga.vgaOnly to be "True", then:

  1. Shut down the VM.

  2. Update the svga.vgaOnly setting to "true".

  3. Power on the VM and attempt the migration again.