virsh-undefine

Delete a virtual machine.

TLDR

Delete only the virtual machine configuration file

$ virsh undefine --domain [vm_name]
copy


Delete the configuration file and all associated storage volumes
$ virsh undefine --domain [vm_name] --remove-all-storage
copy


Delete the configuration file and the specified storage volumes using the target name or the source name (as obtained from the virsh domblklist command)
$ virsh undefine --domain [vm_name] --storage [sda,path/to/source]
copy

Copied to clipboard