openstack-manuals/doc/src/docbkx/openstack-compute-admin/interfaces.xml

267 lines
14 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<chapter xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"
xml:id="ch_openstack-interfaces">
<title>OpenStack Interfaces</title>
<para>OpenStack has components that provide a view of the OpenStack installation such as a Django-built website that serves as a dashboard and the ability to connect to running instances using a VNC connection via a VNC Proxy.</para>
<section xml:id="about-the-dashboard">
<title>About the Dashboard</title><para>You can use a dashboard interface with an OpenStack Compute installation with a web-based
console provided by the Openstack-Dashboard project. It provides a reference implementation of a Django site that provides web-based interactions with the OpenStack Compute cloud controller. For more information about the Openstack-Dashboard project,
please visit: <link xlink:href="http://launchpad.net/openstack-dashboard"
>http://launchpad.net/openstack-dashboard</link>. These instructions are for a test deployment of an OpenStack Dashboard. They configure your dashboard to use the default Django server. To create a more robust, production-ready installation, you would configure this with an Apache web server. </para>
<section xml:id="dashboard-system-requirements">
<title>System Requirements for the Dashboard</title>
<para>You should have a running OpenStack Compute installation with the Keystone module
enabled for identity management. Follow these <link xlink:href="http://docs.openstack.org/diablo/">general instructions for installing Identity Management</link>. For a good all-in-one Nova/Glance/Keystone installation there is the <link xlink:href="https://github.com/cloudbuilders/devstack">devstack</link> project.</para>
<para>The dashboard needs to be installed on the node that can contact the Keystone service.</para>
<para>You should know the URL of your Identity endpoint and the Compute endpoint. </para>
<para>You must know the credentials of a valid Keystone tenant.</para>
<para>You must have git installed. It's straightforward to install it with <code>sudo
apt-get install git-core</code>. </para>
<para>Python 2.6 is required, and these instructions have been tested with Ubuntu 10.10. It
should run on any system with Python 2.6 or 2.7 that is capable of running Django
including Mac OS X (installing prerequisites may differ depending on platform). </para>
<para>Optional components:</para>
<para>an Image Store (Glance) endpoint </para>
<para>an Object Store (Swift) endpoint </para>
<para>a <link xlink:href="http://wiki.openstack.org/Quantum">Quantum</link> (networking)
endpoint</para>
</section>
<section xml:id="installing-openstack-dashboard">
<title>Installing the OpenStack Dashboard</title>
<para>Here are the overall steps for building the dashboard.</para>
<orderedlist>
<listitem><para>Get the source for the openstack-dashboard project.</para></listitem>
<listitem>
<para>Configure the openstack-dashboard.</para>
</listitem>
<listitem>
<para>Install.</para>
</listitem>
<listitem>
<para>Run the server that starts the dashboard.</para>
</listitem>
</orderedlist>
<para>Before you begin, you must have git installed. </para>
<para>Create a source directory to house the project:</para>
<literallayout class="monospaced">mkdir src
cd src </literallayout>
<para>Next, get the openstack-dashboard project, which provides all the look and feel for the OpenStack Dashboard.</para>
<literallayout class="monospaced">
git clone https://github.com/4P/openstack-dashboard
</literallayout>
<para>You should now have a directory called openstack-dashboard, which contains the OpenStack Dashboard application.</para>
<section xml:id="build-and-configure-openstack-dashboard">
<title>Configure Openstack-Dashboard</title>
<para>Now you can configure the dashboard application. The first step in configuring the application
is to create your local_settings.py file. An example is provided that you can copy
to local_settings.py and then modify for your environment.
</para>
<para>
<literallayout class="monospaced">
cd openstack-dashboard/openstack-dashboard/local
cp local_settings.py.example local_settings.py
vi local_settings.py
</literallayout>
</para>
<para>In the new copy of the local_settings.py file, change these important options:</para>
<itemizedlist>
<listitem>
<para>OPENSTACK_ADMIN_TOKEN : Token for Keystone endpoint.</para>
</listitem>
<listitem>
<para>OPENSTACK_KEYSTONE_URL : URL for the Keystone endpoint.</para>
</listitem>
</itemizedlist>
<simplesect> <title>Keystone Configuration (required)</title>
<para>
The admin token can be generated by executing something like the following using the keystone-manage command on the Keystone host:</para>
<literallayout class="monospaced"> keystone-manage token add 999888777666 admin admin 2015-02-05T00:00</literallayout>
<para>To use this token you would add the following to local_settings.py:</para>
<literallayout class="monospaced">OPENSTACK_ADMIN_TOKEN = "999888777666"</literallayout>
<para>The Keystone endpoint setting takes the following form:</para>
<literallayout class="monospaced">OPENSTACK_KEYSTONE_URL = "http://mykeystoneurl:5000/v2.0/".</literallayout></simplesect>
<simplesect><title>Object Storage Configuration (optional)</title>
<para>If a Swift endpoint is available and configured in the Keystone service catalog turning on the Swift UI is as simple as adding the following to local_settings.py:
</para>
<literallayout class="monospaced">SWIFT_ENABLED = True</literallayout>
</simplesect>
<simplesect><title>Quantum Configuration (optional)</title>
<para>Quantum currently requires the following settings:</para>
<literallayout class="monospaced">
QUANTUM_ENABLED = True
QUANTUM_URL = '127.0.0.1'
QUANTUM_PORT = '9696'
QUANTUM_TENANT = '1234'
QUANTUM_CLIENT_VERSION='0.1'
</literallayout></simplesect>
</section>
<section xml:id="install-dashboard">
<title>Install the Dashboard</title>
<para>After Dashboard has been configured install the Dashboard virtual environment using the terminal commands below:</para>
<note><para>Note: the instructions below are for Ubuntu, however, setuptools can be installed on a wide variety of platforms: http://pypi.python.org/pypi/setuptools</para></note>
<literallayout class="monospaced">$ apt-get install -y python-setuptools
$ sudo easy_install virtualenv
$ python tools/install_venv.py</literallayout>
<para>Installing the virtual environment will take some time depending on download speeds. </para>
</section>
<section xml:id="run-the-server">
<title>Run the Server</title>
<para>Dashboard is run using the standard Django manage.py script from the context
of the virtual environment. Be sure you synchronize the database with this
command: </para>
<literallayout class="monospaced">tools/with_venv.sh dashboard/manage.py syncdb</literallayout>
<para>Run the server on a high port value so that you can validate the
installation.</para><para><literallayout class="monospaced">tools/with_venv.sh dashboard/manage.py runserver 0.0.0.0:8000</literallayout></para><para>Make sure that your firewall isn't blocking TCP/8000 and just point your browser at this server on port 8000. If you are running the server on the same machine as your browser, this would be "http://localhost:8000". </para>
<mediaobject>
<imageobject role="fo">
<imagedata fileref="figures/dashboard-overview.png"
format="PNG" scale="60"/>
</imageobject>
<imageobject role="html">
<imagedata fileref="../figures/dashboard-overview.png"
format="PNG" />
</imageobject>
</mediaobject></section></section></section>
<section xml:id="getting-started-with-the-vnc-proxy"><info><title>Getting Started with the VNC Proxy</title></info>
<para>
The VNC Proxy is an OpenStack component that allows users of Nova to
access their instances through a websocket enabled browser (like
Google Chrome 4.0). See <link xlink:href="http://caniuse.com/#search=websocket">http://caniuse.com/#search=websocket</link> for a reference list of supported web browsers.</para>
<para>
A VNC Connection works like so:
</para>
<itemizedlist>
<listitem>
<para>
User connects over an API and gets a URL like
http://ip:port/?token=xyz
</para>
</listitem>
<listitem>
<para>
User pastes URL in browser
</para>
</listitem>
<listitem>
<para>
Browser connects to VNC Proxy though a websocket enabled client
like noVNC
</para>
</listitem>
<listitem>
<para>
VNC Proxy authorizes users token, maps the token to a host and
port of an instance's VNC server
</para>
</listitem>
<listitem>
<para>
VNC Proxy initiates connection to VNC server, and continues
proxying until the session ends
</para>
</listitem>
</itemizedlist>
<section xml:id="configuring-the-vnc-proxy"><info><title>Configuring the VNC Proxy</title></info>
<para>The nova-vncproxy requires a websocket enabled html client to work properly. At this time,
the only tested client is a slightly modified fork of noVNC, which you can at find <link
xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://github.com/openstack/noVNC.git"
>http://github.com/openstack/noVNC.git</link>
</para>
<para>The noVNC tool must be in the location specified by --vncproxy_wwwroot, which defaults to
/var/lib/nova/noVNC. nova-vncproxy will fail to launch until this code is properly installed. </para>
<para>
By default, nova-vncproxy binds 0.0.0.0:6080. This can be
configured with:
</para>
<itemizedlist>
<listitem>
<para>
--vncproxy_port=[port]
</para>
</listitem>
<listitem>
<para>
--vncproxy_host=[host]
</para>
</listitem>
</itemizedlist>
</section>
<section xml:id="enabling-vnc-consoles-in-nova"><info><title>Enabling VNC Consoles in Nova</title></info>
<para>
At the moment, VNC support is supported only when using libvirt.
To enable VNC Console, configure the following flags in the nova.conf file:
</para>
<itemizedlist>
<listitem>
<para>
--vnc_console_proxy_url=http://[proxy_host]:[proxy_port] -
proxy_port defaults to 6080. This URL must point to
nova-vncproxy
</para>
</listitem>
<listitem>
<para>
--vnc_enabled=[True|False] - defaults to True. If this flag is
not set your instances will launch without VNC support.
</para>
</listitem>
</itemizedlist>
</section>
<section xml:id="getting-an-instances-vnc-console"><info><title>Getting an Instance's VNC Console</title></info>
<para>
You can access an instance's VNC Console URL in the following
methods:
</para>
<itemizedlist>
<listitem>
<para>
Using the direct api: eg: 'stack --user=admin --project=admin
compute get_vnc_console instance_id=1'
</para>
</listitem>
<listitem>
<para>
Support for Dashboard, and the Openstack API will be
forthcoming
</para>
</listitem>
</itemizedlist><para>
At the moment, VNC Consoles are only supported through the web
browser, but more general VNC support is in the works.
</para>
</section>
</section>
</chapter>