lxd icon indicating copy to clipboard operation
lxd copied to clipboard

Add support for virtiofsd cache mode via `io.cache` setting

Open tomponline opened this issue 6 months ago • 0 comments

Please confirm

  • [x] I have searched existing issues to check if an issue already exists for my feature request.

Is your feature request related to a problem? Please describe.

LXD currently starts virtiofsd using the equivalent of the --cache auto option. This allows executing commands from the share, and is a reasonable default for concurrently sharing of a filesystem with multiple instances.

However it is not as safe & coherent as --cache never, which also prevents executing from the shared filesystem (for strong coherence).

It would be good to default to --cache never in order to be safe/correct by default, and allow admins to control the level of performance vs coherency risk they are willing to take.

Incus has a PR that adds support for configuring some of this via io.cache setting:

https://github.com/lxc/incus/pull/951

However it lacks the ability to use --cache auto, and because it defaults to --cache never, it is not possible to use --allow-mmap to support executing commands from that filesystem.

It also doesn't use the --writeback option in unsafe mode which we could consider.

Describe the solution you'd like

N/A

Describe alternatives you've considered

N/A

Additional context

N/A

tomponline avatar Jun 16 '25 13:06 tomponline