Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#52047 - [mkinitcpio] replace virtio_blk with virtio_scsi in block hook

Attached to Project: Arch Linux
Opened by Anonymous (bobobo1618) - Monday, 05 December 2016, 04:53 GMT
Last edited by Dave Reisner (falconindy) - Tuesday, 06 December 2016, 19:31 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: The usual recommended driver for block devices in a KVM guest is virtio_blk, however virtio_scsi is also usable for the same purpose. At the moment, only virtio_blk is packaged by initcpio in the block hook's install file. It'd be nice if virtio_scsi was included as well, so that Arch Linux guests can boot from virtio_scsi devices.

There are a list of reasons to use the virtio_scsi driver here: https://www.ovirt.org/develop/release-management/features/storage/virtio-scsi/

* Improved scalability—virtual machines can connect to more storage devices (the virtio-scsi can handle multiple block devices per virtual SCSI adapter).
* Standard command set—virtio-scsi uses standard SCSI command sets, simplifying new feature addition.
* Standard device naming—virtio-scsi disks use the same paths as a bare-metal system. This simplifies physical-to-virtual and virtual-to-virtual migration.
* SCSI device passthrough—virtio-scsi can present physical storage devices directly to guests.

This applies to the mkinitcpio package.

Additional info:
* package version(s): 21-1
This task depends upon

Closed by  Dave Reisner (falconindy)
Tuesday, 06 December 2016, 19:31 GMT
Reason for closing:  Works for me
Additional comments about closing:  Already working as intended.
Comment by Dave Reisner (falconindy) - Monday, 05 December 2016, 13:15 GMT
Unfortunately, virtio-blk gets prioritized higher than virtio-scsi, which is kind of dumb if virtio-scsi is meant to be a replacement for virtio-blk.

$ grep -E 'virtio.(blk|scsi)' /lib/modules/4.8.0-rampage/modules.order
kernel/drivers/block/virtio_blk.ko
kernel/drivers/scsi/virtio_scsi.ko

I'm not opposed to this change, but it's sadly not as simple as just s/blk/scsi/.
Comment by Dave Reisner (falconindy) - Monday, 05 December 2016, 13:25 GMT
It also doesn't seem to be true that virtio_scsi strictly replaces virtio_blk, as your linked doc suggests... I can't boot without virtio_blk.

Have you tested this? How are you using virtio_scsi?
Comment by Dave Reisner (falconindy) - Monday, 05 December 2016, 15:41 GMT
Ok, of course this requires changes to the VM itself to make use of virtio-scsi...
Comment by Anonymous (bobobo1618) - Monday, 05 December 2016, 15:44 GMT
Sorry, it isn't a strict replacement as there are still cases where you might use virtio_blk.

I'd like it to be added to the initcpio beside virtio_blk. And yes, I've tested it by repeating the virtio_blk line inside the block install file and replacing blk with scsi. After that my VM was able to boot from a scsi disk.
Comment by Dave Reisner (falconindy) - Tuesday, 06 December 2016, 13:44 GMT
Ok, so I've tested this on a VM and was able to get it running with virtio_scsi. The thing is, I didn't have to make any changes at all to the block hook. In fact, I'm more inclined to *remove* the explicit addition of virtio_blk as well, because this is automatically detected through the sysfs scan.

Are you suggesting that this doesn't work for you out of the box? What does 'mkinitcpio -M' show for you on a VM booted via virtio scsi-based disks?
Comment by Anonymous (bobobo1618) - Tuesday, 06 December 2016, 19:25 GMT
Ah, I think I know what happened...

So I switched a preexisting VM from virtio_blk to virtio_scsi without regenerating the initcpio. Of course the VM failed to boot. Since that happened I booted from archiso, chrooted and forcibly added virtio_scsi by adding it to the install file and filed this bug. I'd forgotten needed modules were dynamically detected.

Yes, everything seems fine when I run mkinitcpio -M. This can be closed.

Loading...