df -h command in the vCenter Server Appliance Command Line Interface./opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB -c "SELECT COUNT(EVENT_ID) AS NUMEVENTS, EVENT_TYPE, USERNAME FROM VPXV_EVENT_ALL GROUP BY EVENT_TYPE, USERNAME ORDER BY NUMEVENTS DESC LIMIT 10;"
VMware vCenter Server
Third-party software or monitoring tools may generate a large volume of data in the event tables, filling the /storage/seat partition and causing vCenter Server services to fail.
Please ensure there is a valid vCenter snapshot (Offline Snapshots in case of Linked Mode vCenters) before proceeding further as per Snapshot Best practices for vCenter Server Virtual Machines.
The following steps are performed to purge specific high-volume events from the VCDB using a provided SQL script.
service-control --stop vmware-vpxd
clean_specific_events.sql file to vCenter into /tmp path, using WinSCP.lv_event_type1 = 'vim.event.UserLoginSessionEvent';lv_event_type2 = 'vim.event.UserLogoutSessionEvent';/opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB -c "SELECT COUNT(EVENT_ID) AS NUMEVENTS, EVENT_TYPE, USERNAME FROM VPXV_EVENT_ALL GROUP BY EVENT_TYPE, USERNAME ORDER BY NUMEVENTS DESC LIMIT 10;"
/opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB -f /tmp/clean_specific_events.sql
/opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB -c "\df remove_some_events"
/opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB -c "select * from remove_some_events ();"
/opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDBreindex database "VCDB";
vacuum full analyze verbose;vacuum full analyze; -------- if the above command fails.\q
service-control --start vmware-vpxd
Note:
To periodically clear the event tables and prevent recurrence, the cleanup function can be called using an automated script.
vi /storage/core/run_cleanup.sh
#!/bin/sh
/opt/vmware/vpostgres/current/bin/psql -U postgres -d VCDB -c "select * from remove_some_events ();"chmod 777 /storage/core/run_cleanup.sh
crontab -e0 2 * * * /storage/core/run_cleanup.sh