Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


vzdump snapshot mode not working
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

vzdump snapshot mode not working

Hi,

I'm trying to use vzdump to backup a container and it is failing..

[root@ccg1 ~]# vzdump --compress --dumpdir /home/backup --snapshot 101 INFO: starting new backup job: vzdump --compress --dumpdir /home/backup --snapshot 101 INFO: Starting Backup of VM 101 (openvz) INFO: CTID 101 exist mounted running INFO: status = CTID 101 exist mounted running **INFO: mode failure - unable to detect lvm volume group** **INFO: trying 'suspend' mode instead** INFO: backup mode: suspend INFO: bandwidth limit: 10240 KB/s : :

I can't use solusvm or something similar because I just want to backup my own 5-6 vps only and not going to sell vps hosting.

Any one please help me fix this..

thanks.

Comments

  • ndelaespadandelaespada Member, Host Rep

    Try this:
    vzdump --dumpdir=/home/backup --suspend --compress 101

    Thanked by 1niceboy
  • smansman Member
    edited October 2013

    Is your /vz directory on an LVM partition? Try without the --snapshot.

    If you are using LVM check these things:

    You need to have at least 512MB free in your LVM volume group, to be able to create snapshots

    The directory where you are writing your backup dumps to (usually /vz/dump) should be on a different volume group than the one you are taking a backup from (usually /vz/private)

    There is a bug in VZDump.pm that can make the snapshot creation fail

    Fixing VZDump.pm

    When trying to backup a virtual machine, creation of the snapshot can fail. This is because of a bug in VZDump.pm. In CentOS (and other RHEL derivatives), this file is located in

    /usr/share/perl5/PVE/VZDump.pm

    On line 622, you will find the following:

    if ($line =~ m|^\s*(\S+):(\S+):(\d+(\.\d+))M$|) {

    Replace this with:

    if ($line =~ m|^\s*(\S+):(\S+):(\d+([\.,]\d+))[mM]$|) {

    Save and close the file.

    Snapshots will now work with vzdump

    http://openvz.org/Backup_of_a_running_container_with_vzdump

    Thanked by 1niceboy
  • @ndelaespada vzdump works in stop/suspend mode, but that causes considerable downtime as the container will be around 20-30gb in size. Hence, I would like to use it in snapshot mode which does not cause any downtime.

    @sman I already tried fixing vzdump.pm as given in your second method, but it does not work. As I just mentioned, without --snapshot, it does work. But, I need snapshot for taking a backup without any downtime.

    Is your /vz directory on an LVM partition?

    Btw, I don't know much about lvm partitions. I can see /vz folder in / but don't know if it is on lvm. If I need to put /vz on an lvm partition, how to do it? And, I have enough disk space available for backups.. Here is df -h..

    [root@ccg1 ~]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/vda1              30G  3.1G   25G  11% /
    tmpfs                 491M     0  491M   0% /dev/shm
    

    Please help.

  • prometeusprometeus Member, Host Rep

    which version of vzdump are using? The version available as rpm package has this problem with lvm. Just download the version available in a more recent tarball...

    Thanked by 1niceboy
  • @prometeus I dont know how to see vzdump version. I checked the manual page but there is no version option. I used the tutor at http://www.zedt.eu/tech/linux/install-vzdump-using-yum-on-centos/ to install vzdump.

  • prometeusprometeus Member, Host Rep

    Download this
    http://download2.proxmox.com/sources/vzdump_2011-09-13.tar.gz

    you need also cpio and perl-LockFile-Simple (usually into the epel repository)

    Thanked by 1niceboy
  • @prometeus I have downloaded http://download2.proxmox.com/sources/vzdump_2011-09-13.tar.gz

    perl-LockFile-Simple seems to be already on the system. Is there any tutor on how to use this?

    thanks.

  • prometeusprometeus Member, Host Rep

    remove the rpm package then

    tar xzf vzdump_2011-09-13.tar.gz 
    cd vzdump_2011-09-13
    make install
    

    then create a config /etc/vzdump.conf

    size:19480
    mode:snapshot
    

    where size is the size of the snapshot partition (you need this space to be available in your volume group).

    Thanked by 1niceboy
  • niceboyniceboy Veteran
    edited October 2013

    sorry for incorrect formatting..

  • Did you by any chance press control-c before it finished?

    Thanked by 1niceboy
  • Here it is..

    [root@ccg1 vzdump_2011-09-13]# make install
    rm -f vzdump.1.gz
    pod2man -n vzdump -s 1 -r 1.2 -c "Proxmox Documentation"  <vzdump |gzip -c9 >vzdump.1.gz
    rm -f vzrestore.1.gz
    pod2man -n vzrestore -s 1 -r 1.2 -c "Proxmox Documentation"  <vzrestore |gzip -c9 >vzrestore.1.gz
    sed -e s/@@ARCH@@/all/ -e s/@@VERSION@@/1.2/ -e s/@@PKGRELEASE@@/15/ <control.in >control
    install -d /usr/sbin
    install -m 0755 vzdump /usr/sbin
    install -m 0755 vzrestore /usr/sbin
    install -d /usr/share/man/man1/
    install -m 0644 vzdump.1.gz /usr/share/man/man1/
    install -m 0644 vzrestore.1.gz /usr/share/man/man1/
    install -d /usr/share/perl5/PVE
    install -m 0644 VZDump.pm /usr/share/perl5/PVE
    install -d /usr/share/perl5/PVE/VZDump
    install -m 0644 Plugin.pm /usr/share/perl5/PVE/VZDump
    install -m 0644 OpenVZ.pm /usr/share/perl5/PVE/VZDump
    

    I tried vzdump..

    [root@ccg1 vzdump_2011-09-13]# vzdump  --compress --dumpdir /home/backup --snapshot 101
    INFO: starting new backup job: vzdump --compress --dumpdir /home/backup --snapshot 101
    INFO: Starting Backup of VM 101 (openvz)
    INFO: CTID 101 exist mounted running
    INFO: status = CTID 101 exist mounted running
    INFO: mode failure - unable to detect lvm volume group
    INFO: trying 'suspend' mode instead
    INFO: backup mode: suspend
    INFO: ionice priority: 7
    INFO: starting first sync /vz/private/101/ to /home/backup/vzdump-openvz-101-2013_10_18-01_47_49.tmp
    ^CERROR: Backup of VM 101 failed - interrupted by signal
    ERROR: Backup job failed - interrupted by signal
    

    Same result.. :(

  • @rds100 Yes.. I did press Ctrl+C as the backup is using suspend mode again..

  • prometeusprometeus Member, Host Rep

    look like you're using the old perl module or there is some issue with your lvm setup....

    Thanked by 1niceboy
  • It seems it is not possible to use snapshot vzdump backups inside a kvm vps.

    Any one did tried this earlier and succeeded?

  • ndelaespadandelaespada Member, Host Rep

    do you have lvm?

    Thanked by 1niceboy
  • I only have the default configuration as given my kvm vps provider.

    I did try to display lvms, but it says "No lvm groups found". Therefore, I thought Its not possible to have snapshot backup inside kvm vps. Am I wrong?

  • @zen Is it possible to create lvm inside my kvm vps? If yes, how?

    I did go thru numerous googled articles on the subject and could not find any thing useful.

  • @zen could you please share one tutor for this? thx

  • @zen The problem is, most of the articles suggest to use lvm before installing the os and then resize according to the need.

    Since I get my kvm vps pre installed with os, Is there any way to do what they are suggesting?

  • smansman Member
    edited October 2013

    You can run vzdump --suspend. Only downtime is after the first rsync pass where it shuts down the container briefly and does a second rsync pass to catch changes that occurred during the first pass. I've used it quite a bit. Never had any problems.

    Thanked by 1niceboy
  • ndelaespadandelaespada Member, Host Rep

    It's only a matter of seconds when using suspend, of course, the bigger the VPS is (in size) the longer it takes but in my experience a 25gb vps can take about 60-75 secs suspended while a 1-2GB vps only takes about 2 seconds suspended.

    Thanked by 1niceboy
  • If it is just a matter of seconds, I'll use the suspend mode.

    Thanks everyone for all the help. :)

  • @sman said:
    You can run vzdump --suspend. Only downtime is after the first rsync pass where it shuts down the container briefly and does a second rsync pass to catch changes that occurred during the first pass. I've used it quite a bit. Never had any problems.

    on my 80GB large VM, this suspension/downtime and second rsync took almost 13 minutes, how can i have LVM? i have two hdds in softare raid:

    Filesystem Size Used Avail Use% Mounted on

    /dev/md2 2.0T 150G 1.8T 8% /

    tmpfs 7.7G 0 7.7G 0% /dev/shm

    /dev/md1 496M 30M 441M 7% /boot

Sign In or Register to comment.