fix(instance-templates): Link volumes to volume templates - #478
Merged
Conversation
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>
khatibomar
approved these changes
Aug 25, 2026
khatibomar
left a comment
Contributor
There was a problem hiding this comment.
Reviewed-by: Omar El Khatib <omar@unikraft.com>
Approved-by: Omar El Khatib <omar@unikraft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Templates and checkpoints were linking their attached volumes at the
volumeresource 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,
typeandsnapshotturned out to be populated for both andboot_time_us/net_time_usfor 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.