From Fedora Project Wiki

m (typo)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[http://devstack.org Devstack] is a script used primarily for upstream OpenStack development. This wiki page documents usage information for devstack on Fedora.
[http://devstack.org Devstack] is a script used primarily for upstream OpenStack development. This wiki page documents usage information for devstack on Fedora.


= Feedback =
= Getting Devstack for Fedora =


{{admon/caution|Work in Progress|You should be aware up front that Devstack support for Fedora is still a work in progress. You may run into problems. If you do, please provide feedback on [https://review.openstack.org/#change,4364 the review] so we can get the problems resolved. Also, if you come up with any tips that Fedora users should be aware of, please update this page. Thanks!}}
Devstack has native support for Fedora in the master branch. The stable/essex and stable/diablo branches of devstack do not support Fedora.


= Getting Devstack for Fedora =
Start by cloning the upstream devstack repo.


Devstack does not currently officially support Fedora.  However, there is a patch that adds support for Fedora 16 which you can find [https://review.openstack.org/#change,4364 here]. Optionally, you can grab a version from github that includes support for using Qpid as the messaging system instead of RabbitMq: [https://github.com/russellb/devstack/commits/fedora-support russellb's github repo].
  $ git clone git://github.com/openstack-dev/devstack.git


In either case, start by cloning the upstream devstack repo.
= Initial Setup =


  $ git clone git://github.com/openstack-dev/devstack.git
Devstack allows you to create a <code>localrc</code> file with settings specific to your environment. Creating this file isn't strictly necessary, but it's likely you'll want to use it at some point. Here are some options commonly used that are worth noting:


=== Using the patch from gerrit ===
By default, devstack puts your GIT checkout in /opt/stack instead of your home directory. To choose a more sensible location set


Go to the gerrit page for the patch and find the '''Download''' section.  It will provide a git command to use to get the latest version of the patch.
  DEST=$HOME/src/openstack
  DATA_DIR=$DEST/data


=== Using russellb's github repo ===
By default DevStack will spew 100000's of lines of shell script at your console while it works. This is less than helpful, because you can't understand what it is doing and if something goes wrong the important messages have probably scrolled off the screen. So turn off verbose output and instead save all shell output to log files. Also make each screen session log its output.


   $ git remote add russellb git://github.com/russellb/devstack.git
   LOGFILE=$DATA_DIR/logs/stack.log                                                                                                 
   $ git remote update
   SCREEN_LOGDIR=$DATA_DIR/logs                                                                                                     
   $ git checkout -b fedora-support russellb/fedora-support
   VERBOSE=False


= Initial Setup =
Set this if you would like to use Qpid instead of RabbitMQ.  Qpid is set as the default in the Fedora OpenStack packages.


Devstack allows you to create a <code>localrc</code> file with settings specific to your environment. Creating this file isn't strictly necessary, but it's likely you'll want to use it at some point. Here are some options commonly used that are worth noting:
  disable_service rabbit
  enable_service qpid


Set this option if you are using the version from russellb's github repo and would like to use Qpid instead of RabbitMQ.
You may also want to use postgresql instead of mysql (seem that mysql has some issues being configured on F18).


  MESSAGING_SYSTEM=''qpid''
  disable_service mysql
enable_service postgresql


By default, devstack assumes your primary network interface is <code>eth0</code>.  Ethernet and other network device naming has changed in recent versions of Fedora.  To see what your machine actually uses for a network device, run ''ifconfig'' and use the device that your machine uses to talk to the outside world. It is likely that this is  <code>em1</code>.
By default, devstack assumes your primary network interface is <code>eth0</code>.  Ethernet and other network device naming has changed in recent versions of Fedora.  To see what your machine actually uses for a network device, run ''ifconfig'' and use the device that your machine uses to talk to the outside world. It is likely that this is  <code>em1</code>.
Line 38: Line 41:
  FLAT_INTERFACE=''em1''
  FLAT_INTERFACE=''em1''


When creating the stack deployment for the first time, you are going to see prompts for multiple passwords.  Your results will be stored in the localrc file.  If you wish to byp[ass this, and provide the passwords up front,  add in the following lines with your own password:
When creating the stack deployment for the first time, you are going to see prompts for multiple passwords.  Your results will be stored in the localrc file.  If you wish to bypass this, and provide the passwords up front,  add in the following lines with your own password:


  MYSQL_PASSWORD=badpassword
  MYSQL_PASSWORD=badpassword
Line 45: Line 48:
  ADMIN_PASSWORD=badpassword
  ADMIN_PASSWORD=badpassword


To have devstack automatically load custom images, set the <code>IMAGE_URLS</code> option. If you're using russellb's version, you can have devstack load dabpb's Fedora 16 image:
To have devstack automatically load custom images, set the <code>IMAGE_URLS</code> option.


  IMAGE_URLS="http://berrange.fedorapeople.org/images/2012-02-29/f16-x86_64-openstack-sda.qcow2"
  IMAGE_URLS="http://berrange.fedorapeople.org/images/2012-02-29/f16-x86_64-openstack-sda.qcow2"
or for Fedora 17
IMAGE_URLS="http://berrange.fedorapeople.org/images/2012-11-15/f17-x86_64-openstack-sda.qcow2"


If you would like to load the Cirros images devstack uses by default, as well as the Fedora 16 image, use:
If you would like to load the Cirros images devstack uses by default, as well as the Fedora 16 image, use:
Line 58: Line 65:


To run devstack, you just run the <code>stack.sh</code> script.
To run devstack, you just run the <code>stack.sh</code> script.
{{admon/note|NodeJS|Note that the nodejs RPMs are not currently available in Fedora and devstack will not install them. Thus if you intend to run Horizon, you must to manually install the 'nodejs' and 'nodejs-compat-symlinks' RPMs from http://nodejs.tchol.org/}}


{{admon/note|Root|Note that this script expects to be run as non-root, but with sudo access.  If you run the script as root, it will automatically create a new user.}}
{{admon/note|Root|Note that this script expects to be run as non-root, but with sudo access.  If you run the script as root, it will automatically create a new user.}}
Line 86: Line 95:
To skip a set of exercises, specify a comma separated list of exercise names in the <code>SKIP_EXERCISES</code> variable:
To skip a set of exercises, specify a comma separated list of exercise names in the <code>SKIP_EXERCISES</code> variable:


  $ SKIP_EXERCISES=switft,volumes
  $ SKIP_EXERCISES=swift,volumes
  $ ./exercise.sh
  $ ./exercise.sh

Latest revision as of 15:29, 9 April 2013

Devstack is a script used primarily for upstream OpenStack development. This wiki page documents usage information for devstack on Fedora.

Getting Devstack for Fedora

Devstack has native support for Fedora in the master branch. The stable/essex and stable/diablo branches of devstack do not support Fedora.

Start by cloning the upstream devstack repo.

$ git clone git://github.com/openstack-dev/devstack.git

Initial Setup

Devstack allows you to create a localrc file with settings specific to your environment. Creating this file isn't strictly necessary, but it's likely you'll want to use it at some point. Here are some options commonly used that are worth noting:

By default, devstack puts your GIT checkout in /opt/stack instead of your home directory. To choose a more sensible location set

 DEST=$HOME/src/openstack
 DATA_DIR=$DEST/data

By default DevStack will spew 100000's of lines of shell script at your console while it works. This is less than helpful, because you can't understand what it is doing and if something goes wrong the important messages have probably scrolled off the screen. So turn off verbose output and instead save all shell output to log files. Also make each screen session log its output.

 LOGFILE=$DATA_DIR/logs/stack.log                                                                                                   
 SCREEN_LOGDIR=$DATA_DIR/logs                                                                                                       
 VERBOSE=False

Set this if you would like to use Qpid instead of RabbitMQ. Qpid is set as the default in the Fedora OpenStack packages.

disable_service rabbit
enable_service qpid

You may also want to use postgresql instead of mysql (seem that mysql has some issues being configured on F18).

disable_service mysql
enable_service postgresql

By default, devstack assumes your primary network interface is eth0. Ethernet and other network device naming has changed in recent versions of Fedora. To see what your machine actually uses for a network device, run ifconfig and use the device that your machine uses to talk to the outside world. It is likely that this is em1.

HOST_IP_IFACE=em1
PUBLIC_INTERFACE=em1
VLAN_INTERFACE=em1
FLAT_INTERFACE=em1

When creating the stack deployment for the first time, you are going to see prompts for multiple passwords. Your results will be stored in the localrc file. If you wish to bypass this, and provide the passwords up front, add in the following lines with your own password:

MYSQL_PASSWORD=badpassword
SERVICE_TOKEN=badpassword
SERVICE_PASSWORD=badpassword
ADMIN_PASSWORD=badpassword

To have devstack automatically load custom images, set the IMAGE_URLS option.

IMAGE_URLS="http://berrange.fedorapeople.org/images/2012-02-29/f16-x86_64-openstack-sda.qcow2"

or for Fedora 17

IMAGE_URLS="http://berrange.fedorapeople.org/images/2012-11-15/f17-x86_64-openstack-sda.qcow2"

If you would like to load the Cirros images devstack uses by default, as well as the Fedora 16 image, use:

IMAGE_URLS="http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-uec.tar.gz,http://berrange.fedorapeople.org/images/2012-02-29/f16-x86_64-openstack-sda.qcow2"

For a list of other variables that can be specified, including ones that allow you specify custom git repos and branches to use for testing, see the stackrc file.

Running Devstack

To run devstack, you just run the stack.sh script.

NodeJS
Note that the nodejs RPMs are not currently available in Fedora and devstack will not install them. Thus if you intend to run Horizon, you must to manually install the 'nodejs' and 'nodejs-compat-symlinks' RPMs from http://nodejs.tchol.org/
Root
Note that this script expects to be run as non-root, but with sudo access. If you run the script as root, it will automatically create a new user.
$ ./stack.sh

Using the environment

Once the stack is up and running, you can use it like you would any other OpenStack deployment. Devstack includes a couple of files that will populate your environment with the needed variables for various tools to work: openrc and eucarc.

$ . ./openrc
$ nova list
$ . ./eucarc
$ euca-describe-instances

Running the devstack exercises

Devstack includes a set of exercise scripts to do some basic testing of the running stack. These tests are used by jenkins to gate commits to various OpenStack projects. To run them, run the exercise.sh script.

$ ./exercise.sh

To see a list of tests:

$ ls exercises/
boot_from_volume.sh  bundle.sh  client-args.sh  client-env.sh  euca.sh  floating_ips.sh  swift.sh  volumes.sh

To skip a set of exercises, specify a comma separated list of exercise names in the SKIP_EXERCISES variable:

$ SKIP_EXERCISES=swift,volumes
$ ./exercise.sh