Skip to content

Temp PR for visual diff of VM templating change. DO NOT MERGE#456

Draft
Camelron wants to merge 17 commits into
msft-preview-3.27.0from
guptaharshit/runtime-go-clh-templating
Draft

Temp PR for visual diff of VM templating change. DO NOT MERGE#456
Camelron wants to merge 17 commits into
msft-preview-3.27.0from
guptaharshit/runtime-go-clh-templating

Conversation

@Camelron

@Camelron Camelron commented Jun 8, 2026

Copy link
Copy Markdown
Merge Checklist
  • Followed patch format from upstream recommendation: https://github.com/kata-containers/community/blob/main/CONTRIBUTING.md#patch-format
  • Included a single commit in a given PR - at least unless there are related commits and each makes sense as a change on its own.
  • Merged using "create a merge commit" rather than "squash and merge" (or similar)
  • genPolicy only: Builds on Windows
  • genPolicy only: Updated sample YAMLs' policy annotations, if applicable
Summary
Associated issues
Links to CVEs
Test Methodology

Harshit Gupta and others added 17 commits May 22, 2026 20:45
The CLH impl of Hypervisor iface was missing Save and Pause
functions that are crucial for creating a template.
This commit implements those functions and snapshot is getting saved
when the template initialization finishes.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Although the official Kata docs require initrd image with VM templating.
However, even with a root disk image the overlay upper layer is created in memory.
Which will be captured in the VM snapshot. Therefore, the initrd image constraint
does not apply for VM templating.

Update the test TestCheckFactoryConfig to not expect error when template is enabled
and RootFS image is specified.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Create the VM Template's memory file as an empty file with size equal to that
of the VM's memory size.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
When VM is booted to be template or booted from template, its memory is to be backed
by a file. This commit updates the memory config to use a file in both cases.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
The template VM is created with the default value for VMStorePath,
causing the runtime to be unable to reach the CLH VM's API socket.
This commit sets the VMStorePath to be equal to the VM's statePath,
which is set to the `factory.template_path` config parameter.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Make deviceStatePath calculation in VM template workflow configurable
based on hypervisor, instead of hardcoding it to `state`.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Expand the scope of the resetHypervisorConfig function to include resetting
sandbox name, namespace and the default max vcpus.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Update config.json for the CLH VM template to set memory shared=false.
This forces the VMs created from the template to trigger CoW.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Add logic to restore VM from snapshot instead of starting new VM when
VM template is enabled. Copy the config.json and state.json to the new
VM's VmStorePath, and update the config to create the VSOCK device for
Kata agent in the VmStorePath.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Use diff storage paths for diff VMs created from the same template.
Add comments to the test.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
Implement the first draft of the VM Templating integration K8s tests.

Signed-off-by: Harshit Gupta <guptaharshit@microsoft.com>
@Camelron Camelron force-pushed the guptaharshit/runtime-go-clh-templating branch from 7c3ad7a to d0c37a1 Compare June 10, 2026 22:00
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