Amanda Enterprise 3.0 allows you to backup VMware ESX images to various media supported by Amanda. The backups are performed in an application consistent manner. These backups can be used for restoration of guest VMs running on the ESX server and can be restored to alternate ESX server.
Guest VM files will have to restored from the restored VMs. Zmanda recommends using Amanda client to backup files from guest VM if file level backup of VMs is needed.
Amanda Enterprise VMware ESX application supports licensed versions of VMware ESX 3.5 and 4 (Vsphere 4).
VMware vSphere VCLI (VMware-vSphere-CLI)
VMware vSphere VDDK (VMware-vix-disklib)
VMWare-ovftool (required for recovery)
perl-Crypt-SSLeay
perl-URI
fuse
fuse-libs
curl
All packages mentioned above are required by VMware commands. They can be installed using yum or yast or apt-get tools available in the Linux distribution. The actual names of the packages might be different in different distributions. VMware VCLI and VMware VDDK packages are available in the Vmware web site. VMware VDDK package is also available in Zmanda Network.
Following example commands shows how to install some of these packages on RHEL 5 distribution.
# yum install fuse-libs fuse perl-Crypt-SSLeay perl-URI curl
# <extract from VMware-vix-disklib tar archive>
# <extract from VMware-vSphere-CLI tar archive>
# ./vmware-vix-disklib-distrib/vmware-install.pl
# ./vmware-vsphere-cli-distrib/vmware-install.pl
# <install the Amanda VMware application>
On Ubuntu 8.04, fuse and fuse-libs packages are installed as part of default installation. The package names on Ubuntu are fuse-utils and libfuse2. In Ubuntu distribution, perl-Crypt-SSLeay package is called libcrypt-ssleay-perl and perl-URI is called liburi-perl. The following command line will help in installation of dependencies on Ubuntu distribution
# apt-get install fuse-utils libfuse2 libcrypt-ssleay-perl liburi-perl curl
Amanda ESX VMware application must be installed on the Amanda server. Download the ESX VMware application from the Zmanda Network and extract the tar ball. Run the install.sh script.
If the VMware commands (vmware-cmd, vmkfs, vmware-diskmanager, snapshotmanager.pl) are not installed in default locations (/usr/lib/vmware-cli for VCLI and /usr/bin for vmware-diskmanager), you will have to modify /etc/zmanda/zmc_aee/zmc_user_dumptypes to fix the application properties (VCLI-PATH, VCLI-BIN-PATH and VDDK-BIN_PATH).
It is also important to change TEMP-WORKING-DIR location in the /etc/zmanda/zmc_aee/zmc_user_dumptypes file for zmc_vmware_userapp. This location should have sufficient disk space to hold one full backup of ESX VMware images.
Configuring VMware guest VM backups requires steps in both Zmanda Management Console and some manual steps.
localhost "\\\\<ip address of the ESX server>\\<guest VM name>" "\\\\<ip address of the ESX server>\\<guest VM name>" {
comment "Base dumptype for VMWare ESXi virtual machine"
zmc_global_base
zmc_bsdtcp_auth
estimate server
compress server best
encrypt none
property "zmc_version" "3"
property "zmc_type" "vmware"
property "zmc_amanda_app" "vmware"
zmc_vmware_app
}
Please make sure you do not edit using Backup What page on the Zmanda Management Console for this backup set.
An example esxipass file is shown below:
//esx4.company.com root%root_password
esx4.company.com is the IP address or the name of the ESX server whose guest VMs are being backed up by the backup set. root is the user on the ESX server used for the backup operations and password for the user is root_password. The password must not be encrypted.
$ amcheck -c <backup set name>
Please resolve any configuration errors found.
You can schedule backups using Zmanda Management Console Backup When page or run immediate backups for the backup set from the Backup Activate page.
The status of the backup are shown in the Monitor page. Backup reports will be available under the Report tab in the Zmanda Management Console.
Amanda ESX Server application supports only full backups (level 0 backups).
Zmanda Management Console restores the files to the Amanda server. The VMware files will have to be extracted and manually transferred to the ESX server to complete the recovery.
The Restore What page configuration is similar to all other applications. In the Restore Where page, Select Destination Host as localhost and Destination Directory as the location to restore in the Amanda server. The directory must have sufficient disk space to store restored images. Conflict Resolution options are not supported for this application.
After reviewing the entries, click Restore to start the restore process.
When the ZMC restore process is complete, the restored files will reside on the specified host and destination directory. Use the following steps to complete the VM recovery on the ESX server.
# dd if=zmc_restore_<number> bs=512 skip=1 | tar xv
# /opt/vmware/ovftool/ovftool <vmx file name> <ovf file name>
Copy the contents of the directory to the ESX server and import it using Vsphere console.
Alternatively, you can convert and copy it to ESX host in a single step.
# /opt/vmware/ovftool/ovftool -ds=<datastore> <Name of vmx file that has to be copied> vi://<user name>@<ESX host>/
Another alternative is to use VMware VCenter Converter to convert and transport restored VM image to the target ESX server.
This section describes how to use Amanda recovery command amrecover to perform ESX guest VM recovery. This procedure can be used to restore guest VM to the original ESX server (not to a different ESX server). These steps can be used instead of the procedure described in the previous section.
amrecover> sethost localhost
200 Dump host set to localhost.
amrecover> setdisk //192.168.1.2/rhel4-32
200 Disk set to //192.168.1.2/rhel4-32
amrecover> ls 2010-03-03-17-22-35 rhel4-32.vmx
2010-03-03-17-22-35 rhel4-32.vmdk
2010-03-03-17-22-35 .
amrecover> add *
Added file /rhel4-32.vmx
Added file /rhel4-32.vmdk
amrecover> extract
Using VMware Vsphere client, create a backup user role.
After creating the role, assign the role to specific user that can be used for VMware backups.