GhettoVCB is a free, open-source tool that you can use to back up VMware virtual machines. Like VMware’s VCB tool, GhettoVCB works by creating a snapshot of running virtual machines, backing up the VM, and then deleting the snapshot. However, it has its limitations. This article provides tips, tricks and best practices for working with GhettoVCB.
Dry Run Mode
Backups can be time-consuming, and with any backup application, there is a potential for a backup job to be misconfigured, thereby causing it to fail. One of the best ways to make sure that GhettoVCB is going to back up everything that you intended is to perform a dry run.
The syntax used in performing a dry run is really simple. You will need to use either the -a switch to backup all virtual machines, or the -f switch to specify the virtual machines that you want to back up. You will also need to include the -d switch, which tells GhettoVCB to perform a dry run rather than an actual backup. Here is an example of what a dry run command looks like:
./ghettoVCB.sh -a -d dryrun
VM Startup and Shutdown
Often times dependencies exist between virtual machines. A Web application server, for instance, might have a dependency on a backend database. As such, it is often necessary to shut down and startup virtual machines in a specific order.
You can control GhettoVCB’s VM startup and shutdown sequence through the configuration file. The virtual machine shutdown sequence is controlled with the VM_SHUTDOWN_ORDER. Simply append an equal sign and the names of your virtual machines, in the order that you want to shut them down. Here is an example:
The VM startup sequence is also controlled through the configuration file. Simply specify the startup order using the VM_STARTUP_ORDER line. As was the case for the shutdown sequence, you will need to list the virtual machines in the order that you want to bring them online. Here is an example:
Choosing the VMs to Back Up
When it comes to backing up a VMware host, it is usually advisable to back up all of your virtual machines. GhettoVCB makes it easy to back up all of a VMware host’s VMs. Just specify the -a switch to back up all VMs.
As handy as the -a switch might be, there are situations in which you might not want to back up every virtual machine. For example, you might prefer to skip backing up lab VMs or static application VMs that have already been backed up. Similarly, there may occasionally be a need to back up one specific virtual machine or one particular application. In these situations, it probably doesn’t make sense to back up everything.
If you only want to back up a small number of VMs, then your best option is probably to use the -f switch. This switch allows you to list all of the virtual machines that you want to back up.
If on the other hand, you want to back up most of your VMs but have a few specific VMs that you don’t want to back up, then you may be better off creating an exclusion list. To do so, use the -a switch to tell GhettoVCB that all VMs should be backed up, and then specify the -e switch, followed by your exclusion list of VMs that you do not want to include in the backup.
Best Practices for Selecting a Backup Target
One of the things that you will have to do when you first deploy GhettoVCB is to specify a backup target. GhettoVCB is designed to backup your VMware virtual machines to an NFS volume. While there is nothing stopping you from backing up your virtual machines to an NFS volume that is stored on a virtual machine, it’s important to make sure that the VM hosting the NFS volume does not reside on the VMware host that you are backing up. Otherwise, if something were to happen to the VM or to the underlying datastore, you could end up losing your backups.
If possible, it’s probably best to write your backups to an NFS volume that is hosted on a NAS appliance or other dedicated storage device. If you do decide to use a VM-based NFS volume, it is important to not only choose a VM residing on a different VMware host but also to put rules in place to keep the VM from being accidentally migrated to the host that the backup is protecting.
One of the most important best practices for working with GhettoVCB is to work with it in a lab environment prior to attempting to use it in any kind of production. It’s important to make sure that you are comfortable with the command-line interface, and that you are able to back up and restore virtual machines reliably.
While it may not be as feature-rich as a commercial backup application, GhettoVCB is an amazing lightweight and free tool to use for backing up VMs in one’s home lab but lacks many useful and important features that one would need in an actual production environment. If you’re not running business-dependent services with it, it could be used for protecting smaller organization’s VMs or for creating one-off backups but the limitations mean I would not advise for serious production use. The following features, which are found commercial VM backup solutions such as Altaro VMBackup, are a few that the script lack for it to be of production use:
- Booting up directly from the backup files
- Different retention policies for different VMs
- Data deduplication and compression
- Offsite Backups
- Replication to a remote site
You can download GhettoVCB from GitHub. I hope you found the information inside this article helpful, but of course, if there is anything you wish to ask about the subject of GhettoVCB, let me know in the comments below and I’ll get back to you!
Download Altaro VM Backup
Start your free 30-day trial of Altaro VM Backup today and see why it's trusted by 40 000+ organizations worldwide. Get started now and run your first backup in under 15 mins!
Not a DOJO Member yet?
Join thousands of other IT pros and receive a weekly roundup email with the latest content & updates!