root@vcsa1 [ ~ ]# /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres -c "SELECT * from vpx_storage_object_info where id='cd07685d-5170-44ed-ae88-dbd66419b27e'"
id | name | capacity | datastore_url | create_time | v_clock | backing_object_id | disk_path | used_capacity
----+------+----------+---------------+-------------+---------+-------------------+-----------+---------------
(0 rows)
Note: Due to the para-virtualized architecture of the CSI in the guest clusters, each volume is represented by two names: one is generated by the pvCSI in the guest cluster and the other is generated by the CSI in the supervisor cluster. The latter is the value that is stored in the database. Therefore, don't filter by the volume name that was mentioned in the pod events. Instead, use the volume ID. If the pod events didn't mention that ID, please check the resolution section for more details on how to get it.
- Take the first part of the volume ID and separate them as ("cd 07 68 5d").
- SSH to one of the ESXi hosts and search for the vmdk file containing the FCD ID.
[root@esxi:~] IFS=$'\n'; for i in `find /vmfs/volumes -iname '*.vmdk' -type f |grep -vE "flat|sesparse|delta|rdm|ctk"`; do echo $i; grep 'fcd.uuid' $i ;done | grep -B1 "cd 07 68 5d"
- If the vmdk exists, it prints the complete path of the VMDK containing the datastore UUID.
/vmfs/volumes/61717a37-7f97f70e-9bce-0050560181cb/fcd/458d9a81daf54a41a10ed09e392d71a1.vmdk
ddb.fcd.uuid = "cd 07 68 5d 51 70 44 ed-ae 88 db d6 64 19 b2 7e"
Note: Get the datastore name. It will be needed as part of the solution.
[root@esxi:~] localcli storage filesystem list | grep -i 61717a37-7f97f70e-9bce-0050560181cb
/vmfs/volumes/61717a37-7f97f70e-9bce-0050560181cb Tanzu 61717a37-7f97f70e-9bce-0050560181cb true VMFS-6 241323474944 5274337280
In this example, the datastore's name is Tanzu.
The volume is present in the backend datastore but missing from Pandora database
Upgrade to a version vCenter Server 8.0 Update 3e or above as the Pandora db is no longer used in vSphere 8.0
Workaround:
Remember: The guest clusters utilize a para-virtualized CSI. This means the PV on the guest clusters refers to a PVC on the supervisor cluster. This PVC will be bound to a PV refers to the volume ID.
- Describe the problematic volume in the guest cluster and get the VolumeHandle.
tseadmin@kube-cli:~$ kubectl describe pv pvc-90b1558e-c3bd-461b-9acc-14ccc2d6567d | grep -i VolumeHandle
VolumeHandle: 577b7137-41f6-4c35-ba26-48316a458f15-90b1558e-c3bd-461b-9acc-14ccc2d6567d
- Go to the supervisor cluster and get the PV that is bound to this PVC.
root@42320f0e4760472d1a96bbbd0bdaa921 [ ~ ]# kubectl get pvc -A | grep -i 577b7137-41f6-4c35-ba26-48316a458f15-90b1558e-c3bd-461b-9acc-14ccc2d6567d
tanzu-1 577b7137-41f6-4c35-ba26-48316a458f15-90b1558e-c3bd-461b-9acc-14ccc2d6567d Bound pvc-1e2b8a72-7b9e-40ae-8ce6-eb61c510913f 1Gi RWO tanzu 50d
- Get the VolumeHandle of this PV, this is our volume ID.
root@42320f0e4760472d1a96bbbd0bdaa921 [ ~ ]# kubectl describe pv pvc-1e2b8a72-7b9e-40ae-8ce6-eb61c510913f | grep -i VolumeHandle
VolumeHandle: cd07685d-5170-44ed-ae88-dbd66419b27e
Note: We can identify the ID from the pvCSI controller logs or the CNS logs (vsanvcmgmtd.log). However, I recommend the above steps because the logs may be rolled over.
root@vcsa1 [ ~ ]# dcli com vmware vcenter datastore list | grep -i Tanzu
|datastore-2009|Tanzu |VMFS|5272240128 |241323474944|
In this example, the MOID is datastore-2009.
root@vcsa1 [ ~ ]# /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres -c "SELECT * from vpx_storage_object_info where id='cd07685d-5170-44ed-ae88-dbd66419b27e'"
id | name | capacity | datastore_url | create_time | v_clock | backing_object_id | disk_path | used_capacity
--------------+-------------------+---------+-----------------------------+----------------+---------+-------------------+---------------------------------------------------+---------------
cd07685d-5170-44ed-ae88-dbd66419b27e | pvc-1e2b8a72-7b9e-40ae-8ce6-eb61c510913f | 1024 | ds:///vmfs/volumes/61717a37-7f97f70e-9bce-0050560181cb/ | 2022-09-13 21:16:54.459 | 91 | | [Tanzu] fcd/458d9a81daf54a41a10ed09e392d71a1.vmdk | -1
(1 row)