VMDK disk show zero size after snapshot operation
search cancel

VMDK disk show zero size after snapshot operation

book

Article ID: 344852

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

  • After taking or consolidating a snapshot on a virtual machine, the task completes successfully. However the VM configuration shows the VMDK disk size is "0" (zero).

Further symptoms that may present:

  • Unable to do any task on the virtual machine.
  • Backup jobs fail for the virtual machine.
  • /var/run/log/hostd.log on the ESXi host has errors similar to:

    2019-12-12T16:02:09.743Z warning hostd[1B4C2B70] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/-db5986e0-695f-/x/x.vmx] Snapshot create succeeded, but UID 650 not in list.
    2019-12-12T16:02:09.743Z warning hostd[1B4C2B70] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/-db5986e0-695f-/x/x.vmx] Failed operation
    2019-12-12T16:02:09.744Z info hostd[1B4C2B70] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/-db5986e0-695f-/x/x.vmx] State Transition (VM_STATE_CREATE_SNAPSHOT -> VM_STATE_ON)
    2019-12-12T16:02:09.744Z info hostd[1B4C2B70] [Originator@6876 sub=Vimsvc.TaskManager] Task Completed : haTask-49-vim.VirtualMachine.createSnapshot-127313764 Status error
    2019-12-12T16:02:09.595Z warning hostd[1B4C2B70] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/-db5986e0-695f-/x/x.vmx] UpdateStorageAccessibilityStatusInt: The datastore is not accessible ide1:0.fileName = "/vmfs/volumes/-4df76266-7681-/contentlib--0b4f-4c5b-bc5b-/-4f37-47e9-aa1e-/x.iso"

Environment

  • VMware vSphere ESXi 6.5
  • VMware vSphere ESXi 6.7
  • VMware vSphere ESXi 7.0.x
  • VMware vSphere ESXi 8.0.x

Cause

While virtual machines consist of multiple files, the ESXi host service (hostd) treats them as a single object. If any of the VMs child items are inaccessible, the virtual machine will be transitioned to an invalid load state.

For example, if an ISO has been attached to the VM and that ISO was moved away from the datastore; or was deleted without removing it from the virtual machine beforehand, the virtual machine will experience the issues described.

Furthermore, when the datastore that the VM is located on becomes inaccessible, hostd will not refresh the disk. Default entries with 0 capacity will be generated for those virtual disks that were not yet cached. In this situation, hostd will not refresh the snapshot list for the VM. As a result, snapshot creation tasks will fail. The snapshot itself is actually getting created, but the system fails to find the new UUID in the list, resulting in the task failing.

Resolution

    1. Migrate the VM from the current Host to another host.
    2. If the issue is still present, ensure that the storage holding the virtual machine files is accessible. Fix any issues preventing its accessibility before continuing.
    3. Perform one of the following actions:
      1. Reload the virtual machine:
        1. SSH into the ESXi host hosting that virtual machine.
        2. Find the virtual machine ID (VMID):
          $ vim-cmd vmsvc/getallvms | grep <VM_name>
        3. Reload the virtual machine:
          $ vim-cmd vmsvc/reload <VMID>
      2. Reregister the virtual machine using the UI:
        1. Right click the virtual machine and select to remove from inventory
        2. Go to the datastore browser and browse to the datastore with the virtual machine directory/folder and vmx file
        3. Select the vmx file and select Register Virtual Machine above the file pane
    4. Edit the virtual machine configuration using the vSphere Client and remove any inaccessible ISOs that are attached to it.