[nova]is there support for discard/trim in virtio-blk?

Sven Kieske S.Kieske at mittwald.de
Thu Sep 2 16:48:32 UTC 2021


Hi,

according to our research discard/trim is commonly documented as "not supported by virtio-blk"
in the wider community and in openstack nova[0].

I understand that this was not supported by the kernel or qemu when discard support was
initially implemented[1] in openstack, but times have changed.

Virtio-blk in upstream Kernel[2] and in qemu[3] does clearly support
discard/trim, which we discovered thanks to StackExchange[4].

So my question is, has someone successfully used trim/discard with
virtio-blk in nova provisioned vms?

[1] makes me guess, that there is no codepath that works with
virtio-blk, but I'm not sure I understood all the codepaths in nova yet.
we are still working our way through it, though.

We currently use the train release in conjunction with ceph rbd volumes for testing this feature
but weren't yet able to use it successfully.
Looking at nova's master branch not much seems to have changed regarding trim support.

If this is no supported configuration currently, should I submit a blueprint to enable this feature?

Would there be other devs/ops interested in this?

Any help or pointers would be appreciated.

[0]: https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L2015 (nova debug log saying discard is unsupported for virtio)
[1]: https://blueprints.launchpad.net/nova/+spec/cinder-backend-report-discard (initial implementation of discard support in openstack)
[2]: https://github.com/torvalds/linux/commit/1f23816b8eb8fdc39990abe166c10a18c16f6b21 (available since linux 5.0-rc1)
[3]: https://github.com/qemu/qemu/commit/37b06f8d46fe602e630e4bdce24e80a3e0f70cc2 (available since qemu 4.0.0)
[4]: https://unix.stackexchange.com/a/518223

-- 
Mit freundlichen Grüßen / Regards

Sven Kieske
Systementwickler / systems engineer
 
 
Mittwald CM Service GmbH & Co. KG
Königsberger Straße 4-6
32339 Espelkamp
 
Tel.: 05772 / 293-900
Fax: 05772 / 293-333
 
https://www.mittwald.de
 
Geschäftsführer: Robert Meyer, Florian Jürgens
 
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhausen
Komplementärin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oeynhausen

Informationen zur Datenverarbeitung im Rahmen unserer Geschäftstätigkeit 
gemäß Art. 13-14 DSGVO sind unter www.mittwald.de/ds abrufbar.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20210902/5afa7f3c/attachment.sig>


More information about the openstack-discuss mailing list