Our Sponsors

Backup ESXi to Local Datastore

Here is my favorite backup solution for ESXi. This utilizes the same script for backup up ESXi to an NFS store but it copies the data to a local ESXi Datastore. Now supports ESXi 4.0

Requirements:

  • Enough hard drive space on a seperate ESXi Datastore
  • ghettoVCB - I found the backup script on the VMware Communities site. You must modify it to work in your environment. It's not hard to do, it can be opened with any unix text editor, I used texpad but do not use Notepad. ghettoVCB is available here, http://communities.vmware.com/docs/DOC-8760.
  • SSH Access to the ESXi console enabled.

To enable SSH read the article Enable SSH in ESXi.

This script requires very little configuration but it does require a file that lists the VMs that you wish to backup. It actually only requires one line to be edited.

# directory that all VM backups should go (e.g. /vmfs/volumes/SAN_LUN1/mybackupdir) VM_BACKUP_VOLUME=/vmfs/volumes/EnterDataNameHere

Change "EnterDatastoreNameHere" to the name of the ESXI Datastore where you want the backups to go, save the script, then move it to the ESXi server.

You also need to edit the BVMs file. You can do it in Notepad but its possible that it will add some extra data that will cause issues. If you do use Notepad you want to make sure you don't hit enter or it will add exta characters that ESXi will not like. After the files are copied to the server I'll show you how to check for the extra characters.

The BVMs file needs to contain the names of the VM's that you want backed up. Each VM needs to be on its own line.

VM1
VM2
VM3

Now that the script and the bvms file is edited it's time to copy the files to the server. Using SCP copy the files to your ESXi server. To make things easy I just copied the file to the root "/" file system.

SCP Screen

Next use an SSH application like Putty to access your ESXi console remotely. After you login type "cat bvms". The image below shows how the file should look if there are no errors in it.

SSH vbs cat

Now that you have verified that your bvms file is correct you need to make sure that the script has executable permissions. You do this by typing chmod +x ghettoVCB.sh.

Now you're ready to run the script. To run the script type ./ghettoVCB bvms, the backup should begin to run. Note: If you are using the latest version of ghettoVCB, you will need to use ./ghettoVCB -f bvms.

As the script runs you will see the staus of the backup as it happens.

running ghetto

 

 

Last Updated (Saturday, 05 December 2009 08:07)