/rh-virt:vm-snapshot-deletefrom rh-virt
Permanently delete virtual machine snapshots to free storage space. Use when: - "Delete snapshot [snapshot-name]" - "Remove old snapshots for VM [name]" - "Free up snapshot storage" Requires user confirmation before deletion. NOT for restoring VMs (use vm-snapshot-restore instead).
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.
None: SKILL.md is the whole skill.
Permanently delete virtual machine snapshots in OpenShift Virtualization. Deleting snapshots frees storage but removes recovery points.
Required MCP Server: openshift-virtualization (OpenShift MCP Server)
Required MCP Tools:
resources_get (from openshift-virtualization) - Verify snapshot existsresources_list (from openshift-virtualization) - List related snapshotsresources_delete (from openshift-virtualization) - Delete snapshotRequired Environment Variables:
KUBECONFIG - Path to Kubernetes configuration file with cluster accessRequired Cluster Setup:
Before executing, verify MCP server availability:
Check MCP Server Configuration
openshift-virtualization exists in mcps.jsonCheck Environment Variables
KUBECONFIG is set (check presence only, never expose value)Trigger this skill when:
User phrases that trigger this skill:
Do NOT use this skill when:
vm-snapshot-create skillvm-snapshot-restore skillvm-snapshot-list skillRequired Information from User:
If namespace not provided, ask for it.
MCP Tool: resources_get (from openshift-virtualization)
Parameters:
{
"apiVersion": "snapshot.kubevirt.io/v1beta1",
"kind": "VirtualMachineSnapshot",
"namespace": "<namespace>",
"name": "<snapshot-name>"
}
Expected Output: VirtualMachineSnapshot resource
Error Handling:
If snapshot not found:
❌ Snapshot Not Found
**Snapshot**: `<snapshot-name>` not found in namespace `<namespace>`.
**To list available snapshots:**
"List snapshots in namespace <namespace>"
Delete operation cancelled.
STOP workflow.
If snapshot found, extract snapshot details:
spec.source.name - VM namemetadata.creationTimestamp - Creation timestampstatus.phase - Snapshot statusMCP Tool: resources_list (from openshift-virtualization)
Parameters:
{
"apiVersion": "snapshot.kubevirt.io/v1beta1",
"kind": "VirtualMachineSnapshot",
"namespace": "<namespace>",
"labelSelector": "vm.kubevirt.io/name=<vm-name>"
}
Fallback: If label selector doesn't work, list all snapshots and filter by spec.source.name.
Count snapshots for the VM to determine if this is the last snapshot.
## ⚠️ Snapshot Deletion - Review
**Snapshot to Delete**: `<snapshot-name>`
### Snapshot Details
- **Snapshot Name**: `<snapshot-name>`
- **VM**: `<vm-name>`
- **Namespace**: `<namespace>`
- **Created**: <creation-timestamp>
- **Age**: <snapshot-age>
- **Status**: <status>
### Impact of Deletion
- ✗ Snapshot will be permanently deleted
- ✗ This recovery point will be lost
- ✗ Cannot restore VM to this snapshot state after deletion
- ✓ Storage will be freed
### Recovery Impact
**Before deletion, consider:**
- Is this snapshot still needed for recovery?
- Are there other recovery points available?
- Could you need to restore to this state in the future?
**Available snapshots for VM `<vm-name>`:**
<list other snapshots for the same VM, if any>
<if no other snapshots>
⚠️ **WARNING**: This is the ONLY snapshot for VM `<vm-name>`. After deletion, no snapshot recovery points will exist.
</if>
---
**Type the snapshot name `<snapshot-name>` to confirm deletion (cannot be undone):** _____
Wait for user typed confirmation.
Handle response:
❌ Confirmation failed. You typed: <input>. Expected: <snapshot-name>. Cancelled. STOP workflow.On cancellation:
Snapshot deletion cancelled by user. Snapshot `<snapshot-name>` preserved.
STOP workflow.
ONLY PROCEED AFTER user confirmation in Step 4.
MCP Tool: resources_delete (from openshift-virtualization)
Parameters:
{
"apiVersion": "snapshot.kubevirt.io/v1beta1",
"kind": "VirtualMachineSnapshot",
"namespace": "<namespace>",
"name": "<snapshot-name>"
}
Example tool invocation:
resources_delete({
"apiVersion": "snapshot.kubevirt.io/v1beta1",
"kind": "VirtualMachineSnapshot",
"namespace": "production",
"name": "old-snapshot"
})
Expected Output: VirtualMachineSnapshot deleted successfully
Error Handling:
Report progress:
🗑️ Deleting snapshot...
✓ Snapshot `<snapshot-name>` deleted
On success:
## ✓ Snapshot Deleted Successfully
**Snapshot**: `<snapshot-name>` (VM: `<vm-name>`, namespace: `<namespace>`)
### Deletion Summary
- ✓ Snapshot permanently deleted
- ✓ Storage freed
- ✓ Recovery point removed
### Impact
- ✗ Cannot restore VM to <snapshot-creation-timestamp> state
- ✗ Snapshot `<snapshot-name>` no longer available
<if other snapshots exist>
### Remaining Snapshots for VM `<vm-name>`
<list remaining snapshots>
These snapshots are still available for recovery.
</if>
<if no other snapshots>
⚠️ **No snapshots remain** for VM `<vm-name>`. Consider creating new snapshots for future recovery points.
</if>
---
### Next Steps
**To create a new snapshot:**
"Create snapshot of VM <vm-name>"
**To list remaining snapshots:**
"List snapshots for VM <vm-name>"
On failure:
## ❌ Snapshot Deletion Failed
**Error**: <error-message>
**Snapshot**: `<snapshot-name>` (VM: `<vm-name>`, namespace: `<namespace>`)
**Common Causes:**
- **Snapshot not found** - May have been deleted externally
- **Insufficient RBAC permissions** - ServiceAccount lacks delete permissions
- **Snapshot in use** - Snapshot may be in active restore process
- **Storage backend error** - CSI driver or storage backend issue
**Troubleshooting Steps:**
1. **Verify snapshot still exists:**
"List snapshots for VM <vm-name>"
2. **Check if snapshot is being used for restore:**
Use `resources_list` to check for active VirtualMachineRestore resources
3. **Check permissions:**
Use CLI: `oc auth can-i delete virtualmachinesnapshots -n <namespace>`
4. **Wait and retry** if snapshot is in use by restore operation
Would you like help troubleshooting this error?
Error: "Snapshot <name> not found in namespace <namespace>"
Cause: Snapshot doesn't exist, was deleted, or wrong namespace/name.
Solution:
Error: "Snapshot is in use by restore operation"
Cause: An active VirtualMachineRestore is using this snapshot.
Solution:
resources_list with apiVersion="snapshot.kubevirt.io/v1beta1", kind="VirtualMachineRestore"Error: "Forbidden: User lacks permissions to delete virtualmachinesnapshots"
Cause: Missing RBAC permissions for snapshot deletion.
Solution:
oc auth can-i delete virtualmachinesnapshots -n <namespace>openshift-virtualization - OpenShift MCP server with kubevirt toolsetresources_get (from openshift-virtualization) - Get snapshot details
resources_list (from openshift-virtualization) - List related snapshots
resources_delete (from openshift-virtualization) - Delete Kubernetes resources
vm-snapshot-list - List snapshots before deletionvm-snapshot-create - Create new snapshotsvm-snapshot-restore - Restore VMs from snapshotsIMPORTANT: This skill performs destructive operations. You MUST:
Before Deleting Snapshots
Never Auto-Execute
Why This Matters:
User: "Delete snapshot database-01-daily-backup"
Agent: "Which namespace is the snapshot in?"
User: "production"
Agent: [Invokes vm-snapshot-delete skill]
[Step 2: Verifies snapshot exists]
[Step 3: Lists other snapshots]
[Step 4: Presents deletion confirmation]
## ⚠️ Snapshot Deletion - Review
Snapshot to Delete: `database-01-daily-backup`
Snapshot Details:
- Name: `database-01-daily-backup`
- VM: `database-01`
- Namespace: `production`
- Created: 2024-01-14 02:00:00 UTC
- Age: 1 day
Impact of Deletion:
- ✗ Snapshot will be permanently deleted
- ✗ This recovery point will be lost
- ✓ Storage will be freed
Available snapshots for VM `database-01`:
- `database-01-pre-upgrade` (created 2024-01-15 10:30)
Type the snapshot name `database-01-daily-backup` to confirm deletion (cannot be undone): _____
User: "database-01-daily-backup"
Agent: [Step 5: Deletes snapshot]
🗑️ Deleting snapshot...
✓ Snapshot `database-01-daily-backup` deleted
[Step 6: Reports results]
## ✓ Snapshot Deleted Successfully
Snapshot: `database-01-daily-backup`
Deletion Summary:
- ✓ Snapshot permanently deleted
- ✓ Storage freed
- ✓ Recovery point removed
Remaining Snapshots for VM `database-01`:
- `database-01-pre-upgrade` (created 2024-01-15 10:30)
This snapshot is still available for recovery.
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-