vm_delete_snapshot
Delete a VMware VM snapshot to free disk space by consolidating its delta disk into the parent. Supports preserving or removing child snapshots. Works on running VMs.
Instructions
[WRITE] Permanently delete a named snapshot, consolidating its delta disk into the parent.
Frees disk space and does NOT change the VM's current state (unlike vm_revert_snapshot, which discards changes since the snapshot). Works while the VM is powered on. Run vm_list_snapshots first for exact names — unknown names return the available list. Irreversible: confirm with the user before calling. Audited to ~/.vmware/audit.db.
Snapshot consolidation is slow for old/large delta disks (often minutes). By default (wait=False) this fires the delete and returns a task id immediately so it does not block your context — poll completion with vm_task_status. Set wait=True only for small snapshots where you want the final confirmation inline (blocks up to 30 min, then returns the task id).
Args: vm_name: Exact name of the VM owning the snapshot. snapshot_name: Exact snapshot name from vm_list_snapshots output. remove_children: False (default) = children are kept and consolidated; True = delete the entire snapshot subtree below this one as well. wait: False (default) = async, return task id immediately; True = block on consolidation. target: vCenter/ESXi target name from config.yaml; omit to use the default target.
Returns: Status string with a task id (poll via vm_task_status), or a not-found message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | ||
| target | No | ||
| vm_name | Yes | ||
| snapshot_name | Yes | ||
| remove_children | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |