VM Shuts Down Unexpectedly During Migration Due to Incompatible VMDK Format
search cancel

VM Shuts Down Unexpectedly During Migration Due to Incompatible VMDK Format

book

Article ID: 379026

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

A virtual machine (VM) unexpectedly shuts down when migrated between hosts. Users may also encounter issues taking snapshots of the affected VM, and the VM's disk may show as 0 MB in the vSphere client despite the VM running normally.

Environment

- VMware vSphere 6.5 or later
- VMs with non-standard VMDK formats

Cause

This issue typically occurs when a VM uses a VMDK file with a non-standard format that is incompatible with standard VMware ESXi operations. The incompatibility often stems from the VMDK being created with atypical parameters, such as an unusual "createType" value in the VMDK descriptor file. The cause of this may be a third-party vendor who doesn't have full access to ESXi, so is using a product such as VMware Workstation to create VMDKs for their customers.

Resolution

Before attempting to resolve the issue, verify that the problem is indeed caused by an incompatible VMDK format:

  1. Verify the VMDK format:
    1. Log in to the ESXi host via SSH.
    2. Locate the VM's directory, typically in /vmfs/volumes/datastore_name/vm_name/.
    3. Find the VMDK descriptor file (it will have a .vmdk extension without -flat in the name).
    4. View the contents of the file using the following command:
      • cat /path/to/your_vm.vmdk
    5. Look for a line starting with "createType=". If you see an unusual value like "twoGbMaxExtentSparse", this confirms the incompatible VMDK format issue.
  2. If you've confirmed the incompatible VMDK format, proceed with one of the following resolution methods:

Method 1: Using vmkfstools (Recommended for most cases):

  1. While still logged into the ESXi host via SSH, locate the problematic VMDK file.
  2. Run the following command to convert the VMDK:
    • vmkfstools -i /path/to/source.vmdk /path/to/destination.vmdk -d thin
  3. Update the VM configuration to use the new VMDK file:
    • In the vSphere Client, right-click the VM and select "Edit Settings".
    • Locate the existing hard disk, click the dropdown arrow, and select "Remove".
    • Click "Add New Device" and select "Existing Hard Disk".
    • Browse and select the newly created VMDK file.
  4. Power on the VM and verify that it functions correctly.

Method 2: Using VM-to-VM Conversion:

  1. Use VMware Converter or a third-party tool like Starwind V2V Converter.
  2. Create a new VM with a standard VMDK format.
  3. Convert the data from the old VM to the new VM.
  4. Sync data between the old and new VMs until ready to switch.
  5. Power down the old VM and power on the new VM to complete the migration.

Method 3: Cloning the VM:

  1. In the vSphere Client, right-click on the VM and select "Clone" > "Clone to Virtual Machine."
  2. Follow the wizard to create a clone with default VMDK settings.
  3. Power on the cloned VM and verify its functionality.
  4. If successful, decommission the original VM.

IMPORTANT: Before attempting any of these methods, take a full backup of the VM and, if possible, create a snapshot as an additional precaution. If you're unable to create a snapshot due to the VMDK incompatibility, ensure you have a robust backup before proceeding.

After applying any of these methods, verify that the issue is resolved by attempting to migrate the VM and take a snapshot. The disk size should also now display correctly in the vSphere Client.

 

Additional Information