Using the virsh# command to delete an existing VM
I have a been working on a Centos7 Box with a couple of VMs installed, I know how to use the virsh# command to list, start or powerOff all existing VMs, However, I will like to know how to actually remove the VM with the virsh# command. Is there Such functionality. My problem is that I manually deleted a couple VMs a while ago. But when I use the virsh# command to list all existing VMs, those deleted VMs are appearing on the list as well. Any help will be very much appreciated
1 Answer
You can remove a VM's configuration by using the virsh undefine command. Note that this will not remove any storage unless you pass the arguments to do so, and this will not immediately remove any currently running VMs - they will be converted to transient and later removed after they're stopped.
See also,