After the release of VMware vSphere 6, the vCenter Server Appliance 6 (Linux) has a possibility to run vPostgres internal DB. The VCSA with vPostgress DB can support up to up to 1000 hosts and 10,000 VMs using the embedded database. If you running vCenter server 6 appliance (VCSA) the built in vPostgres database can be backed up separately. VMware provides a Python based scripts which allows to backup and restore the built-in DB.
I have tested their solution in my lab. You can use this tutorial to test it as well. You don't have to have much Linux skills. Me too I'm rather Windows guy, but few Linux commands is a must those days… 🙂 I used two tools for the job – Putty and WinSCP. I guess the wast majority of IT admins know those tools and how to use them. Both are listed on my Free Tools page as well. In fact I just followed a VMware KB as a reference. You'll find the link inside the tutorial (you'll need to download the Python scripts) and also below the post. This post is for everyone who want to test backup and restore vPostgres database on VCSA 6.
In case you're still running on VCSA 5.5, you might want to check how my lab upgrade was – How to Upgrade from VCSA 5.5 to 6.0 – Lab Time.
How to backup and restore vPostgres database on VCSA 6 – The steps:
Step 0: Download this script from VMware KB (you'll find it attached at the bottom) > unzip the content (you'll get 2 files backup_lin.py and restore_lin.py)
Step 1. login as a root via SSH client and copy the two files to a /tmp folder on the appliance.
Step 2. Make the backup_lin.py executable with this command
chmod 700 /tmp/backup_lin.py
Step 3: run the backup_lin.py command to backup the db
python /tmp/backup_lin.py -f /tmp/backup_VCDB_vladan.bak
Then check the directory with ls -l to see the details on size etc…
If you want you can copy that file outside of the VCSA to have it on different location as well… Below screenshot showing WinSCP used for this…
How to restore?
Step 1: The restore operation is similar, but before we do a restore we need to stop some VMware services…
service vmware-vpxd stop
service vmware-vdcs stop
Step 2: run this command to restore:
restore_lin.py -f /tmp/backup_VCDB_vladan.bak
or whichever name you gave it…
You should see
Restore completed successfully message
The Original VMware KB is here. Check it out!
While the wast majority of the backup products out there is not for the moment compatible with vSphere 6 you might use this method to backup your DB “just-in-case”…. But those products shall be compatible quite soon. Veeam announced the compatibility of vSphere 6 in a reasonable time as they're working towards complete compatibility with vSphere 6 including VVOLs.
One product should't have problem with backing up VCSA however – vSphere Data Protection 6 which has been released at the same time that vSphere 6. I haven't tested VDP 6 just yet, but it's on my To-do list… Subscribe to my RSS or follow via Twitter or FB. In case you did not know, the blog has daily updates. That's why it's been listed as N 13 most popular Virtualization Blog … -:) Stay tuned for more !!