KubeVirt VM Management
Virtual machine management with KubeVirt on Kubernetes. Use when creating, managing, or troubleshooting VMs running on Kubernetes clusters.
Rohit Ghumare
@rohitg00
Install
$ openclaw skills install @rohitg00/k8s-kubevirtKubeVirt VM Management
Manage virtual machines on Kubernetes using kubectl-mcp-server's KubeVirt tools (13 tools).
Requires the
kubevirttoolset: start kubectl-mcp-server with--toolsets default,kubevirt(orMCP_TOOLSETS=default,kubevirt).
When to Apply
Use this skill when:
- User mentions: "KubeVirt", "virtual machine", "VM", "VirtualMachineInstance", "VMI"
- Operations: starting/stopping VMs, live migration, managing VM lifecycle
- Keywords: "VM on Kubernetes", "virtualization", "data volume", "instance type"
Priority Rules
| Priority | Rule | Impact | Tools |
|---|---|---|---|
| 1 | Detect KubeVirt installation first | CRITICAL | detect_ecosystem |
| 2 | Check VM status before operations | HIGH | kubevirt_vm_get |
| 3 | List VMIs for running VMs | HIGH | kubevirt_vmis_list |
| 4 | Use instance types for consistency | MEDIUM | kubevirt_instancetypes_list |
Quick Reference
| Task | Tool | Example |
|---|---|---|
| Detect KubeVirt | detect_ecosystem | detect_ecosystem() |
| List VMs | kubevirt_vms_list | kubevirt_vms_list(namespace) |
| Start VM | kubevirt_vm_start | kubevirt_vm_start(name, namespace) |
| Live migrate VM | kubevirt_vm_migrate | kubevirt_vm_migrate(name, namespace) |
Check Installation
detect_ecosystem()
List VMs
# List VirtualMachines
kubevirt_vms_list(namespace="default")
# List VirtualMachineInstances (running VMs)
kubevirt_vmis_list(namespace="default")
Get VM Details
# Get VM definition
kubevirt_vm_get(name="my-vm", namespace="default")
# Shows:
# - Spec (CPU, memory, disks)
# - Running status
# - Conditions
VM Lifecycle
Start VM
kubevirt_vm_start(name="my-vm", namespace="default")
Stop VM
kubevirt_vm_stop(name="my-vm", namespace="default")
Restart VM
kubevirt_vm_restart(name="my-vm", namespace="default")
Pause/Unpause VM
# Pause (freeze CPU)
kubevirt_vm_pause(name="my-vm", namespace="default")
# Unpause
kubevirt_vm_unpause(name="my-vm", namespace="default")
Live Migration
# Migrate VM to another node
kubevirt_vm_migrate(name="my-vm", namespace="default")
# Check migration status
kubevirt_vmis_list(namespace="default")
# Look for: migrationState
Instance Types
# List available instance types
kubevirt_instancetypes_list()
# Instance types define:
# - CPU count
# - Memory size
# - GPU allocation
Data Volumes
# List data volumes (persistent VM disks)
kubevirt_datavolumes_list(namespace="default")
# List data sources (golden images)
kubevirt_datasources_list(namespace="default")
Create VM
kubectl_apply(manifest="""
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: my-vm
namespace: default
spec:
running: true
template:
metadata:
labels:
kubevirt.io/vm: my-vm
spec:
domain:
cpu:
cores: 2
memory:
guest: 4Gi
devices:
disks:
- name: rootdisk
disk:
bus: virtio
- name: cloudinitdisk
disk:
bus: virtio
volumes:
- name: rootdisk
containerDisk:
image: quay.io/kubevirt/fedora-cloud-container-disk-demo
- name: cloudinitdisk
cloudInitNoCloud:
userData: |
#cloud-config
password: fedora
chpasswd: { expire: False }
""")
Create VM with DataVolume
kubectl_apply(manifest="""
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: vm-with-pvc
namespace: default
spec:
running: true
dataVolumeTemplates:
- metadata:
name: vm-with-pvc-disk
spec:
source:
http:
url: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
storage:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
template:
spec:
domain:
cpu:
cores: 2
memory:
guest: 4Gi
devices:
disks:
- name: rootdisk
disk:
bus: virtio
volumes:
- name: rootdisk
dataVolume:
name: vm-with-pvc-disk
""")
Troubleshooting
VM Not Starting
1. kubevirt_vm_get(name, namespace) # Check status/conditions
2. kubevirt_vmis_list(namespace) # Check VMI exists
3. kubectl_get(resource_type="events", namespace) # Check events
4. kubectl_get(resource_type="pods", namespace, label_selector="kubevirt.io/vm=<name>") # Check virt-launcher
Migration Failed
1. kubevirt_vmis_list(namespace) # Check migrationState
2. kubectl_get(resource_type="events", namespace) # Check events
3. # Common issues:
# - No suitable target node
# - Insufficient resources
# - Shared storage required
Related Skills
- k8s-storage - Persistent storage
- k8s-operations - kubectl operations
Top skills in this category
API Gateway
@byungkyuCall third-party APIs through the Maton gateway, which injects the credential for an app the user has already connected. Use this skill when the user names a connected app and a concrete action in it - read a mailbox, query a CRM, file an issue, update a spreadsheet, etc.
Marketing Mode
@thesethroseMarketing Mode combines 23 comprehensive marketing skills covering strategy, psychology, content, SEO, conversion optimization, and paid growth. Use when users need marketing strategy, copywriting, SEO help, conversion optimization, paid advertising, or any marketing tactic.
Blogwatcher
@steipeteMonitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
Marketing Skills
@jchopard69Access 23 marketing modules offering checklists, frameworks, and ready-to-use deliverables for CRO, SEO, copywriting, analytics, launches, ads, and social me...
diagram-generator
@matthewyinGenerate and edit diagrams with the mcp-diagram-generator MCP server. Use this skill for new diagrams, existing .drawio/.mmd/.excalidraw edits, network topology, architecture, flowchart, swimlane, sequence, class, ER, and Excalidraw whiteboard work. Always use this skill when the user asks to draw,