Bug 1243474 - "virsh console" depends on PTY devices and doesn't support TCP serial devices
Summary: "virsh console" depends on PTY devices and doesn't support TCP serial devices
Keywords:
Status: CLOSED DUPLICATE of bug 781467
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-15 14:18 UTC by Markus Zoeller
Modified: 2016-04-10 21:35 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-04-10 21:35:31 UTC
Embargoed:


Attachments (Terms of Use)

Description Markus Zoeller 2015-07-15 14:18:11 UTC
Description of problem:
When OpenStack uses libvirt(KVM) as hypervisor, it creates multiple devices for the guest:
* One device is used to log the kernel boot messages into a 
  file on the host
* another device is used to provide a "serial TCP console" if a host
  doesn't support graphical devices like VNC or SPICE.

In the case where this TCP device is created, it is not possible to
login to the guest with "virsh console <domain> [--devname]".


Version-Release number of selected component (if applicable):
1.2.2


How reproducible:
100%


Steps to Reproduce:
1. start a domain (XML below) which has a serial TCP device
2. login to the domain with "virsh console <domain>" 


Actual results:
error: internal error character device (null) is not using a PTY


Expected results:
Login to the guest and prompt for credentials (like it is done if the PTY device is used)

Additional info:
Domain XML I used:
    <domain type='qemu' id='2'>
      <name>instance-00000001</name>
      <uuid>2497e33d-1af5-4e11-b0c1-c18cc6b229f3</uuid>
      <memory unit='KiB'>524288</memory>
      <currentMemory unit='KiB'>524288</currentMemory>
      <vcpu placement='static'>1</vcpu>
      <cputune>
        <shares>1024</shares>
      </cputune>
      <resource>
        <partition>/machine</partition>
      </resource>
      <sysinfo type='smbios'>
        <system>
          <entry name='manufacturer'>OpenStack Foundation</entry>
          <entry name='product'>OpenStack Nova</entry>
          <entry name='version'>2015.2.0</entry>
          <entry name='serial'>71f4adb7-41c7-8f3d-a1aa-6a935aa79ac6</entry>
          <entry name='uuid'>2497e33d-1af5-4e11-b0c1-c18cc6b229f3</entry>
        </system>
      </sysinfo>
      <os>
        <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
        <kernel>/opt/stack/data/nova/instances/2497e33d-1af5-4e11-b0c1-c18cc6b229f3/kernel</kernel>
        <initrd>/opt/stack/data/nova/instances/2497e33d-1af5-4e11-b0c1-c18cc6b229f3/ramdisk</initrd>
        <cmdline>root=/dev/vda console=tty0 console=ttyS0 no_timer_check</cmdline>
        <boot dev='hd'/>
        <smbios mode='sysinfo'/>
      </os>
      <features>
        <acpi/>
        <apic/>
      </features>
      <cpu>
        <topology sockets='1' cores='1' threads='1'/>
      </cpu>
      <clock offset='utc'/>
      <on_poweroff>destroy</on_poweroff>
      <on_reboot>restart</on_reboot>
      <on_crash>destroy</on_crash>
      <devices>
        <emulator>/usr/bin/qemu-system-x86_64</emulator>
        <disk type='file' device='disk'>
          <driver name='qemu' type='qcow2' cache='none'/>
          <source file='/opt/stack/data/nova/instances/2497e33d-1af5-4e11-b0c1-c18cc6b229f3/disk'/>
          <target dev='vda' bus='virtio'/>
          <alias name='virtio-disk0'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
        </disk>
        <disk type='file' device='cdrom'>
          <driver name='qemu' type='raw' cache='none'/>
          <source file='/opt/stack/data/nova/instances/2497e33d-1af5-4e11-b0c1-c18cc6b229f3/disk.config'/>
          <target dev='hdd' bus='ide'/>
          <readonly/>
          <alias name='ide0-1-1'/>
          <address type='drive' controller='0' bus='1' target='0' unit='1'/>
        </disk>
        <controller type='usb' index='0'>
          <alias name='usb0'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
        </controller>
        <controller type='pci' index='0' model='pci-root'>
          <alias name='pci.0'/>
        </controller>
        <controller type='ide' index='0'>
          <alias name='ide0'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
        </controller>
        <interface type='bridge'>
          <mac address='fa:16:3e:38:57:f2'/>
          <source bridge='qbr350e5bbe-e0'/>
          <target dev='tap350e5bbe-e0'/>
          <model type='virtio'/>
          <driver name='qemu'/>
          <alias name='net0'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
        </interface>
        <serial type='tcp'>
          <source mode='bind' host='127.0.0.1' service='10000'/>
          <protocol type='raw'/>
          <target port='0'/>
          <alias name='serial0'/>
        </serial>
        <serial type='pty'>
          <source path='/dev/pts/45'/>
          <target port='1'/>
          <alias name='serial1'/>
        </serial>
        <console type='tcp'>
          <source mode='bind' host='127.0.0.1' service='10000'/>
          <protocol type='raw'/>
          <target type='serial' port='0'/>
          <alias name='serial0'/>
        </console>
        <memballoon model='virtio'>
          <alias name='balloon0'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
          <stats period='10'/>
        </memballoon>
      </devices>
      <seclabel type='dynamic' model='apparmor' relabel='yes'>
        <label>libvirt-2497e33d-1af5-4e11-b0c1-c18cc6b229f3</label>
        <imagelabel>libvirt-2497e33d-1af5-4e11-b0c1-c18cc6b229f3</imagelabel>
      </seclabel>
    </domain>

This issue got mentioned as a side note in bug 781467

Comment 1 Cole Robinson 2016-04-10 21:35:31 UTC
Just duping to 781467, we can repurpose that bug to track multiple console additions

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


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