[pve-devel] [PATCH pve-manager] Add "SSD" property to IDE, SATA, and SCSI hard drives

Nick Chevsky nchevsky at gmail.com
Wed Nov 7 18:20:13 CET 2018


On Wed, Nov 7, 2018 at 3:23 AM Thomas Lamprecht <t.lamprecht at proxmox.com>
wrote:

> 1) I also have the checkbox enabled for SCSI with virtio-scsi controller,
>    and it's not needed in that case, AFAICT.
>

It's not needed *for TRIM support*, but that's actually not the purpose of
the "SSD" flag. This flag merely determines whether we emulate a rotational
hard disk or an SSD; nothing more. What that means to each guest is
OS-dependent, and people will have different uses for it—TRIM is just one
of them. The VirtIO SCSI controller does honor this property, by the way.
For example, on a Linux guest with VirtIO SCSI:

With the "SSD" box unchecked:
# cat /sys/block/sda/queue/rotational
1

With the "SSD" box checked:
# cat /sys/block/sda/queue/rotational
0


Useful or not, I don't think we should disable the checkbox for VirtIO SCSI
since the feature is supported and honored, and people may have
non-TRIM-related uses for it (e.g. some guest OSs may display different
icons for HDDs and SSDs).

Finally, this feature is implemented at the bus—not controller—level in
QEMU, so disabling it for only one particular type of SCSI controller would
be conceptually unsound. Enforcing this in the UI would also be messy,
since the controller type is configured on a different screen. I just don't
think we need to concern ourselves with this at all.

2) I'd add a boxLabel with gettext('autodetected') (or similar) when it gets
>    disabled, so that user know that they just do not need to set it in
> those
>    cases, not that someone thinks that the virtio stuff is inferior
> because it
>    can't even handle SSDs properly :) Somewhat similar in principle to:
>    https://pve.proxmox.com/pipermail/pve-devel/2018-November/034260.html


My recommendation is that we disable the box only when the feature is
actually unsupported (i.e. virtio-blk), and let users decide in all other
cases.

To further minimize confusion and stress the fact that the only direct
purpose of this property is to define the type of drive we emulate, how
would you feel about selectively labeling drives "Hard Disk" or "SSD" on
the "Hardware" tab depending on the state of the flag? We could even drop
the "SSD" checkbox in favor of a "Type" drop-down (with "Hard Disk" and
"SSD" options), which would be conceptually neater.

Also see my next reply to Dominik regarding the use of emulated SSDs with
HDD-backed storage.

Nick



More information about the pve-devel mailing list