Dean Troyer | e9819d5 | 2012-03-21 11:25:06 -0500 | [diff] [blame] | 1 | DevStack is a set of scripts and utilities to quickly deploy an OpenStack cloud. |
Anthony Young | 6398787 | 2011-09-30 11:34:43 -0700 | [diff] [blame] | 2 | |
| 3 | # Goals |
| 4 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 5 | * To quickly build dev OpenStack environments in a clean Ubuntu or Fedora |
| 6 | environment |
| 7 | * To describe working configurations of OpenStack (which code branches |
| 8 | work together? what do config files look like for those branches?) |
| 9 | * To make it easier for developers to dive into OpenStack so that they can |
| 10 | productively contribute without having to understand every part of the |
| 11 | system at once |
Anthony Young | 6398787 | 2011-09-30 11:34:43 -0700 | [diff] [blame] | 12 | * To make it easy to prototype cross-project features |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 13 | * To provide an environment for the OpenStack CI testing on every commit |
| 14 | to the projects |
Jesse Andrews | ba23cc7 | 2011-09-11 03:22:13 -0700 | [diff] [blame] | 15 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 16 | Read more at http://devstack.org. |
Jesse Andrews | b69d6ce | 2011-10-13 10:36:00 -0700 | [diff] [blame] | 17 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 18 | IMPORTANT: Be sure to carefully read `stack.sh` and any other scripts you |
| 19 | execute before you run them, as they install software and will alter your |
| 20 | networking configuration. We strongly recommend that you run `stack.sh` |
| 21 | in a clean and disposable vm when you are first getting started. |
Dean Troyer | 2aa2a89 | 2013-08-04 19:53:19 -0500 | [diff] [blame] | 22 | |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 23 | # Versions |
| 24 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 25 | The DevStack master branch generally points to trunk versions of OpenStack |
| 26 | components. For older, stable versions, look for branches named |
| 27 | stable/[release] in the DevStack repo. For example, you can do the |
Joe Gordon | 6b9deba | 2015-02-18 11:24:31 -0800 | [diff] [blame] | 28 | following to create a juno OpenStack cloud: |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 29 | |
Joe Gordon | 6b9deba | 2015-02-18 11:24:31 -0800 | [diff] [blame] | 30 | git checkout stable/juno |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 31 | ./stack.sh |
| 32 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 33 | You can also pick specific OpenStack project releases by setting the appropriate |
| 34 | `*_BRANCH` variables in the ``localrc`` section of `local.conf` (look in |
| 35 | `stackrc` for the default set). Usually just before a release there will be |
| 36 | milestone-proposed branches that need to be tested:: |
Dean Troyer | ce043c4 | 2012-02-03 22:56:38 -0600 | [diff] [blame] | 37 | |
Steve Kowalik | 047cac5 | 2013-11-07 22:36:10 +1100 | [diff] [blame] | 38 | GLANCE_REPO=git://git.openstack.org/openstack/glance.git |
Dean Troyer | e9819d5 | 2012-03-21 11:25:06 -0500 | [diff] [blame] | 39 | GLANCE_BRANCH=milestone-proposed |
Dean Troyer | ce043c4 | 2012-02-03 22:56:38 -0600 | [diff] [blame] | 40 | |
| 41 | # Start A Dev Cloud |
| 42 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 43 | Installing in a dedicated disposable VM is safer than installing on your |
| 44 | dev machine! Plus you can pick one of the supported Linux distros for |
| 45 | your VM. To start a dev cloud run the following NOT AS ROOT (see |
| 46 | **DevStack Execution Environment** below for more on user accounts): |
Anthony Young | 0e65abf | 2011-09-30 09:24:00 -0700 | [diff] [blame] | 47 | |
| 48 | ./stack.sh |
| 49 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 50 | When the script finishes executing, you should be able to access OpenStack |
| 51 | endpoints, like so: |
Anthony Young | 6398787 | 2011-09-30 11:34:43 -0700 | [diff] [blame] | 52 | |
Tres Henry | ca85b79 | 2011-10-28 14:00:21 -0700 | [diff] [blame] | 53 | * Horizon: http://myhost/ |
Anthony Young | 6398787 | 2011-09-30 11:34:43 -0700 | [diff] [blame] | 54 | * Keystone: http://myhost:5000/v2.0/ |
| 55 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 56 | We also provide an environment file that you can use to interact with your |
| 57 | cloud via CLI: |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 58 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 59 | # source openrc file to load your environment with OpenStack CLI creds |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 60 | . openrc |
| 61 | # list instances |
| 62 | nova list |
Dean Troyer | 0bd2410 | 2012-03-08 00:33:54 -0600 | [diff] [blame] | 63 | |
| 64 | If the EC2 API is your cup-o-tea, you can create credentials and use euca2ools: |
| 65 | |
| 66 | # source eucarc to generate EC2 credentials and set up the environment |
| 67 | . eucarc |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 68 | # list instances using ec2 api |
| 69 | euca-describe-instances |
| 70 | |
Dean Troyer | 23f69d8 | 2013-10-04 12:35:24 -0500 | [diff] [blame] | 71 | # DevStack Execution Environment |
| 72 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 73 | DevStack runs rampant over the system it runs on, installing things and |
| 74 | uninstalling other things. Running this on a system you care about is a recipe |
| 75 | for disappointment, or worse. Alas, we're all in the virtualization business |
| 76 | here, so run it in a VM. And take advantage of the snapshot capabilities |
| 77 | of your hypervisor of choice to reduce testing cycle times. You might even save |
| 78 | enough time to write one more feature before the next feature freeze... |
Dean Troyer | 23f69d8 | 2013-10-04 12:35:24 -0500 | [diff] [blame] | 79 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 80 | ``stack.sh`` needs to have root access for a lot of tasks, but uses ``sudo`` |
| 81 | for all of those tasks. However, it needs to be not-root for most of its |
| 82 | work and for all of the OpenStack services. ``stack.sh`` specifically |
| 83 | does not run if started as root. |
| 84 | |
| 85 | This is a recent change (Oct 2013) from the previous behaviour of |
| 86 | automatically creating a ``stack`` user. Automatically creating |
| 87 | user accounts is not the right response to running as root, so |
Sean Dague | 7d4c7e0 | 2014-03-12 08:05:08 -0400 | [diff] [blame] | 88 | that bit is now an explicit step using ``tools/create-stack-user.sh``. |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 89 | Run that (as root!) or just check it out to see what DevStack's |
| 90 | expectations are for the account it runs under. Many people simply |
| 91 | use their usual login (the default 'ubuntu' login on a UEC image |
| 92 | for example). |
Dean Troyer | 23f69d8 | 2013-10-04 12:35:24 -0500 | [diff] [blame] | 93 | |
Anthony Young | 6398787 | 2011-09-30 11:34:43 -0700 | [diff] [blame] | 94 | # Customizing |
| 95 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame^] | 96 | You can override environment variables used in `stack.sh` by creating |
| 97 | file name `local.conf` with a ``localrc`` section as shown below. It |
| 98 | is likely that you will need to do this to tweak several settings for |
| 99 | your environment. |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 100 | |
| 101 | [[local|localrc]] |
| 102 | VARIABLE=value |
| 103 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame^] | 104 | Start by reading the [configuration |
| 105 | guide](doc/source/configuration.rst) for details of the many available |
| 106 | options. |