-
Reboot the vCenter Server
This will resolve any problem with lost process threads.
- Note the percentage space full you saw when running df -h from the command line.
- Find if the VCSA virtual machine is managed through another vCenter Server. If the vCenter Server is on a host in the cluster find which ESXi host manages the vCenter Server virtual machine. Access the host client by opening a web browser tab to the host web client at https://<host IP or FQDN>.
- Open a console window to the VCSA VM.
- Select to shut down the guest operating system. Do not power off.
- After reboot wait 30 minutes then run df -h again to check the space available.
- If space free is not any better than before, continue with the steps below.
-
Resolving a completely full partitition
- If the database disk is 100% full you will have to extend it. The cleanup utility does need some space as overhead to function. Increase the disk size and extend the partition that's full on the df -h output.
- To increase the disk size, see Increasing the disk space for the VMware vCenter Server Appliance in vSphere 6.5, 6.7 and 7.0
-
Check for bloat
- Download the script attached to this KB 51981_check_bloat.sql
- Connect to the DB: /opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB
- Copy and paste the content of the file and hit enter.
- Check the results. If the tbloat column or the ibloat column are >25 then schedule maintenance to reduce the bloat in this database.
Note: This query looks at table , index structure, and the number of rows in a table, and estimates the minimum size required to hold that data. It then compares this estimate to the actual current size, to estimate bloat.
To determine the top tables taking up space in the VCSA vPostgres, run this query:
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
AND C.relkind <> 'i'
AND nspname !~ '^pg_toast'
ORDER BY pg_total_relation_size(C.oid) DESC
LIMIT 20;
-
Remove the bloat
- Stop all the services:
service-control --stop --all
- Run the below command to start the vpostgres:
service-control --start vmware-vpostgres
- Run the command to connect to postgres service:
/opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB
- To rebuild all the tables and indexes on the database:
vacuum full;
Note: This command will remove all bloat.
- To collect new statistics for the planner to use for optimal performance
vacuum analyze;
- To quit from the path:
\q
- Run the command to start all the service:
service-control --start --all