mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-16 05:12:04 +00:00
[PR #71] [MERGED] feat(lxc): instant linked-clone fast path for lvmthin storage #71
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#71
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/71
Author: @JBailes
Created: 6/7/2026
Status: ✅ Merged
Merged: 6/7/2026
Merged by: @JBailes
Base:
main← Head:feat/pve-lvmthin-linked-clone📝 Commits (1)
e12a758feat(lxc): instant linked-clone fast path for lvmthin storage📊 Changes
3 files changed (+199 additions, -7 deletions)
View changed files
📝
internal/lxc/manager.go(+18 -6)📝
internal/lxc/pve_tarball.go(+147 -1)📝
internal/lxc/pve_tarball_test.go(+34 -0)📄 Description
On lvmthin (and any non-ZFS PVE storage) every
docker runtook thepct createpath, which re-extracts the whole image rootfs tarball into a fresh thin volume each launch — ~2 GB for the Steam image, tens of seconds. Only ZFS had a copy-on-write fast path.This adds the equivalent for lvmthin while keeping containers as normal
pct-managed CTs:pct template).pct cloneof that template — an instant CoW clone, no data copy regardless of image size.Details:
pveStorageSupportsLinkedClone()(lvmthin only; ZFS keeps its raw-clone path; dir/lvm/nfs keeppct create).ensureImageTemplateCTmaterializes/reuses the template once, serialized bytmplMu, tagged soreapOrphanCTscan reclaim it if its image record is lost.--fulland no--storage(pct rejects--storagefor linked clones; the clone stays on the template’s storage).pct createon any template/clone failure, so a launch never hard-fails on the fast path.RemoveImagedestroys the template CT (best-effort; on lvmthin the base volume can be removed while linked clones still reference its blocks).finalizePVECT.Tradeoff: the per-image template CT is visible in the Proxmox UI — the cost of staying on the supported
pct clonepath for block storage (ZFS avoids this with a hidden dataset).Validated the
pctprimitives live on PVE 9.2 / lvmthin (template create +pct template, linkedpct clonewith no--storage, and destroying the template while a linked clone still exists). Build, vet, and unit tests pass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.