Bug 1159420

Summary: Prevent migration of VMs using scsi reservation on virtio-scsi LUNs
Product: Red Hat Enterprise Virtualization Manager Reporter: Federico Simoncelli <fsimonce>
Component: ovirt-engineAssignee: Ala Hino <ahino>
Status: CLOSED CURRENTRELEASE QA Contact: lkuchlan <lkuchlan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: aburden, ahino, amureini, gklein, lpeer, lsurette, nsoffer, rbalakri, Rhev-m-bugs, yeylon, ykaul
Target Milestone: ovirt-3.6.0-rc   
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Previously, if a virtual machine had a virtio-scsi passthrough disk on a direct LUN, VDSM/QEMU had no way of knowing if the LUN had a reservation request against it. The virtual machine then was not prevented from being migrated, thus losing access to the disk. Now, you can mark a direct LUN as having SCSI reservation, which prevents migration of that virtual machine.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1111784, 1331277    

Description Federico Simoncelli 2014-10-31 22:11:03 UTC
Description of problem:
VMs with passthrough on virtio-scsi LUNs could be using scsi reservation. If the VM is migrated when the reservation is active the guest will lose access to the disk as the initiator will change as the host changes.

Version-Release number of selected component (if applicable):
rhevm-backend-3.5.0-0.18.beta.el6ev

Steps to Reproduce:
1. start a VM with a virtio-scsi passthrough disk on a direct lun
2. issue a scsi reservation request (e.g. using sg_persist)
3. migrate the VM

Actual results:
The VM loses access to the disk

Expected results:
It shouldn't be possible to migrate the VM as it would lose access to the disk

Additional info:
At the moment it seems impossible for vdsm/qemu to know in advance (or detect) if there's any persistent reservation active. Probably the best solution is to force the VM pin-to-host if at least one of the virtio-scsi disks is flagged with a new special option (e.g. "uses scsi reservation").

Comment 1 Nir Soffer 2014-11-02 20:48:05 UTC
Looks like 3.6 stuff.

Comment 2 Allon Mureinik 2014-11-06 08:14:08 UTC
(In reply to Nir Soffer from comment #1)
> Looks like 3.6 stuff.
Agreed.

Comment 3 Allon Mureinik 2015-04-21 12:32:43 UTC
Ala, can you add the doctext here please?

Comment 4 lkuchlan 2015-06-15 10:18:11 UTC
Tested using:
ovirt-engine-3.6.0-0.0.master.20150519172219.git9a2e2b3.el6.noarch
vdsm-4.17.0-912.git25a063d.el7.noarch

Verification instructions:
1. start a VM with a virtio-scsi passthrough disk on a direct lun
2. issue a scsi reservation request (e.g. using sg_persist)
3. migrate the VM

Results:
The VM can not be migrated, as a result of using SCSI reservation

Comment 7 Allon Mureinik 2016-03-10 10:42:46 UTC
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE

Comment 8 Allon Mureinik 2016-03-10 10:47:20 UTC
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE

Comment 9 Allon Mureinik 2016-03-10 12:03:53 UTC
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE