[one-users] Attach a console to kvm instance to debug network/boot issue

Javier Fontan jfontan at fdi.ucm.es
Mon Aug 24 02:57:22 PDT 2009


Hello,

There are two ways of getting console in KVM machines.

  * Tell VM to create a VNC server where you can connect to it:
http://opennebula.org/doku.php?id=documentation:rel1.4:template The
information you need is in "I/O Devices Section", search for VNC. Take
into account that by default the server will be attached to 127.0.0.1
so you will have to launch vnc client from the exection host.

  * Virtualize a console so you can use "virsh console". From the
libvirt documentation:

--8<------
Pseudo TTY
A Pseudo TTY is allocated using /dev/ptmx. A suitable client such as
'virsh console' can connect to interact with the serial port locally.

      ...
      <serial type="pty">
        <source path="/dev/pts/3"/>
        <target port="1"/>
      </serial>
      ...
NB special case if <console type='pty'>, then the TTY path is also
duplicated as an attribute tty='/dev/pts/3' on the top level <console>
tag. This provides compat with existing syntax for <console> tags.
----->8--

This can be added using the RAW parameter in the template. But seems
you are having troubles with that. What xml parameters have you tried?

Bye


On Sat, Aug 22, 2009 at 12:54 AM, Gavin<netmatters at gmail.com> wrote:
> Hi there,
>
> My last OpenNebula installation was based on 1.2 and made use of the
> xen hypervisor, this time I went for the 1.4 branch and the kvm
> hypervisor on Ubuntu server 9.04 (64bit).
>
> With xen from a node it was possible to console into a vm by typing
> 'xm console vmname', and as such it was possible to troubleshoot a
> network/booting issue.
>
> So my vm's are being successfully deployed, oned.log only shows me
> success stories, 'Message received: DEPLOY SUCCESS 9 one-9' and so on.
>
> The vm shows as running and onevm returns the monitoring info, ie:
> cpu, memory, etc.
>
>  ID     USER     NAME STAT CPU     MEM        HOSTNAME        TIME
>   9 oneadmin     vm01 runn   0  262144          node01 00 00:20:09
>
>
> The nodes have 2 nics/bridges, br0 (public) and br1 (private) and a
> 'brctl show' before vm deployed reports both bridges like this:-
>
> bridge name     bridge id               STP enabled     interfaces
> br0             8000.00221980d2f4       no              eth0
> br1             8000.00221980d2f6       no              eth1
>
>
> After installing kvm/libvirt however another bridge was added, virbr0:-
>
> bridge name     bridge id               STP enabled     interfaces
> br0             8000.00221980d2f4       no              eth0
> br1             8000.00221980d2f6       no              eth1
> virbr0          8000.000000000000       yes
>
> Now when I deploy a vm two new interfaces are created, vnet0 and
> vnet1, which both get assigned to the relevant bridges:-
>
> bridge name     bridge id               STP enabled     interfaces
> br0             8000.00221980d2f4       no              eth0
>                                                        vnet0
> br1             8000.00221980d2f6       no              eth1
>                                                        vnet1
> virbr0          8000.000000000000       yes
>
> Previously with my xen installation I used the vmcontext.sh script at
> vm boot to get the network 'up' and it worked very well, this time I
> tried that with the kvm host and I'm not having the same luck.
>
> I also tried the new CONTEXT parameter that creates the iso that gets
> executed vi rc.local on the vm and that looks like an awesome
> improvement but that also did not bring up the vm interfaces.
>
> Basically I think that if I could attach a console to the now
> 'running' vm, or at least get a boot log of sorts I would be able to
> see what exactly is not allowing me to see this vm on the network.
>
> I've tried adding some xml to the RAW parameter in the template as per
> the docs but no matter what I put there, it never seems to make it to
> the running vm.
>
> If I check the 'qemu' logs for the vm it shows 'serial -none' no
> matter what I put into the RAW parameter.
>
> Has anyone else had to console onto a kvm vm created by OpenNebula ???
>
> If you have I would really like to hear how you did it as I have
> searched, and searched, and tried various different methods and am now
> emailing this list in the hope that someone else can point me in the
> right direction.
>
> Thanks and Regards,
> Gavin
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



-- 
Javier Fontan, Grid & Virtualization Technology Engineer/Researcher
DSA Research Group: http://dsa-research.org
Globus GridWay Metascheduler: http://www.GridWay.org
OpenNebula Virtual Infrastructure Engine: http://www.OpenNebula.org


More information about the Users mailing list