Standardizes the creation, management, and troubleshooting of virtual machines via kcli commands.
Install
mkdir -p .claude/skills/kcli-vm-operations && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/7163" && unzip -o skill.zip -d .claude/skills/kcli-vm-operations && rm skill.zipInstalls to .claude/skills/kcli-vm-operations
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Guides VM lifecycle operations with kcli. Use when creating, managing, or troubleshooting virtual machines across providers.Key capabilities
- →Provision virtual machines from images or profiles
- →Manage VM lifecycle states including start, stop, and restart
- →Perform disk and network interface operations
- →Create, list, and revert VM snapshots
- →Export VMs to images
- →Troubleshoot boot and connectivity issues
How it works
The tool interacts with libvirt to manage virtual machine lifecycles and configurations based on local profile definitions and command-line overrides.
Inputs & outputs
When to use kcli-vm-operations
- →Create new virtual machines
- →Manage VM states
- →Troubleshoot VM boot issues
- →Automate VM provisioning
About this skill
Important: Before creating a VM, always run
kcli create vm -hto check the latest available flags and examples.
kcli VM Operations
VM Lifecycle Commands
Create VM
# From image
kcli create vm -i fedora40 myvm
# With parameters
kcli create vm -i centos9stream -P memory=4096 -P numcpus=4 -P disks=[20,50] myvm
# From profile
kcli create vm -p myprofile myvm
# Create multiple VMs at once with -c (count)
kcli create vm -c 3 myvm
# Create 3 VMs to emulate baremetal
kcli create vm -P start=false -P memory=20480 -P numcpus=16 -P disks=[200] -P uefi=true -P nets=[default] -c 3 myvm
# Create a VM with a static IP
kcli create vm -i centos9stream -P nets=['{"name":"default","ip":"192.168.122.250","netmask":"24","gateway":"192.168.122.1"}'] myvm
# Create a VM with a DNS reservation
kcli create vm -i centos9stream -P nets=['{"name":"default","reservedns":"true"}'] myvm
# Create a VM with a DHCP reservation
kcli create vm -i centos9stream -P nets=['{"name":"default","ip":"192.168.122.250","reserveip":"true"}'] myvm
List VMs
kcli list vm # All VMs
kcli list vm -o yaml # YAML output
kcli list vm -o json # JSON output
VM Info
kcli info vm myvm # Full info
kcli info vm myvm -f ip # Specific field
kcli info vm myvm -o yaml # YAML format
Start/Stop/Restart
kcli start vm myvm
kcli stop vm myvm
kcli restart vm myvm
Delete VM
kcli delete vm myvm # With confirmation
kcli delete vm myvm --yes # Skip confirmation
kcli delete vm myvm --snapshots # Delete snapshots too
SSH Access
kcli ssh myvm # SSH as default user
kcli ssh -u root myvm # SSH as specific user
kcli ssh -l myvm # List SSH command only
Console Access
kcli console myvm # Graphical console (VNC/SPICE)
kcli console myvm --serial # Serial console
Disk Operations
# Add disk
kcli create disk -s 20 -p default myvm # 20GB disk
kcli create disk -s 50 --thin myvm # Thin provisioned
# Delete disk
kcli delete disk myvm-disk1 myvm
# List disks
kcli list disk
NIC Operations
# Add NIC
kcli create nic -n mynetwork myvm
# Delete NIC
kcli delete nic eth1 myvm
# Update NIC
kcli update nic -n newnetwork myvm --index 0
Snapshots
# Create snapshot
kcli create snapshot myvm mysnapshot
# List snapshots
kcli list snapshot myvm
# Revert to snapshot
kcli revert snapshot myvm mysnapshot
# Delete snapshot
kcli delete snapshot myvm mysnapshot
VM Configuration
Configuration Hierarchy
Parameters are resolved in order (later overrides earlier):
kvirt/defaults.py- Built-in defaults~/.kcli/config.ymldefault section- Provider-specific section in config.yml
- Profile definition (
~/.kcli/profiles.yml) - Plan file parameters
- Command-line
-Poverrides
Common Parameters
# Compute
numcpus: 2 # CPU count
memory: 512 # Memory in MB
cpumodel: host-model # CPU model
# Storage
pool: default # Storage pool
disks: # Disk configuration
- size: 20 # Size in GB
- size: 50
pool: otherpool
thin: true
# Network
nets: # Network configuration
- default # Simple: network name only
- name: mynet # Advanced: with options
ip: 192.168.1.10
netmask: 255.255.255.0
gateway: 192.168.1.1
mac: aa:bb:cc:dd:ee:ff
# OS Customization
image: fedora40 # Base image
cloudinit: true # Enable cloud-init
keys: # SSH public keys
- ssh-rsa AAAA... user@host
cmds: # Post-boot commands
- dnf -y update
- systemctl enable nginx
files: # Files to inject
- path: /etc/myconfig
content: |
key=value
Images
# List available images
kcli list image
# Download image
kcli download image fedora40
kcli download image centos9stream -p mypool
# Delete image
kcli delete image fedora40
# List all available images (from kcli catalog)
kcli list available-images
Profiles
Profiles in ~/.kcli/profiles.yml:
small:
numcpus: 1
memory: 1024
disks:
- size: 10
medium:
numcpus: 2
memory: 2048
disks:
- size: 20
webserver:
image: centos9stream
numcpus: 2
memory: 4096
nets:
- default
cmds:
- dnf -y install nginx
- systemctl enable --now nginx
Usage:
kcli create vm -p webserver myweb
Update Operations
# Update memory
kcli update vm myvm -P memory=8192
# Update CPUs
kcli update vm myvm -P numcpus=4
# Update metadata
kcli update vm myvm -P information="Production server"
Clone VM
kcli clone vm myvm myclone
kcli clone vm myvm myclone --full # Full clone (not linked)
Export VM
kcli export vm myvm # Export to image
kcli export vm myvm --image myimage # Custom image name
Troubleshooting
VM Won't Start
kcli -d start vm myvm # Debug output
sudo virsh list --all # Check libvirt state
sudo virsh start myvm # Try direct start
No IP Address
# Check DHCP is enabled on network
kcli info network default
# Check cloud-init completed
kcli ssh myvm
cat /var/log/cloud-init.log
SSH Connection Issues
# Get SSH command details
kcli ssh -l myvm
# Check VM has IP
kcli info vm myvm -f ip
# Try direct SSH
ssh -i ~/.kcli/id_rsa user@<ip>
When not to use it
- →Managing non-virtualized infrastructure
- →Directly modifying host hardware configurations
Prerequisites
Limitations
- →Requires libvirt-based virtualization environment
- →Parameter resolution follows a strict hierarchy that may override local settings
How it compares
It provides a unified command-line interface for complex virtualization tasks that would otherwise require multiple manual virsh or provider-specific commands.
Compared to similar skills
kcli-vm-operations side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| kcli-vm-operations (this skill) | 1 | 2mo | Review | Intermediate |
| docker-expert | 11 | 6mo | Review | Intermediate |
| devops-iac-engineer | 2 | 7mo | Review | Advanced |
| azure-containerregistry-py | 3 | 29d | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by karmab
View all by karmab →You might also like
docker-expert
davila7
Docker containerization expert with deep knowledge of multi-stage builds, image optimization, container security, Docker Compose orchestration, and production deployment patterns. Use PROACTIVELY for Dockerfile optimization, container issues, image size problems, security hardening, networking, and orchestration challenges.
devops-iac-engineer
davila7
Implements infrastructure as code using Terraform, Kubernetes, and cloud platforms. Designs scalable architectures, CI/CD pipelines, and observability solutions. Provides security-first DevOps practices and site reliability engineering guidance.
azure-containerregistry-py
microsoft
Azure Container Registry SDK for Python. Use for managing container images, artifacts, and repositories. Triggers: "azure-containerregistry", "ContainerRegistryClient", "container images", "docker registry", "ACR".
deployment-engineer
sickn33
Expert deployment engineer specializing in modern CI/CD pipelines, GitOps workflows, and advanced deployment automation. Masters GitHub Actions, ArgoCD/Flux, progressive delivery, container security, and platform engineering. Handles zero-downtime deployments, security scanning, and developer experience optimization. Use PROACTIVELY for CI/CD design, GitOps implementation, or deployment automation.
devops
mrgoonie
Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.
ecs
itsmostafa
AWS ECS container orchestration for running Docker containers. Use when deploying containerized applications, configuring task definitions, setting up services, managing clusters, or troubleshooting container issues.