When you install VMWare vCenter to manage your virtual environment, unless you specify an existing database, it will automatically install MS SQL 2005 Express. This is great and works fine. However, one of hte important limitations of SQL 2005 Express is a 4GB database size limit. As you use VMWare, performance data, tasks history, and event history will all be recorded to the database and will slowly fill it up. Depending on size and complixty of your environment, some time later your DB will hit 4GB, the SQL server will stop accepting data, and vCenter will simply stop. As always, before making changes to DB make sure you have a good backup.
The solution is to quickly shrink your DB size, restart SQL, and start the vCenter service again. The easiest way to shrink the DB is to clear out all the old performance, task, and event data. If you haven't already, download and install the SQL Management Studio. Open up your vCenter database, and then run the following query to clear performance data:
truncate table VPX_HIST_STAT1;
truncate table VPX_SAMPLE_TIME1;
truncate table VPX_HIST_STAT2;
truncate table VPX_SAMPLE_TIME2;
truncate table VPX_HIST_STAT3;
truncate table VPX_SAMPLE_TIME3;
truncate table VPX_HIST_STAT4;
truncate table VPX_SAMPLE_TIME4;
Then open the table in the vCenter database called dbo.VPX_PARAMETER, modify "event.maxAge" to how many days of events you want to keep (I usually keep 90 days), modify "event.maxAgeEnabled" to "true", modify "task.maxAge" to how many days of tasks you want to keep (again I usually keep 90 days), and finally set "task.maxAgeEnabled" to "true". Once you're done open the "programmability" folder for the vCenter DB in Management Studio, open "stored procedures", and execute the one called "dbo.cleanup_events_tasks_proc".
The final step is right clicking on the database, going to tasks, and selecting shrink database (not file). Let it run, and your DB should suddenly be well under 4GB. Restart your vCenter service.
You can either monitor the growth of your DB and clean it up periodically, or you can upgrade to SQL standard. Because of Microsoft's SQL licensing, and because you're probably already running SQL in your virtual environment, you can probably upgrade to standard for no cost to you.
No comments:
Post a Comment