<div dir="ltr"><div><div><div><div><div><div>Hi,<br><br></div>Until today, I hadn't found a way to cleanly remove a KVM virtual machine through command line on CentOS 6 or 7! I had to run 'systemctl restart libvirtd' or 'service libvirtd restart'<br><br></div>After several months (!!!), I found this thread:<br><a href="https://github.com/pradels/vagrant-libvirt/issues/107">https://github.com/pradels/vagrant-libvirt/issues/107</a><br><br></div>Now, I know how to cleanly remove a KVM virtual machine (with default file location):<br>virsh destroy <a href="http://vm.example.com">vm.example.com</a><br>virsh undefine <a href="http://vm.example.com">vm.example.com</a> --managed-save<br>/bin/rm /var/lib/libvirt/images/vm.example.com.img<br>/bin/rm /var/log/libvirt/qemu/vm.example.com.log<br>virsh vol-delete /var/lib/libvirt/images/vm.example.com.img --pool default<br><br></div>I don't know if the last command ('virsh vol-delete' avoiding the libvirtd restart) is a bug or a feature but it must be documented! Only a libvirt developer can guess something like this.<br><br></div>Feel free to change my instructions in any way you think it's better but at least document this in a public place (<a href="http://wiki.libvirt.org">http://wiki.libvirt.org</a> for example).<br><br></div>Regards.<br></div>