LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

virsh-snapshot-delete

delete a libvirt domain snapshot

TLDR

Delete a named snapshot
$ virsh snapshot-delete [domain] [snapshot]
copy
Delete the current snapshot
$ virsh snapshot-delete [domain] --current
copy
Delete a snapshot and its children
$ virsh snapshot-delete [domain] [snapshot] --children
copy
Delete only children, keep this snapshot
$ virsh snapshot-delete [domain] [snapshot] --children-only
copy
Remove libvirt metadata only (leave disk snapshot files)
$ virsh snapshot-delete [domain] [snapshot] --metadata
copy

SYNOPSIS

virsh snapshot-delete domain {snapshot | --current} [--metadata] [{--children | --children-only}]

DESCRIPTION

virsh snapshot-delete removes a snapshot from a domain. If the snapshot has children and you do not pass --children / --children-only, libvirt merges this snapshot's changes into the children so the remaining tree stays consistent.Without --metadata, deleting a snapshot also drops the data for that point in time (internal snapshot content or managed files). With --metadata, only libvirt's record is removed.This is a virsh subcommand, not a separate binary.

PARAMETERS

snapshot | --current

Snapshot to delete, or the domain's current snapshot.
--children
Also delete descendant snapshots. Mutually exclusive with --children-only.
--children-only
Delete descendants but keep this snapshot.
--metadata
Delete only libvirt's snapshot metadata; leave the underlying snapshot data for other tools.

INSTALL

sudo apt install libvirt-clients
copy
sudo dnf install libvirt-client
copy
sudo apk add libvirt-client
copy
sudo zypper install libvirt-client
copy

CAVEATS

Destructive: snapshot contents are gone unless you used --metadata or an external file you keep. Deleting the current snapshot moves "current" to a parent or another snapshot. External qemu snapshots can leave backing-file chains that qemu-img still needs to manage. Needs libvirtd access, usually with privileges to change storage.

HISTORY

Part of libvirt snapshot support in virsh.

SEE ALSO

RESOURCES

Copied to clipboard
Kai