Bug 1034993
Summary: | [libvirt] can create live snapshot of passthrough device (iSCSI LUN or block device) | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Ademar Reis <areis> | |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 7.0 | CC: | acathrow, bili, chayang, chhu, dallan, dyuan, juzhang, michen, mzhan, pbonzini, pkrempa, qzhang, shyu, sluo, virt-maint, xfu | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-1.1.1-25.el7 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | 1032369 | |||
: | 1073368 (view as bug list) | Environment: | ||
Last Closed: | 2014-06-13 09:23:42 UTC | Type: | Bug | |
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: | 1032369, 1032393 | |||
Bug Blocks: | 1073368, 1131974 |
Description
Ademar Reis
2013-11-26 20:08:38 UTC
I've posted a patch to provide an error message before even attempting to reach qemu with flawed snapshot attempts: http://www.redhat.com/archives/libvir-list/2014-January/msg00956.html Libvirt isn't using -snapshot=on. For external snapshots while the VM is running I've pushed the following patch: commit 3d1e9e47794f95b9862a3f75d268380b7b700687 Author: Peter Krempa <pkrempa> Date: Tue Jan 21 15:34:39 2014 +0100 qemu: snapshot: Forbid snapshots when backing is a scsi passthrough disk https://bugzilla.redhat.com/show_bug.cgi?id=1034993 SCSI passthrough disks (<disk .. device="lun">) can't be used as backing for snapshots. Currently with upstream qemu the vm crashes on such attempt. This patch adds a early check to catch an attempt to do such a snapshot and rejects it right away. qemu will fix the issue but this will let us control the error message. Reproduced with packages: libvirt-1.1.1-23.el7.x86_64 qemu-kvm-rhev-1.5.3-47.el7.x86_64 Try to verified with packages: libvirt-1.1.1-25.el7.x86_64 qemu-kvm-rhev-1.5.3-50.el7.x86_64 Test steps: 1. start a guest with xml below: #virsh define r7-iscsi.xml Domain r7 defined from r7-iscsi.xml #virsh start r7 Domain r7 started #virsh dumpxml r7|grep disk -A 8 <disk type='block' device='lun'> <driver name='qemu' type='raw'/> <source dev='/dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi-lun-1'/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> #ps -ef|grep r7| grep iscsi ....... -drive file=/dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi-lun-1,if=none,id=drive-scsi0-0-0-0,format=raw -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ...... 2. Try to do live snapshots #virsh snapshot-create-as r7 s1 error: unsupported configuration: internal snapshot for disk sda unsupported for storage type raw #virsh snapshot-create-as r7 snap1 --disk-only --diskspec sda,file=/tmp/r7-snap1 error: unsupported configuration: external active snapshots are not supported on scsi passthrough devices #virsh snapshot-create-as r7 snap2 --memspec file=snap2,snapshot=external --diskspec sda,file=/tmp/r7-snap2 error: unsupported configuration: external active snapshots are not supported on scsi passthrough devices Test results: external active snapshots are not supported. Hi, Peter I covered below xmls as well. Not sure if they are needed. Will you please help to check if we need to cover these tests? Many thanks! Try to verified with packages: libvirt-1.1.1-25.el7.x86_64 qemu-kvm-rhev-1.5.3-50.el7.x86_64 Test steps: 1. start a guest with iscsi lun with disk type='network'. #virsh dumpxml r7|grep disk <disk type='network' device='lun'> <driver name='qemu' type='raw'/> <source protocol='iscsi' name='iqn.2013-10.com.example:iscsi/1'> <host name='10.66.7.108' port='3260'/> </source> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> #virsh list --all Id Name State ---------------------------------------------------- 26 r7 running #ps -ef|grep qemu| grep r7 qemu 18795 1 1 17:17 ? 00:00:00 /usr/libexec/qemu-kvm -name r7 ...... -drive file=iscsi://10.66.7.108:3260/iqn.2013-10.com.example%3Aiscsi/1,if=none,id=drive-scsi0-0-0-0,format=raw -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ...... #virsh snapshot-create-as r7 s1 error: unsupported configuration: internal snapshot for disk sda unsupported for storage type raw #virsh snapshot-create-as r7 snap1 --disk-only --diskspec sda,file=/tmp/r7-snap1 error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied #virsh snapshot-create-as r7 snap2 --memspec file=snpa2,snapshot=external --diskspec sda,file=/tmp/r7-snap2 error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied 2. start a gust with xml below: <disk type='volume' device='disk'> <driver name='qemu'/> <source pool='pool-iscsi' volume='unit:0:0:1' mode='host'/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='scsi' index='0' model='virtio-scsi'> <alias name='scsi0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </controller> #ps -ef|grep qemu-kvm| grep iscsi qemu 12673 1 4 16:27 ? 00:00:26 /usr/libexec/qemu-kvm -name r7 ....... -drive file=/dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi-lun-1,if=none,id=drive-scsi0-0-0-0 -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ...... #virsh snapshot-create-as r7 s1 Domain snapshot s1 created #virsh snapshot-create-as r7 snap1 --disk-only --diskspec vda,file=/tmp/r7-snap1 Domain snapshot snap1 created #virsh snapshot-create-as r7 snap2 --memspec file=snap2,snapshot=external --diskspec vda,file=/tmp/r7-snap2 Domain snapshot snap2 created #virsh snapshot-list r7 Name Creation Time State ------------------------------------------------------------ s1 2014-03-04 16:38:33 +0800 running snap1 2014-03-04 16:33:40 +0800 disk-snapshot snap2 2014-03-04 16:34:31 +0800 running (In reply to chhu from comment #9) > -drive > file=iscsi://10.66.7.108:3260/iqn.2013-10.com.example%3Aiscsi/1,if=none, > id=drive-scsi0-0-0-0,format=raw -device > scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0, > id=scsi0-0-0-0,bootindex=1 > ...... Paolo, is this combination invalid similar to using the initiator in the host? > > #virsh snapshot-create-as r7 s1 > error: unsupported configuration: internal snapshot for disk sda unsupported > for storage type raw > > #virsh snapshot-create-as r7 snap1 --disk-only --diskspec > sda,file=/tmp/r7-snap1 > error: internal error: unable to execute QEMU command 'transaction': Could > not create file: Permission denied > > #virsh snapshot-create-as r7 snap2 --memspec file=snpa2,snapshot=external > --diskspec sda,file=/tmp/r7-snap2 > error: internal error: unable to execute QEMU command 'transaction': Could > not create file: Permission denied > Thanks, Peter Yes, it is. It's just an ugly error message though, right? Try to verified with packages: libvirt-1.1.1-25.el7.x86_64 qemu-kvm-rhev-1.5.3-50.el7.x86_64 Test steps: 1. Try to start a guest with a scsi passthrough qcow2 disk, met the same error as qemu-kvm bug1032369 # qemu-img create -f qcow2 /dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi-lun-1 20G Formatting '/dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi-lun-1', fmt=qcow2 size=21474836480 encryption=off cluster_size=65536 lazy_refcounts=off # virsh define r7-iscsi.xml Domain r7 defined from r7-iscsi.xml # virsh dumpxml r7| grep disk -A 6 <disk type='block' device='lun'> <driver name='qemu' type='qcow2'/> <source dev='/dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi-lun-1'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start r7 error: Failed to start domain r7 error: internal error: early end of file from monitor: possible problem: qemu-kvm: -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1: scsi-block: scsi generic interface too old qemu-kvm: -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1: Device initialization failed. qemu-kvm: -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1: Device 'scsi-block' could not be initialized Test with packages: libvirt-1.1.1-25.el7.x86_64 qemu-kvm-rhev-1.5.3-50.el7.x86_64 Test steps: 1. start a guest with iscsi qcow2 disk: <disk type='network' device='disk'> # virsh dumpxml r7|grep disk -A 7 <disk type='network' device='disk'> <driver name='qemu' type='qcow2'/> <source protocol='iscsi' name='iqn.2013-10.com.example:iscsi/1'> <host name='10.66.7.108' port='3260'/> </source> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # ps -ef| grep iscsi qemu 10414 1 1 10:12 ? 00:00:00 /usr/libexec/qemu-kvm -name r7 ...... -drive file=iscsi://10.66.7.108:3260/iqn.2013-10.com.example%3Aiscsi/1,if=none,id=drive-scsi0-0-0-0,format=qcow2 -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ...... # virsh snapshot-create-as r7 s1 Domain snapshot s1 created # virsh snapshot-create-as r7 snap1 --disk-only --diskspec sda,file=/tmp/r7-snap1 error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied # virsh snapshot-create-as r7 snap2 --memspec file=snap2,snapshot=external --diskspec sda,file=/tmp/r7-snap2 error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied 2. start a guest with iscsi qcow2 disk: <disk type='volume' device='disk'> # virsh dumpxml r7|grep disk -A 7 <disk type='volume' device='disk'> <driver name='qemu'/> <source pool='pool-iscsi' volume='unit:0:0:1' mode='direct'/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # ps -ef|grep r7| grep iscsi qemu 11074 1 1 10:22 ? 00:00:00 /usr/libexec/qemu-kvm -name r7 ....... -drive file=iscsi://10.66.7.108:3260/iqn.2013-10.com.example%3Aiscsi/1,if=none,id=drive-scsi0-0-0-0 -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ...... # virsh snapshot-create-as r7 s1 Domain snapshot s1 created # virsh snapshot-create-as r7 snap1 --disk-only --diskspec sda,file=/tmp/r7-snap1 error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied # virsh snapshot-create-as r7 snap2 --memspec file=snap2,snapshot=external --diskspec sda,file=/tmp/r7-snap2 error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied Test results: Can create internal live snapshot. Can't create external snapshot, output error: "unable to execute QEMU command 'transaction': Could not create file: Permission denied" (In reply to chhu from comment #12) > Try to verified with packages: > libvirt-1.1.1-25.el7.x86_64 > qemu-kvm-rhev-1.5.3-50.el7.x86_64 > > Test steps: > 1. Try to start a guest with a scsi passthrough qcow2 disk, met the same > error as qemu-kvm bug1032369 > > # qemu-img create -f qcow2 > /dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi- > lun-1 20G > Formatting > '/dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi- > lun-1', fmt=qcow2 size=21474836480 encryption=off cluster_size=65536 > lazy_refcounts=off > > # virsh define r7-iscsi.xml > Domain r7 defined from r7-iscsi.xml > > # virsh dumpxml r7| grep disk -A 6 > <disk type='block' device='lun'> > <driver name='qemu' type='qcow2'/> > <source > dev='/dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example: > iscsi-lun-1'/> > <target dev='sda' bus='scsi'/> > <address type='drive' controller='0' bus='0' target='0' unit='0'/> > </disk> > > # virsh start r7 > error: Failed to start domain r7 > error: internal error: early end of file from monitor: possible problem: > qemu-kvm: -device > scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0, > id=scsi0-0-0-0,bootindex=1: scsi-block: scsi generic interface too old > qemu-kvm: -device > scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0, > id=scsi0-0-0-0,bootindex=1: Device initialization failed. > qemu-kvm: -device > scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0, > id=scsi0-0-0-0,bootindex=1: Device 'scsi-block' could not be initialized Met the same error, when using xml with: <disk type='network' device='lun'>, type='qcow2' # virsh dumpxml r7| grep disk -A 7 <disk type='network' device='lun'> <driver name='qemu' type='qcow2'/> <source protocol='iscsi' name='iqn.2013-10.com.example:iscsi/1'> <host name='10.66.7.108' port='3260'/> </source> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start r7 error: Failed to start domain r7 error: internal error: early end of file from monitor: possible problem: qemu-kvm: -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1: scsi-block: scsi generic interface too old qemu-kvm: -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1: Device initialization failed. qemu-kvm: -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1: Device 'scsi-block' could not be initialized Summary the test results of comment 8,9,12,13,14 as below: 1. test with xml below: <disk type='block' device='lun'> <driver name='qemu' type='raw'/> <source dev='/dev/disk/by-path/ip-10.66.7.108:3260-iscsi- iqn.2013-10.com.example:iscsi-lun-1'/> ....... qemu-kvm command line: scsi-block -drive file=/dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi-lun-1,if=none,id=drive-scsi0-0-0-0,format=raw -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ==Result: external active snapshots are not supported. PASS 2. test with xml below: <disk type='block' device='lun'> <driver name='qemu' type='qcow2'/> <source dev='/dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi-lun-1'/> ...... ==Result: start the guest met the same error as qemu-kvm bug1032369 3. test with xml below: <disk type='network' device='lun'> <driver name='qemu' type='raw'/> <source protocol='iscsi' name='iqn.2013-10.com.example:iscsi/1'> ...... qemu-kvm command line: scsi-block -drive file=iscsi://10.66.7.108:3260/iqn.2013-10.com.example%3Aiscsi/1,if=none,id=drive-scsi0-0-0-0,format=raw -device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ==Results: external active snapshot failed with error: error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied 4. test with xml below: <disk type='network' device='lun'> <driver name='qemu' type='qcow2'/> <source protocol='iscsi' name='iqn.2013-10.com.example:iscsi/1'> ==Result: start the guest met the same error as qemu-kvm bug1032369 5. test with xml below: <disk type='network' device='disk'> <driver name='qemu' type='qcow2'/> <source protocol='iscsi' name='iqn.2013-10.com.example:iscsi/1'> qemu-kvm command line: scsi-hd -drive file=iscsi://10.66.7.108:3260/iqn.2013-10.com.example%3Aiscsi/1,if=none,id=drive-scsi0-0-0-0,format=qcow2 -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ==Result: 1) internal active snapshot succeeded 2) external active snapshot failed with error: error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied 6. test with xml below: <disk type='network' device='disk'> <driver name='qemu' type='raw'/> <source protocol='iscsi' name='iqn.2013-10.com.example:iscsi/1'> qemu-kvm command line: -drive file=iscsi://10.66.7.108:3260/iqn.2013-10.com.example%3Aiscsi/1,if=none,id=drive-scsi0-0-0-0,format=raw -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ==Result: 1) internal active snapshot not support: PASS 2) external active snapshot failed with error: error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied 7. test with xml below: <disk type='volume' device='disk'> <driver name='qemu'/> <source pool='pool-iscsi' volume='unit:0:0:1' mode='direct'/> qemu-kvm command line: scsi-hd -drive file=iscsi://10.66.7.108:3260/iqn.2013-10.com.example%3Aiscsi/1,if=none,id=drive-scsi0-0-0-0 -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ==Result: 1) internal active snapshot succeeded 2) external active snapshot failed with error: error: internal error: unable to execute QEMU command 'transaction': Could not create file: Permission denied 8. test with xml below: <disk type='volume' device='disk'> <driver name='qemu'/> <source pool='pool-iscsi' volume='unit:0:0:1' mode='host'/> qemu-kvm command line: scsi-hd -drive file=/dev/disk/by-path/ip-10.66.7.108:3260-iscsi-iqn.2013-10.com.example:iscsi-lun-1,if=none,id=drive-scsi0-0-0-0 -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,id=scsi0-0-0-0,bootindex=1 ==Result: 1) internal active snapshot succeeded 2) external active snapshot succeeded Hi, Peter As the test according to the xml listed in the patch in comment 2 is PASS, according to the comment 15, step1 (or comment 8). And the related qemu-kvm bug is set on rhel-7.1.0. How about set this bug verified and clone it to 7.1 for the left issues? (In reply to chhu from comment #16) > Hi, Peter > > As the test according to the xml listed in the patch in comment 2 is PASS, > according to the comment 15, step1 (or comment 8). And the related qemu-kvm > bug is set on rhel-7.1.0. How about set this bug verified and clone it to > 7.1 for the left issues? I agree, we can figure out the rest in the next release as it's just improvement of error reporting. 1. The test according to the xml listed in the patch in comment 2 is PASS, according to the comment 15, step1 (or comment 8) 2. Do related test listed in comment 15, on libvirt-1.1.1-23.el7.x86_64, qemu-kvm-rhev-1.5.3-47.el7.x86_64, step2-step8 got the same results, no regression. Set this bug verified and will clone it to 7.1 for left issues. This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |