Skip to content

Conversation

@tomponline
Copy link
Member

@tomponline tomponline commented Jun 13, 2025

  • Switches to modern flags provided by Rust implementation of virtiofsd, in the process fixes VM: Invalid compat argument from virtiofsd for paths containing = #15248
  • Enables direct I/O passthrough from guest when using virtiofs (for correctness when an application specifies to open a file with direct I/O rather than silently converting that to a non-direct operation).
  • Adds io.threads option for filesystem disk devices when being passed to the VM as virtiofsd based shares - this can improve performance. Fixes Poor write performance of LXD storage volume with cephfs driver on VM #15742
  • Restricts use of this new io.threads option in restricted projects unless restricted.virtual-machines.lowlevel is set to allow to prevent restricted VMs from setting a high thread pool count and consuming extra host resources.
  • Adds disk_io_threads_virtiofsd API extension.

@tomponline tomponline self-assigned this Jun 13, 2025
@tomponline tomponline force-pushed the tp-virtiofsd branch 3 times, most recently from 1600298 to 1e125ac Compare June 13, 2025 13:52
@github-actions github-actions bot added the Documentation Documentation needs updating label Jun 13, 2025
@tomponline tomponline force-pushed the tp-virtiofsd branch 2 times, most recently from 35c05cc to 8e835dd Compare June 13, 2025 15:34
@tomponline tomponline marked this pull request as ready for review June 13, 2025 15:42
@github-actions github-actions bot added the API Changes to the REST API label Jun 13, 2025
simondeziel
simondeziel previously approved these changes Jun 13, 2025
Copy link
Member

@simondeziel simondeziel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the caveat that I think it breaks compat with the bundled version of virtiofsd in Jammy's QEMU.

@tomponline
Copy link
Member Author

LGTM with the caveat that I think it breaks compat with the bundled version of virtiofsd in Jammy's QEMU.

Indeed, unfortunately only the rust version has the direct io option so think we will be forced to support only that. We wont backport anyhow to 5.0.

skozina
skozina previously approved these changes Jun 16, 2025
Copy link
Contributor

@skozina skozina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

… flag to avoid path parsing bug in rust implementation

Fixes canonical#15248

Inspired-by: hamistao <[email protected]>
Signed-off-by: Thomas Parrott <[email protected]>
Although it is the default behaviour, make this explicit to indicate why we use it
and not the other modes ("never" and "metadata" don't allow execution).

Signed-off-by: Thomas Parrott <[email protected]>
Allow directs I/O from guests.

Signed-off-by: Thomas Parrott <[email protected]>
@tomponline tomponline dismissed stale reviews from skozina and simondeziel via 98b9302 June 16, 2025 07:17
@tomponline tomponline force-pushed the tp-virtiofsd branch 2 times, most recently from ec9fdb8 to 8ec06d7 Compare June 16, 2025 07:57
…ead pool size

This option can increase performance of virtiofsd based filesystem VM shares.

Defaults to 0 (no thread pool) - which is the existing behaviour.

Fixes canonical#15742

Signed-off-by: Thomas Parrott <[email protected]>
Signed-off-by: Thomas Parrott <[email protected]>
@tomponline tomponline force-pushed the tp-virtiofsd branch 3 times, most recently from 00b5b3f to 943fb3a Compare June 16, 2025 09:05
@tomponline tomponline requested review from minaelee and skozina June 16, 2025 09:06
… in checkInstanceRestrictions

Signed-off-by: Thomas Parrott <[email protected]>
…in restricted project without restricted.virtual-machines.lowlevel allowed

This is to prevent restricted projects from configuring disks with a large virtiofsd thread pool size and consuming extra resources.

Signed-off-by: Thomas Parrott <[email protected]>
@tomponline tomponline dismissed minaelee’s stale review June 16, 2025 13:20

changes addressed

@tomponline tomponline merged commit 72ea33e into canonical:main Jun 16, 2025
30 checks passed
@tomponline tomponline deleted the tp-virtiofsd branch June 16, 2025 13:24
tomponline added a commit that referenced this pull request Jun 17, 2025
simondeziel added a commit to canonical/lxd-ci that referenced this pull request Jun 17, 2025
@simondeziel simondeziel mentioned this pull request Jun 18, 2025
tomponline added a commit to tomponline/lxd-pkg-snap that referenced this pull request Jun 19, 2025
tomponline added a commit to canonical/lxd-pkg-snap that referenced this pull request Jun 19, 2025
…(latest-candidate) (#840)

Cherry-picks virtiofsd io.threads option and direct I/O support into LXD
6.4.

From PR canonical/lxd#15792

Fixes canonical/lxd#15248
Fixes canonical/lxd#15742
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Changes to the REST API Documentation Documentation needs updating

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poor write performance of LXD storage volume with cephfs driver on VM VM: Invalid compat argument from virtiofsd for paths containing =

5 participants