Identifying vSAN Unassociated objects on your vSAN Datastore

In vSAN virtual machines in your inventory have an association with the objects on the vSAN datastore. If you would remove a virtual machine from the inventory but not from disk then the objects on disk will still consume disk space but you will not able to see the direct link with the virtual machine that was previously in your inventory. Such objects on your vSAN datastore are known as unassociated objects.

Other types of unassociated objects are folders with files that you place on a vSAN datastore. Each such folder becomes an object and because it's not in the inventory this is also an unassociated object. So if you store ISO-files or AppVolumes packages on a vSAN datastore they are stored in an object and they will be protected according to the policy that was assigned as the default datastore policy. 

The vSAN Capacity overview will show how much of your datstore is taken by other data. You can see this in the image below. But what it doesn't show is which files are taking that space.

When executing the command vsan.obj_status_report . -t on a cluster in Ruby vSphere Console the output will show the UUID's of the unassociated objects on your datastore. It would then be possible for each of these objects to retrieve the object information with the command vsan.object_info . <UUID>. The next image shows the ouput with a few unassociated objects listed.

There is another way of creating a report with the unassociated objects that contains more detailed information. This procedure is described in the following VMware knowledge base article: Procedures for identifying Unassociated vSAN objects. (70726)

The KB-article contains instructions you can use in the shell but if that's not you cup of tea then the PowerCLI script from the KB article might be another easy choice, The script in the article however contains an error. The scripts uses a variable $clusterMoRef that is not defined before it is used and that leads to an error when executing the script. An updated version of the script is as follows (for convenience also added the connect-viserver command):

connect-viserver <your-server-fqdn>
$clustername = "<your-cluster-name>"
$clusterView = Get-Cluster $ClusterName
$ClusterMoRef = $Clusterview.ExtensionData.MoRef
$vmhost = ($clusterView | Get-VMHost) | select -First 1
$vsanIntSys = Get-View $vmhost.ExtensionData.configManager.vsanInternalSystem

$vsanClusterObjectSys = Get-VsanView -Id VsanObjectSystem-vsan-cluster-object-system
$results = (($vsanClusterObjectSys.VsanQueryObjectIdentities($clusterMoRef,$null,$null,$true,$true,$false)).Identities | where {$_.Vm -eq $null})

foreach ($result in $results) {
$jsonResult = ($vsanIntSys.GetVsanObjExtAttrs($result.Uuid)) | ConvertFrom-JSON
foreach ($object in $jsonResult | Get-Member) {
# crappy way to iterate through keys ...
if($($object.Name) -ne "Equals" -and $($object.Name) -ne "GetHashCode" -and $($object.Name) -ne "GetType" -and $($object.Name) -ne "ToString") {
$objectID = $

Running this script shows an overview of the unassociated objects on the cluster's datastore with details about the location of the objects. In the image below you can see the ISO-folder I had created. By using the UUID you can now find more detailed information through the vsan.object_info command in RVC that was discussed earlier.

When the unassociated objects are virtual machines that are no longer un the inventory then there is another tool that can also show a health report with these so called zombie-files. The tool is RVtools. 


 (RVTools homepage)

In the output below you see the result of the vHealth tab that shows virtual machine Web01 being on the filesystem ond no longer in the inventory. The other virtual machines in the list are the vSAN File Services virtual machines. They don't show up in the inventory either but they do belong on the file system.

Follow us on LinkedIn




Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer