[openstack-dev] How to access Guest via serial console?

Kashyap Chamarthy kchamart at redhat.com
Wed May 15 10:31:53 UTC 2013


On 05/15/2013 03:37 PM, Chengyuan Li wrote:
> Hi,
> 
> The guest Linux launched by openstack doesn't have serial console device. The "virsh
> console" returns error and "virsh ttyconsole" shows no device.


Note that serial console log is locat/var/lib/nova/instances/instance-00000003/console.log

More explanation -
http://kashyapc.wordpress.com/2013/04/06/finding-serial-console-log-of-a-nova-instance/

> 
> I tried to update the libvirt XML by "virsh edit", i.e. adding "<console type='pty>'", but
> the changes can't be saved.
> 
> Does anybody know how to change openstack/nova configuration, then the console device of
> Guest can be used?
> 
> 
> sudo virsh ttyconsole instance-00000005
> 
> sudo virsh -c qemu:///system console instance-00000005  
> Connected to domain instance-00000005
> Escape character is ^]
> error: internal error character device (null) is not using a PTY

It's because, virsh connects to the first console device; it does not use a PTY console:

It can be noticed from instance's XML fragment:
#---------#
[test]$ virsh dumpxml instance-00000003 | egrep -i 'serial type' -A9
    <serial type='file'>
      <source path='/var/lib/nova/instances/instance-00000003/console.log'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target port='1'/>
      <alias name='serial1'/>
    </serial>
    <console type='file'>
      <source path='/var/lib/nova/instances/instance-00000003/console.log'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
#---------#

So, you have to *explicitly* configure something on that console. A simple test:
	- http://kashyapc.fedorapeople.org/virt/openstack/serial-console-test.txt


Hope that helps a bit.

-- 
/kashyap



More information about the OpenStack-dev mailing list