The VMware vCenter Server Appliance (VCSA) is the wave of the future, right? Well, that depends on who you talk to. By now you have probably noticed that VMware has been releasing many of their products and tools as virtual appliances. This seems to mean that they may eventually phase out the Windows-based vCenter install. Either way, the VCSA now can support 100 hosts and 3,000 virtual machines, which means that it would be able to support the vast majority of VMware installs.
But to be able to roll out the VCSA in your datacenter you will need to work out a plan for backing up the data. The appliance does not have a built-in backup utility yet. You could use any VMware-based backup tool to backup the appliance as a whole, but that might not be a supported method and you could possibly run into database issues. So for an added level of protection, you will want to take database backups.
In this article I will walk you through the steps to take a manual backup of the internal VCSA database. If you connect the VCSA to an external Oracle database, then you would not need this process. The internal database is a Postgres database and as of vSphere 5.5, it must still be backed up via these commands.
To accomplish this project you will need the following items. These will be needed for remotely connecting into the appliance and copying files.
In the image below, you can see what the vCenter looks like on the server on which we are backing up the database. The server name is vcsa55 and has a single datacenter and a test cluster.
cat /etc/vmware-vpx/embedded_db.cfg
./pg_dump EMB_DB_INSTANCE -U EMB_DB_USER -Fp -c > VCDBBackupFile
service vmware-vpxd start
Now that the backup is completed you will need to use the SCP client and connect to the VCSA and copy your backup file. This can be stored some place for safe keeping.
Now we need to restore our database backup. For this post, I stood up another VCSA that has an empty base configuration. I will then restore the backup and we will see the inventory items from the original VCSA.
cat /etc/vmware-vpx/embedded_db.cfg
PGPASSWORD=’EMB_DB_PASSWORD’ ./psql -d EMB_DB_INSTANCE -Upostgres -f VCDBBackupFile
If you are planning on implementing the VCSA in a test or production environment, then you will need to take regular backups of the database. You can use this process, but you would want to script it and run in a Cron job so that it happens on a regular schedule.