[feature] add support for enabling discard on a bcache device

Bug #1788862 reported by Dmitrii Shcherbakov
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Undecided
Unassigned
curtin
Triaged
Medium
Unassigned

Bug Description

Curtin and MAAS currently do not allow discard option to be configured on a bcache device (only cache set and cache mode are possible to set).

Discard is disabled by default.

https://wiki.ubuntu.com/ServerTeam/Bcache
make-bcache -C /dev/sdc -B /dev/sdb --discard --writeback
# ... --discard is for using TRIM on ssd, not activated by default.
https://www.kernel.org/doc/html/latest/admin-guide/bcache.html#sysfs-cache-device
"discard Boolean; if on a discard/TRIM will be issued to each bucket before it is reused. Defaults to off, since SATA TRIM is an unqueued command (and thus slow)."

https://github.com/CanonicalLtd/curtin/blob/ubuntu/18.1-50-g2d9b2c6f-0ubuntu1/curtin/commands/block_meta.py#L1188-L1208

Tags: cpe-onsite
Ryan Harper (raharper)
Changed in curtin:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: New → Invalid
Changed in maas:
status: Invalid → New
Revision history for this message
Blake Rouse (blake-rouse) wrote :

I think this is something that curtin should be able to determine on the fly, if could check that that device is an SSD (or supports TRIM) and enable discard.

Changed in maas:
status: New → Invalid
Revision history for this message
Ryan Harper (raharper) wrote :

there's no reason for curtin to determine on the fly; MAAS inventories the node, it knows which disks are rotational or ssd/nvme.

Curtin can extend the bcache syntax to allow discard to be enabled/disabled; However MAAS is the correct place to set the correct configuration.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.