Status: Attach Error: Message: rpc error: code = Internal desc = failed to attach disk: "####" with node: "####" err failed to attach cns volume: "####" to node vm: "VirtualMachine:vm-## [VirtualCenterHost: ####, UUID:####, Datacenter: Datacenter [Datacenter: Datacenter:datacenter-##, VirtualCenterHost: ####]]". fault: "(*types.LocalizedMethodFault)(0xc00000000)({\n DynamicData: (types.DynamicData) {\n },\n Fault: (types.CnsFault) {\n BaseMethodFault: (types.BaseMethodFault) <nil>,\n Reason: (string) (len=88) \"The input volume #### is not registered as a CNS volume.\"\n },\n LocalizedMessage: (string) (len=35) \"fault.CnsNotRegisteredFault.summary\"\n})\n". opId: "##" Time: YYYY:MM:DD Attached: false Detach Error: Message: rpc error: code = Internal desc = volumeID "####" not found in QueryVolumeGeneral discrepancies between the datastore and the CNS database cause this issue.
Prerequisites:
esxcfg-advcfg -s 1 /VSAN/IgnoreClusterMemberListUpdatesesxcfg-advcfg -s 0 /VSAN/IgnoreClusterMemberListUpdates
find /vmfs/volumes/<datastore>/catalog/journal -name "*.xaction"
If the output contains files, do not rebuild the catalog.Steps to Rebuild the Catalog:
hostd service:/etc/init.d/hostd stop
mkdir /tmp/<datastore>-catalog-bkp(or any other temporary directory in any other datastore)cd /vmfs/volumes/<datastore>/catalogmv $(ls | grep -v journal) /tmp/catalogls /tmp/catalog #(make sure all files are copied)
hostd service:/etc/init.d/hostd start
hostd:/etc/init.d/hostd restarthostd restart:/usr/lib/vmware/hostd/bin/notifyDatastore.py -t PreUnmount -d <dsName>
VC MOB > content > vStorageObjectManager > ReconcileDatastoreInventoryEx_Taskhttps://<vcsa- fqdn>/mob/?moid=VStorageObjectManager&method=reconcileDatastoreInventoryEx<spec> <datastore type="Datastore">datastore-MOID</datastore></spec>
VC MOB > content >rootFolder > datacenter > datastore > moiddatastore-##" from the URL when the datastore is selected in the vSphere client).
host MOB > ha-vstorage-object-manager > HostReconcileDatastoreInventory_Taskhttps://<ESXI_host_fqdn/IP>/mob/?moid=ha-vstorage-object-manager&method=reconcileDatastoreInventory
<datastore-UUID>ds:///vmfs/volumes/<datastore-UUID>/ (Found on the summary page of the datastore in the vCenter UI)ls /vmfs/volumes/<datastore-path>/catalog vclock is created in the format of "vclock-" for all the datastores:ls /vmfs/volumes/<datastore-path>/catalog 1.dat”ls /vmfs/volumes/<datastore-path>/catalog
fullSync (for VC version 8.0 and above), by following the below instructions:psql -U postgres -d VCDB
vpx_ds_info or cns.vpx_storage_datastore_info;select name, url from vpx_ds_info;select * from cns.vpx_storage_datastore_info;update cns.vpx_storage_datastore_info set vclock=-1 where datastore_url='<>';delete from cns.volume_info where datastore='<>';
vmon-cli --restart vsan-health
/var/log/vmware/vsan-health/vsanvcmgmtd.log:info vsanvcmgmtd[219935] [vSAN@6876 sub=CnsSync] Sync all datastores ...info vsanvcmgmtd[219935] [vSAN@6876 sub=CnsSync] Sync ds:///vmfs/volumes/<ds-uuid>: startVClock = 0, fullSync = trueinfo vsanvcmgmtd[219935] [vSAN@6876 sub=CnsSync] Synced all datastores
vclock values:psql -U postgres -d VCDBselect * from cns.vpx_storage_datastore_info;select * from cns.volume_info where datastore='<>';
StorageLifecycleManager".https://<VCIP>/vslm/mob//?moid=StorageLifecycleManager&method=VslmSyncDatastore "ds:///vmfs/volumes/##### - ###### - ######". (Found on the summary page of the datastore in the vCenter UI)"fullSync=true""fcd Id" can be blank