Virtual Machines “Inaccessible” after Datastore Outage

Issue

If you ever had to take a NFS datastore down to perform updates on an early release of vSphere 5.1 then you may have seen  (inaccessible) following the grayed and italicized virtual machine name in the vSphere Client.

This is a know issue and is identified in VMware ESXi 5.1u1 release notes as:

Virtual machines residing on NFS datastores are inaccessible in ESXi 5.1 host after vSphere Storage Appliance (VSA) 5.1 exits maintenance mode

The hostd agent reports the status of virtual machines incorrectly to vCenter and the ESXi host after you disconnect the NFS storage as it goes over the Misc.APDTimeout value. This issue is observed on powered off virtual machines.

This issue is resolved in this release.

This issue is commonly seen when an ESXi hosts loses connectivity with an NFS datastore.

Resolution

Methods for correcting the issue is as follows:

Power CLI:

#Get Inaccessible Virtual Machines
$VMs = Get-View -ViewType VirtualMachine | ?{$_.Runtime.ConnectionState -eq "invalid" -or $_.Runtime.ConnectionState -eq "inaccessible"} | select name,@{Name="GuestConnectionState";E={$_.Runtime.ConnectionState}}write-host "---------------------------"
write-host "Inaccessible VMs"
write-host "---------------------------"

$VMs

#Reload VMs into inventory
Get-View -ViewType VirtualMachine | ?{$VMs} | %{$_.reload()}

#Show new state of reloaded VMs
$ReloadedVMs = Get-View -ViewType VirtualMachine | ?{$VMs} | select name,@{Name="GuestConnectionState";E={$_.Runtime.ConnectionState}}

write-host "---------------------------"
write-host "Reloaded VMs"
write-host "---------------------------"

$ReloadedVMs

vim-cmd:

vim-cmd vmsvc/getallvms >grep skip
Skipping invalid VM '118'
Skipping invalid VM '127'
vim-cmd vmsvc/reload [NUMBER] 

Articles Cited:

Using Power CLI: http://blog.mattvogt.net/2013/02/08/vms-grayed-out-after-nfs-datastore-restored/
Using vim-cmd: http://vmdamentals.com/?p=4503
VMware ESXi 5.1u1 Release Notes: https://www.vmware.com/support/vsphere5/doc/vsphere-esxi-51u1-release-notes.html#resolvedissuesstorage

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s