Comment 19 for bug 562189

Revision history for this message
Lennart Karssen (l.c.karssen) wrote :

I ran into this same problem (Ubuntu 10.04). As the successful use of the --hostname option already suggests, this has to do with the hostname given to the VM. This hostname is also used in the xml files that are placed in the /etc/libvirt/qemu directory as noted in comments #11/#12/#15. If one wants to (re-)create a VM with a name that has been used previously, it is not only necessary to remove the .xml file in /etc/libvirt/qemu/ (comment #15), but also that libvirtd is told to remove the VM definition (basically what comment #15 did by restarting libvirtd).

The simplest way to tell libvirtd to forget about the old VM host is to run virsh --connect qemu:///system undefine your_hostname (this also removes the .xml file from /etc/libvirt/qemu).

So I guess the simplest fix for this bug is outputting an error message if the hostname of the new VM already exists.