Datastore shows as (inaccessible) in the vCenter UI
No files are available in the vCenter UI for the respective datastore
There is an error: Datastore ‘{name}’ is not accessible or “No connected and accessible host is attached to the datastore.”
Datastores may show as accessible but will not have any reference to the ESXi hosts or virtual machines.
VMware vCenter Server 6.5.x
VMware vCenter Server 6.7.x
VMware vCenter Server 7.x
VMware vCenter Server 8.x
VMware vCenter Server 9.0.x
This issue can be due to any of the following:
The underlying storage device or LUN associated with the datastore may have been removed, decommissioned, or failed without proper cleanup.
vCLS VMs were forcefully deleted from the VMs without the host being in Retreat Mode.
The vCenter database (VCDB) retains inaccessible datastore records when they are not properly removed, leaving objects in the environment.
Perform a cluster level rescan on all the clusters where the datastore was mounted previously.
If after a cluster level rescan the inaccessible datastore entry is seen, proceed with the below steps.
Note : Make sure to take a snapshot or backup of the vCenter server before making any changes to the VCDB. If vCenter is in Enhanced Linked Mode (ELM), then take offline snapshots of all ELM partners before proceeding. See VMware vCenter in Enhanced Linked Mode pre-changes snapshot (online or offline) best practice
To identify and remove the objects completely from the VCDB:
# service-control --stop vpxd
# /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
SELECT id FROM vpx_entity WHERE name = 'Datastore Name';
Example:
id -------- 169867 (1 row)Find if the id is being associated with objects which were present in the datastore:
VCDB=# SELECT * FROM vpx_ds_assignment WHERE ds_id=169867;
ds_id | entity_id | accessible | mount_path | mount_id | mount_mode | mounted --------+-----------+------------+------------+----------+------------+--------- 169867 | 160136 | | | | | 169867 | 160148 | | | | | (2 rows)
VCDB=# SELECT * FROM vpx_entity WHERE id=16##36; id | name | type_id | parent_id --------+-------------------+---------+----------- 160136 | <VM_Name> | 0 | 161290 (1 row)
VCDB=# SELECT * FROM vpx_entity WHERE id=16##48; id | name | type_id | parent_id --------+------------------+---------+----------- 160148 | <VM_Name> | 0 | 161290 (1 row)
DELETE FROM vpx_vm_ds_space WHERE ds_id=169867;
DELETE FROM vpx_ds_assignment WHERE ds_id=169867;
DELETE FROM vpx_datastore WHERE id=169867;
DELETE FROM vpx_entity where id=169867;
Start the vpxd service for the vCenter:
# service-control --start vpxd
Additionally, if the datastore was removed or deleted from storage before removing from the host, and is now
- showing as inaccessible from vCenter
- is present but errors out when accessing from the host client
- cannot be removed from vCenter or host client while failing with "Not a known device"
- does NOT show from the host CLI
The issue may be resolved by rebooting the hosts showing the datastore attached.
Note: Please make sure that you remove the datastore assignments from the ESXi hosts at the backend storage level to prevent them from reappearing in vCenter.