Skip to content

fix(instance-templates): Link volumes to volume templates - #478

Merged
jedevc merged 3 commits into
prod-stagingfrom
jedevc/instance-template-volumes
Aug 25, 2026
Merged

fix(instance-templates): Link volumes to volume templates#478
jedevc merged 3 commits into
prod-stagingfrom
jedevc/instance-template-volumes

Conversation

@jedevc

@jedevc jedevc commented Aug 25, 2026

Copy link
Copy Markdown
Member

Templates and checkpoints were linking their attached volumes at the volume resource type, but converting an instance turns its volumes into volume templates — and the two platform lookups are mutually exclusive, so that link could only ever miss. Broke TUI drill-down and left the volumes untracked by the sandbox at teardown.

While auditing the two resources against the platform status handlers, type and snapshot turned out to be populated for both and boot_time_us/net_time_us for templates, so those are surfaced too. Autokill was in scope as well but is left out — #355 already covers it.

Schedules are also emitted and still missing, but instances have no schedule support to be consistent with yet.

jedevc added 3 commits August 25, 2026 11:26
It was hidden here but long on instance templates, for no reason other
than oversight - the platform populates it identically for both.

Signed-off-by: Justin Chadwell <justin@unikraft.com>
Converting an instance to a template - or checkpointing one - turns its
attached volumes into volume templates, and the two lookups are mutually
exclusive: /v1/volumes/status excludes template-state volumes and
/v1/volumes/templates/status requires them. So a Link[Volume] on either
resource could only ever miss, breaking TUI drill-down and leaving the
volumes untracked by the sandbox at teardown.

Adds a read-only InstanceTemplateVolume carrying Link[VolumeTemplate]
rather than reusing InstanceVolume, which also drops the create-only
size subfield that has no meaning without a volume-create path.

Integration tests cover both directions, including that a checkpoint
gets its own cloned volume under a fresh UUID while the source volume
is left alone.

Signed-off-by: Justin Chadwell <justin@unikraft.com>
The status handlers for templates and checkpoints emit add_common,
add_basics, add_boot_stats, add_volumes and add_schedops, so type and
snapshot were being dropped on the floor for both. Boot and net timings
are template-only: the conversion happens in place and keeps the
record, whereas a checkpoint is a fresh clone that never boots.

Schedules are emitted too, but instances have no schedule support to be
consistent with yet, so they are left out.

Signed-off-by: Justin Chadwell <justin@unikraft.com>
@jedevc
jedevc requested a review from khatibomar August 25, 2026 11:06

@khatibomar khatibomar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed-by: Omar El Khatib <omar@unikraft.com>
Approved-by: Omar El Khatib <omar@unikraft.com>

@jedevc
jedevc merged commit 6775151 into prod-staging Aug 25, 2026
14 checks passed
@jedevc
jedevc deleted the jedevc/instance-template-volumes branch August 25, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants