Skip to content

chore(kubevirt): add eval tasks for VM creation and lifecycle#626

Merged
manusa merged 2 commits intocontainers:mainfrom
lyarwood:kubevirt-evals
Jan 21, 2026
Merged

chore(kubevirt): add eval tasks for VM creation and lifecycle#626
manusa merged 2 commits intocontainers:mainfrom
lyarwood:kubevirt-evals

Conversation

@lyarwood
Copy link
Contributor

@lyarwood lyarwood commented Jan 7, 2026

Add evaluation tasks for testing KubeVirt virtual machine operations through the kubernetes-mcp-server's vm_create and vm_lifecycle tools.

Tasks added:

  • create-vm-basic: Create a basic Fedora VM
  • create-vm-ubuntu: Create an Ubuntu VM
  • create-vm-with-instancetype: Create VM with specific instance type
  • create-vm-with-size: Create VM with size hint
  • delete-vm: Delete a running VM
  • pause-vm: Pause and unpause a VM
  • update-vm-resources: Modify CPU and memory of existing VM

Infrastructure:

  • Shared verification helpers for VM state validation
  • Test functions for instancetype, resources, and networking
  • Support for both container disk and DataSource-based VMs

These tasks validate that AI agents can correctly use the KubeVirt MCP tools to manage virtual machine lifecycles, including proper use of modern runStrategy field instead of deprecated 'running' field.

@manusa
Copy link
Member

manusa commented Jan 8, 2026

/run-gevals

@lyarwood
Copy link
Contributor Author

lyarwood commented Jan 8, 2026

/run-gevals

/hold

Apologies I should make it clear this isn't going to work on the existing generic k8s gevals test runner, assuming this is running everything under /evals? I'm working on a local env based on kind that might work in CI assuming our runners are able to run virt workloads (nested or otherwise).

@lyarwood lyarwood marked this pull request as draft January 12, 2026 19:11
@lyarwood lyarwood force-pushed the kubevirt-evals branch 2 times, most recently from 6827983 to f7d7198 Compare January 13, 2026 12:59
@lyarwood lyarwood marked this pull request as ready for review January 13, 2026 13:12
Copy link
Contributor

@codingben codingben left a comment

Choose a reason for hiding this comment

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

Just started trying it, until then a partial review

@echo "Or run with MCP inspector:"
@echo " npx @modelcontextprotocol/inspector@latest \$$(pwd)/$(BINARY_NAME) --config _output/config.toml"

.PHONY: local-env-setup-kubevirt
Copy link
Member

Choose a reason for hiding this comment

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

based on prior internal discussions, we might want to remove the local-env-setup and others, and leave the more local granular tasks (kind, keycloak, kiali, and kubevirt)

cc @matzew

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@manusa I don't mind either way but maybe for now that's something we could handle in a follow up that also removes these local-env-setup targets?

@lyarwood
Copy link
Contributor Author

@codingben @ksimon1 would you mind taking another look at this?

Add comprehensive KubeVirt support to enable local testing of VM
management tools with a complete Kind + KubeVirt setup.

New Makefile Targets:
- local-env-setup-kubevirt: Complete environment setup including KubeVirt
- kubevirt-install: Install KubeVirt operator and CDI
- kubevirt-uninstall: Remove KubeVirt and CDI from cluster
- kubevirt-status: Display KubeVirt, CDI, and VM status

KubeVirt Installation (build/kubevirt.mk):
- Installs KubeVirt v1.7.0 operator and custom resource
- Installs CDI (Containerized Data Importer) v1.64.0 for disk management
- Waits for components to be ready before proceeding
- Provides status checking for all KubeVirt resources

The local-env-setup-kubevirt target orchestrates a complete setup:
1. Creates Kind cluster with ingress and cert-manager
2. Installs KubeVirt and CDI
3. Builds the MCP server binary

This enables developers to test VM lifecycle management tools
(start, stop, restart, create) in a local Kubernetes environment.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
@lyarwood
Copy link
Contributor Author

Thanks @ksimon1 I've addressed your comments.

Add evaluation tasks for testing KubeVirt virtual machine operations
through the kubernetes-mcp-server's vm_create and vm_lifecycle tools.

Tasks added:
  - create-vm-basic: Create a basic Fedora VM
  - create-vm-ubuntu: Create an Ubuntu VM
  - create-vm-with-instancetype: Create VM with specific instance type
  - create-vm-with-size: Create VM with size hint
  - delete-vm: Delete a running VM
  - pause-vm: Pause and unpause a VM
  - update-vm-resources: Modify CPU and memory of existing VM

Infrastructure:
  - Shared verification helpers for VM state validation
  - Test functions for instancetype, resources, and networking
  - Support for both container disk and DataSource-based VMs

These tasks validate that AI agents can correctly use the KubeVirt MCP
tools to manage virtual machine lifecycles, including proper use of
modern runStrategy field instead of deprecated 'running' field.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
@ksimon1
Copy link
Contributor

ksimon1 commented Jan 21, 2026

/lgtm

Copy link
Contributor

@codingben codingben left a comment

Choose a reason for hiding this comment

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

/lgtm

@manusa manusa changed the title kubevirt: Add eval tasks for VM creation and lifecycle chore(kubevirt): add eval tasks for VM creation and lifecycle Jan 21, 2026
Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

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

From my side looks good, thx!
I'll defer to @Cali0707 to approve and merge since he is the Gevals expert

@manusa manusa requested a review from Cali0707 January 21, 2026 13:30
@manusa manusa added this to the 0.1.0 milestone Jan 21, 2026
@manusa manusa merged commit 605d033 into containers:main Jan 21, 2026
6 checks passed
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.

5 participants