This is something that I encounter more commonly with older versions of vCenter where the MS SQL Express 2008 that came bundled with vCenter was used.
I’ve stumbled on to this when you can’t login to vCenter and the VirtualCenter Server service won’t stay started.
**I have found that in some cases it might make sense to drop event.maxAge and task.maxAge to 15 if they keep filling up over and over.
In the event log, it will say something like:
Could not allocate space for object ‘dbo.VPX_EVENT’.’VPXI_EVENT_USERNAME’ in database ‘VCDB’ because the ‘PRIMARY’ filegroup is full.
- Connect to
Servername\SQL Databaseand log in with the appropriate credentials.
- Click databases to expand and select VIM_VCDB > Tables.Note: By default, the vCenter Server database is named
VIM_VCDB, unless it was renamed during initial creation.
- Right-click the dbo.VPX_PARAMETER table and click Open.Note: If you are using SQL Server 2008, right-click the dbo.VPX_PARAMETER table and click Edit Top 200 Rows.
- Modify event.maxAge to 30 and the event.maxAgeEnabled value to true.
- Modify task.maxAge to 30 and the task.maxAgeEnabled value to true.Note: To improve the time of the data cleanup, run the preceding steps in several intervals:
- Ensure to keep the default value of event.maxAge and task.maxAge.
- Perform step 6 to run the cleanup.
- Reduce the event.maxAge and task.maxAge value by 60 and run the cleanup.
- Repeat the steps a-c until the value is reached to 30 for the final cleanup process.
- Run the built-in stored procedure:
- Go to VIM_VCDB > Programmability > Stored Procedures.
- Right-click dbo.cleanup_events_tasks_proc and select Execute Stored Procedure.This purges the data from the vpx_event, vpx_event_arg, and vpx_task tables based on the date specified for maxAge.
- When purging is successfully completed, close the SQL Management Studio and start the VMware Virtual Center Server service.
- Ensure that the default Statistics Level is set to 1:
- Using the vSphere Client, log in to vCenter Server as an administrator.
- Go to Administration > vCenter Server Settings > Statistics.
- Under Statistics Intervals, ensure the Statistics Level column is set to 1.
- To change the value, select the Interval Duration, click Edit and select Level 1 from the list.