Unable to delete vm with zero size disks after restore
search cancel

Unable to delete vm with zero size disks after restore

book

Article ID: 378194

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi 7.0 VMware vSphere ESXi 8.0 VMware vSphere ESXi 6.0

Issue/Introduction

  • After restore, VM shows disk size 0 bytes
  • Not able to delete VM.  Receive error: Invalid virtual machine state. Unable to delete the Virtual Machine as it has incomplete disk information. Ensure all disks are accessible before deleting, or detach inaccessible disks.
  • In the vCenter vpxd.log : cd var/log/vmware/vpxd may contain similar entries to these:

yyyy-mm-ddThh:mm:ss.mssZ info vpxd[####] [Originator@#### sub=Default opID=########] [VpxLRO] -- ERROR task-#### -- vm-### -- vim.ManagedEntity.destroy: vim.fault.InvalidVmState:
--> Result:
--> (vim.fault.InvalidVmState) {
-->    faultCause = (vmodl.MethodFault) null, 
-->    faultMessage = (vmodl.LocalizableMessage) [
-->       (vmodl.LocalizableMessage) {
-->          key = "com.vmware.vim.vpxd.vmprov.deleteVmWithIncompleteDisks", 
-->          arg = <unset>, 
-->          message = <unset>
-->       }
-->    ], 
-->    vm = 'vim.VirtualMachine:########-####-####-####-############:vm-###'
-->    msg = ""
--> }
--> Args:
--> 

yyyy-mm-ddThh:mm:ss.mssZverbose vpxd[####] [Originator@6876 sub=Vmomi opID=######] Invoke done: vim.Task.GetInfo session: ########-####-####-####-############ 
--> Result:
--> (vim.TaskInfo) {
-->    key = "task-####", 
-->    task = 'vim.Task:########-####-####-####-############:task-####', 
-->    description = (vmodl.LocalizableMessage) null, 
-->    name = "vim.ManagedEntity.destroy", 
-->    descriptionId = "VirtualMachine.destroy", 
-->    entity = 'vim.VirtualMachine:vm-###', 
-->    entityName = "eamUnitTest:########-####-####-####-############:HostSystem:host-##", 
-->    locked = <unset>, 
-->    state = "error", 
-->    cancelled = false, 
-->    cancelable = false, 
-->    error = (vim.fault.InvalidVmState) {
-->       faultCause = (vmodl.MethodFault) null, 
-->       faultMessage = (vmodl.LocalizableMessage) [
-->          (vmodl.LocalizableMessage) {
-->             key = "com.vmware.vim.vpxd.vmprov.deleteVmWithIncompleteDisks", 
-->             arg = <unset>, 
-->             message = "Unable to delete the Virtual Machine as it has incomplete disk information. Ensure all disks are accessible before deleting, or detach inaccessible disks."
-->          }
-->       ], 
-->       vm = 'vim.VirtualMachine:########-####-####-####-############:vm-###'
-->       msg = "Invalid virtual machine state."

Cause

It occurs due to improperly restored Virtual Machine.

Resolution

Manually remove disks from VM:

Prerequisites:

  • vSphere Client or vSphere Web Client: Access to the vSphere administration interface.  
  • VM Power State: The VM must be powered off.  

Procedure:

  1. Access VM Settings:
    • In the vSphere Client or Web Client, navigate to the VM.  
    • Right-click the VM and select Edit Settings.  
  2. Locate Disks:
    • In the VM settings window, go to the Hardware tab.
    • Expand the Hard Disk section.
  3. Identify Empty Disks:
    • Look for disks with a size of 0 GB or any other indication of emptiness. 
  4. Remove Disks:
    • Select the empty disk.
    • Click the Remove button (it might be an "X" icon or similar).  
    • Confirm the removal: A confirmation dialog will appear. Review the details and click Yes to proceed.  
  5. Save Changes:
    • Click OK to save the updated VM configuration.