Files
cheatsheet-tldr/tldr/virsh-undefine
2025-08-17 00:22:45 +00:00

22 lines
649 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# virsh undefine
> Delete a virtual machine.
> More information: <https://manned.org/virsh>.
- Delete only the virtual machine configuration file:
`virsh undefine --domain {{vm_name}}`
- Delete the configuration file and all associated storage volumes:
`virsh undefine --domain {{vm_name}} --remove-all-storage`
- 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,sdb,path/to/source,...}}`