Red Hat Bugzilla – Bug 453009
Cannot create new virtual machines in virt-manager
Last modified: 2014-06-18 04:46:26 EDT
After attempting to install a virtual machine, I got an error during the OS
installer. I destroyed the VM, deleted the image from /var/lib/libvirt/images,
and tried again. Now I can't click finish in the virtmanager create new virtual
system wizard without getting a "Domain has already been started!" error message
with this backtrace:
Unable to complete install '<type 'exceptions.RuntimeError'> Domain has already
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/create.py", line 651, in do_install
dom = guest.start_install(False, meter = meter)
File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 837, in
File "/usr/lib/python2.5/site-packages/virtinst/FullVirtGuest.py", line 236,
File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 951, in
raise RuntimeError, _("Domain has already been started!")
RuntimeError: Domain has already been started!
I'm trying to use qemu-kvm, with a 4GiB file image (which virtmanager
successfully creates) 512MB of ram, 1 vcpu (on a dual core box), default network
Will see if a reboot solves this. Component is almost certainly wrong, but I
figured I'd start it at the top.
Destroy doesn't actually delete a VM, it would be more accurately named 'Force
Poweroff'. Did you destroy the vm via the command line or virt-manager? Also the
proper way to delete a VM is either the delete button in the manager window of
virt-manager or use 'virsh undefine'.
So just to be sure, the first install fails, you destroy the vm then delete the
config, the hit finish on the still open install screen?
I destroyed the vm, and I deleted the config. Sorry to be unclear.
On reboot, however, the config was back, as well as a new config which libvirt
had claimed to be unsuccessful in creating previously.
Ok, it seems what's happening is this: when I click finish, it is in fact
creating the virtual machine, but the new config is not showing up in the list,
the vnc window is not coming up, and (most oddly) the wizard window is not being
closed. Having lost my train of thought during the image creation, I was
thinking there was still another step and clicking finish again, which is where
the error happens.
So the issue is it isn't properly registering when I create a new vm (except for
the first time I do it in a sesssion). Simply closing virt-manager and reopening
it makes things show up again.
Can you attach ~/.virt-manager/virt-manager.log please? Thanks
Created attachment 310359 [details]
Here you go.
Okay, what you are seeing is a result of a couple libvirt bugs, one of which is
fixed upstream but not yet in fedora. Basically if you create a machine, destroy
and delete it, then create another machine with the exact same name, crap hits
the fan. Reason was that there was a leak in the destroy python bindings that
caused libvirt reference counting to go screwy, and the unfixed bug being that
libvirt's hash entries should key on uuid and not name.
The workaround is to change the name of the second guest, or restart
virt-manager in between the two attempts. This is only an issue when using
destroy and creating guests with identical names with a persistent hypervisor
connection (which virt-manager uses)
My guess is the new libvirt release will land in fedora soon which should solve
this issue, so we can keep this bug open till then and make sure it is indeed fixed.
*** This bug has been marked as a duplicate of bug 453488 ***