VirtIO Block Driver: When to Use?

Sep 1, 2022
276
54
33
40
Hello,

All the tutorials and manuals for Linux guests that I've read that came out relatively recently (concurrent to Proxmox 7 or later), use VirtIO SCSI for the disks inside a VM.

I'm tinkering with a BSD VM, and the tutorial I'm using uses VirtIO Block for the boot disk. I can't figure out why, as my understanding is that VIrtIO SCSI, even if you don't need its massive scalability, is designed to replace VirtIO Block and work better inside VMs (by using the standard SCSI command set with the virtual disks, for example).

What am I missing? I tried googling around for this, but couldn't really find any sort of modern "when to choose VirtIO Block" articles.
 
the tutorial I'm using uses VirtIO Block for the boot disk. I can't figure out why
Maybe VirtIO was ahead in features or perofrmance in the past? Maybe because there was no VirtIO SCSI driver available at the time? Maybe it was a mistake or old habit?
People here could continue guessing which tutorial you used and why someone did something, but contacting (or at least referencing) the source might help a lot.
 
answer is "it depends" : each has some pros and some cons.
Maybe I should have been more specific.

I'm looking for examples of when you'd actually choose VirtIO Block. I was hoping a pattern might emerge.

Maybe VirtIO was ahead in features or perofrmance in the past? Maybe because there was no VirtIO SCSI driver available at the time? Maybe it was a mistake or old habit?
@leesteken I'm definitely going to ask. I was mostly curious if there was some collective "when to use VirtIO Block" wisdom that I should have picked up on but missed. It wouldn't be the first time. Sounds like this is something of an oddity.
 
there was some collective "when to use VirtIO Block" wisdom
Whenever your OS supports it/has drivers for it.

In general you want VirtIO "devices", not only for block devices, also as NIC inside. VirtIO stuff was made for best throughput and lowest possible latency inside VMs.

If you need some exotic OS without Virtio-support/drivers or have a Win3.11-VM you need to choose some more generic everywhere-compatible stuff like realtek or the Intel E1000.
 
Whenever your OS supports it/has drivers for it.

In general you want VirtIO "devices", not only for block devices, also as NIC inside. VirtIO stuff was made for best throughput and lowest possible latency inside VMs.

If you need some exotic OS without Virtio-support/drivers or have a Win3.11-VM you need to choose some more generic everywhere-compatible stuff like realtek or the Intel E1000.
I understand the preference for VirtIO devices. :)

In this case, I'm trying to figure out when/if VirtIO Block is preferable to VirtIO SCSI, assuming you can choose either.
 
VirtIO SCSI refers to the controller inside the VM and VirtIO Block is the command set for the "disk".

VirtIO SCSI = like SATA generic controller and VirtIO Block = like AHCI (for SATA disks) ;)
 
Which newer controller features do you need from VirtIO SCSI vs. a couple faster (but older) VirtIO-blk ?
Just have a further disk in vm and do any filesystem onto ... which has it's features ... but you don't have access to the above - or ?!?
 
@mr44er This is actually confusing until you're used to it: you always select the SCSI controller (default: "VirtIO SCSI Single," which is presently the most performant choice, if I'm understanding the docs correctly).

But when you set up the disks, you can choose not to use SCSI disks at all.

That is: every VM has to have a SCSI controller designated, but does not have to use SCSI disks.

@waltar There are non-performance advantages to using VirtIO-SCSI, even in VMs that don't use lots of virtual disks. For one thing, the VirtIO SCSI disks speak the SCSI protocol, which makes them easier to use inside the VM with tools that operate speak the SCSI protocol, and also has positive implications for migration in certain circumstances.

But more than that, VirtIO SCSI is the preferred default in Proxmox and the documentation for Proxmox. So, I'm trying to understand why I'd be asked to deviate from the default and potentially create more complications for myself if something goes wrong by veering from the default config.
 
  • Like
Reactions: Kingneutron
you always select the SCSI controller (default: "VirtIO SCSI Single," which is presently the most performant choice, if I'm understanding the docs correctly).
Yes. Special case only for exotic/old OS without availabe VirtIO drivers.*

That is: every VM has to have a SCSI controller designated, but does not have to use SCSI disks.
Yes. *same here :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!