vmbk.pl Version 2.20.2 by Massimiliano Daneri email: manzi@vmts.net NAME vmbk.pl - VMware ESX Server copy disk utility SYNOPSIS vmbk.pl OPTIONS USAGE vmbk.pl usage: $0 -h | -d directory [-a] [-t] [-i] [-1][-2][-3][-4][-c][-z][-m] [ -n nfs | -s smb | -f ftp ] [-j size] [-5 predirname] [-l log file][-L log file] 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 vmbk can be used on guest powered or on guest unpowered. vmbk support batch and interactive use. vmbk search about 'backup' option on vm guest definition file ,the option may have 3 value NONE,MANUAL,AUTO, 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 OPTIONS The long and short forms of options, shown here listed together, are equivalent. -h Help about parameters -n don't display start info -d directory Exports the disk contents of the specified guest OS on the specified directory local or remote, to a VMware Workstation format virtual disk. The virtual disk may then be transferred to another machine and imported to a SCSI device on the remote machine. The virtual disk will likely take less space then the full size of the VMFS file, since the virtual disk does not include zeroed sectors of the disk image. When this option is used on a guest powered on an ESX Server REDO log is created, when the exported virtual disk is done the REDO log is commit to its base disk. REMEMBER FINAL / on directory -n host:export Mount NFS host's export on directory specified by -d parameter -s smb='host/share',user='user name',password='password' Mount SMB host's share on directory specified by -d parameter, -u and -p options are now obsolete -l logfile Text Log mode Create a text log -L logfile HTML Log mode Create a HTML log -t Test mode Don’t create export file, but done all loop -i Interactive mode Shows a menu where you may choose what guest do you want export -a Backup all vm Override default setting backup only started vm. -f ftp='host',dir='remote directory',user='user name',password='password',passive='true o false' Export dsk to ftp server -1 use vmdk format for export Export disk file with vmdk extension -2 debug mode -3 do backup of redo disk file When start do a REDO.REDO file and backup DSK + REDO file -4 backup configuration file (.VMX) and CMOS -c create restore command on export directory, simply execute the script file on destination directory and follow instruction -m export disk in flat mode, every dsk file is exported to unique directory -e smtp='host',from='from email address',to='to email address' send report to email -j value Set minimum allowed free space on destination disk -z Use cp instead of vmkfstools (copy dsk file) -5 Set the initial name of directory (default 'vm-') EXAMPLES vmbk.pl -d /export/ Backup vm started to /export/ directory vmbk.pl -d /export/ -a -1 Backup ALL vm to /export/ directory with vmdk extension vmbk.pl -d /export/ -i Show menu where you may chose which guest backup vmbk.pl -d /tmp/ -f ftp=ftpserver,dir=/vmbackup,user=ftpuser,password=ftppassword,passive=false Backup VM to ftpserver with ftp protocol(passive mode), using /tmp/ directory for temporary file vmbk.pl -d /vmbk/ -s smb=//smbserver/share,user=smbuser,password=smbpassword Backup VM to smbserver mounting //smbserver/share on /vmbk/ vmbk.pl -d /vmbk/ -s smb=//smbserver/share,user=smbuser,password=smbpassword -e smtp=smtpserver,from=esx@vmts.net,to=support@vmts.net Backup VM to smbserver mounting //smbserver/share on /vmbk/ and send a report by email vmbk.pl -d /export/ -n srvnfs:/exp -a Backup ALL vm to exp on server 'srvnfs' vmbk.pl -d /export/ -l logfile Backup all vm started to /export/ directory and send output to log file 'logfile' sample file for cron scheduling, with log file mountpoint=/export/archive/ arg2=/var/log/vmbk.log nfsmount=lnxrh02:/vol/d1 /usr/local/bin/vmbk.pl -d $mountpoint -n $nfsmount -l $arg2