HOW TO backup ESX 3.0.1 with vmbk.pl
This nice perl script allows online backup of Virtual Machines to a remote FTP/SMB/NFS
It was written by Massimiliano Daneri, and many other authors contributed
it can be downloaded from here

How to install it:

Download and copy to a the ESX server using WinSCP, copy to /etc/vmbk
Login via SSH into the ESX server:
# cd /etc/vmbk
# bash install.sh
Runing the script from /etc/vmbk/ it will work, since the dependencies are in these folders.
USAGE
usage: vmbk.pl -h | -d directory |-f |-B |-G
DESCRIPTION:
vmbk.pl is a script for creating ESX disk snapshot.
It supports disk copy to local host disk or remote Disk with NFS / SMB / FTP
vmbk.pl can be used on guest powered or on guest unpowered.
vmbk.pl support batch and interactive use.
vmbk.pl search about ‘backup’ option on vm guest definition file ,the option may have 4 value NONE , MANUAL , AUTO , ALWAYS if NONE no backup is possible, if MANUAL is possible only interactive mode (-i option) , if AUTO backup is always done.
If backup isn’t finding, it’s equivalent to AUTO.
You can choose also to set SCSIx:y.BACKUP for permit or not a single disk backup, the value are the same NONE , MANUAL , AUTO
You have also the possibility to define various backup session
See OPTION IN VMX CONFIGURATION FILE for more info
Example cmd:
#perl vmbk.pl -f ftp=’192.168.1.2′,dir=’/’,user=’backup’,password=’123′,passive=’true’ -R -l /var/backup_vm.log -v 5
Backup Step-by-Step:
1.Set the ESX firewall to allow outgoing FTP
Enter on the VI go to server>Configuration>Security Profile> Select FTP Outgoing port 21
Also you should define some Port Range for PASSV settings I set CommVaultStatic (8400-8403)
In the FTP Client like Fillezila (these ports must be the same)
In case you have trouble, always check the ftp from the prompt, try transfering data. Create also a user/permission/folders etc…
2.List all current VM:
#perl vmbk.pl -f ftp=’192.168.1.1′,dir=’/’,user=’1′,password=’1′,passive=’true’ -i
Make note of the number of each server.
3.Backup Servers via FTP
#perl vmbk.pl -f ftp=’192.168.3.253′,dir=’/’,user=’backup’,password=’vmvmvm’,passive=’true’ -R -l /etc/vmbk/backup_vm.log -v 6
vmbk

Restore Step-by-Step:

It is not posible (at least with ESX 3.0) to import via Vmware Converter Utility.
So the way I do to restore the VM is:
1. Copy the .vmdk and .vmx files you need to restore using WinSCP to the ESX server
2. Browse the datastorage and register the .vmdk
(any problems with these please leave a comments)

Tags: , , , , , , ,

1 thought on “Howto backup ESX

Leave a Reply

Your email address will not be published. Required fields are marked *