As I am writing this post, I just finished running some manual tasks because of a vCenter Server 4.1 database which was filled up at a customer.
Since the default SQL instance delivered by the vCenter Server installation is an Express Edition, no SQL agent is supplied. This means that the jobs created for automatic cleaning of the events and tasks is not happening properly.
The database I am talking about had 0 MB free and the vCenter Server service entered the stopped state because of this.
Everything I needed can be found in the following KB article supplied by VMware:
Make sure all services of vCenter Server are stopped
Edit the dbo.VPX_PARAMETER table and set the events.MaxAge and tasks.MaxAge records to change how long events and tasks are supposed to be kept in days. We have these records set to 180.
Next, edit the records events.MxAgeEnabled and tasks.MaxAgeEnabled and set them to true.
Finally, run the Stored Procedure “dbo.cleanup_events_tasks_proc” and monitor the free space of the database using the properties window of the database.
It took about 20 minutes for us to clear out events from January 2010 until December 2012. Next step was starting all vCenter Server services and getting back to bed =)