Back to skills
SkillHub ClubRun DevOpsFull StackDevOps

k8s-kubevirt

Virtual machine management with KubeVirt on Kubernetes. Use when creating, managing, or troubleshooting VMs running on Kubernetes clusters.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
847
Hot score
99
Updated
March 20, 2026
Overall rating
C3.9
Composite score
3.9
Best-practice grade
A85.2

Install command

npx @skill-hub/cli install rohitg00-kubectl-mcp-server-k8s-kubevirt

Repository

rohitg00/kubectl-mcp-server

Skill path: kubernetes-skills/claude/k8s-kubevirt

Virtual machine management with KubeVirt on Kubernetes. Use when creating, managing, or troubleshooting VMs running on Kubernetes clusters.

Open repository

Best for

Primary workflow: Run DevOps.

Technical facets: Full Stack, DevOps.

Target audience: everyone.

License: Apache-2.0.

Original source

Catalog source: SkillHub Club.

Repository owner: rohitg00.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install k8s-kubevirt into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/rohitg00/kubectl-mcp-server before adding k8s-kubevirt to shared team environments
  • Use k8s-kubevirt for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: k8s-kubevirt
description: Virtual machine management with KubeVirt on Kubernetes. Use when creating, managing, or troubleshooting VMs running on Kubernetes clusters.
license: Apache-2.0
metadata:
  author: rohitg00
  version: "1.0.0"
  tools: 13
  category: virtualization
---

# KubeVirt VM Management

Manage virtual machines on Kubernetes using kubectl-mcp-server's KubeVirt tools (13 tools).

## 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 | `kubevirt_detect_tool` |
| 2 | Check VM status before operations | HIGH | `kubevirt_vm_get_tool` |
| 3 | List VMIs for running VMs | HIGH | `kubevirt_vmis_list_tool` |
| 4 | Use instance types for consistency | MEDIUM | `kubevirt_instancetypes_list_tool` |

## Quick Reference

| Task | Tool | Example |
|------|------|---------|
| Detect KubeVirt | `kubevirt_detect_tool` | `kubevirt_detect_tool()` |
| List VMs | `kubevirt_vms_list_tool` | `kubevirt_vms_list_tool(namespace)` |
| Start VM | `kubevirt_vm_start_tool` | `kubevirt_vm_start_tool(name, namespace)` |
| Live migrate VM | `kubevirt_vm_migrate_tool` | `kubevirt_vm_migrate_tool(name, namespace)` |

## Check Installation

```python
kubevirt_detect_tool()
```

## List VMs

```python
# List VirtualMachines
kubevirt_vms_list_tool(namespace="default")

# List VirtualMachineInstances (running VMs)
kubevirt_vmis_list_tool(namespace="default")
```

## Get VM Details

```python
# Get VM definition
kubevirt_vm_get_tool(name="my-vm", namespace="default")

# Shows:
# - Spec (CPU, memory, disks)
# - Running status
# - Conditions
```

## VM Lifecycle

### Start VM

```python
kubevirt_vm_start_tool(name="my-vm", namespace="default")
```

### Stop VM

```python
kubevirt_vm_stop_tool(name="my-vm", namespace="default")
```

### Restart VM

```python
kubevirt_vm_restart_tool(name="my-vm", namespace="default")
```

### Pause/Unpause VM

```python
# Pause (freeze CPU)
kubevirt_vm_pause_tool(name="my-vm", namespace="default")

# Unpause
kubevirt_vm_unpause_tool(name="my-vm", namespace="default")
```

## Live Migration

```python
# Migrate VM to another node
kubevirt_vm_migrate_tool(name="my-vm", namespace="default")

# Check migration status
kubevirt_vmis_list_tool(namespace="default")
# Look for: migrationState
```

## Instance Types

```python
# List available instance types
kubevirt_instancetypes_list_tool()

# Instance types define:
# - CPU count
# - Memory size
# - GPU allocation
```

## Data Volumes

```python
# List data volumes (persistent VM disks)
kubevirt_datavolumes_list_tool(namespace="default")

# List data sources (golden images)
kubevirt_datasources_list_tool(namespace="default")
```

## Create VM

```python
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

```python
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

```python
1. kubevirt_vm_get_tool(name, namespace)  # Check status/conditions
2. kubevirt_vmis_list_tool(namespace)  # Check VMI exists
3. get_events(namespace)  # Check events
4. get_pods(namespace, label_selector="kubevirt.io/vm=<name>")  # Check virt-launcher
```

### Migration Failed

```python
1. kubevirt_vmis_list_tool(namespace)  # Check migrationState
2. get_events(namespace)  # Check events
3. # Common issues:
   # - No suitable target node
   # - Insufficient resources
   # - Shared storage required
```

## Related Skills

- [k8s-storage](../k8s-storage/SKILL.md) - Persistent storage
- [k8s-operations](../k8s-operations/SKILL.md) - kubectl operations


---

## Referenced Files

> The following files are referenced in this skill and included for context.

### ../k8s-storage/SKILL.md

```markdown
---
name: k8s-storage
description: Kubernetes storage management for PVCs, storage classes, and persistent volumes. Use when provisioning storage, managing volumes, or troubleshooting storage issues.
license: Apache-2.0
metadata:
  author: rohitg00
  version: "1.0.0"
  tools: 3
  category: storage
---

# Kubernetes Storage

Manage Kubernetes storage using kubectl-mcp-server's storage tools.

## When to Apply

Use this skill when:
- User mentions: "PVC", "PV", "storage class", "volume", "disk", "storage"
- Operations: provisioning storage, mounting volumes, expanding storage
- Keywords: "persist", "data", "backup storage", "volume claim"

## Priority Rules

| Priority | Rule | Impact | Tools |
|----------|------|--------|-------|
| 1 | Verify storage class exists before PVC | CRITICAL | `get_storage_classes` |
| 2 | Check PVC status before pod deployment | HIGH | `describe_pvc` |
| 3 | Review access modes for multi-pod access | MEDIUM | `get_pvcs` |
| 4 | Monitor PV reclaim policy | LOW | `get_persistent_volumes` |

## Quick Reference

| Task | Tool | Example |
|------|------|---------|
| List PVCs | `get_pvcs` | `get_pvcs(namespace)` |
| PVC details | `describe_pvc` | `describe_pvc(name, namespace)` |
| Storage classes | `get_storage_classes` | `get_storage_classes()` |
| List PVs | `get_persistent_volumes` | `get_persistent_volumes()` |

## Persistent Volume Claims (PVCs)

```python
get_pvcs(namespace="default")

describe_pvc(name="my-pvc", namespace="default")

kubectl_apply(manifest="""
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
  namespace: default
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: standard
""")

kubectl_delete(resource_type="pvc", name="my-pvc", namespace="default")
```

## Storage Classes

```python
get_storage_classes()

kubectl_apply(manifest="""
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: fast-ssd
provisioner: kubernetes.io/gce-pd
parameters:
  type: pd-ssd
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
""")
```

## Persistent Volumes

```python
get_persistent_volumes()

describe_persistent_volume(name="pv-001")
```

## Volume Snapshots

```python
kubectl_apply(manifest="""
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
  name: my-snapshot
  namespace: default
spec:
  volumeSnapshotClassName: csi-snapclass
  source:
    persistentVolumeClaimName: my-pvc
""")

kubectl_apply(manifest="""
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: restored-pvc
spec:
  dataSource:
    name: my-snapshot
    kind: VolumeSnapshot
    apiGroup: snapshot.storage.k8s.io
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
""")
```

## Troubleshooting Storage

```python
describe_pvc(name="my-pvc", namespace="default")

get_events(namespace="default")
describe_pod(name="my-pod", namespace="default")
```

## Related Skills

- [k8s-backup](../k8s-backup/SKILL.md) - Velero backup/restore
- [k8s-operations](../k8s-operations/SKILL.md) - kubectl apply/patch

```

### ../k8s-operations/SKILL.md

```markdown
---
name: k8s-operations
description: kubectl operations for applying, patching, deleting, and executing commands on Kubernetes resources. Use when modifying resources, running commands in pods, or managing resource lifecycle.
license: Apache-2.0
metadata:
  author: rohitg00
  version: "1.0.0"
  tools: 14
  category: operations
---

# kubectl Operations

Execute kubectl commands using kubectl-mcp-server's operations tools.

## When to Apply

Use this skill when:
- User mentions: "apply", "patch", "delete", "exec", "scale", "rollout"
- Operations: modifying resources, running commands, scaling workloads
- Keywords: "update", "change", "modify", "run command", "restart"

## Priority Rules

| Priority | Rule | Impact | Tools |
|----------|------|--------|-------|
| 1 | Dry run before apply in production | CRITICAL | `kubectl_apply(dry_run=True)` |
| 2 | Check current state before patching | HIGH | `describe_*` tools |
| 3 | Avoid force delete unless necessary | HIGH | `kubectl_delete` |
| 4 | Verify rollout status after changes | MEDIUM | `kubectl_rollout_status` |

## Quick Reference

| Task | Tool | Example |
|------|------|---------|
| Apply manifest | `kubectl_apply` | `kubectl_apply(manifest=yaml)` |
| Patch resource | `kubectl_patch` | `kubectl_patch(type, name, namespace, patch)` |
| Delete resource | `kubectl_delete` | `kubectl_delete(type, name, namespace)` |
| Exec command | `kubectl_exec` | `kubectl_exec(pod, namespace, command)` |
| Scale deployment | `scale_deployment` | `scale_deployment(name, namespace, replicas)` |

## Apply Resources

```python
kubectl_apply(manifest="""
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  namespace: default
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
""")

kubectl_apply(file_path="/path/to/manifest.yaml")

kubectl_apply(manifest="...", dry_run=True)
```

## Patch Resources

```python
kubectl_patch(
    resource_type="deployment",
    name="nginx",
    namespace="default",
    patch={"spec": {"replicas": 5}}
)

kubectl_patch(
    resource_type="deployment",
    name="nginx",
    namespace="default",
    patch=[{"op": "replace", "path": "/spec/replicas", "value": 5}],
    patch_type="json"
)

kubectl_patch(
    resource_type="service",
    name="my-svc",
    namespace="default",
    patch={"metadata": {"annotations": {"key": "value"}}},
    patch_type="merge"
)
```

## Delete Resources

```python
kubectl_delete(resource_type="pod", name="my-pod", namespace="default")

kubectl_delete(
    resource_type="pods",
    namespace="default",
    label_selector="app=test"
)

kubectl_delete(
    resource_type="pod",
    name="stuck-pod",
    namespace="default",
    force=True,
    grace_period=0
)
```

## Execute Commands

```python
kubectl_exec(
    pod="my-pod",
    namespace="default",
    command="ls -la /app"
)

kubectl_exec(
    pod="my-pod",
    namespace="default",
    container="sidecar",
    command="cat /etc/config/settings.yaml"
)

kubectl_exec(
    pod="my-pod",
    namespace="default",
    command="sh -c 'curl -s localhost:8080/health'"
)
```

## Scale Resources

```python
scale_deployment(name="nginx", namespace="default", replicas=5)

scale_deployment(name="nginx", namespace="default", replicas=0)

kubectl_scale(
    resource_type="statefulset",
    name="mysql",
    namespace="default",
    replicas=3
)
```

## Rollout Management

```python
kubectl_rollout_status(
    resource_type="deployment",
    name="nginx",
    namespace="default"
)

kubectl_rollout_history(
    resource_type="deployment",
    name="nginx",
    namespace="default"
)

kubectl_rollout_restart(
    resource_type="deployment",
    name="nginx",
    namespace="default"
)

rollback_deployment(name="nginx", namespace="default", revision=1)
```

## Labels and Annotations

```python
kubectl_label(
    resource_type="pod",
    name="my-pod",
    namespace="default",
    labels={"env": "production"}
)

kubectl_annotate(
    resource_type="deployment",
    name="nginx",
    namespace="default",
    annotations={"description": "Main web server"}
)
```

## Related Skills

- [k8s-deploy](../k8s-deploy/SKILL.md) - Deployment strategies
- [k8s-helm](../k8s-helm/SKILL.md) - Helm operations

```

k8s-kubevirt | SkillHub