vCenter Server services cannot start because the /storage/seat partition is full caused by large event tables in the VCDB.
The size of the partition can be validated by executing the df -h command in the vCenter Server Appliance Command Line Interface.
To list all events in VCDB, the following command is executed:
/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 7.x
VMware vCenter Server 8.x
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.
Important: Ensure there is a valid vCenter server 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 need to be performed to purge specific high-volume events from the VCDB using a SQL script (clean_specific_events.sql) provided below in the attachments section.
/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;"Modify the script event types depending on which event needs to be purged, attached clean_specific_events.sql script is specifically designed to delete login and logout session events in vim.event.UserLoginSessionEvent and vim.event.UserLogoutSessionEvent.
lv_event_type1 = 'vim.event.UserLoginSessionEvent'; -------- Line 27 in the script.lv_event_type2 = 'vim.event.UserLogoutSessionEvent'; -------- Line 28 in the script.
service-control --stop vmware-vpxd
clean_specific_events.sql file into vCenter server /tmp directory using WinSCP software.
/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 774 /storage/core/run_cleanup.sh
crontab -e0 2 * * * /storage/core/run_cleanup.shWhile complete clearing of all event tables is possible, this document exclusively outlines the procedure for purging specific (vim.event.UserLoginSessionEvent and vim.event.UserLogoutSessionEvent) high-volume session events to maintain audit integrity where possible.