An inventory clean refers to a process in VMware Cloud Director in which you clean up or reconcile the inventory of objects, such as virtual machines VMs, networks, storage, and other resources, to ensure that the inventory within VCD is accurate and up to date.
This operation is usually performed directly in the embedded Postgres vcloud database.
This process involves removing orphaned or stale objects that no longer exist in the underlying vCenter Server or not correctly synchronised with VCD.
Upon completion of the clean, you might see in the VCD UI that the Storage Containers are empty and the Storage Profile values are displayed as N/A.
VMware Cloud Director 10.3.3.4
vCenter 7.0U3
NSX 3.2.0.1
Take snapshots of the VCD Appliances in vCenter.
Set failover mode to Manual:
curl -k -X POST -H "Accept: application/json" -u "root" "https://localhost:5480/api/1.0.0/nodes/failover/manual"
Stop any further tasks from being accepted by the system and allow those that are running to complete. Run this on all Appliances.
/opt/vmware/vcloud-director/bin/cell-management-tool cell -i `cat /var/run/vmware-vcd-cell.pid` -t --quiesce true
Check the status of the current running jobs:
/opt/vmware/vcloud-director/bin/cell-management-tool cell -i `cat /var/run/vmware-vcd-cell.pid` -tt --status
Once all of the jobs have finished, shut down the VCD service on all Appliances:
/opt/vmware/vcloud-director/bin/cell-management-tool cell -i `cat /var/run/vmware-vcd-cell.pid` --shutdown
SSH into your Primary Appliance as root and elevate to Postgres, then drop into the vcloud database:
sudo -i -u postgres psql -d vcloud
Paste in these queries to clear the activity queues:
truncate table scheduled_activity_jobs;
truncate table activity_pc_queue;
truncate table activity_pc_event_queue;
truncate table fifo_activity_queue;
truncate table task_activity_queue;
truncate table vc_activity_queue;
Exit from psql:
\q
Exit from the postgres user:
Exit
Restart the vmware-vcd service on all Appliances:
service vmware-vcd start
Tail the cell.log on all Appliances to ensure the Appliance is rebooted successfully.
tail -f /opt/vmware/vcloud-director/logs/cell.log
Login to your Provider URL and navigate to vsphere-resources > vCenters and perform a reconnect and refresh on all attached vCenters.
Revisit the Provider VDC Storage view.