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 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 96 | You can override environment variables used in `stack.sh` by creating file |
Roman Bogorodskiy | 4df4a15 | 2013-11-12 12:09:40 +0000 | [diff] [blame] | 97 | name `local.conf` with a ``localrc`` section as shown below. It is likely |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 98 | that you will need to do this to tweak your networking configuration should |
| 99 | you need to access your cloud from a different host. |
| 100 | |
| 101 | [[local|localrc]] |
| 102 | VARIABLE=value |
| 103 | |
| 104 | See the **Local Configuration** section below for more details. |
Chmouel Boudjnah | 782f24e | 2012-02-29 13:42:44 +0000 | [diff] [blame] | 105 | |
Terry Wilson | 428af5a | 2012-11-01 16:12:39 -0400 | [diff] [blame] | 106 | # Database Backend |
| 107 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 108 | Multiple database backends are available. The available databases are defined |
| 109 | in the lib/databases directory. |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 110 | `mysql` is the default database, choose a different one by putting the |
| 111 | following in the `localrc` section: |
Terry Wilson | 428af5a | 2012-11-01 16:12:39 -0400 | [diff] [blame] | 112 | |
Dean Troyer | afc29fe | 2013-02-07 15:56:24 -0600 | [diff] [blame] | 113 | disable_service mysql |
| 114 | enable_service postgresql |
Terry Wilson | 428af5a | 2012-11-01 16:12:39 -0400 | [diff] [blame] | 115 | |
Dean Troyer | afc29fe | 2013-02-07 15:56:24 -0600 | [diff] [blame] | 116 | `mysql` is the default database. |
Terry Wilson | 428af5a | 2012-11-01 16:12:39 -0400 | [diff] [blame] | 117 | |
ewindisch | 3bae7c2 | 2012-01-18 11:18:35 -0500 | [diff] [blame] | 118 | # RPC Backend |
| 119 | |
| 120 | Multiple RPC backends are available. Currently, this |
| 121 | includes RabbitMQ (default), Qpid, and ZeroMQ. Your backend of |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 122 | choice may be selected via the `localrc` section. |
ewindisch | 3bae7c2 | 2012-01-18 11:18:35 -0500 | [diff] [blame] | 123 | |
| 124 | Note that selecting more than one RPC backend will result in a failure. |
| 125 | |
| 126 | Example (ZeroMQ): |
| 127 | |
| 128 | ENABLED_SERVICES="$ENABLED_SERVICES,-rabbit,-qpid,zeromq" |
| 129 | |
| 130 | Example (Qpid): |
| 131 | |
| 132 | ENABLED_SERVICES="$ENABLED_SERVICES,-rabbit,-zeromq,qpid" |
| 133 | |
zhang-hare | d98a5d0 | 2013-06-21 18:18:02 +0800 | [diff] [blame] | 134 | # Apache Frontend |
| 135 | |
Morgan Fainberg | 46455a3 | 2014-06-20 10:37:18 -0700 | [diff] [blame] | 136 | Apache web server can be enabled for wsgi services that support being deployed |
| 137 | under HTTPD + mod_wsgi. By default, services that recommend running under |
| 138 | HTTPD + mod_wsgi are deployed under Apache. To use an alternative deployment |
| 139 | strategy (e.g. eventlet) for services that support an alternative to HTTPD + |
| 140 | mod_wsgi set ``ENABLE_HTTPD_MOD_WSGI_SERVICES`` to ``False`` in your |
| 141 | ``local.conf``. |
zhang-hare | d98a5d0 | 2013-06-21 18:18:02 +0800 | [diff] [blame] | 142 | |
Morgan Fainberg | 46455a3 | 2014-06-20 10:37:18 -0700 | [diff] [blame] | 143 | Each service that can be run under HTTPD + mod_wsgi also has an override |
| 144 | toggle available that can be set in your ``local.conf``. |
| 145 | |
Morgan Fainberg | e6dd4e6 | 2014-06-25 17:25:25 -0700 | [diff] [blame] | 146 | Keystone is run under HTTPD + mod_wsgi by default. |
| 147 | |
Morgan Fainberg | 46455a3 | 2014-06-20 10:37:18 -0700 | [diff] [blame] | 148 | Example (Keystone): |
| 149 | |
| 150 | KEYSTONE_USE_MOD_WSGI="True" |
| 151 | |
| 152 | Example (Swift): |
| 153 | |
| 154 | SWIFT_USE_MOD_WSGI="True" |
zhang-hare | d98a5d0 | 2013-06-21 18:18:02 +0800 | [diff] [blame] | 155 | |
Chmouel Boudjnah | 782f24e | 2012-02-29 13:42:44 +0000 | [diff] [blame] | 156 | # Swift |
| 157 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 158 | Swift is disabled by default. When enabled, it is configured with |
| 159 | only one replica to avoid being IO/memory intensive on a small |
| 160 | vm. When running with only one replica the account, container and |
| 161 | object services will run directly in screen. The others services like |
| 162 | replicator, updaters or auditor runs in background. |
Chmouel Boudjnah | 782f24e | 2012-02-29 13:42:44 +0000 | [diff] [blame] | 163 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 164 | If you would like to enable Swift you can add this to your `localrc` section: |
Chmouel Boudjnah | 0c3a558 | 2013-03-06 10:58:33 +0100 | [diff] [blame] | 165 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 166 | enable_service s-proxy s-object s-container s-account |
Chmouel Boudjnah | 782f24e | 2012-02-29 13:42:44 +0000 | [diff] [blame] | 167 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 168 | If you want a minimal Swift install with only Swift and Keystone you |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 169 | can have this instead in your `localrc` section: |
Chmouel Boudjnah | 504f871 | 2012-03-15 20:43:26 +0000 | [diff] [blame] | 170 | |
Doug Hellmann | f04178f | 2012-07-05 17:10:03 -0400 | [diff] [blame] | 171 | disable_all_services |
Chmouel Boudjnah | 0c3a558 | 2013-03-06 10:58:33 +0100 | [diff] [blame] | 172 | enable_service key mysql s-proxy s-object s-container s-account |
Chmouel Boudjnah | 504f871 | 2012-03-15 20:43:26 +0000 | [diff] [blame] | 173 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 174 | If you only want to do some testing of a real normal swift cluster |
| 175 | with multiple replicas you can do so by customizing the variable |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 176 | `SWIFT_REPLICAS` in your `localrc` section (usually to 3). |
Chmouel Boudjnah | 0c3a558 | 2013-03-06 10:58:33 +0100 | [diff] [blame] | 177 | |
| 178 | # Swift S3 |
Chmouel Boudjnah | 504f871 | 2012-03-15 20:43:26 +0000 | [diff] [blame] | 179 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 180 | If you are enabling `swift3` in `ENABLED_SERVICES` DevStack will |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 181 | install the swift3 middleware emulation. Swift will be configured to |
| 182 | act as a S3 endpoint for Keystone so effectively replacing the |
| 183 | `nova-objectstore`. |
Chmouel Boudjnah | 504f871 | 2012-03-15 20:43:26 +0000 | [diff] [blame] | 184 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 185 | Only Swift proxy server is launched in the screen session all other |
| 186 | services are started in background and managed by `swift-init` tool. |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 187 | |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 188 | # Neutron |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 189 | |
| 190 | Basic Setup |
| 191 | |
Ian Wienand | 0352f58 | 2013-07-24 13:01:32 +1000 | [diff] [blame] | 192 | In order to enable Neutron a single node setup, you'll need the |
Dean Troyer | 91baef3 | 2014-02-28 11:11:45 -0600 | [diff] [blame] | 193 | following settings in your `local.conf`: |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 194 | |
| 195 | disable_service n-net |
| 196 | enable_service q-svc |
| 197 | enable_service q-agt |
| 198 | enable_service q-dhcp |
| 199 | enable_service q-l3 |
| 200 | enable_service q-meta |
Emilien Macchi | 40546f7 | 2013-09-24 15:10:25 +0200 | [diff] [blame] | 201 | enable_service q-metering |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 202 | # Optional, to enable tempest configuration as part of DevStack |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 203 | enable_service tempest |
| 204 | |
Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 205 | Then run `stack.sh` as normal. |
| 206 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 207 | DevStack supports setting specific Neutron configuration flags to the |
| 208 | service, Open vSwitch plugin and LinuxBridge plugin configuration files. |
Dean Troyer | 91baef3 | 2014-02-28 11:11:45 -0600 | [diff] [blame] | 209 | To make use of this feature, the settings can be added to ``local.conf``. |
| 210 | The old ``Q_XXX_EXTRA_XXX_OPTS`` variables are deprecated and will be removed |
| 211 | in the near future. The ``local.conf`` headers for the replacements are: |
Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame] | 212 | |
Dean Troyer | 91baef3 | 2014-02-28 11:11:45 -0600 | [diff] [blame] | 213 | * ``Q_SRV_EXTRA_OPTS``: |
Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame] | 214 | |
Dean Troyer | 91baef3 | 2014-02-28 11:11:45 -0600 | [diff] [blame] | 215 | [[post-config|/$Q_PLUGIN_CONF_FILE]] |
| 216 | [linuxbridge] # or [ovs] |
Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame] | 217 | |
Dean Troyer | 91baef3 | 2014-02-28 11:11:45 -0600 | [diff] [blame] | 218 | Example extra config in `local.conf`: |
| 219 | |
| 220 | [[post-config|/$Q_PLUGIN_CONF_FILE]] |
| 221 | [agent] |
| 222 | tunnel_type=vxlan |
| 223 | vxlan_udp_port=8472 |
| 224 | |
| 225 | [[post-config|$NEUTRON_CONF]] |
| 226 | [DEFAULT] |
| 227 | tenant_network_type=vxlan |
Kyle Mestery | ebfac64 | 2013-05-17 15:20:56 -0500 | [diff] [blame] | 228 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 229 | DevStack also supports configuring the Neutron ML2 plugin. The ML2 plugin |
Dean Troyer | 91baef3 | 2014-02-28 11:11:45 -0600 | [diff] [blame] | 230 | can run with the OVS, LinuxBridge, or Hyper-V agents on compute hosts. This |
| 231 | is a simple way to configure the ml2 plugin: |
Kyle Mestery | b772659 | 2013-07-19 14:26:53 +0000 | [diff] [blame] | 232 | |
| 233 | # VLAN configuration |
| 234 | Q_PLUGIN=ml2 |
| 235 | ENABLE_TENANT_VLANS=True |
| 236 | |
| 237 | # GRE tunnel configuration |
| 238 | Q_PLUGIN=ml2 |
| 239 | ENABLE_TENANT_TUNNELS=True |
| 240 | |
| 241 | # VXLAN tunnel configuration |
| 242 | Q_PLUGIN=ml2 |
| 243 | Q_ML2_TENANT_NETWORK_TYPE=vxlan |
| 244 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 245 | The above will default in DevStack to using the OVS on each compute host. |
| 246 | To change this, set the `Q_AGENT` variable to the agent you want to run |
| 247 | (e.g. linuxbridge). |
Kyle Mestery | b772659 | 2013-07-19 14:26:53 +0000 | [diff] [blame] | 248 | |
| 249 | Variable Name Notes |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 250 | ---------------------------------------------------------------------------- |
| 251 | Q_AGENT This specifies which agent to run with the |
YAMAMOTO Takashi | 10a8c88 | 2015-03-11 16:41:32 +0900 | [diff] [blame] | 252 | ML2 Plugin (Typically either `openvswitch` |
| 253 | or `linuxbridge`). |
| 254 | Defaults to `openvswitch`. |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 255 | Q_ML2_PLUGIN_MECHANISM_DRIVERS The ML2 MechanismDrivers to load. The default |
YAMAMOTO Takashi | 10a8c88 | 2015-03-11 16:41:32 +0900 | [diff] [blame] | 256 | is `openvswitch,linuxbridge`. |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 257 | Q_ML2_PLUGIN_TYPE_DRIVERS The ML2 TypeDrivers to load. Defaults to |
| 258 | all available TypeDrivers. |
YAMAMOTO Takashi | 10a8c88 | 2015-03-11 16:41:32 +0900 | [diff] [blame] | 259 | Q_ML2_PLUGIN_GRE_TYPE_OPTIONS GRE TypeDriver options. Defaults to |
| 260 | `tunnel_id_ranges=1:1000'. |
| 261 | Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS VXLAN TypeDriver options. Defaults to |
| 262 | `vni_ranges=1001:2000` |
Kyle Mestery | b772659 | 2013-07-19 14:26:53 +0000 | [diff] [blame] | 263 | Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS VLAN TypeDriver options. Defaults to none. |
Kyle Mestery | b772659 | 2013-07-19 14:26:53 +0000 | [diff] [blame] | 264 | |
Steve Baker | 389b3a0 | 2013-08-01 10:44:09 +1200 | [diff] [blame] | 265 | # Heat |
| 266 | |
JordanP | 97eb9bb | 2014-05-26 09:38:50 +0200 | [diff] [blame] | 267 | Heat is enabled by default (see `stackrc` file). To disable it explicitly |
| 268 | you'll need the following settings in your `localrc` section: |
Steve Baker | 389b3a0 | 2013-08-01 10:44:09 +1200 | [diff] [blame] | 269 | |
JordanP | 97eb9bb | 2014-05-26 09:38:50 +0200 | [diff] [blame] | 270 | disable_service heat h-api h-api-cfn h-api-cw h-eng |
Steve Baker | 389b3a0 | 2013-08-01 10:44:09 +1200 | [diff] [blame] | 271 | |
| 272 | Heat can also run in standalone mode, and be configured to orchestrate |
| 273 | on an external OpenStack cloud. To launch only Heat in standalone mode |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 274 | you'll need the following settings in your `localrc` section: |
Steve Baker | 389b3a0 | 2013-08-01 10:44:09 +1200 | [diff] [blame] | 275 | |
| 276 | disable_all_services |
| 277 | enable_service rabbit mysql heat h-api h-api-cfn h-api-cw h-eng |
| 278 | HEAT_STANDALONE=True |
| 279 | KEYSTONE_SERVICE_HOST=... |
| 280 | KEYSTONE_AUTH_HOST=... |
| 281 | |
Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 282 | # Tempest |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 283 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 284 | If tempest has been successfully configured, a basic set of smoke |
| 285 | tests can be run as follows: |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 286 | |
| 287 | $ cd /opt/stack/tempest |
Joe Gordon | c9b245b | 2015-02-10 14:32:39 -0800 | [diff] [blame] | 288 | $ tox -efull tempest.scenario.test_network_basic_ops |
| 289 | |
| 290 | By default tempest is downloaded and the config file is generated, but the |
| 291 | tempest package is not installed in the system's global site-packages (the |
| 292 | package install includes installing dependences). So tempest won't run |
| 293 | outside of tox. If you would like to install it add the following to your |
| 294 | ``localrc`` section: |
| 295 | |
| 296 | INSTALL_TEMPEST=True |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 297 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 298 | # DevStack on Xenserver |
| 299 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 300 | If you would like to use Xenserver as the hypervisor, please refer |
| 301 | to the instructions in `./tools/xen/README.md`. |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 302 | |
Dean Troyer | cdf3d76 | 2013-10-15 09:42:43 -0500 | [diff] [blame] | 303 | # Additional Projects |
| 304 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 305 | DevStack has a hook mechanism to call out to a dispatch script at specific |
| 306 | points in the execution of `stack.sh`, `unstack.sh` and `clean.sh`. This |
| 307 | allows upper-layer projects, especially those that the lower layer projects |
| 308 | have no dependency on, to be added to DevStack without modifying the core |
| 309 | scripts. Tempest is built this way as an example of how to structure the |
| 310 | dispatch script, see `extras.d/80-tempest.sh`. See `extras.d/README.md` |
| 311 | for more information. |
Dean Troyer | cdf3d76 | 2013-10-15 09:42:43 -0500 | [diff] [blame] | 312 | |
Dean Troyer | cc6b443 | 2013-04-08 15:38:03 -0500 | [diff] [blame] | 313 | # Multi-Node Setup |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 314 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 315 | A more interesting setup involves running multiple compute nodes, with Neutron |
| 316 | networks connecting VMs on different compute nodes. |
| 317 | You should run at least one "controller node", which should have a `stackrc` |
| 318 | that includes at least: |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 319 | |
| 320 | disable_service n-net |
| 321 | enable_service q-svc |
| 322 | enable_service q-agt |
| 323 | enable_service q-dhcp |
| 324 | enable_service q-l3 |
| 325 | enable_service q-meta |
Mark McClain | b05c876 | 2013-07-06 23:29:39 -0400 | [diff] [blame] | 326 | enable_service neutron |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 327 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 328 | You likely want to change your `localrc` section to run a scheduler that |
| 329 | will balance VMs across hosts: |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 330 | |
| 331 | SCHEDULER=nova.scheduler.simple.SimpleScheduler |
| 332 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 333 | You can then run many compute nodes, each of which should have a `stackrc` |
| 334 | which includes the following, with the IP address of the above controller node: |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 335 | |
Daniel Gonzalez | e53e158 | 2015-04-07 16:44:54 +0200 | [diff] [blame^] | 336 | ENABLED_SERVICES=n-cpu,rabbit,neutron,q-agt |
Oleg Bondarev | 1f11f9a | 2013-03-25 05:34:23 -0700 | [diff] [blame] | 337 | SERVICE_HOST=[IP of controller node] |
| 338 | MYSQL_HOST=$SERVICE_HOST |
| 339 | RABBIT_HOST=$SERVICE_HOST |
| 340 | Q_HOST=$SERVICE_HOST |
Eric Windisch | 800bf38 | 2013-05-24 11:21:11 -0400 | [diff] [blame] | 341 | MATCHMAKER_REDIS_HOST=$SERVICE_HOST |
Kieran Spear | fb2a3ae | 2013-03-11 23:55:49 +0000 | [diff] [blame] | 342 | |
Bartosz Górski | 0abde39 | 2014-02-28 14:15:19 +0100 | [diff] [blame] | 343 | # Multi-Region Setup |
| 344 | |
| 345 | We want to setup two devstack (RegionOne and RegionTwo) with shared keystone |
| 346 | (same users and services) and horizon. |
| 347 | Keystone and Horizon will be located in RegionOne. |
| 348 | Full spec is available at: |
| 349 | https://wiki.openstack.org/wiki/Heat/Blueprints/Multi_Region_Support_for_Heat. |
| 350 | |
| 351 | In RegionOne: |
| 352 | |
| 353 | REGION_NAME=RegionOne |
| 354 | |
| 355 | In RegionTwo: |
| 356 | |
| 357 | disable_service horizon |
| 358 | KEYSTONE_SERVICE_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE> |
| 359 | KEYSTONE_AUTH_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE> |
| 360 | REGION_NAME=RegionTwo |
| 361 | |
Kieran Spear | fb2a3ae | 2013-03-11 23:55:49 +0000 | [diff] [blame] | 362 | # Cells |
| 363 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 364 | Cells is a new scaling option with a full spec at: |
| 365 | http://wiki.openstack.org/blueprint-nova-compute-cells. |
Kieran Spear | fb2a3ae | 2013-03-11 23:55:49 +0000 | [diff] [blame] | 366 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 367 | To setup a cells environment add the following to your `localrc` section: |
Kieran Spear | fb2a3ae | 2013-03-11 23:55:49 +0000 | [diff] [blame] | 368 | |
| 369 | enable_service n-cell |
Kieran Spear | fb2a3ae | 2013-03-11 23:55:49 +0000 | [diff] [blame] | 370 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 371 | Be aware that there are some features currently missing in cells, one notable |
| 372 | one being security groups. The exercises have been patched to disable |
| 373 | functionality not supported by cells. |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 374 | |
| 375 | |
| 376 | # Local Configuration |
| 377 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 378 | Historically DevStack has used ``localrc`` to contain all local configuration |
| 379 | and customizations. More and more of the configuration variables available for |
| 380 | DevStack are passed-through to the individual project configuration files. |
| 381 | The old mechanism for this required specific code for each file and did not |
| 382 | scale well. This is handled now by a master local configuration file. |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 383 | |
| 384 | # local.conf |
| 385 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 386 | The new config file ``local.conf`` is an extended-INI format that introduces |
| 387 | a new meta-section header that provides some additional information such |
| 388 | as a phase name and destination config filename: |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 389 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 390 | [[ <phase> | <config-file-name> ]] |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 391 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 392 | where ``<phase>`` is one of a set of phase names defined by ``stack.sh`` |
| 393 | and ``<config-file-name>`` is the configuration filename. The filename is |
| 394 | eval'ed in the ``stack.sh`` context so all environment variables are |
| 395 | available and may be used. Using the project config file variables in |
| 396 | the header is strongly suggested (see the ``NOVA_CONF`` example below). |
| 397 | If the path of the config file does not exist it is skipped. |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 398 | |
| 399 | The defined phases are: |
| 400 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 401 | * **local** - extracts ``localrc`` from ``local.conf`` before ``stackrc`` is sourced |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 402 | * **post-config** - runs after the layer 2 services are configured |
| 403 | and before they are started |
| 404 | * **extra** - runs after services are started and before any files |
| 405 | in ``extra.d`` are executed |
Ryan Hsu | feb2883 | 2013-11-07 12:12:35 -0800 | [diff] [blame] | 406 | * **post-extra** - runs after files in ``extra.d`` are executed |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 407 | |
Radoslaw Smigielski | 8c666cf | 2014-05-14 12:36:29 +0100 | [diff] [blame] | 408 | The file is processed strictly in sequence; meta-sections may be specified more |
| 409 | than once but if any settings are duplicated the last to appear in the file |
| 410 | will be used. |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 411 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 412 | [[post-config|$NOVA_CONF]] |
| 413 | [DEFAULT] |
| 414 | use_syslog = True |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 415 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 416 | [osapi_v3] |
| 417 | enabled = False |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 418 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 419 | A specific meta-section ``local|localrc`` is used to provide a default |
| 420 | ``localrc`` file (actually ``.localrc.auto``). This allows all custom |
| 421 | settings for DevStack to be contained in a single file. If ``localrc`` |
| 422 | exists it will be used instead to preserve backward-compatibility. |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 423 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 424 | [[local|localrc]] |
| 425 | FIXED_RANGE=10.254.1.0/24 |
| 426 | ADMIN_PASSWORD=speciale |
| 427 | LOGFILE=$DEST/logs/stack.sh.log |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 428 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 429 | Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to *NOT* |
| 430 | start with a ``/`` (slash) character. A slash will need to be added: |
Dean Troyer | 893e663 | 2013-09-13 15:05:51 -0500 | [diff] [blame] | 431 | |
Dean Troyer | b8dd27b | 2013-10-17 12:03:55 -0500 | [diff] [blame] | 432 | [[post-config|/$Q_PLUGIN_CONF_FILE]] |