Bug 248305

Summary: Unable to install qemu-kvm guest machine
Product: [Fedora] Fedora Reporter: Jonathan Underwood <jonathan.underwood>
Component: virt-managerAssignee: Daniel Berrangé <berrange>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 7   
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: 2007-07-15 20:31:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Underwood 2007-07-15 18:48:31 UTC
Description of problem:
Installing virt-manager and friends today, and KVM, I tried to install a guest
OS from within virtmanager, but it fails at the point of creating the guest
machine with:

Unable to complete install '<class 'libvirt.libvirtError'>
virDomainCreateLinux() failed 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 681, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 649, in
start_install
    return self._do_install(consolecb, meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 666, in
_do_install
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib64/python2.5/site-packages/libvirt.py", line 521, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: virDomainCreateLinux() failed 
'

Version-Release number of selected component (if applicable):
libvirt-0.3.0-1.fc7
python-virtinst-0.103.0-3.fc7
libvirt-python-0.3.0-1.fc7
virt-manager-0.4.0-2.fc7
kvm-24-1

How reproducible:
Everytime

Steps to Reproduce:
1.Try to create a guest machine from an iso image.
2.
3.
  
Actual results:
See above

Expected results:
Guest machine created.

Additional info:
/root/.virt-manager/virt-manager.log:

Sun, 15 Jul 2007 18:59:17 WARNING  Unable to resolve local hostname for machine
Sun, 15 Jul 2007 19:04:50 DEBUG    OS Type: windows
Sun, 15 Jul 2007 19:04:50 DEBUG    OS Variant: winxp
Sun, 15 Jul 2007 19:04:50 DEBUG    Creating a VM WindowsXPProSP2
  Type: kvm
  UUID: 99527d74-cb01-c9d9-ae41-affd4527c8a5
  Source: /home/jgu/WindowsXP/XP_PRO_SP2_ENG.iso
  OS: Microsoft Windows XP
  Kickstart: 
  Memory: 500
  Max Memory: 500
  # VCPUs: 1
  Filesize: 4.8828125
  Disk image: /home/jgu/VM/WinXPPro
  Non-sparse file: False
Sun, 15 Jul 2007 19:04:50 DEBUG    Sparse file or partition selected
Sun, 15 Jul 2007 19:04:50 DEBUG    Starting background install process
Sun, 15 Jul 2007 19:04:50 DEBUG    Creating guest from '<domain type='kvm'>
  <name>WindowsXPProSP2</name>
  <currentMemory>512000</currentMemory>
  <memory>512000</memory>
  <uuid>99527d74-cb01-c9d9-ae41-affd4527c8a5</uuid>
  <os>
    <type arch='x86_64'>hvm</type>

    <boot dev='cdrom'/>
  </os>
  <features>
    <apic/><acpi/><pae/>
  </features>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>destroy</on_reboot>
  <on_crash>destroy</on_crash>
  <vcpu>1</vcpu>
  <devices>
    <console device='pty'/>
    <disk type='file' device='disk'>
      <source file='/home/jgu/VM/WinXPPro'/>
      <target dev='hda'/>
    </disk>
    <disk type='file' device='cdrom'>
      <source file='/home/jgu/WindowsXP/XP_PRO_SP2_ENG.iso'/>
      <target dev='hdc'/>
      <readonly/>
    </disk>

    <interface type='network'>
      <source network='default'/>
      <mac address='00:16:3e:38:67:d8'/>
    </interface>

    <graphics type='vnc' port='-1' />
  </devices>
</domain>
'
Sun, 15 Jul 2007 19:04:50 ERROR    Unable to complete install '<class 'libvirt.l
ibvirtError'> virDomainCreateLinux() failed 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 681, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 649, in start_
install
    return self._do_install(consolecb, meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 666, in _do_in
stall
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib64/python2.5/site-packages/libvirt.py", line 521, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self
)
libvirtError: virDomainCreateLinux() failed 
'
Sun, 15 Jul 2007 19:15:32 DEBUG    OS Type: windows
Sun, 15 Jul 2007 19:15:32 DEBUG    OS Variant: winxp
Sun, 15 Jul 2007 19:15:32 DEBUG    Creating a VM WindowsXPPro
  Type: kvm
  UUID: a7ca11fd-1a40-7ca6-640c-cb1347073613
  Source: /home/jgu/WindowsXP/XP_PRO_SP2_ENG.iso
  OS: Microsoft Windows XP
  Kickstart: 
  Memory: 512
  Max Memory: 512
  # VCPUs: 1
  Filesize: 4.8828125
  Disk image: /home/jgu/VM/WinXPPro
  Non-sparse file: True
Sun, 15 Jul 2007 19:15:32 DEBUG    Non-sparse file selected
Sun, 15 Jul 2007 19:15:32 DEBUG    Starting background install process
Sun, 15 Jul 2007 19:15:32 DEBUG    Creating guest from '<domain type='kvm'>
  <name>WindowsXPPro</name>
  <currentMemory>524288</currentMemory>
  <memory>524288</memory>
  <uuid>a7ca11fd-1a40-7ca6-640c-cb1347073613</uuid>
  <os>
    <type arch='x86_64'>hvm</type>

    <boot dev='cdrom'/>
  </os>
  <features>
    <apic/><acpi/><pae/>
  </features>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>destroy</on_reboot>
  <on_crash>destroy</on_crash>
  <vcpu>1</vcpu>
  <devices>
    <console device='pty'/>
    <disk type='file' device='disk'>
      <source file='/home/jgu/VM/WinXPPro'/>
      <target dev='hda'/>
    </disk>
    <disk type='file' device='cdrom'>
      <source file='/home/jgu/WindowsXP/XP_PRO_SP2_ENG.iso'/>
      <target dev='hdc'/>
      <readonly/>
    </disk>

    <interface type='network'>
      <source network='default'/>
      <mac address='00:16:3e:26:ab:f6'/>
    </interface>

    <graphics type='vnc' port='-1' />
  </devices>
</domain>
'
Sun, 15 Jul 2007 19:15:32 ERROR    Unable to complete install '<class 'libvirt.l
ibvirtError'> virDomainCreateLinux() failed 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 681, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 649, in start_
install
    return self._do_install(consolecb, meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 666, in _do_in
stall
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib64/python2.5/site-packages/libvirt.py", line 521, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self
      <mac address='00:16:3e:26:ab:f6'/>
    </interface>

    <graphics type='vnc' port='-1' />
  </devices>
</domain>
'
Sun, 15 Jul 2007 19:15:32 ERROR    Unable to complete install '<class 'libvirt.l
ibvirtError'> virDomainCreateLinux() failed 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 681, in do_install
    dom = guest.start_install(False, meter = meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 649, in start_
install
    return self._do_install(consolecb, meter)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 666, in _do_in
stall
    self.domain = self.conn.createLinux(install_xml, 0)
  File "/usr/lib64/python2.5/site-packages/libvirt.py", line 521, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self
)
libvirtError: virDomainCreateLinux() failed 
'

Comment 1 Jonathan Underwood 2007-07-15 18:58:21 UTC
I think this may have something to do with the fact that I unchecked the box to
allocate the whole disk storeage now - it succeeds if I leave that checked.

Comment 2 Jonathan Underwood 2007-07-15 18:59:19 UTC
Oh, scrap my previous comment. If I leave the box to create the whole disk image
now checked, the file is crated, but then once that completes I get the same
error message as previously.

Comment 3 Daniel Berrangé 2007-07-15 19:03:15 UTC
Yep, I won't expect  the pre-allocation to make any functional difference -
though I have noticed that sometimes the kernel is so overwhealmed with I/O from
pre-allocating the disk, that the VM startup takes longer than normal & times
out.  I'll try and reproduce this problem.


What kernel are you on, btw ?

Comment 4 Jonathan Underwood 2007-07-15 19:23:44 UTC
uname -ar:

2.6.21-1.3255.fc7 #1 SMP Thu Jul 5 18:03:06 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux


Comment 5 Daniel Berrangé 2007-07-15 19:29:18 UTC
I tried with pretty much same install parameters as your logs show and it
succeeded for me. So there must be something in host environment that is
different for me vs you which we need to track down & resolve. So a couple more
questions 

 - What does   'virsh --conect qemu:///system net-list --all'  show when run as
root ?
 - Did you get a /var/log/libvirt/qemu/WindowsXPProSP2.log  file created, and if
so is there any info in it ?
 - How much physical RAM have you got & how much is free - output of
/proc/meminfo would be useful 

Comment 6 Jonathan Underwood 2007-07-15 20:00:57 UTC
(In reply to comment #5)
> I tried with pretty much same install parameters as your logs show and it
> succeeded for me. So there must be something in host environment that is
> different for me vs you which we need to track down & resolve. So a couple more
> questions 
> 
>  - What does   'virsh --conect qemu:///system net-list --all'  show when run as
> root ?
]# virsh --conect qemu:///system net-list --all
virsh: unrecognized option `--conect'
virsh: error: unsupported option '-?'. See --help.
[root@renton jgu]# virsh --connect qemu:///system net-list --all
Name                 State      Autostart 
-----------------------------------------
default              active     yes     




>  - Did you get a /var/log/libvirt/qemu/WindowsXPProSP2.log  file created, and if
> so is there any info in it ?

It is created, but has zero length I am afraid.

>  - How much physical RAM have you got & how much is free - output of
> /proc/meminfo would be useful 
# cat /proc/meminfo 
MemTotal:      2050300 kB
MemFree:        962172 kB
Buffers:         30028 kB
Cached:         444152 kB
SwapCached:          0 kB
Active:         546304 kB
Inactive:       345976 kB
SwapTotal:     4096564 kB
SwapFree:      4096564 kB
Dirty:               0 kB
Writeback:           0 kB
AnonPages:      418224 kB
Mapped:         114508 kB
Slab:            40280 kB
SReclaimable:    16528 kB
SUnreclaim:      23752 kB
PageTables:      26844 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   5121712 kB
Committed_AS:   913300 kB
VmallocTotal: 34359738367 kB
VmallocUsed:      4836 kB
VmallocChunk: 34359733031 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     2048 kB



Comment 7 Daniel Berrangé 2007-07-15 20:14:05 UTC
> >  - Did you get a /var/log/libvirt/qemu/WindowsXPProSP2.log  file created, and if
> > so is there any info in it ?
>
> It is created, but has zero length I am afraid.

Excellant - that gives me a critically useful bit of info. There is only one
function called between time of opening the log file & time the first data is
written to it, so this must be what is failing. 

Based on this I think the 'qemu' binary is missing - can you tell me if you have
 the 'qemu' RPM installed ? And, yes, this is needed even for KVM installs.
There's a missing RPM dependancy which I think could be the cause of the trouble.

Comment 8 Jonathan Underwood 2007-07-15 20:22:58 UTC
Aha, yes, I checked, and indeed qemu wasn't installed. Naively I had assumed
that yum install kvm would pull in any qemu requirement - I had actually thought
that kvm shipped with a modified qemu and so wouldn't need the "normal" one. Now
I feel really dumb. I have installed qemu, and everything works. Very sorry for
the noise and wasting your time. I'll check for a BZ for the missing dependency
and make one if there isn't already one.

Comment 9 Jonathan Underwood 2007-07-15 20:31:17 UTC
Have opened bug 248312 against kvm for the missing dependency. Will close this
as NOTABUG.