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

Chengyuan Li chengyuanli at gmail.com
Wed May 15 14:37:36 UTC 2013


Hi Kashyap,

Thanks !

After using parameter "--devname serial1" in virsh, the serial console
works now.

sudo virsh console instance-00000005 --devname serial1
*
*

One more question, why "virsh edit" doesn't work?



Regards,
CY.


On Wed, May 15, 2013 at 6:31 PM, Kashyap Chamarthy <kchamart at redhat.com>wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130515/df26c164/attachment.html>


More information about the OpenStack-dev mailing list