Bug 694399 - virt-image: cannot attach graphic console to guest from default xml desc
Summary: virt-image: cannot attach graphic console to guest from default xml desc
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-virtinst
Version: 6.1
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Cole Robinson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-07 08:38 UTC by Nan Zhang
Modified: 2011-12-06 16:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No description necessary
Clone Of:
Environment:
Last Closed: 2011-12-06 16:16:29 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1643 0 normal SHIPPED_LIVE python-virtinst bug fix and enhancement update 2011-12-06 00:50:36 UTC

Description Nan Zhang 2011-04-07 08:38:38 UTC
Description of problem:
as subject.

Version-Release number of selected component (if applicable):
python-virtinst-0.500.5-3.el6.noarch

How reproducible:
Always

Steps to Reproduce:
# cat image.xml
<image>
  <name>vm1</name>
  <domain>
    <boot type="hvm">
      <guest>
        <arch>i386</arch>
      </guest>
      <os>
        <loader dev="hd"/>
      </os>
      <drive disk="mydisk" target="hda"/>
    </boot>
    <devices>
      <vcpu>1</vcpu>
      <memory>524288</memory>
      <interface/>
      <graphics type="vnc" port="-1"/>
    </devices>
  </domain>
  <storage>
    <disk id="mydisk" file="/var/lib/libvirt/images/vm1.img" use="system" format="raw"/>
  </storage>
</image>

# virt-image image.xml
  
Actual results:
With no graphic console defined in guest.

Expected results:
With graphic console defined in guest.

Additional info:
Specifying with --graphics or --vnc can workaround this problem.

Comment 1 RHEL Program Management 2011-04-07 08:43:41 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 2 Cole Robinson 2011-04-07 15:45:23 UTC
I can't reproduce. Please show the results of

virt-image image.xml --print --debug

and

virsh dumpxml $vmname

after running the original command virt-manager image.xml

Comment 3 Nan Zhang 2011-04-08 05:00:36 UTC
Okay, the outputs as follows.

# virt-image image.xml --print --debug
Fri, 08 Apr 2011 12:53:59 DEBUG    Launched with command line:
/usr/bin/virt-image image.xml --print --debug
Fri, 08 Apr 2011 12:53:59 DEBUG    Requesting libvirt URI default
Fri, 08 Apr 2011 12:53:59 DEBUG    Received libvirt URI qemu:///system
Fri, 08 Apr 2011 12:54:00 DEBUG    DISPLAY is not set: defaulting to nographics.
Fri, 08 Apr 2011 12:54:00 DEBUG    Generated install XML: None required
Fri, 08 Apr 2011 12:54:00 DEBUG    Generated boot XML: 
<domain type='kvm'>
  <name>vm1</name>
  <currentMemory>524288</currentMemory>
  <memory>524288</memory>
  <uuid>54ef4c92-1a58-fb25-18c6-d16d9c540915</uuid>
  <os>
    <type arch='i686'>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>
  <vcpu>1</vcpu>
  <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/vm1.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <interface type='network'>
      <source network='default'/>
      <mac address='52:54:00:75:31:84'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <console type='pty'/>
  </devices>
</domain>

<domain type='kvm'>
  <name>vm1</name>
  <currentMemory>524288</currentMemory>
  <memory>524288</memory>
  <uuid>54ef4c92-1a58-fb25-18c6-d16d9c540915</uuid>
  <os>
    <type arch='i686'>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>
  <vcpu>1</vcpu>
  <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/vm1.img'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <interface type='network'>
      <source network='default'/>
      <mac address='52:54:00:75:31:84'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <console type='pty'/>
  </devices>
</domain>

# virt-image image.xml 


Creating guest vm1...
Creating domain...                                                                                    |    0 B     00:00     
# virsh dumpxml vm1
<domain type='kvm' id='35'>
  <name>vm1</name>
  <uuid>966a3ecb-7614-50c8-dd29-da651e877b84</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686' 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/vm1.img'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:64:b2:cf'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/3'>
      <source path='/dev/pts/3'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='selinux'>
    <label>system_u:system_r:svirt_t:s0:c532,c831</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c532,c831</imagelabel>
  </seclabel>
</domain>

Comment 5 Cole Robinson 2011-07-28 15:33:52 UTC
Fixed in python-virtinst-0.600.0-1.el6

Comment 7 zhe peng 2011-08-02 08:37:47 UTC
Verify with :
python-virtinst-0.600.0-1.el6
libvirt-0.9.4-0rc1.el6
qemu-kvm-0.12.1.2-2.172.el6

step:
  1:remove os key,run command:
   #unset DISPLAY
  2:#cat test_image.xml
 <image>
  <name>vm1</name>
    <domain>
        <boot type="hvm">
          <guest>
            <arch>i386</arch>
          </guest>
          <os>
           <loader dev="hd"/>
          </os>
          <drive disk="mydisk" target="hda"/>
         </boot>
         <devices>
          <vcpu>1</vcpu>
          <memory>524288</memory>
          <interface/>
          <graphics type="vnc" port="-1"/>
         </devices>
     </domain>
     <storage>
      <disk id="mydisk" file="/tmp/test/ESX3.5-RHEL6-x64-20100807.0-flat.raw" use="system" format="raw"/>
     </storage>
</image>
   3:virt-image test_image --debug
Tue, 02 Aug 2011 03:55:28 DEBUG    Launched with command line:
/usr/bin/virt-image test_image.xml --debug
Tue, 02 Aug 2011 03:55:28 DEBUG    Requesting libvirt URI default
Tue, 02 Aug 2011 03:55:28 DEBUG    Received libvirt URI qemu:///system
Tue, 02 Aug 2011 03:55:28 DEBUG    --graphics compat generated: vnc


Creating guest vm1...
Tue, 02 Aug 2011 03:55:28 DEBUG    Generated install XML: None required
Tue, 02 Aug 2011 03:55:28 DEBUG    Generated boot XML: 
<domain type='kvm'>
  <name>vm1</name>
  <uuid>1301a091-594a-0477-31c3-b5b3876e95ca</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686'>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'/>
      <source file='/tmp/test/ESX3.5-RHEL6-x64-20100807.0-flat.raw'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <interface type='network'>
      <source network='default'/>
      <mac address='52:54:00:e3:37:b4'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1'/>
    <console type='pty'/>
    <video>
      <model type='cirrus'/>
    </video>
  </devices>
</domain>

Creating domain...                                                                                                          |    0 B     00:00     
Tue, 02 Aug 2011 03:55:29 DEBUG    Started guest, connecting to console if requested
Tue, 02 Aug 2011 03:55:29 DEBUG    XML fetched from libvirt object:
<domain type='kvm' id='47'>
  <name>vm1</name>
  <uuid>1301a091-594a-0477-31c3-b5b3876e95ca</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686' machine='rhel6.2.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'/>
      <source file='/tmp/test/ESX3.5-RHEL6-x64-20100807.0-flat.raw'/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:e3:37:b4'/>
      <source network='default'/>
      <target dev='vnet0'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='yes'/>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'>
    <label>system_u:system_r:svirt_t:s0:c358,c719</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c358,c719</imagelabel>
  </seclabel>
</domain>

Verification passed.

Comment 8 Cole Robinson 2011-11-07 16:52:41 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No description necessary

Comment 9 errata-xmlrpc 2011-12-06 16:16:29 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-1643.html


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