Backing up your Vsphere Virtual Machines host unfortunately is one of the last items you address when bringing your VMs online. With everything that goes into VMware Vsphere, back up seems to be an area where Vmware has fallen short.
Currently there is no built in method for performing a backup of your Vsphere Virtual Machines. In previous version of Vsphere, VCB or Vmware Consolidated Backup was a viable option for backing up your Vms, but in newer version of Vsphere, VCB has been discarded in favor to VMware Data Protection. As is the case, this option is available for purchase. Other solutions are available, such as Net backup, Acronis and others, but like anything else they aren’t free…So what is a cash crunched admin to do..The answer is ghettoVCB.sh
This article will provide you the details of backing up your Vsphere Virtual Machines without breaking the bank. Now, as the case with most free options this solution does require you possess an intermediate level of understanding of Linux, VI and have SSH access to your Vsphere host.
GhettoVCB.sh script performs backups of virtual machines residing on ESX(i) 3.5/4.x/5.x servers using methodology similar to VMware’s VCB tool. The script takes snapshots of live running virtual machines, backs up the master VMDK(s) and then upon completion, deletes the snapshot until the next backup.
Upon dowloading GhettoVCB.sh, you will want to create a folder on the root file system and copy it to this folder. Then it will be necessary to unzip the file
and make sure you have the appropriate rights and permissions:
chmod +x ghettoVCB.shchmod +x ghettoVCB-restore.sh
As is the case with open source solutions, it is now necessary to configure the solution for your environment. Below are list of the variables ,with sample values, that are necessary for GhettoVCB.sh to successfully backup your Vsphere Virtual machines. Several of the variables are pretty self explanatory & are within your scope of setting up. With that being said, please take the time to gather this data prior to configuring this solution, it will make this alot easier. Of the variables listed below if you have any issues it will most certainly come from these variables
But don’t sweat it, it wont be anything you and your Email admin cant figure out.
After you have addressed each variable, now it is time to give it a go. Like with so many solutions there are numerous switches to further define how the backup will run
-a Backup all VMs on host
-f List of VMs to backup
-m Name of VM to backup (overrides -f)
-c VM configuration directory for VM backups
-g Path to global ghettoVCB configuration file
-l File to output logging
-w ghettoVCB work directory (default: )
-d Debug level [info|debug|dryrun] (default: info)
I will make the assumption that you want to backup all your VMs on your host for this example.
./ghettoVCB.sh -a -d debug
Now like all good admins we will want test our first pass of the backup. For this we will use the option
I suggest you run your first pass like this
./ghettoVCB.sh -a -d dryrun
This will let you know a few things before going live:
1.Duration of backup
2.Verify if your variables are defined correctly
OK that’s it..You should have everything you need to start backing your VMs. Going forward you will probably want to schedule this script to run regularly to make sure you have consistent backups. To schedule this script will need to create a cron job, and that my friends is a different subject altogether
Read More →