Bug 767104
Summary: | Libvirt shouldn't check the presence of the live snapshot file | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Federico Simoncelli <fsimonce> |
Component: | libvirt | Assignee: | Eric Blake <eblake> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 6.2 | CC: | abaron, acathrow, cpelland, dallan, danken, eblake, mzhan, nigil, rwu, whuang, zhpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-0.9.10-1.el6 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-06-20 06:38:47 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 638506, 747667, 768485, 773650, 773651, 773677, 773696, 782457 |
Description
Federico Simoncelli
2011-12-13 09:09:49 UTC
live snapshot code has been moved from qemu-kvm in 6.2GA and supposed to be re-introduced in 6.3 So libvirt fails with errors is expected, IMO. (In reply to comment #2) > live snapshot code has been moved from qemu-kvm in 6.2GA and supposed to be > re-introduced in 6.3 So libvirt fails with errors is expected, IMO. This wasn't removed from libvirt. In fact for qcow2 images on block devices it is working. Anyway I just noticed that libvirt is allowing to issue the live snapshot command even with qemu-kvm => 0.12.1.2-2.206, where the feature was disabled. (In reply to comment #3) > (In reply to comment #2) > > live snapshot code has been moved from qemu-kvm in 6.2GA and supposed to be > > re-introduced in 6.3 So libvirt fails with errors is expected, IMO. > > This wasn't removed from libvirt. In fact for qcow2 images on block devices it > is working. Anyway I just noticed that libvirt is allowing to issue the live > snapshot command even with qemu-kvm => 0.12.1.2-2.206, where the feature was > disabled. Hi, Federico Could you provide some details reproduce steps for this bug and qemu-kvm version? I try to reproduce it in my environment . Wenlong # qemu-img create -f qcow2 /tmp/test2.qcow2 10G Formatting '/tmp/test.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 # cat vm1.xml <domain type='kvm'> <name>vm1</name> <memory>131072</memory> <os> <type arch='x86_64' machine='rhel6.2.0'>hvm</type> <boot dev='hd'/> <bootmenu enable='no'/> </os> <devices> <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='writeback'/> <source file='/tmp/test.qcow2'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> </devices> </domain> # virsh create vm1.xml Domain vm1 created from vm1.xml # qemu-img create -f qcow2 /tmp/test2.qcow2 10G Formatting '/tmp/test2.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 # cat snapshot.xml <domainsnapshot> <disks> <disk name='/tmp/test.qcow2' snapshot='external'> <source file='/tmp/test2.qcow2'/> </disk> </disks> </domainsnapshot> # virsh snapshot-create --disk-only vm1 snapshot.xml error: unsupported configuration: external snapshot file for disk vda already exists and is not a block device: /tmp/test2.qcow2 Upstream patch under discussion: https://www.redhat.com/archives/libvir-list/2012-January/msg00291.html 6.3 will pick this up via rebase: commit 4e9953a426b44b40c5e0890abb73e0f90c454da5 Author: Eric Blake <eblake> Date: Mon Jan 9 11:57:46 2012 -0700 snapshot: allow reuse of existing files in disk snapshot When disk snapshots were first implemented, libvirt blindly refused to allow an external snapshot destination that already exists, since qemu will blindly overwrite the contents of that file during the snapshot_blkdev monitor command, and we don't like a default of data loss by default. But VDSM has a scenario where NFS permissions are intentionally set so that the destination file can only be created by the management machine, and not the machine where the guest is running, so that libvirt will necessarily see the destination file already existing; adding a flag will allow VDSM to force the file reuse without libvirt complaining of possible data loss. Tested with libvirt-0.9.10-1.el6.x86_64. # virsh dumpxml sss .... <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/rhel6_x86_64_qcow2.img'> <seclabel relabel='no'/> </source> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </disk> .... # qemu-img create -f qcow2 /tmp/test2.qcow2 10G Formatting '/tmp/test2.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 # cat snapshot.xml <domainsnapshot> <disks> <disk name='/tmp/test.qcow2' snapshot='external'> <source file='/tmp/test2.qcow2'/> </disk> </disks> </domainsnapshot> # virsh snapshot-create --disk-only sss snapshot.xml error: unsupported configuration: no disk named '/tmp/test.qcow2' This is expected results. Sorry about comment12, wrong steps. # virsh dumpxml sss .... <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/rhel6_x86_64_qcow2.img'> <seclabel relabel='no'/> </source> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </disk> .... # qemu-img create -f qcow2 /tmp/test2.qcow2 10G Formatting '/tmp/test2.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 # cat snapshot.xml <domainsnapshot> <disks> <disk name='/var/lib/libvirt/images/rhel6_x86_64_qcow2.img' snapshot='external'> <source file='/tmp/test2.qcow2'/> </disk> </disks> </domainsnapshot> # virsh snapshot-create --disk-only vm1 snapshot.xml error: unsupported configuration: external snapshot file for disk vda already exists and is not a block device: /tmp/test2.qcow2 # virsh snapshot-create --reuse-external --disk-only sss snapshot.xml Domain snapshot 1329276391 created from 'snapshot.xml' So it's verified. See also this upstream patch, which affects the use of the --reuse-external flag: https://www.redhat.com/archives/libvir-list/2012-March/msg00846.html and which will probably be folded into my storage migration patches for bug 638506 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0748.html Hi, Is it fixed in RHEL6.3? I am having the same issue. Please see log below: [root@lnx132-76 vol_vm_os_disk_f63]# lsb_release -r Release: 6.3 [root@lnx132-76 vol_vm_os_disk_f63]# rpm -qa | grep libvirt libvirt-python-0.9.10-21.el6.x86_64 libvirt-cim-0.6.1-3.el6.x86_64 libvirt-qmf-0.3.0-6.el6.x86_64 libvirt-snmp-0.0.2-3.el6.x86_64 libvirt-0.9.10-21.el6.x86_64 libvirt-client-0.9.10-21.el6.x86_64 fence-virtd-libvirt-0.2.3-9.el6.x86_64 libvirt-java-0.4.7-1.el6.noarch [root@lnx132-76 vol_vm_os_disk_f63]# virsh list Id Name State ---------------------------------------------------- 3 VM13-RHEL5U9-X86-64 running 7 VM17-WINXP-X86-32 running 8 VM18-WINVISTA-X86-64 running 9 vm19_win7_x86_64 running 12 VM12-RHEL6U2-X86-64 running 13 VM14-RHEL5U8-X86-64 running 30 VM15-Win2k3-x86-64 running 40 snap_vm2 running [root@lnx132-76 vol_vm_os_disk_f63]# virsh domblklist snap_vm2 Target Source ------------------------------------------------ vda /var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/snap_vm2.img hdc - [root@lnx132-76 vol_vm_os_disk_f63]# virsh dumpxml snap_vm2 <domain type='kvm' id='40'> <name>snap_vm2</name> <uuid>be863f03-65dc-de32-5b07-3b2821509a3c</uuid> <memory unit='KiB'>2097152</memory> <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>2</vcpu> <os> <type arch='x86_64' machine='rhel6.3.0'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' cache='none'/> <source file='/var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/snap_vm2.img'> <seclabel relabel='no'/> </source> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </disk> <disk type='block' device='cdrom'> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> </disk> <controller type='usb' index='0'> <alias name='usb0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <controller type='ide' index='0'> <alias name='ide0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <interface type='bridge'> <mac address='52:54:00:e4:7c:17'/> <source bridge='br0'/> <target dev='vnet0'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='pty'> <source path='/dev/pts/0'/> <target port='0'/> <alias name='serial0'/> </serial> <console type='pty' tty='/dev/pts/0'> <source path='/dev/pts/0'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> <input type='tablet' bus='usb'> <alias name='input0'/> </input> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='5900' autoport='yes'/> <sound model='ich6'> <alias name='sound0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> <model type='cirrus' vram='9216' heads='1'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <alias name='balloon0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </memballoon> </devices> <seclabel type='dynamic' model='selinux' relabel='yes'> <label>system_u:system_r:svirt_t:s0:c670,c932</label> <imagelabel>system_u:object_r:svirt_image_t:s0:c670,c932</imagelabel> </seclabel> </domain> [root@lnx132-76 vol_vm_os_disk_f63]# virsh domblklist snap_vm2 Target Source ------------------------------------------------ vda /var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/snap_vm2.img hdc - [root@lnx132-76 vol_vm_os_disk_f63]# virsh snapshot-create-as snap_vm2 snap_vm2_snaproot --diskspec vda,file=/var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/snap_vm2.img --disk-only --atomic error: unsupported configuration: external snapshot file for disk vda already exists and is not a block device: /var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/snap_vm2.img ------------- See another VM: snap_vm_rhel6u3 [root@lnx132-76 vol_vm_os_disk_f63]# virsh list Id Name State ---------------------------------------------------- 40 snap_vm2 running 41 snap_vm_rhel6u3 running [root@lnx132-76 vol_vm_os_disk_f63]# virsh dumpxml snap_vm_rhel6u3 <domain type='kvm' id='41'> <name>snap_vm_rhel6u3</name> <uuid>c1081d38-07b3-59c5-a9c9-07796d513fb8</uuid> <memory unit='KiB'>2095104</memory> <currentMemory unit='KiB'>2095104</currentMemory> <vcpu placement='static'>2</vcpu> <os> <type arch='x86_64' machine='rhel6.3.0'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' cache='none'/> <source file='/var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/vm11_rhel6u3_qcow2.img'> <seclabel relabel='no'/> </source> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </disk> <disk type='block' device='cdrom'> <target dev='hdc' bus='ide'/> <readonly/> <alias name='ide0-1-0'/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> </disk> <controller type='usb' index='0'> <alias name='usb0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <controller type='ide' index='0'> <alias name='ide0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <interface type='bridge'> <mac address='52:54:00:94:59:fc'/> <source bridge='br0'/> <target dev='vnet1'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='pty'> <source path='/dev/pts/6'/> <target port='0'/> <alias name='serial0'/> </serial> <console type='pty' tty='/dev/pts/6'> <source path='/dev/pts/6'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> <input type='tablet' bus='usb'> <alias name='input0'/> </input> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='5905' autoport='yes'/> <sound model='ich6'> <alias name='sound0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> <model type='cirrus' vram='9216' heads='1'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <alias name='balloon0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </memballoon> </devices> <seclabel type='dynamic' model='selinux' relabel='yes'> <label>system_u:system_r:svirt_t:s0:c402,c675</label> <imagelabel>system_u:object_r:svirt_image_t:s0:c402,c675</imagelabel> </seclabel> </domain> [root@lnx132-76 vol_vm_os_disk_f63]# virsh domblklist snap_vm_rhel6u3 Target Source ------------------------------------------------ vda /var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/vm11_rhel6u3_qcow2.img hdc - [root@lnx132-76 vol_vm_os_disk_f63]# virsh snapshot-create-as snap_vm_rhel6u3 snap_vm_rhel6u3_vm_rootsnap --diskspec vda,file=/var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/vm11_rhel6u3_qcow2.img --disk-only --atomic error: unsupported configuration: external snapshot file for disk vda already exists and is not a block device: /var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/vm11_rhel6u3_qcow2.img ============= Please let me know the status of this Bug as soon as possible. (In reply to comment #17) > Hi, > Is it fixed in RHEL6.3? Yes. > I am having the same issue. Not quite. > [root@lnx132-76 vol_vm_os_disk_f63]# virsh domblklist snap_vm2 > Target Source > ------------------------------------------------ > vda > /var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/snap_vm2.img > hdc - > > [root@lnx132-76 vol_vm_os_disk_f63]# virsh snapshot-create-as snap_vm2 > snap_vm2_snaproot --diskspec > vda,file=/var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/ > snap_vm2.img --disk-only --atomic That's a usage error on your part. The --diskspec file=/path must be to a NEW file (the new qcow2 file that you are creating that will point to the existing file), not to the existing file. Since snap_v2.img is already the existing file, passing file=/path/to/snap_v2.img is indeed invalid, > error: unsupported configuration: external snapshot file for disk vda > already exists and is not a block device: > /var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/snap_vm2.img so this is error message is expected, to inform you of your usage error. Thanks Eric, but now I am stuck with another error. [root@lnx132-76 ~]# virsh snapshot-create-as snap_vm2 snap_vm2_snaproot --diskspec vda,file=/var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/snap_vm2_snap1.img --disk-only --atomic error: operation failed: Failed to take snapshot: unknown command: 'snapshot_blkdev' Failed even without specifying disk img: virsh snapshot-create-as snap_vm2 snap_vm2_snaproot --disk-only --atomic error: operation failed: Failed to take snapshot: unknown command: 'snapshot_blkdev' And I read in net your comment that qemu packages in RHEL6.3 wont support this disk snapshot. (https://www.redhat.com/archives/libvirt-users/2012-November/msg00030.html). But doc "https://access.redhat.com/knowledge/solutions/269873" says we can. Is there any related bug and errata? See my libvirt and qemu rpms below. [root@lnx132-76 ~]# rpm -qa |grep libvirt libvirt-python-0.9.10-21.el6.x86_64 libvirt-cim-0.6.1-3.el6.x86_64 libvirt-qmf-0.3.0-6.el6.x86_64 libvirt-snmp-0.0.2-3.el6.x86_64 libvirt-0.9.10-21.el6.x86_64 libvirt-client-0.9.10-21.el6.x86_64 fence-virtd-libvirt-0.2.3-9.el6.x86_64 libvirt-java-0.4.7-1.el6.noarch [root@lnx132-76 ~]# rpm -qa |grep qemu qemu-kvm-0.12.1.2-2.295.el6.x86_64 gpxe-roms-qemu-0.9.7-6.9.el6.noarch qemu-kvm-tools-0.12.1.2-2.295.el6.x86_64 qemu-img-0.12.1.2-2.295.el6.x86_64 qemu-guest-agent-0.12.1.2-2.295.el6.x86_64 Thanks, Nigil (In reply to comment #19) > Thanks Eric, but now I am stuck with another error. > > [root@lnx132-76 ~]# virsh snapshot-create-as snap_vm2 snap_vm2_snaproot > --diskspec > vda,file=/var/lib/libvirt/images/vols_f3270_132_63/vol_vm_os_disk_f63/ > snap_vm2_snap1.img --disk-only --atomic > error: operation failed: Failed to take snapshot: unknown command: > 'snapshot_blkdev' That is an unfortunate side effect of you using RHEL 6 instead of RHEV 3; live disk snapshots are not supported in the RHEL 6 qemu. > > And I read in net your comment that qemu packages in RHEL6.3 wont support > this disk snapshot. > (https://www.redhat.com/archives/libvirt-users/2012-November/msg00030.html). > But doc "https://access.redhat.com/knowledge/solutions/269873" says we can. Please file a new bugzilla about the broken documentation; as it is unrelated to this bug. |