Hide Forgot
Description of problem: "rescan-scsi-bus.sh -r" currently removes and re-adds scsi-disk after their SCSI-Revision changed which could render a system unusable. Version-Release number of selected component (if applicable): sg3_utils-1.37-5.el7.x86_64 How reproducible: Always after SCSI-revision change Steps to Reproduce: 1. Create virtual machine on a host running qemu-2.4 or lower 2. live migrate that machine to a host running qemu-2.5+ 3. issue a "rescan-scsi-bus.sh -r" on the quest Actual results: System detects a SCSI-revision change and removes the old-disk and re-adds the disk with the updated revision - which renders the system unusable. Expected results: System detects SCSI-revision change and issues a "rescan" to reflect any updates or simply ignores the revision change. Additional info: The issue is caused by a revision change of a existing SCSI-disk. This also affects disks which may be presented by a storage-system which gets a firmware upgrade - yes this is possible doing online without interruption of the disk.
In case that rescan-scsi-bus.sh with option "-r" can not be changed in the behavior, we should at least remark that this could be a very dangerous action as system-devices could be removed and render the system unusable. This should be reflected in the output of "--help" and in the manpage at least. Raised the priority for given reason.
Hi Andreas Bleischwitz, Changing "-r" behaviour is too risky, I am intend to: 1. Add new option like '--ignore-rev-change' to skip remove/readd on disks with rev change only. 2. Mark '-r' option as 'DANGEROUS'. How's that sounds to you?
Hi Gris, sounds reasonable. I'm fine with a opt-out for the "-r" parameter and that this will be marked as potentially dangerous. That way we would not change current behaviour - which may be intentionally remove devices on revision-changes. /Andreas
Patch send to upstream for review. https://github.com/hreinecke/sg3_utils/pull/13 I didn't mark '-r' as dangerous as 'remove' seems already contain dangerous in it.
Hi Andreas Bleischwitz, I have no idea how to do a live migrate VM. Could try these rpms in your system for `sudo rescan-scsi-bus.sh -r --ignore-rev` command: http://people.redhat.com/fge/BZ_1400491/ Thank you very much.
Not accepted upstream yet.
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.
Created attachment 1423018 [details] scsi_debug code with rev change patch Reproduce steps: * Download attached tarball and extract it. * cd scsi_debug-el7-bz-1400491 && sudo make * sudo insmod scsi_debug.ko * To change revision: echo -n '0001' | sudo tee /sys/module/scsi_debug/parameters/inq_rev * To check current revision: sg_inq /dev/sdb
`--ignore-rec` option has been added to `rescan-scsi-bus.sh` command.
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://access.redhat.com/errata/RHBA-2018:3181