Backup ESXi to NFS
Like many others that work with the free version of ESXi, I think VMware should have included an easy way to backup virtual machines even if it was just a copy to another Datastore. Knowing that backups are extremely important, I have looked all over trying to find a simple and free way to backup the free version of ESXi Server.
This is a backup that will work if you are have an NFS Datastore setup.
Backups can take a lot of time so to avoid any downtime it is best to schedule them to run at night.
Requirements:
- This backup solution requires an NFS server available on the network.
- Enough hard drive space on the NFS Share
- ghettoVCB.zip - I found the backup script on the VMware Communities site. You must modify it to work in your environment. The latest version of the script can be found here, http://communities.vmware.com/docs/DOC-8760.
- SSH Access to the ESXi console enabled.
If you are using Windows and want to enable NFS follow the article Connect ESXi to Windows Based NFS. This will also take you through enableing SSH access.
To enable SSH read the article Enable SSH in ESXi.
Now that you have NFS and SSH enabled it time to configure the backup script.
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/EnterNFS-StorageNameHere
Change "EnterNFS-StorageNameHere" to the name of the NFS datastore where you want the backups to go save the script and you are ready to move the file to the 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.
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.
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.
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.
| < Prev | Next > |
|---|
Last Updated (Saturday, 05 December 2009 08:07)




