User Tools

Site Tools


virtualization:citrix:xenserver_backup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
virtualization:citrix:xenserver_backup [2012/10/20 12:09]
gcooper
— (current)
Line 1: Line 1:
-====== XenServer Backup ====== 
  
-===== Local Backup Disk or CIFS Share ===== 
- 
-http://www.computerforums.org/forums/server-articles/how-setup-live-xenservers-backups-208663.html 
- 
-  * The ''CLEARDOWN.sh'' script reclaims disk space from deleted snapshots 
-  * ''startvmbackup.sh'' is the script that will start the live backups of our XenServer VMs 
- 
-==== Install on the XenServer Host ==== 
- 
-<file> 
-mkdir /home/backup 
-mkdir /VM_Backup 
- 
-# Use a command like this if you want to send backups to a CIFS share 
-#mount -t cifs "//192.168.0.20/VM_Backup" -o username=username,password=password /VM_Backup 
- 
-cd /VM_Backup 
-wget http://www.andy-burton.co.uk/files/xenserver_backup/xenserver_backup.tar.gz 
-tar -xzf xenserver_backup.tar.gz 
-chmod 777 v* 
-</file> 
- 
-=== startvmbackup.sh === 
- 
-<file> 
-vi /home/backup/startvmbackup.sh 
-</file> 
- 
-<file> 
-#!/bin/bash 
-set -x 
- 
-# Dismount then remount backup share to be sure it's mounted 
-umount -f /VM_Backup 
- 
-#mount -t cifs "//192.168.0.20/VM_Backup" -o username=username,password=password /VM_Backup 
- 
-/VM_Backup/CLEARDOWN.sh 
- 
-/VM_Backup/vm_backup.sh 
- 
-/VM_Backups/CLEARDOWN.sh 
- 
-sleep 120 
- 
-/VM_Backups/CLEARDOWN.sh 
-</file> 
- 
-==== Configure The Scripts ==== 
- 
-Edit the ''vm_backup.cfg'' file: 
- 
-<file> 
-cd /VM_Backup 
-vi vm_backup.cfg 
-</file> 
- 
-Insert these two lines in the ''Settings'' section: 
- 
-<file> 
-# 
-# Settings 
-# 
- 
-VM_XENHOST=$(xe vm-list | grep 'Control domain on host' | awk -F ': ' '{ print $3 }') 
- 
-VM_XENUUID=$(xe vm-list params uuid=$(xe vm-list | grep -B1 $VM_XENHOST | grep uuid | awk -F ': ' '{ print $2 }') | grep resident-on | awk -F ': ' '{ print $2 }') 
-</file> 
- 
-Set log path: 
- 
-<file> 
-log_path="/VM_Backup/"$VM_XENHOST"/"$date".log" 
-</file>  
- 
-Set the backup destination: 
- 
-<file> 
-backup_dir="/VM_Backup/"$VM_XENHOST"/" 
-</file> 
- 
-Ensure only running VMs are backed up: 
- 
-<file> 
-backup_vms="running"  
-</file> 
- 
-Edit the ''vm_backup.lib'' file: 
- 
-<file> 
-vi vm_backup.lib 
-</file> 
virtualization/citrix/xenserver_backup.1350756545.txt.gz · Last modified: 2012/10/20 12:09 by gcooper