Run fstrim in a VM via the guest agent #19

Closed
opened 2026-11-02 22:55:43 +01:00 by Duckboot · 0 comments
Owner

Why

On thin-provisioned storage (local-lvm, ZFS), blocks a VM has freed are only returned to the pool after a trim. Running fstrim from the TUI reclaims space without logging in to the VM.

Proposal

  • A key on the info screen runs fstrim in a running VM that has the guest agent enabled.
  • First ping the agent and show a clear message if it is not running.
  • Not for LXC: containers have no guest agent. Use pct fstrim on the node instead, which could reuse the SSH path from the LXC shell feature.

cv4pve-cli (2.4.0)

  • do vm agent ping <node> <vmid>
  • do vm agent fstrim <node> <vmid>

Done when

  • fstrim runs on VM 108 (with approval) and the result is shown.
  • Tests are written first.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

## Why On thin-provisioned storage (`local-lvm`, ZFS), blocks a VM has freed are only returned to the pool after a trim. Running `fstrim` from the TUI reclaims space without logging in to the VM. ## Proposal - A key on the info screen runs `fstrim` in a running VM that has the guest agent enabled. - First ping the agent and show a clear message if it is not running. - Not for LXC: containers have no guest agent. Use `pct fstrim` on the node instead, which could reuse the SSH path from the LXC shell feature. ## cv4pve-cli (2.4.0) - `do vm agent ping <node> <vmid>` - `do vm agent fstrim <node> <vmid>` ## Done when - fstrim runs on VM 108 (with approval) and the result is shown. - Tests are written first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Duckboot added the
priority
4-nice-to-have
label 2026-11-02 22:55:43 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Duckboot/cv4pve-cli-tui#19