Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

How to try out Gluon

kamalhussain edited this page Mar 16, 2016 · 8 revisions

Preliminaries

Find yourself a nice clean machine. I've been using Ubuntu but it shouldn't be particular. If you happen to be doing this on a VM under VMWare or similar, you might want to take a snapshot of it while it's clean, so that you can go back and repeat things from fresh, though running devstack twice (unstack.sh / stack.sh) should also work.

Getting the software

Gluon has a devstack plugin, so the simple way to start is via devstack and a local config. First, download devstack (use the version that provides Liberty, I've been developing on the stable branch for now):

git clone https://github.com/openstack-dev/devstack && cd devstack && git checkout stable/liberty

Apply this small patch to devstack. I don't think this is needed long term when I find the right answer to the problem, but I have sequencing issue with installing things right now:

ijw@gluon:~/devstack$ git diff
diff --git a/lib/neutron-legacy b/lib/neutron-legacy
index 2a0b393..301aca0 100755
--- a/lib/neutron-legacy
+++ b/lib/neutron-legacy
@@ -612,6 +612,9 @@ function init_neutron {
 
 # install_neutron() - Collect source and prepare
 function install_neutron {
+    if is_service_enabled gluon ; then
+        install_gluon_libs
+    fi
     git_clone $NEUTRON_REPO $NEUTRON_DIR $NEUTRON_BRANCH
     setup_develop $NEUTRON_DIR
     if is_service_enabled q-fwaas; then
diff --git a/lib/nova b/lib/nova
index 0013813..43c472e 100644
--- a/lib/nova
+++ b/lib/nova
@@ -745,6 +745,10 @@ function install_nova {
         install_nova_hypervisor
     fi
 
+    if is_service_enabled gluon ; then
+        # Found in gluon devstack plugin
+       install_gluon_libs
+    fi
     if is_service_enabled n-novnc; then
         # a websockets/html5 or flash powered VNC console for vm instances
         NOVNC_FROM_PACKAGE=$(trueorfalse False NOVNC_FROM_PACKAGE)

Next, write a ~/devstack/local.conf file, to tell devstack what you want installing. This is what I use:

[[local|localrc]]

ADMIN_PASSWORD=random1
MYSQL_PASSWORD=random2
RABBIT_PASSWORD=random3
SERVICE_PASSWORD=iheartksl # May be sensitive to this due to a hardcoding problem; not sure
SERVICE_TOKEN=random4

# Convert to Neutron
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta

# Make gluon happen
enable_plugin gluon https://github.com/iawells/gluon demo
# And to prove it's working give it a second backend
enable_plugin gluon-dummynet https://github.com/iawells/gluon-dummynet

# Use a Gluon branch that adds a couple of bugfixes to Nova
NOVA_REPO=https://github.com/iawells/gluon-variant-nova
NOVA_BRANCH=gluon-liberty

# Add the Gluon callbacks to Neutron; this will go away in the near future
NEUTRON_REPO=https://github.com/iawells/gluon-variant-neutron
NEUTRON_BRANCH=gluon-liberty

# Optional: get shot of Cinder if you don't use it; it eats disk
disable_service cinder c-sch c-api c-vol
# Optional: exclude Tempest if you don't plan on using it
disable_service tempest

# Tell Nova it's going to be talking to Gluon - the Gluon network driver picks this up
[[post-config|$NOVA_CONF]]
network_api_class = gluon_nova.api.API
[gluon]
url = http://localhost:2704/

Kick devstack off. It will fetch all the repositories include three Gluon ones: gluon (the server), gluonlib (the client-side API and a diagnostic CLI), and gluon-nova (the Nova plugin).

$ ./stack.sh
[lots of output followed by success]

Using Openstack with Gluon

First, load your credentials. We're going to be the admin user here, working in the admin tenant. Gluon doesn't currently check credentials and you don't have to be admin for the rest to work, so you can also try 'demo demo' if you wish (which devstack has made for you) or even make your own new user.

ijw@gluon:~/devstack$ . openrc admin admin    

To make use of Gluon, here's some hints.

There is a CLI, but note that you would normally not talk to Gluon directly. Neutron, or any other Gluon-respecting backend, tells Gluon that it's created a port. Nova, or any other port consumer, refers to Gluon to bind and unbind ports. The end user doesn't have to do anything; the behaviour is automatic. The CLI is there for debugging. And the first thing we'd like to do is test that things are working, so here we use the CLI to check that:

ijw@gluon:~/devstack$ gluon port-list # Won't have any yet
{}

Then we make a port and see what happens:

ijw@gluon:~/devstack$ neutron port-create private # Make a port on devstack's precreated 'private' net
Created a new port:
[lots of data including the port ID, used in the following commands]
ijw@gluon:~/devstack$ gluon backend-list # Gluon's seen these backends so far:
{u'neutron': {u'name': u'neutron',
              u'service_type': u'neutron',
              u'url': u'http://0:9696/'}}
ijw@gluon:~/devstack$ gluon port-list # Will now have the same port as Neutron made, with minimal info
{u'12829d5f-d832-4dd2-8f11-02ef713c6b15': {u'backend': u'neutron',
                                           u'id': u'12829d5f-d832-4dd2-8f11-02ef713c6b15'}}

And delete it again:

ijw@gluon:~/devstack$ neutron port-delete 12829d5f-d832-4dd2-8f11-02ef713c6b15
ijw@gluon:~/devstack$ gluon port-list # Will now have no IDs
{}

The next step is to create a VM and see it's working. When you create a VM, you can no longer use networks in the boot command (because the only thing a backend is guaranteed to have is ports, so all the network helper code in Nova is now disabled); instead you precreate ports and then use them when making the VM. (This is not terribly elegant, and I'm trying to work out a good way to make Nova talk to Neutron and support net-id again, but right now it's down to basic functionality.)

ijw@gluon:~/devstack$ neutron port-create private # Make a port on devstack's precreated 'private' net
Created a new port:
[lots of data including the port ID, used in the following commands]
ijw@gluon:~/devstack$ nova boot ... --nic port-id=_port-id from previous command_
[VM should now come up]

More to come in this walkthrough: how to use the 'dummy' backend network provider and its API.

If you are getting errors, make sure that the /etc/gluon/gluon.config has the following content:

NEUTRON_USERNAME = 'admin'
NEUTRON_PASSWORD = <password>
NEUTRON_TENANTNAME = 'admin'
KEYSTONE_URL = 'http://<ip>:5000/v2.0'
Clone this wiki locally