Git Product home page Git Product logo

novaconsole's Introduction

This is a simple client for connecting to the remote serial console of an OpenStack Nova server, using the API implemented in the Juno release of OpenStack. You can read more about that support here:

Usage

With valid OpenStack credentials (OS_USERNAME, OS_PASSWORD, OS_AUTH_URL, etc) available in your environment, you can run novaconsole with the name or UUID of a Nova server:

$ novaconsole my-server
WARNING:novaconsole.client:connected to: ws://127.0.0.1:6083/?token=bdcea854-2566-4f3b-86ef-4791aba42eea
WARNING:novaconsole.client:type "~." to disconnect

You can also provide a websocket URL directly on the command line:

$ novaconsole --url ws://127.0.0.1:6083/?token=bdcea854-2566-4f3b-86ef-4791aba42eea
WARNING:novaconsole.client:connected to: ws://127.0.0.1:6083/?token=bdcea854-2566-4f3b-86ef-4791aba42eea
WARNING:novaconsole.client:type "~." to disconnect

In either case, you will have an interactive connection to the serial console of your Nova server. You can type ~. to disconnect. If you find that the ~ conflicts with something (for example, ~ is also used as the default escape character by ssh), you can specify a new escape character with -e:

$ novaconsole -e@ my-server
WARNING:novaconsole.client:connected to: ws://127.0.0.1:6083/?token=3fd11349-cd64-4dac-bbe0-68c49e9e1dc9
WARNING:novaconsole.client:type "@." to disconnect

Server configuration

For this to work, your server must be configured to support serial console access. This is a typical default for most "cloud" specific images, which will include something like console=tty0 console=ttyS0,11500n81 on the kernel command line. This provides console output on both the graphical (vnc) console and the serial console, and takes input from the serial console.

Installation

You can install the package with pip:

pip install git+http://github.com/larsks/novaconsole.git

Or you can clone the repository by hand and run setup.py:

git clone http://github.com/larsks/novaconsole.git
cd novaconsole
python setup.py install

novaconsole's People

Contributors

lanqinglong avatar larsks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

novaconsole's Issues

Does not work with TLS?

Thank you for this little helper.

Am i right now assume that it is not working with a wss:// based URL?

When trying it using

nova get-serial-console <server>
novaconsole --url <URL>

It connects, but when i press enter, it just disconnects right away

WARNING:novaconsole.client:connected to: wss://<FQDN>:6083/?token=<TOKEN>
WARNING:novaconsole.client:type "~." to disconnect

pressing enter leads to

ERROR:novaconsole:remote host closed connection: Connection to remote host was lost

Any ideas, what it might be caused by? The certificate is an official one, normal novnc terminals work with the encrypted channel.

Can I use novaconsole to interact with (send keystrokes to) an instance?

I'm looking for a way to interact with consoles of OpenStack instances which are inaccessible from the Internet (to help with debugging deployments for example). I've tested this and I can see the console output. When I type anything into the local terminal window running novaconsole it disconnects.

On the instance:

root@serial-console-test:~# echo "I am echoing this into /dev/console from an SSH session on the instance" > /dev/console
root@serial-console-test:~# echo "Now I'm going to type some keys in novaconsole" > /dev/console

On my laptop:

$ nova get-serial-console aaaaaaaa-bbbb-cccc-dddd-eeeeffff0000
+--------+--------------------------------------------------------------------------------+
| Type   | Url                                                                            |
+--------+--------------------------------------------------------------------------------+
| serial | wss://js2.jetstream-cloud.org:6083/?token=deadbeef-dead-beef-dead-beefdeadbeef |
+--------+--------------------------------------------------------------------------------+
$ novaconsole -d -v --url wss://js2.jetstream-cloud.org:6083/?token=deadbeef-dead-beef-dead-beefdeadbeef
WARNING:novaconsole.client:connected to: wss://js2.jetstream-cloud.org:6083/?token=7deadbeef-dead-beef-dead-beefdeadbeef
WARNING:novaconsole.client:type "~." to disconnect
I am echoing this into /dev/console from an SSH session on the instance
Now I'm going to type some keys in novaconsole
ERROR:novaconsole:remote host closed connection: Connection to remote host was lost.

I typed a key on my laptop and then the ERROR:... line was printed.

Is this something which is even possible using Nova serial consoles? Is it something that needs to be configured in Nova?

Background: If this is possible then I'd like to reverse engineer novaconsole to build an in-browser version using xterm.js. I don't want to use the SPICE HTML5 client or noVNC, because I want a proper copy & paste experience in the browser.

Any advice appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.