/rh-virt:vm-lifecycle-managerfrom rh-virt
Manage virtual machine lifecycle operations including start, stop, and restart. Use when: - "Start VM [name]" - "Stop the virtual machine [name]" - "Restart VM [name]" - "Power on/off VM [name]" This skill handles VM state transitions safely with user confirmation for each action. NOT for creating VMs (use vm-create) or deleting VMs (use vm-delete).
Ships in rh-virt. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Control virtual machine power state in OpenShift Virtualization using the vm_lifecycle tool.
Required MCP Server: openshift-virtualization (OpenShift MCP Server)
Required MCP Tools:
vm_lifecycle (from openshift-virtualization) - Manage VM power stateRequired Environment Variables:
KUBECONFIG - Path to Kubernetes configuration file with cluster accessRequired Cluster Setup:
Before executing:
openshift-virtualization exists in mcps.json → If missing, report setupKUBECONFIG is set (presence only, never expose value) → If missing, reportHuman Notification Protocol: ❌ Cannot execute vm-lifecycle-manager: MCP server not available. Setup: Add to mcps.json, set KUBECONFIG, restart Claude Code. Docs: https://github.com/openshift/openshift-mcp-server
⚠️ SECURITY: Never display KUBECONFIG path or credential values.
Trigger when:
/vm-lifecycle-manager commandUser phrases:
Do NOT use when:
/vm-create/vm-inventory/vm-deleteRequired from user: VM Name, Namespace, Action (start|stop|restart)
Present for confirmation:
## VM Lifecycle Operation
| Parameter | Value | Impact |
|-----------|-------|--------|
| VM Name | `<vm>` | from user |
| Namespace | `<ns>` | from user |
| Action | `<action>` | start: consumes resources / stop: graceful shutdown / restart: brief interruption (~1-2min) |
Confirm: yes/no
WAIT for explicit "yes" before proceeding to Step 2.
ONLY AFTER user confirmation in Step 1.
For start or stop actions:
MCP Tool: vm_lifecycle (namespace=<ns>, name=<vm>, action=<start|stop>)
For restart action (composite operation):
CRITICAL: Implement restart as two separate operations to avoid resourceVersion conflicts:
vm_lifecycle (namespace=<ns>, name=<vm>, action="stop")resources_get (apiVersion="kubevirt.io/v1", kind="VirtualMachine", namespace=<ns>, name=<vm>) → Check status.printableStatus == "Stopped"vm_lifecycle (namespace=<ns>, name=<vm>, action="start")resources_get → Check status.printableStatus == "Running"Errors:
On Success:
## ✓ VM <Action> Successful
**VM**: `<vm>` | **Namespace**: `<ns>` | **Action**: <action> | **RunStrategy**: <Always|Halted>
**Impact**:
- **start**: Running, consuming resources (CPU/memory). Access: virtctl console or SSH. RunStrategy: Always (auto-restart on crash)
- **stop**: Stopped, resources freed. State preserved. Start: "Start VM <vm>". RunStrategy: Halted (stays off)
- **restart**: Running after stop+start. Brief interruption (~1-2min). Monitor app logs. RunStrategy: Always
**Next**: "Show status of VM <vm>" or "List VMs in namespace <ns>"
On Failure:
OPTIONAL: Read lifecycle-errors.md for start/stop failures or scheduling-errors.md for ErrorUnschedulable. Output: "Consulted lifecycle-errors.md for failure."
When to consult: Start/stop failures, stuck transitions, unexpected errors. NOT: Already in state, not found, RBAC errors.
## ❌ Lifecycle Operation Failed
**Error**: <error>
**Causes**: VM not found | RBAC denied | Already in desired state | VM in transition (wait 30-60s) | Resource constraints (start)
**Troubleshoot**:
1. vm-inventory to verify VM exists
2. Check RBAC: `oc auth can-i update virtualmachines -n <ns>`
3. View VM status and events
4. Check node capacity (for start operations)
Error: "VirtualMachine 'xyz' not found in namespace 'abc'" Solution: Verify spelling, check namespace, use vm-inventory, VM may be deleted
Warning: "VM is already running" (when attempting start)
Solution: Not an error - VM already in desired state. Use restart if intended to restart
Error: "Forbidden: User cannot update VirtualMachines" Solution: Verify RBAC permissions (update VirtualMachine resources), contact admin
Error: "VM stuck in 'Terminating' or 'Starting'"
Solution: Wait 30-60s, check events (oc describe vm), use vm-troubleshooter, check virt-launcher pod
Error: "Insufficient CPU/memory to start VM" Solution: Check cluster availability, stop other VMs, scale nodes, resize VM to smaller instance type
Note: Restart is implemented as two separate operations (stop → verify → start → verify) Reason: Avoids Kubernetes resourceVersion conflicts when using single restart action Behavior: If stop succeeds but start fails, VM remains stopped. Check VM status with vm-inventory
| Action | RunStrategy | Behavior |
|---|---|---|
| start | Always | Runs, auto-restarts on crash |
| stop | Halted | Stops, stays off |
| restart | Always | Stops, starts, auto-restarts |
openshift-virtualization - OpenShift MCP server with KubeVirt toolsetvm_lifecycle - Manage VM power state (start/stop/restart)vm-create - Create VMsvm-inventory - Check VM statusvm-troubleshooter (planned) - Diagnose startup/shutdown issuesIMPORTANT: This skill requires explicit user confirmation before executing. You MUST:
vm_lifecycleIf user says "no" or wants to reconsider, do not proceed.
Batch operations: When the user requests actions on multiple VMs, process each VM individually through the full workflow (Step 1-3) with separate confirmation for each. Never use a single bulk confirmation for multiple VMs.
Why: start (consumes resources), stop (interrupts services), restart (brief downtime). User should verify correct VM and understand impact.
User: "Start VM web-server in namespace vms"
Agent: [vm-lifecycle-manager skill]
## VM Lifecycle Operation
| VM Name | `web-server` | Namespace | `vms` | Action | `start` | consumes resources |
Confirm: yes/no
User: "yes"
Agent: [vm_lifecycle(namespace="vms", name="web-server", action="start")]
## ✓ VM Start Successful
VM: `web-server` | Namespace: `vms` | RunStrategy: Always
Impact: Running, consuming resources. Access: virtctl console or SSH
User: "Stop the database VM in production namespace"
Agent: [vm-lifecycle-manager skill]
| VM | `database` | Namespace | `production` | Action | `stop` | graceful shutdown |
Confirm: yes/no
User: "wait, no, don't stop it"
Agent: Operation cancelled. VM 'database' in namespace 'production' remains running.
User: "Restart test-vm in namespace dev"
Agent: [vm-lifecycle-manager skill]
| VM | `test-vm` | Namespace | `dev` | Action | `restart` | brief interruption ~1-2min |
User: "yes"
Agent: [Composite restart operation]
1. vm_lifecycle(namespace="dev", name="test-vm", action="stop")
2. Verify stopped: resources_get → status.printableStatus="Stopped"
3. Wait 5s
4. vm_lifecycle(namespace="dev", name="test-vm", action="start")
5. Verify started: resources_get → status.printableStatus="Running"
## ✓ VM Restart Successful
VM: `test-vm` | Namespace: `dev` | RunStrategy: Always
Impact: Running after stop+start. Brief interruption. Monitor app logs.
User: "Start web-server in namespace vms"
Agent: [vm-lifecycle-manager skill]
[Checks VM status via resources_get — already Running]
## ℹ️ VM Already Running
VM: `web-server` | Namespace: `vms` | Status: Running
Result: No action taken - VM already in desired state.
To restart: "Restart VM web-server in namespace vms"
User: "Stop VMs web-01, web-02, web-03 in namespace production"
Agent: [vm-lifecycle-manager skill — processes each VM individually with full workflow]
## VM Lifecycle Operation
| VM Name | `web-01` | Namespace | `production` | Action | `stop` | graceful shutdown |
Confirm: yes/no
User: "yes"
Agent: [vm_lifecycle(namespace="production", name="web-01", action="stop")]
✓ web-01: Stopped
## VM Lifecycle Operation
| VM Name | `web-02` | Namespace | `production` | Action | `stop` | graceful shutdown |
Confirm: yes/no
User: "yes"
[...repeats for each VM with individual confirmation...]
references/README.md (opens in a new tab)references/SOURCES.md (opens in a new tab)references/troubleshooting/INDEX.md (opens in a new tab)references/troubleshooting/lifecycle-errors.md (opens in a new tab)references/troubleshooting/network-errors.md (opens in a new tab)references/troubleshooting/runtime-errors.md (opens in a new tab)references/troubleshooting/scheduling-errors.md (opens in a new tab)references/troubleshooting/storage-errors.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
inheritOther plugins' skills for the same job
npx claudepluginhub rhecosystemappeng/agentic-catalog --plugin rh-virt10 skills in this plugin
/vm-cloneClone existing virtual machines for testing, scaling, or creating templates.
Use when:
- "Clone VM [source] to [target]"
- "Create a copy of VM [name]"
- "Duplicate VM [name] for testing"
- "Create 3 copies of template-vm"
This skill clones VM configuration and optionally creates new storage or references existing storage.
NOT for snapshots (use vm-snapshot for point-in-time backups).
/vm-createCreate new virtual machines in OpenShift Virtualization with automatic instance type resolution and OS selection.
Use when:
- "Create a new VM"
- "Deploy a virtual machine with [OS]"
- "Set up a VM in namespace [name]"
- "Provision a [size] VM"
This skill handles VM creation with intelligent defaults for OpenShift Virtualization.
NOT for managing existing VMs (use vm-lifecycle-manager or vm-delete instead).
/vm-deletePermanently delete virtual machines and their associated resources from OpenShift Virtualization.
Use when:
- "Delete VM [name]"
- "Remove virtual machine [name]"
- "Destroy VM [name]"
- "Clean up VM [name]"
This skill handles permanent VM deletion with strict safety confirmations and typed verification.
NOT for power management (use vm-lifecycle-manager to stop VMs).
/vm-inventoryList and view virtual machines across namespaces with status, resource usage, and health information.
Use when:
- "List all VMs"
- "Show VMs in namespace [name]"
- "What VMs are running?"
- "Get details of VM [name]"
This skill provides comprehensive VM inventory and status reporting.
NOT for creating or modifying VMs (use vm-create or vm-lifecycle-manager instead).
/vm-rebalanceOrchestrate VM migrations across cluster nodes for load balancing, maintenance, and resource optimization.
Use when:
- "Move VM database-01 to worker-03"
- "Rebalance VMs to optimize CPU load"
- "Drain worker-02 for maintenance"
- "Automatically rebalance the cluster"
Supports Manual (user-driven) and Automatic (AI-driven) modes.
NOT for creating VMs (use vm-create) or lifecycle only (use vm-lifecycle-manager).
/vm-snapshot-createCreate virtual machine snapshots for backup and recovery.
Use when:
- "Create a snapshot of VM [name]"
- "Backup VM [name] before upgrade"
- "Take a snapshot of [vm]"
Validates storage class snapshot support, CSI driver capabilities, and guest agent status before snapshot creation.
NOT for VM cloning (use vm-clone to create independent copies).