Skip to content

VHD pipeline automation + containerd 2.x CNI fix - #6

Merged
bobsira merged 40 commits into
mainfrom
user/vhd_pipeline_automation
Sep 12, 2026
Merged

bobsira merged 40 commits into
mainfrom
user/vhd_pipeline_automation

Conversation

@bobsira

@bobsira bobsira commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Automated the Windows VHD build and upload pipeline via GitHub Actions (self-hosted Hyper-V runner)
  • Bumped containerd to 2.2.3
  • Fixed CNI path patching in configure-vm.ps1 which caused Windows nodes to stay NotReady after upgrading to containerd 2.x

Root cause of CNI fix

containerd 2.x changed the default config.toml format: the CNI bin directory key was renamed from bin_dir to bin_dirs (array syntax) and values changed from double-quoted to single-quoted strings. The provisioning script was doing exact string matching against the 1.x format, so neither replacement ever fired — leaving containerd pointing at non-existent default paths and causing cni plugin not initialized errors on Windows nodes.

The fix uses version-aware regex patterns, branching on the major version of $containerd_ver to apply the correct format for 1.x or 2.x. Both branches fail loudly if expected keys are not found.

Test plan

  • Local VHDX build with Packer (containerd 2.2.3)
  • Windows node joined minikube cluster and reached Ready state
  • CI pipeline run successfully triggered via self-hosted runner

@bobsira

bobsira commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

@copilot

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Windows node image build system to support automated VHD creation/upload via GitHub Actions and to accommodate containerd 2.x configuration changes (specifically CNI path keys/format), alongside version parameterization through Packer vars/env.

Changes:

  • Adds a GitHub Actions workflow to build a Windows VHD on a self-hosted Hyper-V runner and upload it to Azure Blob Storage.
  • Updates the Packer template/vars to explicitly parameterize Windows/Kubernetes/containerd versions and adjusts provisioning steps.
  • Improves WinRM enablement scripting and updates containerd CNI config patching logic for containerd 2.x.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
windows.json.pkr.hcl Adds version variables and updates provisioning flow (containers feature install/restarts, passes containerd version into VM config).
windows.auto.pkrvars.hcl Updates default Kubernetes/containerd versions and cleans up/organizes ISO URL/checksum inputs.
setup/enable-winrm.ps1 Reworks WinRM setup for better logging/idempotence and adds network profile readiness wait + sanity checks.
setup/configure-vm.ps1 Makes Kubernetes/containerd version selection explicit and patches containerd config parsing for 1.x vs 2.x CNI key formats.
setup/Autounattend.xml Updates first-logon commands (more robust WinRM script discovery; removes containers install from unattend).
.github/workflows/build-windows-vhd.yml Adds/updates CI automation for building VHDs and uploading artifacts/logs and final VHD to Azure.
Comments suppressed due to low confidence (1)

windows.json.pkr.hcl:66

  • win_iso_checksums, win_iso_urls, windows_version, and kubernetes_version are declared twice. Packer/HCL will fail to load the template due to duplicate variable blocks.
variable "win_iso_checksums" {
  type = map(string)
  default = {}
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread setup/configure-vm.ps1
Comment thread setup/enable-winrm.ps1
Comment thread .github/workflows/build-windows-vhd.yml Outdated
Comment thread .github/workflows/build-windows-vhd.yml
Comment thread .github/workflows/build-windows-vhd.yml Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Fix Packer override arguments, validate CNI configuration keys, preserve original WinRM setup errors, and clarify workflow documentation. Always upload available Packer logs and retain failed provisioning VMs for inspection.
Add unique build identities, shared host locking, isolated outputs and logs, and immediate DVD boot retries. Publish the canonical disk under a renewable Azure lease and provide a single-command test runner.
@bobsira
bobsira merged commit 242deef into main Sep 12, 2026
1 check passed
@bobsira
bobsira deleted the user/vhd_pipeline_automation branch September 13, 2026 19:40
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