esxi删除失效的虚拟机(5.x 6.x)

  1. Log in to the VMware ESX/ESXi host as the root user. For more information on VMware ESXi 4.1 and ESXi 5.x Technical Support Mode, see Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910)

  2. To list all running virtual machines and their corresponding VMIDs, run these commands:

    #vim-cmd vmsvc/getallvms
    #cd /etc/vmware/hostd/ 
  1. Make a copy of vmInventory.xml file by running this command:
    #cp vmInventory.xml vmInventory.xml.bak
  1. Stop the vpxa and hostd services by running these commands:
    #/etc/init.d/vpxa stop
    #/etc/init.d/hostd stop 
  1. Rename the vmInventory.xml file by running this command:

Note: This action unregisters all virtual machines from the host.

    #mv vmInventory.xml vmInventory_xml.bak
  1. Start the vpxa and hostd services by running these commands:
    #/etc/init.d/vpxa start
    #/etc/init.d/hostd start
  1. Log in to vSphere Client and verify that the virtual machine Inventory is now displayed as blank.
  2. Use this command to register every virtual machine back to Inventory on the host:
    #vim-cmd solo/registervm*full_path_of_VMX*

For Example: # vim-cmd solo/registervm /vmfs/volumes/datastore_name/VM_directory/VM_name.vmx

你可能感兴趣的:(esxi删除失效的虚拟机(5.x 6.x))