Implement prepared shared rootfs reuse as the primary deduped runtime path #48
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
geomind_code/my_hypervisor#48
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?
Problem
This builds on the broader storage-deduplication work tracked in #35.
The current branch already caches pulled image contents, but it still materializes too much state per VM. The result is avoidable disk duplication and extra startup work when multiple VMs use the same image.
Current behavior
1. The cache stops at extracted rootfs
The image cache stores layers and can extract one shared rootfs per image digest, but there is no cached prepared runtime base for the shared-root path.
That means the cache helps with pulling and extracting, but not enough with the work required to actually run many VMs efficiently from the same image.
2. Backend selection is not capability-driven
Storage backend selection currently resolves directly to block storage unless
virtiofsis explicitly chosen.So even when the runtime environment could support a shared-root design, the normal path still pushes users toward a heavier per-VM block-image workflow.
3. Storage preparation consumes the runtime rootfs source directly
The storage preparation path uses the stored rootfs source directly instead of resolving a separate immutable prepared base for image-backed VMs.
That keeps the design centered around "prepare per VM" rather than "prepare once per image, then reuse many times".
4. Shared-root plus extra filesystem mounts needs valid hypervisor argument assembly
The hypervisor argument builder emits one
--fsentry for the root shared filesystem and then emits another--fsentry for each extra shared mount.That is fragile for hypervisor argument parsing. A VM with a shared-root base plus one or more additional shared mounts needs one valid combined filesystem-share argument structure, not repeated top-level flags assembled in a way that can break launch.
5. First-time prepared-base creation needs serialization
Once a prepared shared rootfs cache exists, cold starts from the same image/variant must not race each other. Without a per-image/per-variant lock, two concurrent first boots can both try to create the same prepared base.
Why this matters
Suggested implementation
Prepared image base
Backend policy
Per-VM state model
Hypervisor argument assembly
Concurrency
Acceptance criteria
Related work