Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenStack: Dev

[XenAPI] Implementing text console (log)

 

 

OpenStack dev RSS feed   Index | Next | Previous | View Threaded


mnaser at vexxhost

May 24, 2012, 5:52 PM

Post #1 of 5 (192 views)
Permalink
[XenAPI] Implementing text console (log)

Hello,

I am currently doing work on adding the text logs / console output
into XenServer, a feature that has not been implemented:

https://github.com/openstack/nova/blob/master/nova/virt/xenapi/vmops.py#L1345

At the moment, I have a sort-of working concept of it that only runs
under XS6 (the only one that offers VT100 terminals), however it has a
fallback to returning nothing if it doesn't find one, however, there
is an issue.

The way to get the console output is by getting the console URL and
CONNECT-ing to it, an example of this in a curl is the following:

curl -k -X CONNECT
'https://192.168.1.215/console?uuid=6e12b329-6d72-19a4-f8ea-61dedcd049b9&session_id=OpaqueRef:d04043d3-4328-c1b6-1a2a-4a3638419967'

The curl process will appear to be hanging, but if you run any
commands or type anything, you'll see it appear in the screen.
Obviously, you need your own session_id and console UUID with type
VT100.

The potential resolution I can see for this is simply having a process
that CONNECT-s to consoles when any VM starts and just keeps storing
it in a file and we can read that file at any given points, however,
I'm not sure if we can create this type of architecture in Nova (or if
we can start background threads, etc). Also, it would need to handle
any reboots (as a new console will be generated) and re-connect to it.
This should not be hard to handle as it only requires a restart when
the connection is dropped.

I'm not sure to as what the best way to approach this at the moment so
I would like the input of the OpenStack XenAPI community so we can get
this silly-sounding feature to output proper output instead of fake
data.

Regards,
Mohammed

--
Mohammed Naser — vexxhost

_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp


John.Garbutt at citrix

May 25, 2012, 2:52 AM

Post #2 of 5 (188 views)
Permalink
Re: [XenAPI] Implementing text console (log) [In reply to]

Awesome, this has been on my team's TODO list for far too long.

Have you added back the xapi-serial-console blueprint anywhere?

> At the moment, I have a sort-of working concept of it that only runs under
> XS6 (the only one that offers VT100 terminals), however it has a fallback to
> returning nothing if it doesn't find one, however, there is an issue.
Yep, we got it added into XS6 especially for OpenStack, certainly missing in previous version.
Maybe the API should return some kind of "Not Supported" response?

> The way to get the console output is by getting the console URL and
> CONNECT-ing to it, an example of this in a curl is the following:
> curl -k -X CONNECT
> 'https://192.168.1.215/console?uuid=6e12b329-6d72-19a4-f8ea-
> 61dedcd049b9&session_id=OpaqueRef:d04043d3-4328-c1b6-1a2a-
> 4a3638419967'
> The curl process will appear to be hanging, but if you run any commands or
> type anything, you'll see it appear in the screen.
> Obviously, you need your own session_id and console UUID with type VT100.
Right, that seems odd.

I have added Wu who was working on this when he was at Citrix. He may have some ideas for you.

I can have a word with the XenServer developers about the best way do this, and take a look myself. Have you gone through how KVM/LibVirt code deals with this?

Cheers,
John
_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp


mnaser at vexxhost

May 25, 2012, 3:02 PM

Post #3 of 5 (183 views)
Permalink
Re: [XenAPI] Implementing text console (log) [In reply to]

Thanks for the reply. It's a bit annoying to see the FAKE text in there.

On Fri, May 25, 2012 at 5:52 AM, John Garbutt <John.Garbutt [at] citrix> wrote:
> Awesome, this has been on my team's TODO list for far too long.
>
> Have you added back the xapi-serial-console blueprint anywhere?

I haven't had the chance to do that, not sure on where to add that
from, but I did create a bug report:
https://bugs.launchpad.net/nova/+bug/1004175

>
>> At the moment, I have a sort-of working concept of it that only runs under
>> XS6 (the only one that offers VT100 terminals), however it has a fallback to
>> returning nothing if it doesn't find one, however, there is an issue.
> Yep, we got it added into XS6 especially for OpenStack, certainly missing in previous version.
> Maybe the API should return some kind of "Not Supported" response?
We could do that, however I'm not sure how the exception is handled
and propagated through the RPC system, at the moment, the VMWare
driver just returns nothing. If we raise an exception, I think it
will give something along the lines of not being able to retrieve the
console logs.

>
>> The way to get the console output is by getting the console URL and
>> CONNECT-ing to it, an example of this in a curl is the following:
>> curl -k -X CONNECT
>> 'https://192.168.1.215/console?uuid=6e12b329-6d72-19a4-f8ea-
>> 61dedcd049b9&session_id=OpaqueRef:d04043d3-4328-c1b6-1a2a-
>> 4a3638419967'
>> The curl process will appear to be hanging, but if you run any commands or
>> type anything, you'll see it appear in the screen.
>> Obviously, you need your own session_id and console UUID with type VT100.
> Right, that seems odd.

It seems that basically the console is streaming the output, but it
does not buffer/store it anywhere in XenServer (or maybe it does? I
found VT100 console by my own research)..

>
> I have added Wu who was working on this when he was at Citrix. He may have some ideas for you.
>

Great, hope that we can get some information

> I can have a word with the XenServer developers about the best way do this, and take a look myself. Have you gone through how KVM/LibVirt code deals with this?
>

I've taken a look at the libvirt/KVM & VMWARE code before:

Libvirt (https://github.com/openstack/nova/blob/master/nova/virt/libvirt/connection.py#L933):
It seems that it gets the PTY for the console first, sets the correct
permissions for it and stores it in the instance folder under
console.log, and the "_flush_libvirt_console" runs a dd from the PTY
to stdout and adding that into the console.log -- This is not
something that can be done by us because nova-compute runs on a DomU
so no access to the console directly.

VMware (https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vmops.py#L710):
Looks like they have a built in API that stores all the console and
it's just read out easily.

> Cheers,
> John



--
Mohammed Naser — vexxhost
-----------------------------------------------------
D. 514-316-8872
D. 800-910-1726 ext. 200
E. mnaser [at] vexxhost
W. http://vexxhost.com

_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp


mnaser at vexxhost

Jun 1, 2012, 8:12 AM

Post #4 of 5 (175 views)
Permalink
Re: [XenAPI] Implementing text console (log) [In reply to]

Just a small ping for everyone involved, any updates?

On Fri, May 25, 2012 at 6:02 PM, Mohammed Naser <mnaser [at] vexxhost> wrote:
> Thanks for the reply.  It's a bit annoying to see the FAKE text in there.
>
> On Fri, May 25, 2012 at 5:52 AM, John Garbutt <John.Garbutt [at] citrix> wrote:
>> Awesome, this has been on my team's TODO list for far too long.
>>
>> Have you added back the xapi-serial-console blueprint anywhere?
>
> I haven't had the chance to do that, not sure on where to add that
> from, but I did create a bug report:
> https://bugs.launchpad.net/nova/+bug/1004175
>
>>
>>> At the moment, I have a sort-of working concept of it that only runs under
>>> XS6 (the only one that offers VT100 terminals), however it has a fallback to
>>> returning nothing if it doesn't find one, however, there is an issue.
>> Yep, we got it added into XS6 especially for OpenStack, certainly missing in previous version.
>> Maybe the API should return some kind of "Not Supported" response?
> We could do that, however I'm not sure how the exception is handled
> and propagated through the RPC system, at the moment, the VMWare
> driver just returns nothing.  If we raise an exception, I think it
> will give something along the lines of not being able to retrieve the
> console logs.
>
>>
>>> The way to get the console output is by getting the console URL and
>>> CONNECT-ing to it, an example of this in a curl is the following:
>>> curl -k -X CONNECT
>>> 'https://192.168.1.215/console?uuid=6e12b329-6d72-19a4-f8ea-
>>> 61dedcd049b9&session_id=OpaqueRef:d04043d3-4328-c1b6-1a2a-
>>> 4a3638419967'
>>> The curl process will appear to be hanging, but if you run any commands or
>>> type anything, you'll see it appear in the screen.
>>> Obviously, you need your own session_id and console UUID with type VT100.
>> Right, that seems odd.
>
> It seems that basically the console is streaming the output, but it
> does not buffer/store it anywhere in XenServer (or maybe it does?  I
> found VT100 console by my own research)..
>
>>
>> I have added Wu who was working on this when he was at Citrix. He may have some ideas for you.
>>
>
> Great, hope that we can get some information
>
>> I can have a word with the XenServer developers about the best way do this, and take a look myself. Have you gone through how KVM/LibVirt code deals with this?
>>
>
> I've taken a look at the libvirt/KVM & VMWARE code before:
>
> Libvirt (https://github.com/openstack/nova/blob/master/nova/virt/libvirt/connection.py#L933):
> It seems that it gets the PTY for the console first, sets the correct
> permissions for it and stores it in the instance folder under
> console.log, and the "_flush_libvirt_console" runs a dd from the PTY
> to stdout and adding that into the console.log -- This is not
> something that can be done by us because nova-compute runs on a DomU
> so no access to the console directly.
>
> VMware (https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vmops.py#L710):
> Looks like they have a built in API that stores all the console and
> it's just read out easily.
>
>> Cheers,
>> John
>
>
>
> --
> Mohammed Naser — vexxhost
> -----------------------------------------------------
> D. 514-316-8872
> D. 800-910-1726 ext. 200
> E. mnaser [at] vexxhost
> W. http://vexxhost.com



--
Mohammed Naser — vexxhost
-----------------------------------------------------
D. 514-316-8872
D. 800-910-1726 ext. 200
E. mnaser [at] vexxhost
W. http://vexxhost.com

_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp


John.Garbutt at citrix

Jun 1, 2012, 8:44 AM

Post #5 of 5 (171 views)
Permalink
Re: [XenAPI] Implementing text console (log) [In reply to]

Not had chance, sorry.

The VNC support has a proxy, you probably need the same kind of proxy for the serial console.
I believe that stream is designed to have a small http wrapper (for the auth) the goes straight to the binary VT100 stream.

I hope that helps,
John

> -----Original Message-----
> From: Mohammed Naser [mailto:mnaser [at] vexxhost]
> Sent: 01 June 2012 16:13
> To: John Garbutt
> Cc: Zhixue Wu; openstack [at] lists
> Subject: Re: [Openstack] [XenAPI] Implementing text console (log)
>
> Just a small ping for everyone involved, any updates?
>
> On Fri, May 25, 2012 at 6:02 PM, Mohammed Naser <mnaser [at] vexxhost>
> wrote:
> > Thanks for the reply.  It's a bit annoying to see the FAKE text in there.
> >
> > On Fri, May 25, 2012 at 5:52 AM, John Garbutt <John.Garbutt [at] citrix>
> wrote:
> >> Awesome, this has been on my team's TODO list for far too long.
> >>
> >> Have you added back the xapi-serial-console blueprint anywhere?
> >
> > I haven't had the chance to do that, not sure on where to add that
> > from, but I did create a bug report:
> > https://bugs.launchpad.net/nova/+bug/1004175
> >
> >>
> >>> At the moment, I have a sort-of working concept of it that only runs
> >>> under
> >>> XS6 (the only one that offers VT100 terminals), however it has a
> >>> fallback to returning nothing if it doesn't find one, however, there is an
> issue.
> >> Yep, we got it added into XS6 especially for OpenStack, certainly missing in
> previous version.
> >> Maybe the API should return some kind of "Not Supported" response?
> > We could do that, however I'm not sure how the exception is handled
> > and propagated through the RPC system, at the moment, the VMWare
> > driver just returns nothing.  If we raise an exception, I think it
> > will give something along the lines of not being able to retrieve the
> > console logs.
> >
> >>
> >>> The way to get the console output is by getting the console URL and
> >>> CONNECT-ing to it, an example of this in a curl is the following:
> >>> curl -k -X CONNECT
> >>> 'https://192.168.1.215/console?uuid=6e12b329-6d72-19a4-f8ea-
> >>> 61dedcd049b9&session_id=OpaqueRef:d04043d3-4328-c1b6-1a2a-
> >>> 4a3638419967'
> >>> The curl process will appear to be hanging, but if you run any
> >>> commands or type anything, you'll see it appear in the screen.
> >>> Obviously, you need your own session_id and console UUID with type
> VT100.
> >> Right, that seems odd.
> >
> > It seems that basically the console is streaming the output, but it
> > does not buffer/store it anywhere in XenServer (or maybe it does?  I
> > found VT100 console by my own research)..
> >
> >>
> >> I have added Wu who was working on this when he was at Citrix. He may
> have some ideas for you.
> >>
> >
> > Great, hope that we can get some information
> >
> >> I can have a word with the XenServer developers about the best way do
> this, and take a look myself. Have you gone through how KVM/LibVirt code
> deals with this?
> >>
> >
> > I've taken a look at the libvirt/KVM & VMWARE code before:
> >
> > Libvirt
> (https://github.com/openstack/nova/blob/master/nova/virt/libvirt/connecti
> on.py#L933):
> > It seems that it gets the PTY for the console first, sets the correct
> > permissions for it and stores it in the instance folder under
> > console.log, and the "_flush_libvirt_console" runs a dd from the PTY
> > to stdout and adding that into the console.log -- This is not
> > something that can be done by us because nova-compute runs on a DomU
> > so no access to the console directly.
> >
> > VMware
> (https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vm
> ops.py#L710):
> > Looks like they have a built in API that stores all the console and
> > it's just read out easily.
> >
> >> Cheers,
> >> John
> >
> >
> >
> > --
> > Mohammed Naser — vexxhost
> > -----------------------------------------------------
> > D. 514-316-8872
> > D. 800-910-1726 ext. 200
> > E. mnaser [at] vexxhost
> > W. http://vexxhost.com
>
>
>
> --
> Mohammed Naser — vexxhost
> -----------------------------------------------------
> D. 514-316-8872
> D. 800-910-1726 ext. 200
> E. mnaser [at] vexxhost
> W. http://vexxhost.com
_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp

OpenStack dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.