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

Symptoms:

  • After taking snapshot on a virtual machine and the task completes successfully, however, when reviewing the VM configuration, the VMDK disk size is shown as "0" (zero), as in the example screenshot below:

  • Consequently, unable to do any task on the virtual machine.
  • Any backup job fail for the VM.
  • When reviewing /var/run/log/hostd.log on the ESXi host the VM is running on, you see errors similar to :
    2019-12-12T16:02:09.743Z warning hostd[1B4C2B70] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/<redacted>-db5986e0-695f-<redacted>/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/<redacted>-db5986e0-695f-<redacted>/x/x.vmx] Failed operation
    2019-12-12T16:02:09.744Z info hostd[1B4C2B70] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/<redacted>-db5986e0-695f-<redacted>/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/<redacted>-db5986e0-695f-<redacted>/x/x.vmx] UpdateStorageAccessibilityStatusInt: The datastore is not accessible ide1:0.fileName = "/vmfs/volumes/<redacted>-4df76266-7681-<redacted>/contentlib-<redacted>-0b4f-4c5b-bc5b-<redacted>/<redacted>-4f37-47e9-aa1e-<redacted>/x.iso"

Environment

  • VMware vCenter Server 6.5.x
  • VMware vCenter Server 6.7.x
  • VMware vCenter Server 7.0.x
  • Vmware vCenter Server 8.0.x
  • 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 daemon (hostd) treats them as a single object. If any of the VMs 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 un-attaching it from the virtual machine beforehand, the virtual machine will experience such issues as described above.

Furthermore, when the datastore the VM is located on becomes inaccessible, hostd will not refresh the disk case. In this case, default entries with 0 capacity will be generated for those virtual disks that weren't cached yet.

In this situation, hostd will neither refresh the snapshot list for the VM. As a result, any 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. To solve this kind of issue:

    1. Ensure that the storage holding the virtual machine files is accessible. Fix any issues preventing its accessibility.
    2. Reload the virtual machine
      1. Connect to the ESXi hosting the virtual machine using SSH
      2. Find the virtual machine ID:
        # vim-cmd vmsvc/getallvms | grep <VM_name> | awk '{print $1}'
      3. Reload the virtual machine:
        # vim-cmd vmsvc/reload <ID_from_step_2b>
    3. Edit the virtual machine configuration using vSphere Client and remove any inaccessible ISOs that are attached to it.