ArchipelProject / Archipel

XMPP Based Orchestrator
http://archipelproject.org
GNU Affero General Public License v3.0
803 stars 126 forks source link

REQUEST: Serial console via Archipel Client web gui #981

Open tomzpl opened 10 years ago

tomzpl commented 10 years ago

Dear Developers, I would like to propose a new feature that would allow serial consoles be accessed through VNC Console Tab.

I have some VMs that are not accessible through normal Display (VGA/XEN). It's possible to use virt-manager to switch between console and Graphical output via View -> Text Consoles. (http://www.tomz.pl/Aukcje/other/archipel6.png).

Regards,

CyrilPeponnet commented 10 years ago

I don't know how virt-manager is dealing with this. I don't find relevant information on libvirt side, if you can explain what is done behind the scene I could check if we could add it to the todo list :)

tomzpl commented 10 years ago

Its handled by libvirt: virsh console

You have some info here: https://fedoraproject.org/wiki/QA:Testcase_Virt_Serial_Console

and here:

http://libvirt.org/html/libvirt-libvirt.html virDomainOpenConsole - This opens the backend associated with a console, serial or parallel port device on a guest, if the backend is supported. If the @dev_name is omitted, then the first console or serial device is opened. The console is associated with the passed in @st stream, which should have been opened in non-blocking mode for bi-directional I/O.

Also patches used to open console remotely: http://www.redhat.com/archives/libvir-list/2010-August/msg00382.html

Nowaker commented 10 years ago

Really nice. I like it.

tomzpl commented 10 years ago

This is also used by LXC machines....

CyrilPeponnet commented 10 years ago

Yeah that's a great idea but virsh console needs to see a pseudo-terminal... I'm not sure it could be done in web interface. I'm digging on it, feel free to share if you know existing tools for remote console without ssh tunnel.

Nowaker commented 10 years ago

virt-manager can do it, and it's in Python.

EDIT: but yeah, there's ssh tunnel... So forget what I'm saying.

tomzpl commented 10 years ago

"To enable virsh console (or equivalent) to be used remotely it is neccessary to provide remote access to the /dev/pts/XXX psuedo-TTY associated with the console/serial/parallel device in the guest. The virStream API provide a bi-directional I/O stream capability that can be used for this purpose. This patch thus introduces a virDomainOpenConsole API that uses the stream APIs."

http://www.redhat.com/archives/libvir-list/2010-August/msg00382.html

And (this describes the problem was before with pseudo TTY access from remote)

https://bugzilla.redhat.com/show_bug.cgi?id=490191

or go via web-ssh:

https://bugzilla.redhat.com/show_bug.cgi?id=790789 + http://en.wikipedia.org/wiki/Web-based_SSH

Or run some system() or exec() but its not stateful.

tomzpl commented 10 years ago

Maybe this would be useful:

my $con = Sys::Virt->new('uri' => "qemu+tls://$url/system"); my $dom = $con->get_domain_by_name("name"); my $st=$con->new_stream(Sys::Virt::Stream::NONBLOCK); $dom->open_console($st, undef, 0);

http://stackoverflow.com/questions/18892447/perl-and-cpan-sysvirt-connect-to-vm-console

CyrilPeponnet commented 10 years ago

The issue is not this part, it’s more how I will show the console output to the web browser… Everything pass through XMPP Stanza (except noVNC)

And as the serial console could be really verbose, I assume it’s not a good idea to send / receive all message through xmpp.

We could get inspired from other projects like GateOne, at least for web console part, or we could use noVNC but we have to found a way to create a « console vnc server » on the hypervisor side.

Thanks for digging on it :) it helps !

Nowaker commented 10 years ago

noVNC acts as a websocket proxy. Maybe the same approach for a serial console websocket proxy?

CyrilPeponnet commented 10 years ago

That's what I said and maybe someone did it already.

I found the Server-side terminal emulation the best candidate for that.

tomzpl commented 10 years ago

Can we have an update on the progress? have you found any solutions that fits in?

CyrilPeponnet commented 10 years ago

No progress for now, no much time :) feel free to contribute if you want !