OpenStack Cloud Computing Cookbook: The Icehouse Scripts!

So you may have realised by now that Cody and I wrote a book to help you all get up to speed with the ubiquitous Open Source Cloud Computing platform, OpenStack. Like any good tech book, it’s full of “At the time of writing…” which covers our ass when people type in things on newer versions. For OpenStack, this happens quite often and the recent release of Icehouse has seen some changes to what we presented in the book. To overcome some of the shortcomings of publishing we maintain scripts that follow the processes and commands in the book as much as possible. You can find these at our Git Repo @ https://github.com/OpenStackCookbook/OpenStackCookbook.

Pre-requisites

What you can do is checkout the supporting scripts and run a multi-node OpenStack setup using Git, Vagrant and VirtualBox.

Ensure you have

Also ensure you’ve something decent to run this all on. A PC or Mac with 8Gb should be enough – but my Mac has 16Gb and gets toasty so YMMV.

The Icehouse OpenStack Cookbook scripts also give you a suggestion to install vagrant-cachier. We use this to speed up installations of the VMs as we pull down a lot of packages when installing OpenStack.

To install vagrant-cachier (ensure you have Vagrant 1.5+) run the following:

vagrant plugin install vagrant-cachier

The Icehouse Vagrant scripts have been updated to use Ubuntu’s latest and greatest, Trusty Tahr 14.04. Icehouse is default in this release.

Environment

When you run these scripts you will end up with the following

4 x VMs: Controller, Network, Compute and Cinder.

Host network (on eth1): Controller 172.16.0.200 | Compute 172.16.0.201 | Network 172.16.0.202 | Cinder 172.16.0.203

Provider (Neutron) network (on eth2)

External network (on eth3): Controller 192.168.100.200 | Compute 192.168.100.201 | Network 192.168.100.202 | Cinder 192.168.100.203

You’d interact with the OpenStack API on the host network (172.16.0.0/24) and when you create an external floating network, you’d create it on the 192.168.100.0/24 network.

Icehouse is here!

After some hacking and slashing, and a little bit of cleanup here and there, the scripts have now been updated to work for Icehouse. You want some? Follow the steps below:

  1. Grab the code from Github
    git clone https://github.com/OpenStackCookbook/OpenStackCookbook.git
  2. Checkout the Icehouse version
    cd OpenStackCookbook
    git checkout icehouse
  3. Run all the things with a simple single liner
    vagrant up
  4. Vagrant-Cachier will prompt you for your system admin password as it modifies /etc/exports to allow the cached areas to be presented to VirtualBox. Once done sit back for 20 mins, head over to Amazon and purchase a book, then come back and play with OpenStack!
  5. Once done you will end up with 4 machines – check they’re running
    vagrant status

    The output should look like below:

    Current machine states:
    controller running (virtualbox)
    network running (virtualbox)
    compute running (virtualbox)
    cinder running (virtualbox)
    This environment represents multiple VMs. The VMs are all listed
    above with their current state. For more information about a specific
    VM, run `vagrant status NAME`.
  6. Connect to the controller
    vagrant ssh controller
  7. The credentials have been written to your /vagrant directory [which is the directory of your git clone on your host presented to all your VMs]. Source them in with
    . /vagrant/openrc

    (Credentials: username=admin, password=openstack, tenant=cookbook)

  8. Now you can use OpenStack as it was intended. To quickly create some networking and spin an instance up run the following (check out the script to see how you can use OpenStack once it’s running)
    /vagrant/demo.sh
  9. You can always visit the OpenStack Dashboard to at http://172.16.0.200/ using the admin/openstack credentials.

Any problems – leave us a note! Happy OpenStacking.

Advertisements

Tagged: , , , ,

10 thoughts on “OpenStack Cloud Computing Cookbook: The Icehouse Scripts!

  1. christophe May 6, 2014 at 10:22 am Reply

    Hi Kevin,

    I’ve followed your steps. The installation stops after about 2 minutes with this message :

    The synced folder type ‘nfs’ is reporting as unusable for
    your current setup. Please verify you have all the proper
    prerequisites for using this shared folder type and try again,

    I’m running Windows 7 on my laptop, with :
    VirtualBox 4.3.10
    Git 1.9.2
    Vagrant 1.5.4

    Only one VM is created in VirtualBox : “controller”

    Any idea?

    Detailed installation log below :

    me@MY-COMPUTER /D/openstackcookbook
    $ git clone https://github.com/OpenStackCookbook/OpenStackCookbook.git
    Cloning into ‘OpenStackCookbook’…
    remote: Reusing existing pack: 372, done.
    remote: Counting objects: 19, done.
    remote: Compressing objects: 100% (19/19), done.
    remote: Total 391 (delta 8), reused 0 (delta 0)Receiving objects: 90% (352/391)
    Receiving objects: 91% (356/391), 148.00 KiB | 280.00 KiB/s
    Receiving objects: 100% (391/391), 339.68 KiB | 280.00 KiB/s, done.
    Resolving deltas: 100% (228/228), done.
    Checking connectivity… done.

    me@MY-COMPUTER /D/openstackcookbook
    $ cd OpenStackCookbook

    me@MY-COMPUTER /D/openstackcookbook/OpenStackCookbook (master)
    $ git checkout icehouse
    Branch icehouse set up to track remote branch icehouse from origin.
    Switched to a new branch ‘icehouse’

    me@MY-COMPUTER /D/openstackcookbook/OpenStackCookbook (icehouse)
    $ vagrant -v
    Vagrant 1.5.4
    me@MY-COMPUTER /D/openstackcookbook/OpenStackCookbook (icehouse)
    $ vagrant up
    Bringing machine ‘controller’ up with ‘virtualbox’ provider…
    Bringing machine ‘network’ up with ‘virtualbox’ provider…
    Bringing machine ‘compute’ up with ‘virtualbox’ provider…
    Bringing machine ‘cinder’ up with ‘virtualbox’ provider…
    ==> controller: Box ‘trusty64’ could not be found. Attempting to find and instal
    l…
    controller: Box Provider: virtualbox
    controller: Box Version: >= 0
    ==> controller: Adding box ‘trusty64’ (v0) for provider: virtualbox
    controller: Downloading: http://cloud-images.ubuntu.com/vagrant/trusty/curre
    nt/trusty-server-cloudimg-amd64-vagrant-disk1.box
    controller: Progress: 10% (Rate: 4177k/s, Estimated time remaining: 0:01:22)

    [cut for brevity…]

    controller: Progress: 98% (Rate: 4237k/s, Estimated time remaining: 0:00:01)
    controller: Progress: 99% (Rate: 4110k/s, Estimated time remaining: –:–:–
    controller: Progress: 100% (Rate: 4013k/s, Estimated time remaining: –:–:-
    ?[0m?[0m
    ==> controller: Successfully added box ‘trusty64’ (v0) for ‘virtualbox’!
    ==> controller: Importing base box ‘trusty64’…
    ==> controller: Matching MAC address for NAT networking…
    ==> controller: Setting the name of the VM: OpenStackCookbook_controller_1399366
    278348_36093
    ==> controller: Clearing any previously set forwarded ports…
    The synced folder type ‘nfs’ is reporting as unusable for
    your current setup. Please verify you have all the proper
    prerequisites for using this shared folder type and try again.

    [installation stops here]

    me@MY-COMPUTER /D/openstackcookbook/OpenStackCookbook (icehouse)
    $ vagrant status
    Current machine states:

    controller poweroff (virtualbox)
    network not created (virtualbox)
    compute not created (virtualbox)
    cinder not created (virtualbox)

    This environment represents multiple VMs. The VMs are all listed
    above with their current state. For more information about a specific
    VM, run `vagrant status NAME`.

  2. Kevin Jackson May 6, 2014 at 10:54 am Reply

    Looks like vagrant-cachier doesn’t like your Windows 7 host:

    The synced folder type ‘nfs’ is reporting as unusable for
    your current setup. Please verify you have all the proper
    prerequisites for using this shared folder type and try again.

    So disable the vagrant-cachier lines and/or modify it so that it isn’t NFS that is used?

    Kev

  3. christophe May 6, 2014 at 1:03 pm Reply

    Kevin,

    I read http://docs.vagrantup.com/v2/synced-folders/basic_usage.html, and I commented out the line :
    # type: :nfs,
    in my Vagrantfile, to let vagrant-cachier select the best option. I got a little further in the installation, but again failed :

    $ vagrant up
    Bringing machine ‘controller’ up with ‘virtualbox’ provider…
    Bringing machine ‘network’ up with ‘virtualbox’ provider…
    Bringing machine ‘compute’ up with ‘virtualbox’ provider…
    Bringing machine ‘cinder’ up with ‘virtualbox’ provider…
    ==> controller: Importing base box ‘trusty64’…

    [cut for brevity]

    ==> controller: Machine booted and ready!
    ==> controller: Checking for guest additions in VM…
    ==> controller: Setting hostname…
    ==> controller: Configuring and enabling network interfaces…
    ==> controller: Mounting shared folders…
    controller: /vagrant => D:/openstackcookbook/OpenStackCookbook
    controller: /tmp/vagrant-cache => C:/Users/xxxx/.vagrant.d/cache/trusty64
    Failed to mount folders in Linux guest. This is usually because
    the “vboxsf” file system is not available. Please verify that
    the guest additions are properly installed in the guest and
    can work properly. The command attempted was:

    mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3`,
    rw,vers=3,tcp,nolock /tmp/vagrant-cache /tmp/vagrant-cache
    mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant`,rw,vers=3,tcp,nolock
    /tmp/vagrant-cache /tmp/vagrant-cache

    So I ended commenting out all the vagrant cache stuff in my Vagrantfile :

    # if Vagrant.has_plugin?(“vagrant-cachier”)
    # config.cache.scope = :box
    # config.cache.enable :apt
    # config.cache.synced_folder_opts = {
    # type: :nfs,
    # mount_options: [‘rw’, ‘vers=3’, ‘tcp’, ‘nolock’]
    # }
    # else
    # puts “[-] WARN: This would be much faster if you ran vagrant plugin install vagrant-cachier first”
    # end

    I re-ran vagrant up, took a while, but at the end it worked :

    $ vagrant status
    Current machine states:

    controller running (virtualbox)
    network running (virtualbox)
    compute running (virtualbox)
    cinder running (virtualbox)

    and I have the four VMs running in VirtualBox

    I suggest you update your install instructions with disabling the vagrant cache in case of failure at first try, as other Windows users might run into the same issue.

    Christophe

  4. Kevin Jackson May 6, 2014 at 1:07 pm Reply

    Thanks. This will help other Windows users. I’ve never had the chance or reason to test this under Windows – this will be useful.

  5. stefanocanepa July 6, 2014 at 3:55 pm Reply

    Thanks for you work.

  6. pxe October 22, 2014 at 4:02 pm Reply

    Hi Kevin

    The install was a success. Where do I find the devstack code? as in /opt/stack

    Thanks

  7. Gary November 30, 2014 at 2:26 pm Reply

    Hi Kevin,
    Thanks for putting all this together. I was following the second edition of your book, slowly slogging me way thru when I found this blog and most importantly all the scripts. Now I can get to what I really wanted which is learn HEAT.

    Everything worked with no problems on my mac. Here’s my question.

    How do I ssh into the test instance? I’m getting confused with all the networks, especially 10.200.0.2 Should I be able to ping that address from Controller? What machines should be able to access 192.168.100.11? I get an imp timeout from all openstack VMs and my host.

  8. Lye December 5, 2014 at 3:03 pm Reply

    Hi,

    Love your scripts. It helps us newbie tremendously who wants to learn OpenStack. One issue I have with these VMs are that once I shutdown them down and bring them back up again. The networks are not working correctly anymore.

    Example:
    Right after installation, br-ex interface IP address with tied to eth3. But after restarting the VM, the IP address are on eth3 rather than on br-ex.

    Hope you can provide some pointer how to preserve the configurations across reboots.

  9. Mike May 16, 2015 at 3:04 am Reply

    Anyone using this on MAC? I am getting stuck at

    ==> controller: Mounting NFS shared folders…

    The following SSH command responded with a non-zero exit status.
    Vagrant assumes that this means the command failed!

    mount -o ‘vers=3,udp’ 172.16.0.1:’/Volumes/Dev/vagrant/OpenStackCookbook’ /vagrant

    Stdout from the command:

    Stderr from the command:

    stdin: is not a tty
    mount.nfs: Connection timed out

  10. Mike May 16, 2015 at 4:55 am Reply

    MAC issue was the NFS as noted by another post. Removed and all VM’s are up.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: