Discussion:
[libvirt-users] snapshot with libvirt tools or with lvm tools ?
Lentes, Bernd
2018-03-09 15:39:09 UTC
Permalink
Hi,

i asked already a time ago about snapshots. I have some guests, each resides in a raw file, placed on an ext3 fs which is on top of a logical volume, for each guest a dedicated lv.
The raw is not a "must have", if there are obvious reasons i can convert them to a qcow2.
What i want is a consistent backup of each guest taken overnight. If possible i won't have downtime.
I can use the libvirt tools, but the lvm way seems to be more elegant.
Before copying the file the guests resides in i take a snapshot from the respective lv. Then i mount the snapshot and transfer it via rsync on a CIFS share.
Rsync seems to be the appropriate tool because i just transfer the changes in the file compared to the file from a day before. So i don't have to transfer complete and big raw files but just the difference.

The guest still can be running, and after the transfer of the snapshot file i just delete it, and the next night the same procedure.

What do you think ?

Bernd
--
Bernd Lentes
Systemadministration
Institut für Entwicklungsgenetik
Gebäude 35.34 - Raum 208
HelmholtzZentrum münchen
[ mailto:***@helmholtz-muenchen.de | ***@helmholtz-muenchen.de ]
phone: +49 89 3187 1241
fax: +49 89 3187 2294
[ http://www.helmholtz-muenchen.de/idg | http://www.helmholtz-muenchen.de/idg ]

no backup - no mercy


Helmholtz Zentrum Muenchen
Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH)
Ingolstaedter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Heinrich Bassler, Dr. Alfons Enhsen
Registergericht: Amtsgericht Muenchen HRB 6466
USt-IdNr: DE 129521671
Lentes, Bernd
2018-03-09 18:05:32 UTC
Permalink
Post by Lentes, Bernd
Hi,
i asked already a time ago about snapshots. I have some guests, each resides in
a raw file, placed on an ext3 fs which is on top of a logical volume, for each
guest a dedicated lv.
The raw is not a "must have", if there are obvious reasons i can convert them to a qcow2.
What i want is a consistent backup of each guest taken overnight. If possible i
won't have downtime.
I can use the libvirt tools, but the lvm way seems to be more elegant.
Before copying the file the guests resides in i take a snapshot from the
respective lv. Then i mount the snapshot and transfer it via rsync on a CIFS
share.
Rsync seems to be the appropriate tool because i just transfer the changes in
the file compared to the file from a day before. So i don't have to transfer
complete and big raw files but just the difference.
The guest still can be running, and after the transfer of the snapshot file i
just delete it, and the next night the same procedure.
What do you think ?
It does not work as expected :-(
My lv's are clustered, but snapshotting a clustered lv requires to activate the source lv exclusively on one node, which is not possible when it's mounted and files on it are open.
So i have to try it with libvirt and qemu.
I'd like to create the snapshot while running the guest, take the backup, and merge (or commit) the changes after the copy procedure, still with a running guest.
Is there a way to do this ? I found https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit , but my software seems to be too old:
I have libvirt-1.2.5-23.3.1. But my virsh offers blockcommit:

virsh # help blockcommit
NAME
blockcommit - Start a block commit operation.

SYNOPSIS
blockcommit <domain> <path> [<bandwidth>] [<base>] [--shallow] [<top>] [--delete] [--wait] [--verbose] [--timeout <number>] [--async]

DESCRIPTION
Commit changes from a snapshot down to its backing image.

OPTIONS
[--domain] <string> domain name, id or uuid
[--path] <string> fully-qualified path of disk
[--bandwidth] <string> bandwidth limit in MiB/s
[--base] <string> path of base file to commit into (default bottom of chain)
--shallow use backing file of top as base
[--top] <string> path of top file to commit from (default top of chain)
--delete delete files that were successfully committed
--wait wait for job to complete
--verbose with --wait, display the progress
--timeout <number> with --wait, abort if copy exceeds timeout (in seconds)
--async with --wait, don't wait for cancel to finish

But it doesn't work ? Although help offers it ?

Bernd


Helmholtz Zentrum Muenchen
Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH)
Ingolstaedter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Heinrich Bassler, Dr. Alfons Enhsen
Registergericht: Amtsgericht Muenchen HRB 6466
USt-IdNr: DE 129521671
Lentes, Bernd
2018-03-09 18:59:06 UTC
Permalink
Post by Lentes, Bernd
It does not work as expected :-(
My lv's are clustered, but snapshotting a clustered lv requires to activate the
source lv exclusively on one node, which is not possible when it's mounted and
files on it are open.
So i have to try it with libvirt and qemu.
I'd like to create the snapshot while running the guest, take the backup, and
merge (or commit) the changes after the copy procedure, still with a running
guest.
Is there a way to do this ? I found
https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit , but my
virsh # help blockcommit
NAME
blockcommit - Start a block commit operation.
SYNOPSIS
blockcommit <domain> <path> [<bandwidth>] [<base>] [--shallow] [<top>]
[--delete] [--wait] [--verbose] [--timeout <number>] [--async]
DESCRIPTION
Commit changes from a snapshot down to its backing image.
OPTIONS
[--domain] <string> domain name, id or uuid
[--path] <string> fully-qualified path of disk
[--bandwidth] <string> bandwidth limit in MiB/s
[--base] <string> path of base file to commit into (default bottom of chain)
--shallow use backing file of top as base
[--top] <string> path of top file to commit from (default top of chain)
--delete delete files that were successfully committed
--wait wait for job to complete
--verbose with --wait, display the progress
--timeout <number> with --wait, abort if copy exceeds timeout (in seconds)
--async with --wait, don't wait for cancel to finish
But it doesn't work ? Although help offers it ?
Bernd
Hmm,

it seems i really have a version too old. This is what i get:

virsh # blockcommit windows7x64 /cluster/guests/servers_alive/sa_snap.qcow2 --wait --verbose
error: Operation not supported: committing the active layer not supported yet

Is there no way to achieve what i want ?


Bernd


Helmholtz Zentrum Muenchen
Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH)
Ingolstaedter Landstr. 1
85764 Neuherberg
www.helmholtz-muenchen.de
Aufsichtsratsvorsitzende: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrer: Prof. Dr. Guenther Wess, Heinrich Bassler, Dr. Alfons Enhsen
Registergericht: Amtsgericht Muenchen HRB 6466
USt-IdNr: DE 129521671

Loading...