Bug 1073368
Summary: | [libvirt] can create live snapshot of passthrough device (iSCSI LUN or block device) | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | chhu | |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> | |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | medium | Docs Contact: | ||
Priority: | medium | |||
Version: | 7.0 | CC: | areis, chayang, dyuan, juzhang, michen, mzhan, pbonzini, pkrempa, qzhang, rbalakri, shyu, sluo, virt-maint, xfu, yanyang | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-1.2.7-1.el7 | Doc Type: | Bug Fix | |
Doc Text: |
Cause:
Libvirt didn't treat the SCSI passthrough device as a host passthrough device which would usually block migration/snapshot and others.
Consequence:
Libvirt allowed the 'lun' passthrough devices for both local and iSCSI targets to be used with snapshot which wasn't supposed to work and caused qemu to crash or produce error message that didn't help diagnosing the problem.
Fix:
libvirt now correctly recognizes the 'lun' passthrough devices and forbids unsupported operations with a better error message.
|
Story Points: | --- | |
Clone Of: | 1034993 | |||
: | 1131974 (view as bug list) | Environment: | ||
Last Closed: | 2015-03-05 07:31:10 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, 1034993 | |||
Bug Blocks: | 1131974 |
Comment 1
chhu
2014-03-12 08:31:54 UTC
Fixed in v1.2.6-196-g1f4933f: commit 1f4933f0f40446136b290694a276cf29df567dfe Author: Peter Krempa <pkrempa> Date: Fri Jul 18 11:07:01 2014 +0200 qemu: snapshot: Forbid snapshots of iSCSI passthrough devices As with the local SCSI passthrough devicesm qemu can't support snapshots on those as the block ops are handled by the device. This is also true for iSCSI backing of the disk. Remove the check for the local block device and just forbid snapshot when the disk is of type 'lun'. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1073368 commit 2a483038009d0e4136af4edb045d5902ec102aa8 Author: Peter Krempa <pkrempa> Date: Fri Jul 18 11:05:08 2014 +0200 doc: domain: Clarify that disk type 'lun' works with iSCSI too Disk type 'lun' enables SCSI command passthrough for a disk. We stated that it works only with "block" disks. Qemu supports it also when using the iSCSI protocol. Hi Peter, I found that the error messages are not friendly enough when doing external memory only snapshot on scsi passthrough devices. Does it deserve a fix? Test on libvirt-1.2.8-4.el7.x86_64 and qemu-kvm-rhev-2.1.2-1.el7.x86_64 Test with active domain qe-con # virsh list --all Id Name State ---------------------------------------------------- 20 qe-con running Steps: 1. virsh dumpxml qe-con <disk type='network' device='lun'> <driver name='qemu' type='raw' cache='none'/> <source protocol='iscsi' name='iqn.yy:server.target1/1'> <host name='10.66.100.101' port='3260'/> </source> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh snapshot-create-as qe-con s1 error: unsupported configuration: internal snapshot for disk sda unsupported for storage type raw # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,file=/tmp/qe-con.s1 error: unsupported configuration: external active snapshots are not supported on scsi passthrough devices *************************** Hi Peter, The error messages are not friendly enough when doing external memory only snapshot. Does it deserve a fix? # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no error: internal error: unable to execute QEMU command 'migrate': State blocked by non-migratable device '0000:00:07.0/ich9_ahci' *************************** # virsh snapshot-create-as qe-con s1 --disk-only --diskspec sda,file=/tmp/qe-con.s1 error: unsupported configuration: external active snapshots are not supported on scsi passthrough devices 2. virsh dumpxml qe-con <disk type='network' device='lun'> <driver name='qemu' type='qcow2' cache='none'/> <source protocol='iscsi' name='iqn.yy:server.target2/1'> <host name='10.66.100.101' port='3260'/> </source> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start qe-con error: Failed to start domain qe-con error: internal error: process exited while connecting to monitor: 2014-09-28T03:54:54.149128Z 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: cannot get SG_IO version number: Operation not supported. Is this a SCSI device? 2014-09-28T03:54:54.149185Z 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. 2014-09-28T03:54:54.149202Z 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 3. virsh dumpxml qe-con <disk type='block' device='lun'> <driver name='qemu' type='raw' cache='none'/> <source dev='/dev/disk/by-path/ip-10.66.100.101:3260-iscsi-iqn.yy:server.target1-lun-1'/> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh snapshot-create-as qe-con s1 error: unsupported configuration: internal snapshot for disk sda unsupported for storage type raw # virsh snapshot-create-as qe-con s1 --memspec file=/tmp/s1 --diskspec sda,snapshot=external,file=/tmp/qe-con.s1 error: unsupported configuration: external active snapshots are not supported on scsi passthrough devices *************************** Hi Peter, The error messages are not friendly enough when doing external memory only snapshot. Does it deserve a fix? # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no error: internal error: unable to execute QEMU command 'migrate': State blocked by non-migratable device '0000:00:07.0/ich9_ahci' *************************** # virsh snapshot-create-as qe-con s1 --disk-only --diskspec sda,snapshot=external,file=/tmp/qe-con.s1 error: unsupported configuration: external active snapshots are not supported on scsi passthrough devices 4. virsh dumpxml qe-con <disk type='block' device='lun'> <driver name='qemu' type='qcow2' cache='none'/> <source dev='/dev/disk/by-path/ip-10.66.100.101:3260-iscsi-iqn.yy:server.target2-lun-1'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh start qe-con error: Failed to start domain qe-con error: internal error: process exited while connecting to monitor: 2014-09-28T05:02:31.837167Z 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: cannot get SG_IO version number: Operation not supported. Is this a SCSI device? 2014-09-28T05:02:31.837218Z 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. 2014-09-28T05:02:31.837236Z 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 5. virsh dumpxml qe-con <disk type='network' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source protocol='iscsi' name='iqn.yy:server.target1/1'> <host name='$ip' port='3260'/> </source> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh snapshot-create-as qe-con s1 error: unsupported configuration: internal snapshot for disk sda unsupported for storage type raw # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,file=/tmp/qe-con.s1 Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --disk-only --diskspec sda,file=/tmp/qe-con.s1 Domain snapshot s1 created 6. virsh dumpxml qe-con <disk type='network' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source protocol='iscsi' name='iqn.yy:server.target2/1'> <host name='$ip' port='3260'/> </source> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh snapshot-create-as qe-con s1 Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,file=/tmp/qe-con.s1 Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --disk-only --diskspec sda,file=/tmp/qe-con.s1 Domain snapshot s1 created 7. test with <disk type='volume' device='disk'> <driver name='qemu' type='raw'/> <source pool='iscsi' volume='unit:0:0:1' mode='direct'/> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh snapshot-create-as qe-con s1 error: unsupported configuration: internal snapshot for disk sda unsupported for storage type raw # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,file=/tmp/qe-con.s1 Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --disk-only --diskspec sda,file=/tmp/qe-con.s1 Domain snapshot s1 created 8. test with <disk type='volume' device='disk'> <driver name='qemu' type='raw'/> <source pool='iscsi' volume='unit:0:0:1' mode='host'/> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh snapshot-create-as qe-con s1 error: unsupported configuration: internal snapshot for disk sda unsupported for storage type raw # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no Domain snapshot s1 created # virsh snapshot-create-as qe-con s2 --memspec snapshot=external,file=/tmp/s2 --diskspec sda,file=/tmp/qe-con.s2 Domain snapshot s2 created # virsh snapshot-create-as qe-con s1 --disk-only --diskspec sda,file=/tmp/qe-con.s1 Domain snapshot s1 created 9. test with <disk type='volume' device='disk'> <driver name='qemu' type='qcow2'/> <source pool='iscsi' volume='unit:0:0:1' mode='direct'/> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh snapshot-create-as qe-con s1 Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,file=/tmp/qe-con.s1 Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --disk-only --diskspec sda,file=/tmp/qe-con.s1 Domain snapshot s1 created 10. test with <disk type='volume' device='disk'> <driver name='qemu' type='qcow2'/> <source pool='iscsi' volume='unit:0:0:1' mode='host'/> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh snapshot-create-as qe-con s1 Domain snapshot s1 created # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no Domain snapshot s1 created # virsh snapshot-create-as qe-con s2 --memspec snapshot=external,file=/tmp/s2 --diskspec sda,file=/tmp/qe-con.s2 Domain snapshot s2 created # virsh snapshot-create-as qe-con s1 --disk-only --diskspec sda,file=/tmp/qe-con.s1 Domain snapshot s1 created > The error messages are not friendly enough
> when doing external memory only snapshot.
> Does it deserve a fix?
>
> # virsh snapshot-create-as qe-con s1 --memspec
> snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no
> error: internal error: unable to execute QEMU command 'migrate': State blocked > by non-migratable device '0000:00:07.0/ich9_ahci'
Memory only snapshots are okay. They should work if you use the i440fx machine type instead of q35.
(In reply to Paolo Bonzini from comment #6) > > The error messages are not friendly enough > > when doing external memory only snapshot. > > Does it deserve a fix? > > > > # virsh snapshot-create-as qe-con s1 --memspec > > snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no > > error: internal error: unable to execute QEMU command 'migrate': State blocked > by non-migratable device '0000:00:07.0/ich9_ahci' > > Memory only snapshots are okay. They should work if you use the i440fx > machine type instead of q35. Thanks Paolo. Re-test with clean env. Memory only snapshots are created without error. 1. test with the following xml <disk type='network' device='lun'> <driver name='qemu' type='raw' cache='none'/> <source protocol='iscsi' name='iqn.2008-09.com.example:server.yy3/1'> <host name='$ip' port='3260'/> </source> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no Domain snapshot s1 created 2. test with the following xml <disk type='block' device='lun'> <driver name='qemu' type='raw' cache='none'/> <source dev='/dev/disk/by-path/ip-10.66.106.36:3260-iscsi-iqn.2008-09.com.example:server.yy3-lun-1'/> <backingStore/> <target dev='sda' bus='scsi'/> <alias name='scsi0-0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> # virsh snapshot-create-as qe-con s1 --memspec snapshot=external,file=/tmp/s1 --diskspec sda,snapshot=no Domain snapshot s1 created Thanks Yang Yang Accodding to comment 5 and 7, I'd like to set it to verified 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. https://rhn.redhat.com/errata/RHSA-2015-0323.html |