venerdì 23 marzo 2012

xenbackup-ng, for backing up your xenserver VMs with quiescent snapshot

Starting from Filippo Zanardo's Xenbackup, I wrote a modified version of his scripts, now tested and running on Citrix Xenserver 5.6 fp1 and Citrix Xenserver 6.0.2.

The script has the purpose to backup a Citrix Xenserver Guests Virtual Machines and it can be configured for doing it in different ways. 

Besides the Filippo's original version, I included some features:
  • Split configuration files: one for strings, one for operational parameters.
  • Added the Job feature: it is possible to create a job file in the job dir where general options can be overridden.
  • Selective VM backup: it is possible to declare a list of VMs that will be backed up.
  • Quiesce Snapshot on Windows VM: only with Xen VSS Provider installed on guest.
  • Preserve VM power state: in case of normal backup (Shutdown->Backup->Start) the original vm state will be preserved. So, if a VM is initially powered off it will not powered on after backup.
  • Improved email notifications: now is possible to receive a mail with a summary of operations executed or a verbose log of backup process. 

You can download the script direct from here or from my GitHub.

Dont't forget to change the mail address where you receive notification!

10 commenti:

  1. Thanks for your script, but i've got this error. What does it mean ?

    [root@Cluster-Node1 backup]# perl m3
    Missing right curly or square bracket at line 605, at end of line
    syntax error at line 605, at EOF
    Execution of aborted due to compilation errors.

  2. Sorry I linked the version in development.
    I've updated the link, you can re-download the script, wich is the stable one!

  3. Looks interesting, any plans for Hyper-V support?

    I am currently using SCST as an iSCSI Target for 3 Hyper-V servers, using HDD Images created via dd and exported via fileio device, so I imagine it would not be an issue right??

    Project looks promising, keep it up!!

    1. Are you talkin' about my storage distro or xenserver backup script? :P

    2. Talking about the Storage Distro.

    3. Sorry - Seems I posted it on the wrong Post :p

  4. No problem :)
    ... you can test with hyper-v and tell me if it works. In a few days I will release the "next step" version, which includes data deduplication. You can create a cluster resource that is a tie of drbd device, dedup file system and an iSCSI LUN pointing on a file seating on the dedup fs.

  5. Hello, Does anybody used this script on citrix xenserver 6?

  6. Hello, I'm using it in a production environment runnig Xenserver 6.0.2.

  7. Hello Riccardo,

    i'm using your script and its working wonderful except one thing: sending the mail after backup does not work at all.
    In /var/log/maillog there are always the same entries saying:
    Aug 1 12:46:05 xen-1 sSMTP[20593]: 501 Syntax error, parameters in command "MAIL FROM:" unrecognized or missing

    I have edited /etc/ssmtp/ssmtp.conf, its now:


    if i run the ssmtp manually using -v switch it says:

    [root@xen-1 ~]# ssmtp "
    [->] HELO _HOSTNAME_
    [<-] 250 Hello _HOSTNAME_ ([]), pleased to meet you
    >->] MAIL FROM:" unrecognized or missing

    if i do a "telnet 25" it is working fine:

    [root@xen-1 ~]# telnet 25
    Connected to
    Escape character is '^]'.
    220 "Welcome to ..."
    EHLO _HOSTNAME_ Hello _HOSTNAME_ ([]), pleased to meet you
    250-AUTH LOGIN
    250 Sender OK
    250 Recipient OK
    354 Enter message, end with "." on a line by itself
    Subject: testmail
    250 Message accepted for delivery

    What can i do for successfully sending the logs to my mailbox?

    Thanks in advance,