Refreshing vSAN after a Node loss and Recovering Inaccessible/Orphaned VMs
search cancel

Refreshing vSAN after a Node loss and Recovering Inaccessible/Orphaned VMs

book

Article ID: 391738

calendar_today

Updated On:

Products

VMware vSAN

Issue/Introduction

Experienced a cluster partition upgrading ESXi from 8.0.2, to 8.0.3 and noticed some VMs showing as orphaned in the vCenter Server Web Client inventory.

-Zero inaccessible objects

-No resync currently running

-All disks in cluster are healthy

Environment

-vCenter 8.0.2 and 8.0.3

Cause

Found that the MTU for the vSAN vmkernel port was set back to factory defaults of 1500 MTU instead of the current cluster setting of 9000 MTU.  Because of this the virtual machines became inaccessible until this issue was resolved.  They then showed as orphaned in the vCenter Web Client UI.  

Resolution

This issue can be resolved by re-registering the orphaned virtual machines.  Please see "How to register / add a VM to the Inventory in vCenter Server" under "Additional Information" below. 

To register a virtual machine in vCenter Server:

  1. Log in to vSphere Web Client (Flex/Flash or HTML5).
  2. Click on the desired host.
  3. Click the Datastores tab
  4. Click on the appropriate datastore
  5. Click on the Files tab
  6. Locate the correct directory for the VM and double-click it to open the folder
  7. Locate the virtual machine.vmx file and click on it to highlight it.
  8. Click the "Register VM" button
    • If using the Flex/Flash client, right-click the VMX file and then select "Register VM"
  9. Continue to follow the wizard to add the virtual machine.

To register a virtual machine from the command line in an ESXi host:

  1. Log in as root to the ESXi host with an SSH client. For more information about enabling SSH on an ESXi host, see Using ESXi Shell in ESXi.
  2. Run the command:

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

 To unregister a virtual machine in vCenter Server:

  1. Log in to vSphere Web Client (Flex/Flash or HTML5).
  2. Power off the virtual machine.
  3. Right click on the virtual machine and select "Remove from inventory".

To unregister a virtual machine from the command line in an ESXi host:

  1. Log in as root to the ESXi host with an SSH client. For more information about enabling SSH on an ESXi host, see Using ESXi Shell in ESXi 5.x, 6.x and 7.x
  2. Obtain the VM's VM ID by running vim-cmd vmsvc/getallvms  and looking at the leftmost column.
  3. Run the command:

# vim-cmd vmsvc/getallvms | grep <vm_name>

# vim-cmd vmsvc/unregister <VM ID>

Additional Information

Following knowledge base article, "Virtual machines appear as invalid or orphaned or inaccessible in vCenter Server", directly under the "Resolution" section, it covers re-registering the virtual machines to clear up the "orphaned" state.  There is also a link to "How to register / add a VM to the Inventory in vCenter Server", if any assistance is needed.