-
Notifications
You must be signed in to change notification settings - Fork 243
Open
Labels
Description
Feature or enhancement request details
Container disk images currently grow over time but never shrink. As containers create and delete data, freed blocks inside their filesystems are not automatically released to the host, leading to permanently increasing disk utilization. This results in wasted space for long-lived containers and unnecessary manual intervention to recover capacity.
To address this, we should automatically reclaim freed blocks from container filesystems using fstrim with minimal user interaction, this way users do not need to manually intervene or recreate containers to reclaim disk space.
Some implementation options:
- Online fstrim: Run
fstrimwhile the container is active to release deallocated blocks to the host. - Periodic cleanup: Execute
fstrimperiodically withinvminitdfor automated cleanup. - Continuous discard: Mount filesystems with the
discardoption for continuous trimming. - Manual offline shrink: Allow users to run
container shrink <id>to launch a temporary VM, mount the image, runfstrimand shut down.
Code of Conduct
- I agree to follow this project's Code of Conduct