Bug 974001 - guest cannot automatically restore access to the exported devices after the passthrough SCSI device recovered
guest cannot automatically restore access to the exported devices after the p...
Status: CLOSED WORKSFORME
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: Paolo Bonzini
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-13 05:10 EDT by Sibiao Luo
Modified: 2014-12-11 08:12 EST (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-12-11 08:12:41 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sibiao Luo 2013-06-13 05:10:38 EDT
Description of problem:
Given that I passthrough SCSI device to guest, the KVM host lost access to the SCSI devices(e.g. due to a link failure or logout the iSCSI LUN), then the link got restored, those devices will be added back to the host. However, the KVM guest cannot automatically restore access to the exported devices.

Version-Release number of selected component (if applicable):
host info:
kernel-3.10.0-0.rc5.61.el7.x86_64
qemu-kvm-1.5.0-2.el7.x86_64
guest info:
kernel-3.10.0-0.rc5.61.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.login a iSCSI LUN and passthrough SCSI device to guest.
# iscsiadm --mode discovery --type sendtargets --portal 10.66.90.100 –discover
# iscsiadm -m node -T iqn.2001-05.com.equallogic:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259 -p 10.66.90.100 -l
# fdisk -l 
-----> /dev/sdb appear
# /usr/libexec/qemu-kvm -S -M q35 -cpu SandyBridge -enable-kvm -m 4096 -smp 2,sockets=2,cores=1,threads=1...-drive file=/dev/sdb,if=none,id=drive-data-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop,serial=QEMU-DISK2 -device virtio-scsi-pci,bus=pcie.0,addr=0x6,id=scsi0 -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0
2.check the passthrough device in guest.
# fdisk -l
3.KVM host lost access to the SCSI devices(e.g. due to a link failure or logout the iSCSI LUN).
# iscsiadm -m node -T iqn.2001-05.com.equallogic:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259 -p 10.66.90.100 --logout
# fdisk -l 
-----> /dev/sdb disappear
4.the link got restored, check the guest and host.
host] # fdisk -l 
guest] # fdisk -l
guest] # dmesg

Actual results:
after step 4, the KVM guest cannot automatically restore access to the exported devices. 
host] # fdisk -l 
-----> /dev/sdc appear
guest] # fdisk -l
-----> fail to check the disk info and prompt many i/o errors.

Expected results:
the iSCSI LUN should be /dev/sdb not sdc appear in KVM host.
the KVM guest should automatically restore access to the exported devices after the link got restored. 

Additional info:
Comment 1 Sibiao Luo 2013-06-13 05:11:34 EDT
guest kernel logs:
[  135.607341] sd 0:0:0:0: [sda]  
[  135.607363] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  135.607371] sd 0:0:0:0: [sda]  
[  135.607378] Sense Key : Aborted Command [current] 
[  135.607386] sd 0:0:0:0: [sda]  
[  135.607392] Add. Sense: I/O process terminated
[  135.607399] sd 0:0:0:0: [sda] CDB: 
[  135.607404] Read(10): 28 00 00 00 00 00 00 00 08 00
[  135.607416] end_request: I/O error, dev sda, sector 0
[  135.608330] Buffer I/O error on device sda, logical block 0
[  135.650282] sd 0:0:0:0: [sda]  
[  135.650305] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  135.650314] sd 0:0:0:0: [sda]  
[  135.650320] Sense Key : Aborted Command [current] 
[  135.650329] sd 0:0:0:0: [sda]  
[  135.650335] Add. Sense: I/O process terminated
[  135.650341] sd 0:0:0:0: [sda] CDB: 
[  135.650346] Read(10): 28 00 00 00 00 00 00 00 08 00
[  135.650358] end_request: I/O error, dev sda, sector 0
[  135.651268] Buffer I/O error on device sda, logical block 0
[  135.693299] sd 0:0:0:0: [sda]  
[  135.693320] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  135.693328] sd 0:0:0:0: [sda]  
[  135.693335] Sense Key : Aborted Command [current] 
[  135.693343] sd 0:0:0:0: [sda]  
[  135.693349] Add. Sense: I/O process terminated
[  135.693356] sd 0:0:0:0: [sda] CDB: 
[  135.693361] Read(10): 28 00 00 00 00 00 00 00 20 00
[  135.693373] end_request: I/O error, dev sda, sector 0
[  135.694284] Buffer I/O error on device sda, logical block 0
[  135.694284] Buffer I/O error on device sda, logical block 1
[  135.694284] Buffer I/O error on device sda, logical block 2
[  135.694284] Buffer I/O error on device sda, logical block 3
[  135.751242] sd 0:0:0:0: [sda]  
[  135.751260] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  135.751268] sd 0:0:0:0: [sda]  
[  135.751274] Sense Key : Aborted Command [current] 
[  135.751282] sd 0:0:0:0: [sda]  
[  135.751287] Add. Sense: I/O process terminated
[  135.751293] sd 0:0:0:0: [sda] CDB: 
[  135.751297] Read(10): 28 00 00 00 00 00 00 00 08 00
[  135.751307] end_request: I/O error, dev sda, sector 0
[  135.752228] Buffer I/O error on device sda, logical block 0
[  170.563323] sd 0:0:0:0: [sda]  
[  170.563347] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  170.563376] sd 0:0:0:0: [sda]  
[  170.563383] Sense Key : Aborted Command [current] 
[  170.563391] sd 0:0:0:0: [sda]  
[  170.563398] Add. Sense: I/O process terminated
[  170.563404] sd 0:0:0:0: [sda] CDB: 
[  170.563410] Read(10): 28 00 00 00 00 00 00 00 08 00
[  170.563422] end_request: I/O error, dev sda, sector 0
[  170.564308] Buffer I/O error on device sda, logical block 0
[  170.606272] sd 0:0:0:0: [sda]  
[  170.606295] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  170.606304] sd 0:0:0:0: [sda]  
[  170.606311] Sense Key : Aborted Command [current] 
[  170.606319] sd 0:0:0:0: [sda]  
[  170.606325] Add. Sense: I/O process terminated
[  170.606332] sd 0:0:0:0: [sda] CDB: 
[  170.606338] Read(10): 28 00 00 00 00 00 00 00 08 00
[  170.606350] end_request: I/O error, dev sda, sector 0
[  170.607257] Buffer I/O error on device sda, logical block 0
[  170.649293] sd 0:0:0:0: [sda]  
[  170.649316] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  170.649325] sd 0:0:0:0: [sda]  
[  170.649332] Sense Key : Aborted Command [current] 
[  170.649340] sd 0:0:0:0: [sda]  
[  170.649346] Add. Sense: I/O process terminated
[  170.649353] sd 0:0:0:0: [sda] CDB: 
[  170.649370] Read(10): 28 00 00 00 00 00 00 00 20 00
[  170.649382] end_request: I/O error, dev sda, sector 0
[  170.650278] Buffer I/O error on device sda, logical block 0
[  170.650278] Buffer I/O error on device sda, logical block 1
[  170.650278] Buffer I/O error on device sda, logical block 2
[  170.650278] Buffer I/O error on device sda, logical block 3
[  170.706756] sd 0:0:0:0: [sda]  
[  170.706786] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  170.706798] sd 0:0:0:0: [sda]  
[  170.706808] Sense Key : Aborted Command [current] 
[  170.706820] sd 0:0:0:0: [sda]  
[  170.706829] Add. Sense: I/O process terminated
[  170.706840] sd 0:0:0:0: [sda] CDB: 
[  170.706849] Read(10): 28 00 00 00 00 00 00 00 08 00
[  170.706868] end_request: I/O error, dev sda, sector 0
[  170.707740] Buffer I/O error on device sda, logical block 0
[  212.515320] sd 0:0:0:0: [sda]  
[  212.515343] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  212.515353] sd 0:0:0:0: [sda]  
[  212.515360] Sense Key : Aborted Command [current] 
[  212.515369] sd 0:0:0:0: [sda]  
[  212.515375] Add. Sense: I/O process terminated
[  212.515382] sd 0:0:0:0: [sda] CDB: 
[  212.515388] Read(10): 28 00 00 00 00 00 00 00 08 00
[  212.515401] end_request: I/O error, dev sda, sector 0
[  212.516307] Buffer I/O error on device sda, logical block 0
[  212.561668] sd 0:0:0:0: [sda]  
[  212.561690] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  212.561709] sd 0:0:0:0: [sda]  
[  212.561716] Sense Key : Aborted Command [current] 
[  212.561724] sd 0:0:0:0: [sda]  
[  212.561730] Add. Sense: I/O process terminated
[  212.561737] sd 0:0:0:0: [sda] CDB: 
[  212.561743] Read(10): 28 00 00 00 00 00 00 00 08 00
[  212.561755] end_request: I/O error, dev sda, sector 0
[  212.562652] Buffer I/O error on device sda, logical block 0
[  212.604418] sd 0:0:0:0: [sda]  
[  212.604440] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  212.604449] sd 0:0:0:0: [sda]  
[  212.604456] Sense Key : Aborted Command [current] 
[  212.604464] sd 0:0:0:0: [sda]  
[  212.604470] Add. Sense: I/O process terminated
[  212.604477] sd 0:0:0:0: [sda] CDB: 
[  212.604483] Read(10): 28 00 00 00 00 00 00 00 20 00
[  212.604495] end_request: I/O error, dev sda, sector 0
[  212.605403] Buffer I/O error on device sda, logical block 0
[  212.605403] Buffer I/O error on device sda, logical block 1
[  212.605403] Buffer I/O error on device sda, logical block 2
[  212.605403] Buffer I/O error on device sda, logical block 3
[  212.653283] sd 0:0:0:0: [sda]  
[  212.653307] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  212.653316] sd 0:0:0:0: [sda]  
[  212.653323] Sense Key : Aborted Command [current] 
[  212.653331] sd 0:0:0:0: [sda]  
[  212.653337] Add. Sense: I/O process terminated
[  212.653344] sd 0:0:0:0: [sda] CDB: 
[  212.653350] Read(10): 28 00 00 00 00 00 00 00 08 00
[  212.653362] end_request: I/O error, dev sda, sector 0
[  212.654269] Buffer I/O error on device sda, logical block 0
[  283.562331] sd 0:0:0:0: [sda]  
[  283.562353] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  283.562362] sd 0:0:0:0: [sda]  
[  283.562368] Sense Key : Aborted Command [current] 
[  283.562377] sd 0:0:0:0: [sda]  
[  283.562384] Add. Sense: I/O process terminated
[  283.562391] sd 0:0:0:0: [sda] CDB: 
[  283.562397] Read(10): 28 00 00 00 00 00 00 00 08 00
[  283.562409] end_request: I/O error, dev sda, sector 0
[  283.563319] Buffer I/O error on device sda, logical block 0
[  283.611153] sd 0:0:0:0: [sda]  
[  283.611178] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  283.611187] sd 0:0:0:0: [sda]  
[  283.611194] Sense Key : Aborted Command [current] 
[  283.611202] sd 0:0:0:0: [sda]  
[  283.611208] Add. Sense: I/O process terminated
[  283.611215] sd 0:0:0:0: [sda] CDB: 
[  283.611221] Read(10): 28 00 00 00 00 00 00 00 08 00
[  283.611233] end_request: I/O error, dev sda, sector 0
[  283.612140] Buffer I/O error on device sda, logical block 0
[  283.653341] sd 0:0:0:0: [sda]  
[  283.653361] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  283.653369] sd 0:0:0:0: [sda]  
[  283.653375] Sense Key : Aborted Command [current] 
[  283.653384] sd 0:0:0:0: [sda]  
[  283.653389] Add. Sense: I/O process terminated
[  283.653395] sd 0:0:0:0: [sda] CDB: 
[  283.653401] Read(10): 28 00 00 00 00 00 00 00 20 00
[  283.653412] end_request: I/O error, dev sda, sector 0
[  283.654329] Buffer I/O error on device sda, logical block 0
[  283.654329] Buffer I/O error on device sda, logical block 1
[  283.654329] Buffer I/O error on device sda, logical block 2
[  283.654329] Buffer I/O error on device sda, logical block 3
[  283.701276] sd 0:0:0:0: [sda]  
[  283.701293] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  283.701300] sd 0:0:0:0: [sda]  
[  283.701305] Sense Key : Aborted Command [current] 
[  283.701312] sd 0:0:0:0: [sda]  
[  283.701318] Add. Sense: I/O process terminated
[  283.701323] sd 0:0:0:0: [sda] CDB: 
[  283.701327] Read(10): 28 00 00 00 00 00 00 00 08 00
[  283.701337] end_request: I/O error, dev sda, sector 0
[  283.702265] Buffer I/O error on device sda, logical block 0
[  305.256332] sd 0:0:0:0: [sda]  
[  305.256356] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  305.256366] sd 0:0:0:0: [sda]  
[  305.256373] Sense Key : Aborted Command [current] 
[  305.256381] sd 0:0:0:0: [sda]  
[  305.256388] Add. Sense: I/O process terminated
[  305.256395] sd 0:0:0:0: [sda] CDB: 
[  305.256401] Read(10): 28 00 00 00 00 00 00 00 08 00
[  305.256414] end_request: I/O error, dev sda, sector 0
[  305.257317] Buffer I/O error on device sda, logical block 0
[  305.299319] sd 0:0:0:0: [sda]  
[  305.299341] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  305.299350] sd 0:0:0:0: [sda]  
[  305.299357] Sense Key : Aborted Command [current] 
[  305.299365] sd 0:0:0:0: [sda]  
[  305.299372] Add. Sense: I/O process terminated
[  305.299378] sd 0:0:0:0: [sda] CDB: 
[  305.299384] Read(10): 28 00 00 00 00 00 00 00 08 00
[  305.299396] end_request: I/O error, dev sda, sector 0
[  305.300303] Buffer I/O error on device sda, logical block 0
[  305.342318] sd 0:0:0:0: [sda]  
[  305.342340] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  305.342349] sd 0:0:0:0: [sda]  
[  305.342355] Sense Key : Aborted Command [current] 
[  305.342363] sd 0:0:0:0: [sda]  
[  305.342370] Add. Sense: I/O process terminated
[  305.342377] sd 0:0:0:0: [sda] CDB: 
[  305.342382] Read(10): 28 00 00 00 00 00 00 00 20 00
[  305.342394] end_request: I/O error, dev sda, sector 0
[  305.343303] Buffer I/O error on device sda, logical block 0
[  305.343303] Buffer I/O error on device sda, logical block 1
[  305.343303] Buffer I/O error on device sda, logical block 2
[  305.343303] Buffer I/O error on device sda, logical block 3
[  305.398169] sd 0:0:0:0: [sda]  
[  305.398204] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  305.398213] sd 0:0:0:0: [sda]  
[  305.398230] Sense Key : Aborted Command [current] 
[  305.398239] sd 0:0:0:0: [sda]  
[  305.398246] Add. Sense: I/O process terminated
[  305.398252] sd 0:0:0:0: [sda] CDB: 
[  305.398258] Read(10): 28 00 00 00 00 00 00 00 08 00
[  305.398270] end_request: I/O error, dev sda, sector 0
[  305.402053] Buffer I/O error on device sda, logical block 0
[  330.265360] sd 0:0:0:0: [sda]  
[  330.265383] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  330.265393] sd 0:0:0:0: [sda]  
[  330.265400] Sense Key : Aborted Command [current] 
[  330.265409] sd 0:0:0:0: [sda]  
[  330.265416] Add. Sense: I/O process terminated
[  330.265423] sd 0:0:0:0: [sda] CDB: 
[  330.265429] Read(10): 28 00 00 00 00 00 00 00 08 00
[  330.265441] end_request: I/O error, dev sda, sector 0
[  330.266347] Buffer I/O error on device sda, logical block 0
[  330.305363] sd 0:0:0:0: [sda]  
[  330.305396] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  330.305404] sd 0:0:0:0: [sda]  
[  330.305411] Sense Key : Aborted Command [current] 
[  330.305420] sd 0:0:0:0: [sda]  
[  330.305426] Add. Sense: I/O process terminated
[  330.305433] sd 0:0:0:0: [sda] CDB: 
[  330.305439] Read(10): 28 00 00 00 00 00 00 00 08 00
[  330.305452] end_request: I/O error, dev sda, sector 0
[  330.309057] Buffer I/O error on device sda, logical block 0
[  330.348314] sd 0:0:0:0: [sda]  
[  330.348338] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  330.348356] sd 0:0:0:0: [sda]  
[  330.348363] Sense Key : Aborted Command [current] 
[  330.348372] sd 0:0:0:0: [sda]  
[  330.348379] Add. Sense: I/O process terminated
[  330.348386] sd 0:0:0:0: [sda] CDB: 
[  330.348392] Read(10): 28 00 00 00 00 00 00 00 20 00
[  330.348405] end_request: I/O error, dev sda, sector 0
[  330.349300] Buffer I/O error on device sda, logical block 0
[  330.349300] Buffer I/O error on device sda, logical block 1
[  330.349300] Buffer I/O error on device sda, logical block 2
[  330.349300] Buffer I/O error on device sda, logical block 3
[  330.405321] sd 0:0:0:0: [sda]  
[  330.405344] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[  330.405353] sd 0:0:0:0: [sda]  
[  330.405360] Sense Key : Aborted Command [current] 
[  330.405369] sd 0:0:0:0: [sda]  
[  330.405375] Add. Sense: I/O process terminated
[  330.405382] sd 0:0:0:0: [sda] CDB: 
[  330.405387] Read(10): 28 00 00 00 00 00 00 00 08 00
[  330.405399] end_request: I/O error, dev sda, sector 0
[  330.406309] Buffer I/O error on device sda, logical block 0
Comment 2 Sibiao Luo 2013-06-13 05:52:47 EDT
(In reply to Sibiao Luo from comment #0)
> Steps to Reproduce:
> 1.login a iSCSI LUN and passthrough SCSI device to guest.
> # iscsiadm --mode discovery --type sendtargets --portal 10.66.90.100
> –discover
> # iscsiadm -m node -T
> iqn.2001-05.com.equallogic:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-
> 172259 -p 10.66.90.100 -l
> # fdisk -l 
> -----> /dev/sdb appear
> # /usr/libexec/qemu-kvm -S -M q35 -cpu SandyBridge -enable-kvm -m 4096 -smp
> 2,sockets=2,cores=1,threads=1...-drive
> file=/dev/sdb,if=none,id=drive-data-disk,format=raw,cache=none,aio=native,
> werror=stop,rerror=stop,serial=QEMU-DISK2 -device
> virtio-scsi-pci,bus=pcie.0,addr=0x6,id=scsi0 -device
> scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0
I also use the udev /dev/disk/by-path devices which should be persistent after the devices being added back to the host, but still hit this issue that once the devices get removed from the host, access cannot be restored from the guest without a re-attach/reboot.
e.g:...-drive file=/dev/disk/by-path/ip-10.66.90.100\:3260-iscsi-iqn.2001-05.com.equallogic\:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259-lun-0,if=none,id=drive-data-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop,serial=QEMU-DISK2 -device virtio-scsi-pci,bus=pci.0,addr=0x8,id=scsi0 -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0
> 2.check the passthrough device in guest
> # fdisk -l
> 3.KVM host lost access to the SCSI devices(e.g. due to a link failure or
> logout the iSCSI LUN).
> # iscsiadm -m node -T
> iqn.2001-05.com.equallogic:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-
> 172259 -p 10.66.90.100 --logout
> # fdisk -l 
> -----> /dev/sdb disappear
> 4.the link got restored, check the guest and host.
> host] # fdisk -l 
> guest] # fdisk -l
> guest] # dmesg
>
Comment 3 Sibiao Luo 2013-06-13 06:10:30 EDT
When the link got restored, those devices will be added back to the host. However, the KVM guest cannot automatically restore access to the exported devices.
guest] # fdisk -l 
fdisk: cannot open /dev/sda: Input/output error

And the HMP monitor can't general any EIO, the VM status is running.
(qemu) info status 
VM status: running
(qemu)
Comment 4 Paolo Bonzini 2013-06-20 07:39:15 EDT
This cannot be fixed in qemu.

The fix for this is to use the userspace initiator to connect to iSCSI devices.  We need to document it, but the gist of it is to define the disk as follows:

    <disk type='network'>
      <driver name="qemu" type="raw"/>
      <source protocol="iscsi" name="iqn.2001-05.com.equallogic:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259">
        <host name="10.66.90.100"/>
      </source>
      <target dev="sda" bus="scsi"/>
    </disk>
Comment 5 Paolo Bonzini 2013-06-20 07:39:53 EDT
sluo, please test with this syntax.  We may need a new section of the test plan to test libiscsi.
Comment 6 Sibiao Luo 2013-06-20 21:55:53 EDT
(In reply to Paolo Bonzini from comment #4)
> This cannot be fixed in qemu.
> 
> The fix for this is to use the userspace initiator to connect to iSCSI
> devices.  We need to document it, but the gist of it is to define the disk
> as follows:
> 
>     <disk type='network'>
>       <driver name="qemu" type="raw"/>
>       <source protocol="iscsi"
> name="iqn.2001-05.com.equallogic:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-
> 172259">
>         <host name="10.66.90.100"/>
>       </source>
>       <target dev="sda" bus="scsi"/>
>     </disk>
Tested the rhel6 host which did not have such issue, the KVM guest can automatically restore access to the exported devices after the link got restored.
(In reply to Paolo Bonzini from comment #5)
> sluo, please test with this syntax.  We may need a new section of the test
> plan to test libiscsi.
OK, i will try it and paste the result here. I will add the new test case to TCMS after checking with you.

Best Regards,
sluo
Comment 9 Paolo Bonzini 2014-05-21 08:08:14 EDT
Ping? Is this a regression from RHEL6?
Comment 10 Sibiao Luo 2014-05-21 23:05:00 EDT
(In reply to Paolo Bonzini from comment #9)
> Ping? Is this a regression from RHEL6?
Yes, we can said that according to my testing in comment #6 as rhel6 host did not hit such issue.
Comment 11 Paolo Bonzini 2014-11-21 08:50:50 EST
Sibiao, have you ever tested that this works with libiscsi?  You probably did, but I couldn't find the result in this bug report.
Comment 12 Paolo Bonzini 2014-11-21 08:53:56 EST
> 3.KVM host lost access to the SCSI devices(e.g. due to a link failure or
> logout the iSCSI LUN).
> # iscsiadm -m node -T
> iqn.2001-05.com.equallogic:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259 
> -p 10.66.90.100 --logout

Logging out of the iSCSI initiator is not supported.  Are you also testing link failure with manual unplugging of the network cable and/or firewall?
Comment 13 Sibiao Luo 2014-11-26 20:05:33 EST
(In reply to Paolo Bonzini from comment #11)
> Sibiao, have you ever tested that this works with libiscsi?  You probably
> did, but I couldn't find the result in this bug report.
Sorry, i forgot it, i will retry it and paste the results here today.

(In reply to Paolo Bonzini from comment #12)
> > 3.KVM host lost access to the SCSI devices(e.g. due to a link failure or
> > logout the iSCSI LUN).
> > # iscsiadm -m node -T
> > iqn.2001-05.com.equallogic:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259 
> > -p 10.66.90.100 --logout
> 
> Logging out of the iSCSI initiator is not supported.
OK, thanks for your checking.

> Are you also testing
> link failure with manual unplugging of the network cable and/or firewall?
Yes, we always test it with unpluging the network cable and/or firewall, does it supporting ? Thanks.

Best Regards,
sluo
Comment 14 Sibiao Luo 2014-11-27 00:06:02 EST
(In reply to Paolo Bonzini from comment #11)
> Sibiao, have you ever tested that this works with libiscsi?  You probably
> did, but I couldn't find the result in this bug report.

Tried the "libiscsi + iptables" with qemu-kvm-1.5.3-82.el7.x86_64
 which the KVM guest **can** automatically restore access to the exported devices.
host info:
# uname -r && rpm -q qemu-kvm
3.10.0-205.el7.x86_64
qemu-kvm-1.5.3-82.el7.x86_64

(qemu) info status 
VM status: running
(qemu) qemu-kvm: iSCSI: NOP timeout. Reconnecting...

(qemu) info status 
VM status: running
(qemu) info block
drive-system-disk: removable=0 io-status=ok file=/home/RHEL-Server-7.1-64-virtio.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
drive-disk: removable=0 io-status=ok file=iscsi://10.66.90.100:3260/iqn.2001-05.com.equallogic:0-8a0906-4c41f7d03-453f49b421052a57-s2-sluo-270305-1/0 ro=0 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
...

##################################

Tried the "libiscsi + iptables" with qemu-kvm-rhev-2.1.2-8.el7.x86_64 which the KVM guest **can** automatically restore access to the exported devices.
host info:
# uname -r && rpm -q qemu-kvm-rhev
3.10.0-205.el7.x86_64
qemu-kvm-rhev-2.1.2-8.el7.x86_64

(qemu) info status 
VM status: running
(qemu) qemu-kvm: iSCSI: NOP timeout. Reconnecting...

(qemu) info status 
VM status: running
(qemu) info block
drive-system-disk: /home/RHEL-Server-7.1-64-virtio.qcow2 (qcow2)

drive-disk: iscsi://10.66.90.100:3260/iqn.2001-05.com.equallogic:0-8a0906-4c41f7d03-453f49b421052a57-s2-sluo-270305-1/0 (raw)
...

Best Regards,
sluo
Comment 15 Paolo Bonzini 2014-12-01 11:50:58 EST
Network cable and firewall are supported, with both iscsiadm and libiscsi.

Thanks!
Comment 16 Paolo Bonzini 2014-12-01 11:52:03 EST
Sibiao,

please test iscsiadm with: 1) network cable unplug from initiator, 2) network cable unplug from target, 3) iptables.  If it works, let's close this bug.  If there is no regression, let's move it to 7.2.
Comment 17 Sibiao Luo 2014-12-08 04:24:04 EST
(In reply to Paolo Bonzini from comment #16)
> Sibiao,
> 
> please test iscsiadm with: 1) network cable unplug from initiator, 2)
> network cable unplug from target, 3) iptables.  If it works, let's close
> this bug.  If there is no regression, let's move it to 7.2.

host info:
# uname -r && rpm -q qemu-kvm-rhev
3.10.0-211.el7.x86_64
qemu-kvm-rhev-2.1.2-15.el7.x86_64
guest info:
# uname -r
3.10.0-211.el7.x86_64

My qemu-kvm command line:
/usr/libexec/qemu-kvm -S -cpu SandyBridge,enforce -machine type=pc,dump-guest-core=off -enable-kvm -m 4096 -smp 4,sockets=1,cores=4,threads=1 -no-kvm-pit-reinjection -usb -device usb-tablet,id=input0 -name sluo -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -drive file=/home/RHEL-Server-7.1-64-virtio.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop -device virtio-scsi-pci,bus=pci.0,addr=0x4,id=scsi0 -device scsi-hd,drive=drive-system-disk,id=system-disk,bus=scsi0.0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:01:02:B6:40:21,bus=pci.0,addr=0x5 -device virtio-balloon-pci,id=ballooning,bus=pci.0,addr=0x6 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -k en-us -boot menu=on -qmp tcp:0:4444,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :1 -spice disable-ticketing,port=5931 -monitor stdio -drive file=/dev/disk/by-path/ip-10.66.90.100:3260-iscsi-iqn.2001-05.com.equallogic:0-8a0906-4fb1f7d03-455f49b421252a57-s2-sluo-270305-2-lun-0,if=none,id=drive-data-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop,serial=QEMU-DISK2 -device virtio-scsi-pci,bus=pci.0,addr=0x8,id=scsi1 -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi1.0

Test Results:
+-----------------------------------+-----------------------------------------+
| Test iscsiadm method              | Test Results                            |
+-----------------------------------+-----------------------------------------+
|unplug network cable from initiator|Generate EIO and recover successufully.  | 
+-----------------------------------+-----------------------------------------+
|unplug network cable from target   |Generate EIO and recover successufully.  |
+-----------------------------------+-----------------------------------------+
|use iptables to firewall iSCSI port|Generate EIO and recover successufully.  | 
+-----------------------------------+-----------------------------------------+

BTW, 
1.Here the IT cann't do unplug network cable from target, he just help offline/online the iscsi server, does it ok for you ?

2.During offline/onle the iscsi, guest appear some aborted log, does it acceptance fo you?
# dmesg
[ 1052.777096] sd 3:0:0:0: [sdb] abort
[ 1113.153045] INFO: rcu_sched detected stalls on CPUs/tasks: {} (detected by 1, t=85836 jiffies, g=11853, c=11852, q=0)
[ 1138.985904] INFO: Stall ended before state dump start
[ 1138.989145] sd 1:0:0:0: [sda] abort
[ 1138.993462] sd 1:0:0:0: [sda] abort
...
[ 1139.041639] sd 1:0:0:0: [sda] abort
[ 1139.042018] sd 1:0:0:0: [sda] abort

If you check there is no any issue above, please close this bug for free, thanks.

Best Regards,
sluo
Comment 18 Paolo Bonzini 2014-12-11 08:12:41 EST
Everything is as expected, thanks!

Note You need to log in before you can comment on or make changes to this bug.