LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

virsh-undefine

Remove libvirt domain definition

TLDR

Undefine domain
$ virsh undefine [domain]
copy
Undefine and remove storage
$ virsh undefine [domain] --remove-all-storage
copy
Undefine NVRAM domain
$ virsh undefine [domain] --nvram
copy

SYNOPSIS

virsh undefine domain [options]

DESCRIPTION

virsh undefine removes a persistent domain definition from libvirt. If the domain is running it becomes transient (running but no longer persistent); otherwise it is removed entirely. By default disk images are preserved; use --remove-all-storage to delete associated managed volumes as well.For domains using UEFI/NVRAM, the NVRAM file is removed by default; pass --keep-nvram to preserve it.

PARAMETERS

--remove-all-storage

Delete associated volumes.
--nvram
Remove NVRAM file.
--keep-nvram
Preserve NVRAM file.
--snapshots-metadata
Remove all snapshot metadata associated with the domain.
--managed-save
Remove any managed save image for the domain.
--storage volumes
Comma-separated list of volume target names or source paths to remove.
--checkpoints-metadata
Remove all checkpoint metadata for the domain.

CAVEATS

Removing storage with --remove-all-storage is irreversible. Domains with snapshots cannot be undefined unless --snapshots-metadata is supplied. Storage volumes managed outside of libvirt pools must be cleaned up manually.

SEE ALSO

Copied to clipboard
Kai