Devstack on RDO Openstack

If you've been following along, you'll notice that I've been talking a lot about RDO Openstack. There are a lot of reasons to use it, especially with flexible deployment options like RDO Manager (which I'll document in a future walk-through), and via a local packstack answers file. But what if you want to test really new (bleeding edge) features using your stable RDO deployment? Welcome to Devstack! Using the existing RDO environment we talked about setting up, this is easier to do than you would initially think.

First, you're going to want to download the correct image. Ubuntu is what I'm going to show you now (just to get something documented), although I will update this walk-through later to include both Fedora and CentOS. This should help all of those Red Hat fans out there.

Preparing your RDO Openstack Environment

If you're not familiar with adding images from the CLI, we'll cover this first. The image that we'll want to use for Devstack is Ubuntu 14.04 (Trusty). The RDO folks have included a great set of links to help you get started at the RDO Image Resource website. I suggest using this reference if you're not familiar with adding images to your new RDO Openstack deployment. The process is very simple.

  1. Log into your Openstack environment and download the image to a location of your choice, and download the Ubuntu 14.04 Trusty QCOW2 image.

    [bjozsa@galvatron micro-jinkit]$ cd /home/virt/openstack/backups/images/
    [bjozsa@galvatron images]$ curl -O https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img
    
  2. Great! Once that's downloaded, we'll need to add the image for use via Glance.

    [bjozsa@galvatron images]$ glance image-create --name='Ubuntu (Trusty) 14.04' --is-public=true --container-format=bare --disk-format=qcow2 < trusty-server-cloudimg-amd64-disk1.img
    
  3. You're done adding the image. Now it's time to create your Devstack environment.

Launch and Build Devstack

Now that you have your image, we're going to create an all-in-one Devstack environment. It's recommended that you create an instance with at least 4GB of RAM. I'm going to use 16GB of RAM, because I am building Devstack for testing the new Magnum release. If you couldn't tell already, I'm a huge fan of Microservices, and I've been testing everything I can get my hands on just to make sure I understand it well. This blog is dedicated to sharing some of my findings with you and the community so that everyone can enjoy, contribute, and give something back! So let's get started.

  1. Log into your RDO environment, and make sure that you're in the Project (Tenant) where you want to create your Devstack all-in-one host. I've created a Tenant called "Development" for this purpose. Once you're in the Tenant, click on "Images" and select your newly created "Ubuntu (Trusty) 14.04" Image.

    Create Instance

  2. Once there, you'll pick your desired flavor (remember to have 4GB or higher for Devstack), attached networks, etc.

    Instance Options

  3. The last step is also the most important. Select the Post-Creation tab. This is where you're going to paste or select an initial automation task called Cloud-Init. Cloud-Init is an Openstack admins best friend, and it's widely adopted throughout the community. Learn this valuable tool if you don't already know it. You'll thank me later!

    Cloud-Init Intro

  4. You can select "Direct Input", and then paste the following text below. Make sure to change the value for - ssh-rsa <key-value> to match your own values if you decide to add additional keys. You can add as many as you want, or you can leave out the ssh_authorized_keys: options altogether.

    #cloud-config
    
    
    ssh_authorized_keys:
      - ssh-rsa <key-value>
    
    
    users:
      - default
      - name: stack
        lock_passwd: False
        sudo: ["ALL=(ALL) NOPASSWD:ALL\nDefaults:stack !requiretty"]
        shell: /bin/bash
    
    
    write_files:
      - content: |
            #!/bin/sh
            DEBIAN_FRONTEND=noninteractive sudo apt-get -qqy update || sudo yum update -qy
            DEBIAN_FRONTEND=noninteractive sudo apt-get install -qqy git || sudo yum install -qy git
            sudo chown stack:stack /home/stack
            cd /home/stack
            git clone https://git.openstack.org/openstack-dev/devstack
            cd devstack
            echo '[[local|localrc]]' > local.conf
            echo ADMIN_PASSWORD=password >> local.conf
            echo DATABASE_PASSWORD=password >> local.conf
            echo RABBIT_PASSWORD=password >> local.conf
            echo SERVICE_PASSWORD=password >> local.conf
            echo SERVICE_TOKEN=tokentoken >> local.conf
            ./stack.sh
        path: /home/stack/start.sh
        permissions: 0755
    
    
    runcmd:
      - su -l stack ./start.sh
    
  5. That's going to take a little while. I would not log into the host until the process has been completed. My recommendation is to watch the log output for the host to keep up with the status of the Cloud-Init buildout process. You can get to this by clicking on the "Instances" side-menu option (I've named mine "devstack.jinkit.com"), and selecting the devstack host.

Using Devstack

After this process has completed, you're ready to start using your new Devstack environment! It will take a little while mind you, because a lot of things are going on in the background: The host is being updated, the devstack repos are being loaded, etc. When you want to use your devstack environment (like say, after a reboot), you'll want to log into your devstack host and run /home/devstack/.start.sh.

Now access your Devstack environment via a web browser over HTTP. The default username/password for the Horizon web interface is:
User: admin
Pass: password

NOTE: Please change those as soon as possible if you plan on keeping devstack up and running for any length of time!

Purpose

The purpose of devstack is to test new features, and possibly write changes to the Openstack project (contributing to the changes of Openstack) without breaking or testing on your production environment. For instance, I would like to test out the new Magnum Project for learning purposes (mainly around the security of such a project), but Magnum is an extremely new project. I understand the components that make up the Magnum Project (like Docker, Swarm, Kubernetes, Flannel, CoreOS, and Atomic), but I really want to see how the Openstack development community has implemented each of these open-sourced projects. Staying sharp has its value, and as I've said before, "You're in control of your own learning curve," so control it and start using devstack within your environment.

References

Devstack
Openstack
RDO
Cloud-Init

comments powered by Disqus