Changes

From SME Server
Jump to navigationJump to search
update for Affa 2.0.0
Line 3: Line 3:  
=== Introduction ===
 
=== Introduction ===
   −
As of version 2, [[Affa]] supports hot backing up virtual machines running on the VMWare ESXi server. It uses the VMware Infrastructure Perl Toolkit to communicate with the EXSi and rsync over ssh to transfer the data. Before the backup starts, the state of the running VM is freezed by creating a snapshot of all its disks. After the freezed virtual disk files were backed up, the snapshot is deleted and the config points to the just backed up disks again. Then, as a last step the config files are backed up.
+
[[Affa]] supports hot backing up virtual machines running on the VMWare ESXi server. It uses the VMware Infrastructure Perl Toolkit to communicate with the EXSi and rsync over ssh to transfer the data. Before the backup starts, the state of the running VM is freezed by creating a snapshot of all its disks. After the freezed virtual disk files were backed up, the snapshot is deleted and the config points to the just backed up disks again. Then, as a last step the config files are backed up.
   −
A restore of a VM can be done by simply copying back all archived files to the original location on the ESXi host. It is also possible to copy the files to a different directory (or to another ESXi server) and add the vmx file to the inventory.
+
A restore of a VM can be done by simply copying back all archived files to the original location on the ESXi host. It is also possible to copy the files to a different directory (or to another ESXi server) and add the vmx file to the inventory. Alternatively with SambaShare=yes the VMWare Converter tool can be used.
   −
Latest Affa version is '''smeserver-affa-2.0.0-beta21'''
      
{{Note box|This document is applicable to ESX3i with an USB boot device. It will most likely not work with other type of boot devices}}
 
{{Note box|This document is applicable to ESX3i with an USB boot device. It will most likely not work with other type of boot devices}}
   −
{{Warning box|As Affa Version 2 is in a BETA state, errors in design and/or implementation cannot be completely eliminated. Therefore take precautions to avoid negative impacts to your system. In particular do not use it on production systems.}}
+
{{Warning box|This software comes 'as is' without any warranty.  Errors in design and/or implementation cannot be completely eliminated. Therefore take precautions to avoid negative impacts to your system.}}
    
=== Preparing the Affa Server ===
 
=== Preparing the Affa Server ===
==== VMware Infrastructure (VI) Perl Toolkit ====
+
==== Affa Installation ====
 +
Install the Affa program as descibed here: [[Affa#Installation_or_Update]]
 +
 
 +
==== VMware Infrastructure (VI) Perl Toolkit Installation ====
 
===== Configure the DAG repository =====
 
===== Configure the DAG repository =====
 
{{Repository|dag}}
 
{{Repository|dag}}
Line 38: Line 40:  
XML::NamespaceSupport
 
XML::NamespaceSupport
   −
==== Install Affa Version 2 beta ====
+
 
Install the '''latest''' Affa 2.x beta version. Download the RPM from http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Affa2
  −
/usr/bin/yum --enable=dag localinstall smeserver-affa-2.0.0-beta*.noarch.rpm
      
=== Preparing the ESXi Host for use with Affa ===
 
=== Preparing the ESXi Host for use with Affa ===
To make the ESXi server ready to cooperate with Affa you must install the rsync program, enable the ssh service, configure passwordless ssh login and add a user for communication using the VMware Infrastructure (VI) Perl Toolkit.
+
To make the ESXi server ready to cooperate with Affa you must install the rsync program, enable the ssh service, configure passwordless ssh login and add a user for API communication using the VMware Infrastructure (VI) Perl Toolkit.
 
==== Adding an ESXi User with restricted Permissions ====
 
==== Adding an ESXi User with restricted Permissions ====
 
Run the Virtual Infrastructure Client and logon to the ESXi host.
 
Run the Virtual Infrastructure Client and logon to the ESXi host.
Line 79: Line 79:  
Download the tarball. The tarball contains the rsync binary and the script.  
 
Download the tarball. The tarball contains the rsync binary and the script.  
 
  cd /bootbank
 
  cd /bootbank
  wget http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Affa2/affa-esxi-setup-02.tgz  
+
  wget <nowiki>http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Affa2/affa-esxi-setup-02.tgz</nowiki>
 
Verify the download
 
Verify the download
   wget http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Affa2/affa-esxi-setup-02.tgz.md5sum  
+
   wget <nowiki>http://mirror.contribs.org/smeserver/contribs/michaelw/sme7/Affa2/affa-esxi-setup-02.tgz.md5sum</nowiki>
 
   md5sum -c affa-esxi-setup-02.tgz.md5sum
 
   md5sum -c affa-esxi-setup-02.tgz.md5sum
 
Unpack it
 
Unpack it
Line 96: Line 96:  
Assume you want to backup the virtual machine named 'myvm' on ESXi server with IP 10.200.48.5.
 
Assume you want to backup the virtual machine named 'myvm' on ESXi server with IP 10.200.48.5.
   −
1. log into the 'affabox' and copy the config helper script
+
* log into the 'affabox' and copy the config helper script
 
  cp -a /usr/lib/affa/jobconfig-esxi-sample.pl /root/esxi-myvm-job.pl
 
  cp -a /usr/lib/affa/jobconfig-esxi-sample.pl /root/esxi-myvm-job.pl
2. edit <tt>/root/esxi-myvm-job.pl</tt> and set
+
* edit <tt>/root/esxi-myvm-job.pl</tt> and set
 
  my $jobname='esxi-myvm';
 
  my $jobname='esxi-myvm';
 
and
 
and
 
  'remoteHostName‘=>'10.200.48.5',
 
  'remoteHostName‘=>'10.200.48.5',
3. tell Affa that this job backups a ESXi virtual machine
+
* tell Affa that this job backups a ESXi virtual machine
 
  'ESXi' => 'yes',
 
  'ESXi' => 'yes',
4. set the VM name
+
* set the VM name
 
  'ESXiVMName' => 'myvm',
 
  'ESXiVMName' => 'myvm',
5. set the username and password (this is the ESXi User with restricted permissions created above)
+
* set the username and password (this is the ESXi User with restricted permissions created above)
 
  'ESXiUsername' => 'affa',
 
  'ESXiUsername' => 'affa',
 
  'ESXiPassword' => 'secret',
 
  'ESXiPassword' => 'secret',
6. configure virtual disk files to be compressed and chunked
+
* configure virtual disk files to be compressed and chunked
 
  'chunkFiles' => '*.vmdk',
 
  'chunkFiles' => '*.vmdk',
7. save the script, then run it
+
* save the script, then run it
 
  /root/esxi-myvm-job.pl
 
  /root/esxi-myvm-job.pl
8. send the public key
+
* send the public key
 
  affa --send-key esxi-myvm
 
  affa --send-key esxi-myvm
9. run the job manually
+
* run the job manually
 
  affa --run esxi-myvm
 
  affa --run esxi-myvm
   Line 133: Line 133:     
=== Addtional Information ===
 
=== Addtional Information ===
===== New properties in Affa 2 =====
  −
{| border="1" cellpadding="3" cellspacing=0
  −
|-
  −
| '''Property''' || '''Value''' || '''Default''' || '''Description'''
  −
|-
  −
| ESXi
  −
| yes ''or'' no || no || enable VMware ESXi virtual machine backup mode
  −
|-
  −
| ESXiVMName
  −
| string || || The name of the VM as displayed in the VI Client
  −
|-
  −
| ESXiUsername
  −
| string || || The name of the VI client with permission to created an delete snapshots
  −
|-
  −
| ESXiPassword
  −
| string || || The password of the user ESXiUsername
  −
|-
  −
| chunkFiles
  −
| string || || Filenames that Affa should chunk and compress. Multiple file names are to be separated by the slash (/) character, e.g. 'mysql.dump/pgsql.dump' chunks the two files mysql.dump and pgsql.dump. With ESXi=yes it is implicitly set to '*.vmdk'
  −
|-
  −
| SambaShare
  −
| yes ''or'' no|| yes || Access to the job archives via SMB
  −
|-
  −
| rsyncOptions
  −
| string || || addtional option string to be passed to rsync
  −
|}
     −
===== New command line options in Affa 2 =====
  −
affa --unchunk-archive JOB ARCHIVE
  −
Concatenate and uncompress all chunked files in the archive ARCHIVE of job JOB to make the archive ready for a restore. Note that the most recent archive scheduled.0 is never chunked and therfore can be restored as it is without previous unchunking.
     −
affa --chunk-archive JOB ARCHIVE
  −
Chunk and compress all files that match the names in property chunkFiles to save disk space. The should only be used as the reversal of --unchunk-archive. Chunks are stored as bzip2 files in a directory named FILENAME.affa-chunks with 8 levels depth.
     −
affa --disk-usage
  −
Shows the current disk usage of all root dir filesystems
      
===== How to update the ESXi System Image =====
 
===== How to update the ESXi System Image =====
Line 198: Line 165:     
===== How to make a statically linked Rsync Binary =====
 
===== How to make a statically linked Rsync Binary =====
 
+
''(This is just for information. A pre-build Rsync static is included in the affa-esxi-setup-*.tgz tarball)''
1. download the source from http://rsync.samba.org/
+
* download the source from http://rsync.samba.org/
 
+
* unpack the tarball
2. unpack the tarball
   
  tar xzf rsync-3.0.4.tar.gz
 
  tar xzf rsync-3.0.4.tar.gz
 
  cd rsync-3.0.4
 
  cd rsync-3.0.4
3. build the statically linked binary
+
* build the statically linked binary
 
  make CFLAGS="-static" EXEEXT="-static"
 
  make CFLAGS="-static" EXEEXT="-static"
 
  strip rsync-static
 
  strip rsync-static
501

edits

Navigation menu