Bug 692355 - Unable to add graphics console device after installing with --nographics option by virt-install
Summary: Unable to add graphics console device after installing with --nographics opti...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.1
Hardware: Unspecified
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-31 06:28 UTC by Nan Zhang
Modified: 2018-11-26 18:00 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.9.2-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 11:03:45 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1513 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-12-06 01:23:30 UTC

Description Nan Zhang 2011-03-31 06:28:38 UTC
Description of problem:
as subject.

Version-Release number of selected component (if applicable):
libvirt-0.8.7-15.el6.x86_64
python-virtinst-0.500.5-3.el6.noarch
virt-manager-0.8.6-3.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. # virt-install -n demo -r 512 -f /var/lib/libvirt/images/demo.img -s 6 -l http://download.englab.nay.redhat.com/pub/rhel/rel-eng/RHEL6.1-20110323.1/6.1/Server/x86_64/os/ -x ks=http://home.englab.nay.redhat.com/~nzhang/kickstart/http/ks-rhel6u1-x86_64.cfg --graphics type=none --noreboot
2. Use virt-manager to add a virtual hardware "Graphics" -> "Type: VNC server"
  
Actual results:
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 932, in add_device
    self.vm.add_device(self._dev)
  File "/usr/share/virt-manager/virtManager/domain.py", line 268, in add_device
    self.redefine_cached()
  File "/usr/share/virt-manager/virtManager/domain.py", line 258, in redefine_cached
    self._redefine_xml(xml)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 152, in _redefine_xml
    return self._redefine_helper(origxml, newxml)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 142, in _redefine_helper
    self._define(newxml)
  File "/usr/share/virt-manager/virtManager/domain.py", line 957, in _define
    self.get_connection().define_domain(newxml)
  File "/usr/share/virt-manager/virtManager/connection.py", line 752, in define_domain
    self.vmm.defineXML(xml)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1363, in defineXML
    if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
libvirtError: internal error unable to reserve PCI address 0:0:2

Expected results:
The graphics console can be added to guest successfully.

Additional info:

Comment 1 Nan Zhang 2011-03-31 06:43:22 UTC
# virt-manager --debug
2011-03-31 14:41:10,109 (virt-manager:175): Application startup
2011-03-31 14:41:10,109 (virt-manager:352): Launched as: /usr/share/virt-manager/virt-manager.py --debug
2011-03-31 14:41:10,185 (config:34): Error importing spice: No module named SpiceClientGtk
2011-03-31 14:41:10,287 (engine:335): About to connect to uris ['qemu:///system']
2011-03-31 14:41:10,326 (engine:461): window counter incremented to 1
2011-03-31 14:41:10,367 (connection:872): Scheduling background open thread for qemu:///system
2011-03-31 14:41:10,368 (connection:1032): Background thread is running
2011-03-31 14:41:10,382 (connection:1060): Background open thread complete, scheduling notify
2011-03-31 14:41:10,406 (connection:1065): Notifying open result
2011-03-31 14:41:10,588 (connection:1072): qemu:///system capabilities:
<capabilities>

  <host>
    <uuid>44454c4c-3800-104e-8058-c3c04f4b3258</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Penryn</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='2' threads='1'/>
      <feature name='xtpr'/>
      <feature name='tm2'/>
      <feature name='est'/>
      <feature name='vmx'/>
      <feature name='ds_cpl'/>
      <feature name='monitor'/>
      <feature name='pbe'/>
      <feature name='tm'/>
      <feature name='ht'/>
      <feature name='ss'/>
      <feature name='acpi'/>
      <feature name='ds'/>
      <feature name='vme'/>
    </cpu>
    <migration_features>
      <live/>
      <uri_transports>
        <uri_transport>tcp</uri_transport>
      </uri_transports>
    </migration_features>
    <topology>
      <cells num='1'>
        <cell id='0'>
          <cpus num='2'>
            <cpu id='0'/>
            <cpu id='1'/>
          </cpus>
        </cell>
      </cells>
    </topology>
    <secmodel>
      <model>selinux</model>
      <doi>0</doi>
    </secmodel>
  </host>

  <guest>
    <os_type>hvm</os_type>
    <arch name='i686'>
      <wordsize>32</wordsize>
      <emulator>/usr/libexec/qemu-kvm</emulator>
      <machine>rhel6.1.0</machine>
      <machine canonical='rhel6.1.0'>pc</machine>
      <machine>rhel6.0.0</machine>
      <machine>rhel5.5.0</machine>
      <machine>rhel5.4.4</machine>
      <machine>rhel5.4.0</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/libexec/qemu-kvm</emulator>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <deviceboot/>
      <pae/>
      <nonpae/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/libexec/qemu-kvm</emulator>
      <machine>rhel6.1.0</machine>
      <machine canonical='rhel6.1.0'>pc</machine>
      <machine>rhel6.0.0</machine>
      <machine>rhel5.5.0</machine>
      <machine>rhel5.4.4</machine>
      <machine>rhel5.4.0</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/libexec/qemu-kvm</emulator>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <deviceboot/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

</capabilities>

2011-03-31 14:41:10,753 (connection:545): Connection managed save support: True
2011-03-31 14:41:10,783 (connection:205): Using libvirt API for netdev enumeration
2011-03-31 14:41:10,784 (connection:244): Using libvirt API for mediadev enumeration
2011-03-31 14:41:20,881 (engine:461): window counter incremented to 2
2011-03-31 14:41:26,683 (addhardware:906): Adding device:
    <graphics type='vnc' port='-1' listen='127.0.0.1'/>
2011-03-31 14:41:26,694 (libvirtobject:140): Redefining 'demo' with XML diff:
--- Original XML 
+++ New XML 
@@ -44,5 +44,6 @@
     <memballoon model="virtio">
       <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
     </memballoon>
+    <graphics type="vnc" port="-1" listen="127.0.0.1"/>
   </devices>
 </domain>

2011-03-31 14:41:26,776 (error:66): dialog message: Error adding device: internal error unable to reserve PCI address 0:0:2 : Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 932, in add_device
    self.vm.add_device(self._dev)
  File "/usr/share/virt-manager/virtManager/domain.py", line 268, in add_device
    self.redefine_cached()
  File "/usr/share/virt-manager/virtManager/domain.py", line 258, in redefine_cached
    self._redefine_xml(xml)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 152, in _redefine_xml
    return self._redefine_helper(origxml, newxml)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 142, in _redefine_helper
    self._define(newxml)
  File "/usr/share/virt-manager/virtManager/domain.py", line 957, in _define
    self.get_connection().define_domain(newxml)
  File "/usr/share/virt-manager/virtManager/connection.py", line 752, in define_domain
    self.vmm.defineXML(xml)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1363, in defineXML
    if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
libvirtError: internal error unable to reserve PCI address 0:0:2

Comment 2 Osier Yang 2011-03-31 08:33:33 UTC
Hi, nzhang, what's the domain xml?

Comment 3 Nan Zhang 2011-03-31 09:29:49 UTC
# virsh dumpxml demo
<domain type='kvm'>
  <name>demo</name>
  <uuid>9af0287b-2db5-9bc8-4fd8-bb9cfb1b642d</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.1.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='threads'/>
      <source file='/var/lib/libvirt/images/demo.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </disk>
    <interface type='network'>
      <mac address='52:54:00:87:1a:e8'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Comment 4 RHEL Product and Program Management 2011-04-04 02:05:38 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 5 Osier Yang 2011-04-05 13:51:41 UTC
patch posted to upstream:
http://www.redhat.com/archives/libvir-list/2011-April/msg00243.html

Comment 6 Daniel Veillard 2011-06-23 02:56:14 UTC
This should be fixed by the libvirt-0.9.2-1.el6 rebase

Comment 7 Huang Wenlong 2011-06-24 05:36:29 UTC
libvirt-0.9.2-1.el6.x86_64
qemu-kvm-0.12.1.2-2.165.el6.x86_64
kernel-2.6.32-156.el6.x86_64
virt-manager-0.8.6-4.el6


Test step:

1)
virt-install -n demo -r 512 -f /var/lib/libvirt/images/demo.img -s 6 -l http://download.englab.nay.redhat.com/pub/rhel/rel-eng/latest-RHEL-6/6.1/Server/x86_64/os/ -x ks=http://pxe.englab.nay.redhat.com/kickstarts/general/v2v-rhel6u1-64b-autotest.cfg --graphics none --noreboot
2) run virt-manager --debug then add vnc to domain

*virt-manager --debug info *
2011-06-23 17:12:27,054 (engine:461): window counter incremented to 2
2011-06-23 17:12:27,056 (console:891): No graphics configured for guest
2011-06-23 17:12:34,557 (addhardware:906): Adding device:
<graphics type='vnc' port='-1' listen='127.0.0.1'/>
2011-06-23 17:12:34,560 (addhardware:913): Device could not be hotplugged: unsupported configuration: device type 'graphics' cannot be attached
2011-06-23 17:12:34,562 (error:66): dialog message: Are you sure you want to add this device? : unsupported configuration: device type 'graphics' cannot be attached

Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/addhardware.py", line 911, in add_device
self.vm.attach_device(self._dev)
File "/usr/share/virt-manager/virtManager/domain.py", line 1159, in attach_device
self._backend.attachDevice(devxml)
File "/usr/lib64/python2.6/site-packages/libvirt.py", line 298, in attachDevice
if ret == -1: raise libvirtError ('virDomainAttachDevice() failed', dom=self)
libvirtError: unsupported configuration: device type 'graphics' cannot be attached

2011-06-23 17:12:36,756 (libvirtobject:140): Redefining 'demo' with XML diff:
--- Original XML 
++ New XML 
@ -41,5 +41,6 @
<memballoon model="virtio">
<address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0"/>
</memballoon>
<graphics type="vnc" port="-1" listen="127.0.0.1"/>
</devices>
</domain>

2011-06-23 17:12:36,886 (console:891): No graphics configured for guest

3)  There are some error message in virt-manager debug info ,when guest is running  virsh dumpxml $domain can find any info about graphics.


4)  But when guest finish installation and shutdown , we can find the the VNC will be attached in domain , virsh dumpxml domain will get 
...
<graphics type='vnc' port='5902' autoport='yes' listen='127.0.0.1'/>
...

and virt-manager can via domain's graphics with VNC



There are still some error message about graphics when attach VNC in virt-manager debug info :
...
libvirtError: unsupported configuration: device type 'graphics' cannot be attached
...
Do you think this is a new issue we need create a new bug for it or assigned this one ?

Comment 8 Osier Yang 2011-07-01 08:37:27 UTC
The error "device type 'graphics' cannot be attached" is expected, you might want to verify the bug with:

Change following

<snip>
2) run virt-manager --debug then add vnc to domain
</snip>

Into:

2) # virsh edit $domain, to add a graphic card.

If you don't see error like "internal error unable to reserve PCI address 0:0:2", then the fix for this bug take effects.

But for:

<snip>
4)  But when guest finish installation and shutdown , we can find the the VNC
will be attached in domain , virsh dumpxml domain will get 
</snip>

It's a bug, actually I tried to remove the graphic of a guest, it reports failure, however, the xml of graphics is removed in the domain xml. Please file another bug.

Comment 9 Huang Wenlong 2011-07-04 07:46:04 UTC
(In reply to comment #8)
> The error "device type 'graphics' cannot be attached" is expected, you might
> want to verify the bug with:
> 
> Change following
> 
> <snip>
> 2) run virt-manager --debug then add vnc to domain
> </snip>
> 
> Into:
> 
> 2) # virsh edit $domain, to add a graphic card.
> 
> If you don't see error like "internal error unable to reserve PCI address
> 0:0:2", then the fix for this bug take effects.
> 
> But for:
> 
> <snip>
> 4)  But when guest finish installation and shutdown , we can find the the VNC
> will be attached in domain , virsh dumpxml domain will get 
> </snip>
> 
> It's a bug, actually I tried to remove the graphic of a guest, it reports
> failure, however, the xml of graphics is removed in the domain xml. Please file
> another bug.

I tried to use virsh edit to add a graphic card without any error info

#virsh edit demo
Domain demo XML configuration edited.

this bug verified.

Comment 11 Rita Wu 2011-07-06 10:57:49 UTC
Set it as VERIFIED per comment9

Comment 12 errata-xmlrpc 2011-12-06 11:03:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1513.html


Note You need to log in before you can comment on or make changes to this bug.