Vmware ESX

Version as of 11:40, 29 Apr 2024

to this version.

Return to Version archive.

View current version

Vmware ESX Server Backup

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). Free version of Vmware ESX requires manual steps at the time of restoration.

Requirements for Vmware Server Backup and Restore

  • All Amanda Enterprise 3.0 and Zmanda Management Console patches must be installed on the Amanda server.
  • Make sure Amanda Enterprise server and Zmanda Management Console is functional before installing and configuring Vmware ESX application.
  • Amanda Vmware ESX application agent performs the backup from the Amanda server. No additional Amanda clients are required in the process.
  • Amanda server must be running  Linux distribution listed on the Zmanda Network Supported Platforms page.
  • Following packages must be installed on the Amanda server for Amanda Vmware ESX application:

fuse-libs

fuse

xinetd

Vmware VCLI

Vmware VDDK

fuse-libs and fuse are required by Vmware commands. They can be installed using yum or yast or apt-get tools available in the Linux distribution. Following command shows how to install these packages on RHEL 5 distribution.

# yum install fuse-libs fuse

Vmware VCLI and Vmware VDDK packages are available in the Vmware web site.

  • Amanda Vmware ESX application requires temporary space to store the backup images on the Amanda server.  The space required should be equal to the size of the guest VM images being backed up. This space requirement is temporary and required only during backup. The amandabackup user should be able to read and write to this directory on the Amanda server.

Installation

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/bin), 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 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 Server Backups

Configuring Vmware guest VM backups requires steps in both Zmanda Management Console and some manual steps.

  • Zmanda recommends creation of separate backup set for backing up guest VM images.
  • Create a backup set for the guest VMs in the Zmanda Management Console.
  • Configure Backup devices in the Admin Devices page and bind them to the backup set in the Backup Where page.
  • Configure minimal staging area in the Backup Where page. Using staging area for the VMware ESX backups does not add any value.
  • Change the Data Timeout value in the Backup How page for the backup set.  The value should be increased to at least 14400 seconds. Increasing the value does not impact the backup window (time to complete the backup).

 BackupHow-datatimeout-Vmware.png

  • Modify the /etc/amanda/<backup set name>/disklist.conf to add backup entries for each guest VM that has to be backed up. See below for the line that must be added. The ip address of the ESX server and guest VM will have to be changed for your configuration (it has to be done in couple of places). You can have multiple entries in the file.

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.
  • Create the ESX authentication file in /etc/amanda/<backup set name>/esxipass . This file should have the ip address for the ESX server, user name and password for the root user. This should be readable only by amandabackup user. 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.

  • Before scheduling backups, it is important to verify the Vmware ESX application configuration. Run the amcheck command to verify the configuration.

$ amcheck -c <backup set name>

Please resolve any configuration errors found.

Scheduling backups of Vmware Server

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).

Performing Vmware Server Restores using ZMC

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.

 RestoreWhere-Vmware.png

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.

  • In the destination directory, there will be single file named zmc_restore_<number> restored.
  • Run the following command to extract the files in the archive. The tar must be GNU tar.

# dd if=zmc_restore_<number> bs=512 skip=1 | tar xv

  • These VMX and VMDK files will have to converted to OVF format. ESX server supports import of OVF files. To convert the files into OVF, use ovftool. The ovftool is available from Vmware. Run the tool and provide vmx file as parameter as shown below. The ovf files will be created in a sub-directory.

# /opt/vmware/ovftool rhel5-32.vmx

  •  Copy the contents of the directory to the ESX server and import it using Vsphere console.

Performing Vmware Server Restores/Recovery using command line

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.

  1. Run amrecover command on the Amanda server as root user. You will need to provide the backup set name as a parameter. The values for options -t and -s will not change.

        # amrecover -C <backup set name> -t localhost -s localhost
     
  2. Set the host to localhost and the disk to DLE name that was used in the backup set configuration. The DLE name will have //<ip address of the ESX server/<name of the guest VM>.


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

  1. You list the files in the backup using ls command. Add all the files to be restored and run extract command to restore the files.

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

  1. The VMDKs will be restored to the original ESX server and the datastore. The name of the restored VM will be <original vm name>_restored.