does the guest have a snapshot ?

Hi, i'm cuurently a bit confused if a guest does have a valid snapshot or not. This is the xml: ... <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/crispor_1604/crispor_1604.sn'/> <backingStore type='file' index='1'> <format type='raw'/> <source file='/var/lib/libvirt/images/crispor_1604/crispor_1604.img'/> <backingStore/> </backingStore> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> ... both files are currently in access by the respective qemu process. lsof: qemu-kvm 19533 root 13u REG 253,0 29761732608 12091393 /var/lib/libvirt/images/crispor_1604/crispor_1604.sn qemu-kvm 19533 root 14r REG 253,0 111561775513 44793857 /var/lib/libvirt/images/crispor_1604/crispor_1604.img Here are both files: pc60181:/var/lib/libvirt/images/crispor_1604 # ll ... -rw------- 1 root root 111561775513 Oct 22 15:23 crispor_1604.img -rw-r--r-- 1 root root 29761732608 Feb 7 15:13 crispor_1604.sn crispor_1604.sn has a recent timestamp. The snapshot is currently in use: virsh # domblklist crispor_1604 Target Source ------------------------------------------------ vda /var/lib/libvirt/images/crispor_1604/crispor_1604.sn But virsh does not show any snapshot: virsh # snapshot-list crispor_1604 Name Creation Time State ------------------------------------------------------------ So i'm a bit confused. Does it have a valid snapshot or not. How can i find out and how can i get rid of it ? Thanks. Bernd -- Bernd Lentes Systemadministration Institute for Metabolism and Cell Death (MCD) Building 35.34 - Raum 208 HelmholtzZentrum münchen bernd.lentes@helmholtz-muenchen.de phone: +49 89 3187 1241 phone: +49 89 3187 3827 fax: +49 89 3187 2294 http://www.helmholtz-muenchen.de/mcd Perfekt ist wer keine Fehler macht Also sind Tote perfekt Helmholtz Zentrum München Helmholtz Zentrum Muenchen Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH) Ingolstaedter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir.in Prof. Dr. Veronika von Messling Geschaeftsfuehrung: Prof. Dr. med. Dr. h.c. Matthias Tschoep, Kerstin Guenther Registergericht: Amtsgericht Muenchen HRB 6466 USt-IdNr: DE 129521671

On Fri, Feb 07, 2020 at 15:25:22 +0100, Lentes, Bernd wrote:
Hi,
i'm cuurently a bit confused if a guest does have a valid snapshot or not. This is the xml: ... <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/crispor_1604/crispor_1604.sn'/> <backingStore type='file' index='1'> <format type='raw'/> <source file='/var/lib/libvirt/images/crispor_1604/crispor_1604.img'/> <backingStore/> </backingStore> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> ...
both files are currently in access by the respective qemu process. lsof: qemu-kvm 19533 root 13u REG 253,0 29761732608 12091393 /var/lib/libvirt/images/crispor_1604/crispor_1604.sn qemu-kvm 19533 root 14r REG 253,0 111561775513 44793857 /var/lib/libvirt/images/crispor_1604/crispor_1604.img
Here are both files: pc60181:/var/lib/libvirt/images/crispor_1604 # ll ... -rw------- 1 root root 111561775513 Oct 22 15:23 crispor_1604.img -rw-r--r-- 1 root root 29761732608 Feb 7 15:13 crispor_1604.sn
crispor_1604.sn has a recent timestamp.
The snapshot is currently in use: virsh # domblklist crispor_1604 Target Source ------------------------------------------------ vda /var/lib/libvirt/images/crispor_1604/crispor_1604.sn
But virsh does not show any snapshot:
virsh # snapshot-list crispor_1604 Name Creation Time State ------------------------------------------------------------
Libvirt is probably lacking the metadata for the snapshot. That is not a problem though, because since libvirt doesn't support deletion of external snapshots anyways currently you'd need to use the below approach anyways.
So i'm a bit confused. Does it have a valid snapshot or not. How can i find out and how can i get rid of it ?
virsh blockcommit crispor_1604 vda --active --pivot in the case above. that merges the file='/var/lib/libvirt/images/crispor_1604/crispor_1604.sn'/ into file='/var/lib/libvirt/images/crispor_1604/crispor_1604.img'/ and finishes the job. If you have more complex backing chain you might want to use the --top and --base arguments to control which portion to merge as the command I've suggested merges everything into the bottom-most image.

----- On Feb 7, 2020, at 3:43 PM, Peter Krempa pkrempa@redhat.com wrote:
On Fri, Feb 07, 2020 at 15:25:22 +0100, Lentes, Bernd wrote: ...
Libvirt is probably lacking the metadata for the snapshot. That is not a problem though, because since libvirt doesn't support deletion of external snapshots anyways currently you'd need to use the below approach anyways.
virsh blockcommit crispor_1604 vda --active --pivot
in the case above. that merges the file='/var/lib/libvirt/images/crispor_1604/crispor_1604.sn'/ into file='/var/lib/libvirt/images/crispor_1604/crispor_1604.img'/ and finishes the job.
If you have more complex backing chain you might want to use the --top and --base arguments to control which portion to merge as the command I've suggested merges everything into the bottom-most image.
Hi Peter, i'm not lucky: virsh help blockcommit does not know --active or --pivot. virsh # help blockcommit SYNOPSIS blockcommit <domain> <path> [<bandwidth>] [<base>] [--shallow] [<top>] [--delete] [--wait] [--verbose] [--timeout <number>] [--async] 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 It does not say anything about the device. I tried: virsh # blockcommit crispor_1604 /var/lib/libvirt/images/crispor_1604.sn vda --wait --verbose error: bandwidth must be a number virsh # blockcommit crispor_1604 /var/lib/libvirt/images/crispor_1604.sn --wait --verbose error: invalid argument: No device found for specified path virsh # blockcommit crispor_1604 crispor_1604.sn --wait --verbose error: invalid argument: No device found for specified path virsh # blockcommit crispor_1604 vda --wait --verbose error: Operation not supported: committing the active layer not supported yet virsh # blockcommit crispor_1604 crispor_1604.sn --wait --verbose error: invalid argument: No device found for specified path virsh # blockcommit crispor_1604 crispor_1604.sn --verbose error: missing --wait option virsh # blockcommit crispor_1604 crispor_1604.sn error: invalid argument: No device found for specified path virsh # blockcommit crispor_1604 crispor_1604.sn vda error: bandwidth must be a number Am i missing something ? Is there an error or is my libvirt version to old ? If yes, would it be successfull to copy the files to a host with more recent libvirt, define it and then blockcommit ? I have libvirt 1.2.5-15.3 (host is SLES 11 SP4). Bernd Helmholtz Zentrum München Helmholtz Zentrum Muenchen Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH) Ingolstaedter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir.in Prof. Dr. Veronika von Messling Geschaeftsfuehrung: Prof. Dr. med. Dr. h.c. Matthias Tschoep, Kerstin Guenther Registergericht: Amtsgericht Muenchen HRB 6466 USt-IdNr: DE 129521671

On Fri, Feb 07, 2020 at 18:29:59 +0100, Lentes, Bernd wrote:
----- On Feb 7, 2020, at 3:43 PM, Peter Krempa pkrempa@redhat.com wrote:
On Fri, Feb 07, 2020 at 15:25:22 +0100, Lentes, Bernd wrote:
[...]
Am i missing something ? Is there an error or is my libvirt version to old ? If yes, would it be successfull to copy the files to a host with more recent libvirt, define it and then blockcommit ?
I have libvirt 1.2.5-15.3 (host is SLES 11 SP4).
Ah, this is probably too old. Well another option is to use: virsh blockpull VM vda This pulls in everything from the backing file into the overlay. This usually means more data transferred, but worked for longer time. The VM will then use the topmost image rather than the base.

----- On Feb 10, 2020, at 8:29 AM, Peter Krempa pkrempa@redhat.com wrote:
virsh blockpull VM vda
Hi Peter, that did the job. Thanks. Bernd Helmholtz Zentrum München Helmholtz Zentrum Muenchen Deutsches Forschungszentrum fuer Gesundheit und Umwelt (GmbH) Ingolstaedter Landstr. 1 85764 Neuherberg www.helmholtz-muenchen.de Aufsichtsratsvorsitzende: MinDir.in Prof. Dr. Veronika von Messling Geschaeftsfuehrung: Prof. Dr. med. Dr. h.c. Matthias Tschoep, Kerstin Guenther Registergericht: Amtsgericht Muenchen HRB 6466 USt-IdNr: DE 129521671
participants (2)
-
Lentes, Bernd
-
Peter Krempa