nova blocks discard with virtio-blk
Bug #2013123 reported by
sean mooney
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Low
|
sean mooney |
Bug Description
nova added support for discard aka trim in mitaka when a cinder backend
reports it's supported. At the time Qemu did not support trim/discard
when using virtio-blk. This gap was adressed in qemu 4.0.0 however we never adapted nova to allow
trim when using virtio-blk. nova raised its min qemu version to 4.0.0 in Ussuri.
As such this should be supported in all nova deployment from Ussuri on but it is still blocked on master today.
Changed in nova: | |
assignee: | nobody → sean mooney (sean-k-mooney) |
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Low |
To post a comment you must log in.
As far as I know Nova doesn´t really block it, it issues a debug log message telling us this will probably not work [1], but it still sets the `discard=unmap` option in the libvirt XML. Maybe I'm missing something...
I was removing this debug message [2] when I realized that it doesn't actually work (just like Nova is saying)! Though I don't know why that is :-(
If I set the "hw_disk_bus" metadata key on the glance image to ide, scsi, or sata, then the sparseness is correct within the VM.
We can check if trimming is reported as supported on the OS by going into the VM and checking if /sys/class/ $DEV/queue/ discard_ max_bytes is not zero.
[1]: https:/ /opendev. org/openstack/ nova/src/ commit/ 971809b4d4db39e 98d6534531e55d5 b8fcde49cb/ nova/virt/ libvirt/ driver. py#L2132- L2147
[2]: https:/ /review. opendev. org/c/openstack /nova/+ /885356