tinkerbell/hook

Add support for virtio scsi

Closed this issue · 3 comments

rgl commented

I want to use the virtio scsi transport but the current hook linux kernel is missing the CONFIG_SCSI_VIRTIO=y setting.

Expected Behaviour

When I use the following vagrant snippet I was expecting to see a /dev/sda device.

      config.vm.provider :libvirt do |lv, config|
        lv.storage :file, :size => '40G', :bus => 'scsi', :discard => 'unmap', :cache => 'unsafe'

Current Behaviour

There is no /dev/sda device.

Possible Solution

Compile linux with CONFIG_SCSI_VIRTIO=y.

Steps to Reproduce (for bugs)

  1. modify the sandbox vagrantfile to use lv.storage :file, :size => '40G', :bus => 'scsi', :discard => 'unmap', :cache => 'unsafe'

If you are able to propose a PR that fixes this, I'm fairly sure it would be safe to merge - and certainly useful for testing.

@thebsdbox - any thoughts here?

rgl commented

Odd, hook linux 5.10.57 has CONFIG_SCSI_VIRTIO=y but it does not work here in a libvirt VM. lsblk does not return sda nor dmesg shows that device.

rgl commented

Hook linux is working fine! sorry for the noise...

The problem is in my local setup. When the vagrant-libvirt provider creates a libvirt domain it does not define a scsi controller, so libvirt will automatically add a lsilogic scsi controller, which linux has no driver for it, so no sda device is ever created.

I was able to make it work with a workaround that modifies the VM configuration to use the virtio-scsi scsi controller.