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 | |
Dean Troyer | 5218d45 | 2012-02-04 02:13:23 -0600 | [diff] [blame] | 5 | * To quickly build dev OpenStack environments in a clean Ubuntu or Fedora environment |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 6 | * To describe working configurations of OpenStack (which code branches work together? what do config files look like for those branches?) |
| 7 | * To make it easier for developers to dive into OpenStack so that they can productively contribute without having to understand every part of the system at once |
Anthony Young | 6398787 | 2011-09-30 11:34:43 -0700 | [diff] [blame] | 8 | * To make it easy to prototype cross-project features |
Dean Troyer | ce043c4 | 2012-02-03 22:56:38 -0600 | [diff] [blame] | 9 | * To sanity-check OpenStack builds (used in gating commits to the primary repos) |
Jesse Andrews | ba23cc7 | 2011-09-11 03:22:13 -0700 | [diff] [blame] | 10 | |
Jesse Andrews | b69d6ce | 2011-10-13 10:36:00 -0700 | [diff] [blame] | 11 | Read more at http://devstack.org (built from the gh-pages branch) |
| 12 | |
Dean Troyer | e9819d5 | 2012-03-21 11:25:06 -0500 | [diff] [blame] | 13 | IMPORTANT: Be sure to carefully read `stack.sh` and any other scripts you execute before you run them, as they install software and may alter your networking configuration. We strongly recommend that you run `stack.sh` in a clean and disposable vm when you are first getting started. |
Anthony Young | 0e65abf | 2011-09-30 09:24:00 -0700 | [diff] [blame] | 14 | |
Renuka Apte | c56885a | 2012-02-29 16:09:26 -0800 | [diff] [blame] | 15 | # Devstack on Xenserver |
| 16 | |
Dean Troyer | e9819d5 | 2012-03-21 11:25:06 -0500 | [diff] [blame] | 17 | If you would like to use Xenserver as the hypervisor, please refer to the instructions in `./tools/xen/README.md`. |
Renuka Apte | c56885a | 2012-02-29 16:09:26 -0800 | [diff] [blame] | 18 | |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 19 | # Versions |
| 20 | |
Dean Troyer | e9819d5 | 2012-03-21 11:25:06 -0500 | [diff] [blame] | 21 | The devstack master branch generally points to trunk versions of OpenStack components. For older, stable versions, look for branches named stable/[release] in the DevStack repo. For example, you can do the following to create a diablo OpenStack cloud: |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 22 | |
| 23 | git checkout stable/diablo |
| 24 | ./stack.sh |
| 25 | |
Dean Troyer | e9819d5 | 2012-03-21 11:25:06 -0500 | [diff] [blame] | 26 | You can also pick specific OpenStack project releases by setting the appropriate `*_BRANCH` variables in `localrc` (look in `stackrc` for the default set). Usually just before a release there will be milestone-proposed branches that need to be tested:: |
Dean Troyer | ce043c4 | 2012-02-03 22:56:38 -0600 | [diff] [blame] | 27 | |
Dean Troyer | e9819d5 | 2012-03-21 11:25:06 -0500 | [diff] [blame] | 28 | GLANCE_REPO=https://github.com/openstack/glance.git |
| 29 | GLANCE_BRANCH=milestone-proposed |
Dean Troyer | ce043c4 | 2012-02-03 22:56:38 -0600 | [diff] [blame] | 30 | |
| 31 | # Start A Dev Cloud |
| 32 | |
| 33 | Installing in a dedicated disposable vm is safer than installing on your dev machine! To start a dev cloud: |
Anthony Young | 0e65abf | 2011-09-30 09:24:00 -0700 | [diff] [blame] | 34 | |
| 35 | ./stack.sh |
| 36 | |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 37 | When the script finishes executing, you should be able to access OpenStack endpoints, like so: |
Anthony Young | 6398787 | 2011-09-30 11:34:43 -0700 | [diff] [blame] | 38 | |
Tres Henry | ca85b79 | 2011-10-28 14:00:21 -0700 | [diff] [blame] | 39 | * Horizon: http://myhost/ |
Anthony Young | 6398787 | 2011-09-30 11:34:43 -0700 | [diff] [blame] | 40 | * Keystone: http://myhost:5000/v2.0/ |
| 41 | |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 42 | We also provide an environment file that you can use to interact with your cloud via CLI: |
| 43 | |
| 44 | # source openrc file to load your environment with osapi and ec2 creds |
| 45 | . openrc |
| 46 | # list instances |
| 47 | nova list |
Dean Troyer | 0bd2410 | 2012-03-08 00:33:54 -0600 | [diff] [blame] | 48 | |
| 49 | If the EC2 API is your cup-o-tea, you can create credentials and use euca2ools: |
| 50 | |
| 51 | # source eucarc to generate EC2 credentials and set up the environment |
| 52 | . eucarc |
Anthony Young | 073d17d | 2011-11-23 12:50:46 -0800 | [diff] [blame] | 53 | # list instances using ec2 api |
| 54 | euca-describe-instances |
| 55 | |
Anthony Young | 6398787 | 2011-09-30 11:34:43 -0700 | [diff] [blame] | 56 | # Customizing |
| 57 | |
Dean Troyer | e9819d5 | 2012-03-21 11:25:06 -0500 | [diff] [blame] | 58 | You can override environment variables used in `stack.sh` by creating file name `localrc`. It is likely that you will need to do this to tweak your networking configuration should you need to access your cloud from a different host. |
Chmouel Boudjnah | 782f24e | 2012-02-29 13:42:44 +0000 | [diff] [blame] | 59 | |
Terry Wilson | 428af5a | 2012-11-01 16:12:39 -0400 | [diff] [blame] | 60 | # Database Backend |
| 61 | |
| 62 | Multiple database backends are available. The available databases are defined in the lib/databases directory. |
Dean Troyer | afc29fe | 2013-02-07 15:56:24 -0600 | [diff] [blame] | 63 | `mysql` is the default database, choose a different one by putting the following in `localrc`: |
Terry Wilson | 428af5a | 2012-11-01 16:12:39 -0400 | [diff] [blame] | 64 | |
Dean Troyer | afc29fe | 2013-02-07 15:56:24 -0600 | [diff] [blame] | 65 | disable_service mysql |
| 66 | enable_service postgresql |
Terry Wilson | 428af5a | 2012-11-01 16:12:39 -0400 | [diff] [blame] | 67 | |
Dean Troyer | afc29fe | 2013-02-07 15:56:24 -0600 | [diff] [blame] | 68 | `mysql` is the default database. |
Terry Wilson | 428af5a | 2012-11-01 16:12:39 -0400 | [diff] [blame] | 69 | |
ewindisch | 3bae7c2 | 2012-01-18 11:18:35 -0500 | [diff] [blame] | 70 | # RPC Backend |
| 71 | |
| 72 | Multiple RPC backends are available. Currently, this |
| 73 | includes RabbitMQ (default), Qpid, and ZeroMQ. Your backend of |
| 74 | choice may be selected via the `localrc`. |
| 75 | |
| 76 | Note that selecting more than one RPC backend will result in a failure. |
| 77 | |
| 78 | Example (ZeroMQ): |
| 79 | |
| 80 | ENABLED_SERVICES="$ENABLED_SERVICES,-rabbit,-qpid,zeromq" |
| 81 | |
| 82 | Example (Qpid): |
| 83 | |
| 84 | ENABLED_SERVICES="$ENABLED_SERVICES,-rabbit,-zeromq,qpid" |
| 85 | |
Chmouel Boudjnah | 782f24e | 2012-02-29 13:42:44 +0000 | [diff] [blame] | 86 | # Swift |
| 87 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 88 | Swift is disabled by default. When enabled, it is configured with |
| 89 | only one replica to avoid being IO/memory intensive on a small |
| 90 | vm. When running with only one replica the account, container and |
| 91 | object services will run directly in screen. The others services like |
| 92 | replicator, updaters or auditor runs in background. |
Chmouel Boudjnah | 782f24e | 2012-02-29 13:42:44 +0000 | [diff] [blame] | 93 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 94 | If you would like to enable Swift you can add this to your `localrc` : |
Chmouel Boudjnah | 0c3a558 | 2013-03-06 10:58:33 +0100 | [diff] [blame] | 95 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 96 | enable_service s-proxy s-object s-container s-account |
Chmouel Boudjnah | 782f24e | 2012-02-29 13:42:44 +0000 | [diff] [blame] | 97 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 98 | If you want a minimal Swift install with only Swift and Keystone you |
| 99 | can have this instead in your `localrc`: |
Chmouel Boudjnah | 504f871 | 2012-03-15 20:43:26 +0000 | [diff] [blame] | 100 | |
Doug Hellmann | f04178f | 2012-07-05 17:10:03 -0400 | [diff] [blame] | 101 | disable_all_services |
Chmouel Boudjnah | 0c3a558 | 2013-03-06 10:58:33 +0100 | [diff] [blame] | 102 | enable_service key mysql s-proxy s-object s-container s-account |
Chmouel Boudjnah | 504f871 | 2012-03-15 20:43:26 +0000 | [diff] [blame] | 103 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 104 | If you only want to do some testing of a real normal swift cluster |
| 105 | with multiple replicas you can do so by customizing the variable |
| 106 | `SWIFT_REPLICAS` in your `localrc` (usually to 3). |
Chmouel Boudjnah | 0c3a558 | 2013-03-06 10:58:33 +0100 | [diff] [blame] | 107 | |
| 108 | # Swift S3 |
Chmouel Boudjnah | 504f871 | 2012-03-15 20:43:26 +0000 | [diff] [blame] | 109 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 110 | If you are enabling `swift3` in `ENABLED_SERVICES` devstack will |
| 111 | install the swift3 middleware emulation. Swift will be configured to |
| 112 | act as a S3 endpoint for Keystone so effectively replacing the |
| 113 | `nova-objectstore`. |
Chmouel Boudjnah | 504f871 | 2012-03-15 20:43:26 +0000 | [diff] [blame] | 114 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 115 | Only Swift proxy server is launched in the screen session all other |
| 116 | services are started in background and managed by `swift-init` tool. |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 117 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 118 | # Neutron |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 119 | |
| 120 | Basic Setup |
| 121 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 122 | In order to enable Neutron a single node setup, you'll need the |
| 123 | following settings in your `localrc` : |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 124 | |
| 125 | disable_service n-net |
| 126 | enable_service q-svc |
| 127 | enable_service q-agt |
| 128 | enable_service q-dhcp |
| 129 | enable_service q-l3 |
| 130 | enable_service q-meta |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 131 | enable_service neutron |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 132 | # Optional, to enable tempest configuration as part of devstack |
| 133 | enable_service tempest |
| 134 | |
Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 135 | Then run `stack.sh` as normal. |
| 136 | |
Simon Pasquier | ca96b0a | 2013-07-09 16:59:12 +0200 | [diff] [blame] | 137 | devstack supports adding specific Neutron configuration flags to the service, Open vSwitch plugin and LinuxBridge plugin configuration files. To make use of this feature, the following variables are defined and can be configured in your `localrc` file: |
Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame] | 138 | |
Simon Pasquier | ca96b0a | 2013-07-09 16:59:12 +0200 | [diff] [blame] | 139 | Variable Name Config File Section Modified |
Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame] | 140 | ------------------------------------------------------------------------------------- |
Simon Pasquier | ca96b0a | 2013-07-09 16:59:12 +0200 | [diff] [blame] | 141 | Q_SRV_EXTRA_OPTS Plugin `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge) |
| 142 | Q_AGENT_EXTRA_AGENT_OPTS Plugin AGENT |
| 143 | Q_AGENT_EXTRA_SRV_OPTS Plugin `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge) |
| 144 | Q_SRV_EXTRA_DEFAULT_OPTS Service DEFAULT |
Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame] | 145 | |
| 146 | An example of using the variables in your `localrc` is below: |
| 147 | |
| 148 | Q_AGENT_EXTRA_AGENT_OPTS=(tunnel_type=vxlan vxlan_udp_port=8472) |
| 149 | Q_SRV_EXTRA_OPTS=(tenant_network_type=vxlan) |
| 150 | |
Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 151 | # Tempest |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 152 | |
| 153 | If tempest has been successfully configured, a basic set of smoke tests can be run as follows: |
| 154 | |
| 155 | $ cd /opt/stack/tempest |
| 156 | $ nosetests tempest/tests/network/test_network_basic_ops.py |
| 157 | |
Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 158 | # Multi-Node Setup |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 159 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 160 | A more interesting setup involves running multiple compute nodes, with Neutron networks connecting VMs on different compute nodes. |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 161 | You should run at least one "controller node", which should have a `stackrc` that includes at least: |
| 162 | |
| 163 | disable_service n-net |
| 164 | enable_service q-svc |
| 165 | enable_service q-agt |
| 166 | enable_service q-dhcp |
| 167 | enable_service q-l3 |
| 168 | enable_service q-meta |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 169 | enable_service neutron |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 170 | |
| 171 | You likely want to change your `localrc` to run a scheduler that will balance VMs across hosts: |
| 172 | |
| 173 | SCHEDULER=nova.scheduler.simple.SimpleScheduler |
| 174 | |
| 175 | You can then run many compute nodes, each of which should have a `stackrc` which includes the following, with the IP address of the above controller node: |
| 176 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 177 | ENABLED_SERVICES=n-cpu,rabbit,g-api,neutron,q-agt |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 178 | SERVICE_HOST=[IP of controller node] |
| 179 | MYSQL_HOST=$SERVICE_HOST |
| 180 | RABBIT_HOST=$SERVICE_HOST |
| 181 | Q_HOST=$SERVICE_HOST |
Eric Windisch | 800bf38 | 2013-05-24 11:21:11 -0400 | [diff] [blame] | 182 | MATCHMAKER_REDIS_HOST=$SERVICE_HOST |
Kieran Spear | fb2a3ae | 2013-03-11 23:55:49 +0000 | [diff] [blame] | 183 | |
| 184 | # Cells |
| 185 | |
| 186 | Cells is a new scaling option with a full spec at http://wiki.openstack.org/blueprint-nova-compute-cells. |
| 187 | |
| 188 | To setup a cells environment add the following to your `localrc`: |
| 189 | |
| 190 | enable_service n-cell |
Kieran Spear | fb2a3ae | 2013-03-11 23:55:49 +0000 | [diff] [blame] | 191 | |
Chris Behrens | c62c2b9 | 2013-07-24 03:56:13 -0700 | [diff] [blame^] | 192 | Be aware that there are some features currently missing in cells, one notable one being security groups. The exercises have been patched to disable functionality not supported by cells. |