Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 453009

Summary: Cannot create new virtual machines in virt-manager
Product: [Fedora] Fedora Reporter: Casey Dahlin <cdahlin>
Component: virt-managerAssignee: Daniel Berrange <berrange>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: crobinso, hbrock, vanhoof
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-01 19:44:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
virt-manager.log none

Description Casey Dahlin 2008-06-26 15:53:25 UTC
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
been started!
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
start_install
    self.validate_parms()
  File "/usr/lib/python2.5/site-packages/virtinst/FullVirtGuest.py", line 236,
in validate_parms
    Guest.Guest.validate_parms(self)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 951, in
validate_parms
    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
settings.

Relevant versions:

Kernel: 2.6.25.3-18.fc9.x86_64
qemu: 0.9.1-5.fc9
libvirt: 0.4.2-3.fc9
virt-manager: 0.5.4-4.fc9

Will see if a reboot solves this. Component is almost certainly wrong, but I
figured I'd start it at the top.

Comment 1 Cole Robinson 2008-06-26 16:30:22 UTC
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?

Comment 2 Casey Dahlin 2008-06-26 17:40:03 UTC
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.

Comment 3 Casey Dahlin 2008-06-26 17:46:18 UTC
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.

Comment 4 Cole Robinson 2008-06-26 18:19:49 UTC
Can you attach ~/.virt-manager/virt-manager.log please? Thanks

Comment 5 Casey Dahlin 2008-06-26 18:37:35 UTC
Created attachment 310359 [details]
virt-manager.log

Here you go.

Comment 6 Cole Robinson 2008-06-26 19:16:13 UTC
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.

Comment 7 Cole Robinson 2008-12-01 19:44:37 UTC

*** This bug has been marked as a duplicate of bug 453488 ***