If you are a Virtualization’s specialist you might not be a DB specialist. Unfortunately vCenter uses DBs, meaning that you will have to deal with them one time or another.
Here I just wanted to give a little generic and easy to perform way for doing backup and maintenance for these DBs on MSSQL. i divided my maintenance plan into two parts. In first, i will show you how to make weekly full backup plan for vCenter DB and in second, will show you to make daily differentials backup plan for vCenter DB.
The following implementation works fine for a vCenter 5.x infrastructure.
LAB-11 TASKS (Part 1)
In this lab we will perform following tasks.
- VCenter is already installed
- MSQL Server is installed for VCenter DBs
- VCenter DBs are already created.
- SQL Agent service is running
- Full DBs Backup Will performed Weekly on Sunday
4-SQL Agent Service is runinng
In SQL Server machine go to “Control panel-> Administrative Tools->Services” and then verify SQL Agent service is running.
5-Full DBs Backup Will performed Weekly on Sunday
We will do all of this through the maintenance plans of MSSQL
Lanuch vCenter’s MSSQL server Management Studio and logon onto your SQL. Once inside.
To create a new Maintenance plan Right Click on “Maintenance Plans” folder under “Management section” and choose “New Maintenance plan”
Enter a name, description and Click on “Change” Button. Leave reset of the settings as default.
As we already discussed in our goals. We want to take full weekly backup of vCenter DB’s. Select the desired schedule settings and Click “OK” twice.
Select the SQL Maintenance plan tasks -> Click “Next”
Choose an Order for your tasks to performance. I have one or two changes, please set as you pleased -> Click “Next”
Click on the drop drop to choose your databases for the tasks.
As we want to backup our vCenter DB’s. There are two option to do this, either we choose “All User databases” options or let it choose from “These databases” option -> Click “OK”
I will only do a rebuild task once a week. In enterprise version of MSSQL you can rebuild them online. Make sure “All User databases” is selected in databases. Leave other as default -> Click “Next”
Make sure “All User databases” is selected in databases. Leave other as default -> Click “Next”
On backup task Choose “Full” backup of “All User databases”. Select your “Database folder path”. Check “create sub-dirs”. Click “verify the backup integrity” and set the backup file extension to bak_full -> Click “Next”
Choose “All User databases” from dropdown. Leave reset as default -> Click “Next”
To the maintenance cleanup task we will ask the plan to remove the backup files of the system databases older than 1 week. Of course you can set a higher retention period if you wish. Note that I specify the same file extension than the one set in the precedent step. Like that I won’t risk deleting other files than these-> Click “Next”
Choose “2 Weeks” retention time to clean the history file. This task clean the history for the backup, agent jobs and maintenance plan for the whole SQL server. It can be set only one time-> Click “Next”
Choose “write a report to text file” and save it . beacuase I want to have a detailed trace of the plan execution for troubleshooting purpose.-> Click “Next”
Complete the Wizard tasks ->Click “Finish”
Wait for task to create. Check the Status against the task it should be successful -> Click “Close”
If we go into the sql management study under maintenance plan. Then you should see a plan task which we just created
NOTE: I have set the recovery model of my vCenter databases into simple. This means that the only point in time of restore is the last backup.
We have only one task completed yet (week full backup of vCenter DB’s. Next will cover in my later post.).