blob: 34e451dc0bf6f9174c0ec29f9e7aa02f88bf6667 [file] [log] [blame] [view]
Dean Troyere9819d52012-03-21 11:25:06 -05001DevStack is a set of scripts and utilities to quickly deploy an OpenStack cloud.
Anthony Young63987872011-09-30 11:34:43 -07002
3# Goals
4
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +01005* 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 Young63987872011-09-30 11:34:43 -070012* To make it easy to prototype cross-project features
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +010013* To provide an environment for the OpenStack CI testing on every commit
14 to the projects
Jesse Andrewsba23cc72011-09-11 03:22:13 -070015
Dean Troyerb8dd27b2013-10-17 12:03:55 -050016Read more at http://devstack.org.
Jesse Andrewsb69d6ce2011-10-13 10:36:00 -070017
Dean Troyerb8dd27b2013-10-17 12:03:55 -050018IMPORTANT: Be sure to carefully read `stack.sh` and any other scripts you
19execute before you run them, as they install software and will alter your
20networking configuration. We strongly recommend that you run `stack.sh`
21in a clean and disposable vm when you are first getting started.
Dean Troyer2aa2a892013-08-04 19:53:19 -050022
Anthony Young073d17d2011-11-23 12:50:46 -080023# Versions
24
Dean Troyerb8dd27b2013-10-17 12:03:55 -050025The DevStack master branch generally points to trunk versions of OpenStack
26components. For older, stable versions, look for branches named
27stable/[release] in the DevStack repo. For example, you can do the
Joe Gordon6b9deba2015-02-18 11:24:31 -080028following to create a juno OpenStack cloud:
Anthony Young073d17d2011-11-23 12:50:46 -080029
Joe Gordon6b9deba2015-02-18 11:24:31 -080030 git checkout stable/juno
Anthony Young073d17d2011-11-23 12:50:46 -080031 ./stack.sh
32
Dean Troyerb8dd27b2013-10-17 12:03:55 -050033You 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
36milestone-proposed branches that need to be tested::
Dean Troyerce043c42012-02-03 22:56:38 -060037
Steve Kowalik047cac52013-11-07 22:36:10 +110038 GLANCE_REPO=git://git.openstack.org/openstack/glance.git
Dean Troyere9819d52012-03-21 11:25:06 -050039 GLANCE_BRANCH=milestone-proposed
Dean Troyerce043c42012-02-03 22:56:38 -060040
41# Start A Dev Cloud
42
Dean Troyerb8dd27b2013-10-17 12:03:55 -050043Installing in a dedicated disposable VM is safer than installing on your
44dev machine! Plus you can pick one of the supported Linux distros for
45your VM. To start a dev cloud run the following NOT AS ROOT (see
46**DevStack Execution Environment** below for more on user accounts):
Anthony Young0e65abf2011-09-30 09:24:00 -070047
48 ./stack.sh
49
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +010050When the script finishes executing, you should be able to access OpenStack
51endpoints, like so:
Anthony Young63987872011-09-30 11:34:43 -070052
Tres Henryca85b792011-10-28 14:00:21 -070053* Horizon: http://myhost/
Anthony Young63987872011-09-30 11:34:43 -070054* Keystone: http://myhost:5000/v2.0/
55
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +010056We also provide an environment file that you can use to interact with your
57cloud via CLI:
Anthony Young073d17d2011-11-23 12:50:46 -080058
Dean Troyerb8dd27b2013-10-17 12:03:55 -050059 # source openrc file to load your environment with OpenStack CLI creds
Anthony Young073d17d2011-11-23 12:50:46 -080060 . openrc
61 # list instances
62 nova list
Dean Troyer0bd24102012-03-08 00:33:54 -060063
64If 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 Young073d17d2011-11-23 12:50:46 -080068 # list instances using ec2 api
69 euca-describe-instances
70
Dean Troyer23f69d82013-10-04 12:35:24 -050071# DevStack Execution Environment
72
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +010073DevStack runs rampant over the system it runs on, installing things and
74uninstalling other things. Running this on a system you care about is a recipe
75for disappointment, or worse. Alas, we're all in the virtualization business
76here, so run it in a VM. And take advantage of the snapshot capabilities
77of your hypervisor of choice to reduce testing cycle times. You might even save
78enough time to write one more feature before the next feature freeze...
Dean Troyer23f69d82013-10-04 12:35:24 -050079
Dean Troyerb8dd27b2013-10-17 12:03:55 -050080``stack.sh`` needs to have root access for a lot of tasks, but uses ``sudo``
81for all of those tasks. However, it needs to be not-root for most of its
82work and for all of the OpenStack services. ``stack.sh`` specifically
83does not run if started as root.
84
85This is a recent change (Oct 2013) from the previous behaviour of
86automatically creating a ``stack`` user. Automatically creating
87user accounts is not the right response to running as root, so
Sean Dague7d4c7e02014-03-12 08:05:08 -040088that bit is now an explicit step using ``tools/create-stack-user.sh``.
Dean Troyerb8dd27b2013-10-17 12:03:55 -050089Run that (as root!) or just check it out to see what DevStack's
90expectations are for the account it runs under. Many people simply
91use their usual login (the default 'ubuntu' login on a UEC image
92for example).
Dean Troyer23f69d82013-10-04 12:35:24 -050093
Anthony Young63987872011-09-30 11:34:43 -070094# Customizing
95
Dean Troyerb8dd27b2013-10-17 12:03:55 -050096You can override environment variables used in `stack.sh` by creating file
Roman Bogorodskiy4df4a152013-11-12 12:09:40 +000097name `local.conf` with a ``localrc`` section as shown below. It is likely
Dean Troyerb8dd27b2013-10-17 12:03:55 -050098that you will need to do this to tweak your networking configuration should
99you need to access your cloud from a different host.
100
101 [[local|localrc]]
102 VARIABLE=value
103
104See the **Local Configuration** section below for more details.
Chmouel Boudjnah782f24e2012-02-29 13:42:44 +0000105
Terry Wilson428af5a2012-11-01 16:12:39 -0400106# Database Backend
107
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100108Multiple database backends are available. The available databases are defined
109in the lib/databases directory.
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500110`mysql` is the default database, choose a different one by putting the
111following in the `localrc` section:
Terry Wilson428af5a2012-11-01 16:12:39 -0400112
Dean Troyerafc29fe2013-02-07 15:56:24 -0600113 disable_service mysql
114 enable_service postgresql
Terry Wilson428af5a2012-11-01 16:12:39 -0400115
Dean Troyerafc29fe2013-02-07 15:56:24 -0600116`mysql` is the default database.
Terry Wilson428af5a2012-11-01 16:12:39 -0400117
zhang-hared98a5d02013-06-21 18:18:02 +0800118# Apache Frontend
119
Morgan Fainberg46455a32014-06-20 10:37:18 -0700120Apache web server can be enabled for wsgi services that support being deployed
121under HTTPD + mod_wsgi. By default, services that recommend running under
122HTTPD + mod_wsgi are deployed under Apache. To use an alternative deployment
123strategy (e.g. eventlet) for services that support an alternative to HTTPD +
124mod_wsgi set ``ENABLE_HTTPD_MOD_WSGI_SERVICES`` to ``False`` in your
125``local.conf``.
zhang-hared98a5d02013-06-21 18:18:02 +0800126
Morgan Fainberg46455a32014-06-20 10:37:18 -0700127Each service that can be run under HTTPD + mod_wsgi also has an override
128toggle available that can be set in your ``local.conf``.
129
Morgan Fainberge6dd4e62014-06-25 17:25:25 -0700130Keystone is run under HTTPD + mod_wsgi by default.
131
Morgan Fainberg46455a32014-06-20 10:37:18 -0700132Example (Keystone):
133
134 KEYSTONE_USE_MOD_WSGI="True"
135
Davanum Srinivasd5537c12015-04-30 21:10:48 -0400136Example (Nova):
137
138 NOVA_USE_MOD_WSGI="True"
139
Morgan Fainberg46455a32014-06-20 10:37:18 -0700140Example (Swift):
141
142 SWIFT_USE_MOD_WSGI="True"
zhang-hared98a5d02013-06-21 18:18:02 +0800143
Chmouel Boudjnah782f24e2012-02-29 13:42:44 +0000144# Swift
145
Ian Wienand0352f582013-07-24 13:01:32 +1000146Swift is disabled by default. When enabled, it is configured with
147only one replica to avoid being IO/memory intensive on a small
148vm. When running with only one replica the account, container and
149object services will run directly in screen. The others services like
150replicator, updaters or auditor runs in background.
Chmouel Boudjnah782f24e2012-02-29 13:42:44 +0000151
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500152If you would like to enable Swift you can add this to your `localrc` section:
Chmouel Boudjnah0c3a5582013-03-06 10:58:33 +0100153
Ian Wienand0352f582013-07-24 13:01:32 +1000154 enable_service s-proxy s-object s-container s-account
Chmouel Boudjnah782f24e2012-02-29 13:42:44 +0000155
Ian Wienand0352f582013-07-24 13:01:32 +1000156If you want a minimal Swift install with only Swift and Keystone you
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500157can have this instead in your `localrc` section:
Chmouel Boudjnah504f8712012-03-15 20:43:26 +0000158
Doug Hellmannf04178f2012-07-05 17:10:03 -0400159 disable_all_services
Chmouel Boudjnah0c3a5582013-03-06 10:58:33 +0100160 enable_service key mysql s-proxy s-object s-container s-account
Chmouel Boudjnah504f8712012-03-15 20:43:26 +0000161
Ian Wienand0352f582013-07-24 13:01:32 +1000162If you only want to do some testing of a real normal swift cluster
163with multiple replicas you can do so by customizing the variable
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500164`SWIFT_REPLICAS` in your `localrc` section (usually to 3).
Chmouel Boudjnah0c3a5582013-03-06 10:58:33 +0100165
166# Swift S3
Chmouel Boudjnah504f8712012-03-15 20:43:26 +0000167
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500168If you are enabling `swift3` in `ENABLED_SERVICES` DevStack will
Ian Wienand0352f582013-07-24 13:01:32 +1000169install the swift3 middleware emulation. Swift will be configured to
170act as a S3 endpoint for Keystone so effectively replacing the
171`nova-objectstore`.
Chmouel Boudjnah504f8712012-03-15 20:43:26 +0000172
Ian Wienand0352f582013-07-24 13:01:32 +1000173Only Swift proxy server is launched in the screen session all other
174services are started in background and managed by `swift-init` tool.
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700175
Mark McClainb05c8762013-07-06 23:29:39 -0400176# Neutron
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700177
178Basic Setup
179
Ian Wienand0352f582013-07-24 13:01:32 +1000180In order to enable Neutron a single node setup, you'll need the
Dean Troyer91baef32014-02-28 11:11:45 -0600181following settings in your `local.conf`:
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700182
183 disable_service n-net
184 enable_service q-svc
185 enable_service q-agt
186 enable_service q-dhcp
187 enable_service q-l3
188 enable_service q-meta
Emilien Macchi40546f72013-09-24 15:10:25 +0200189 enable_service q-metering
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500190 # Optional, to enable tempest configuration as part of DevStack
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700191 enable_service tempest
192
Dean Troyercc6b4432013-04-08 15:38:03 -0500193Then run `stack.sh` as normal.
194
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500195DevStack supports setting specific Neutron configuration flags to the
196service, Open vSwitch plugin and LinuxBridge plugin configuration files.
Dean Troyer91baef32014-02-28 11:11:45 -0600197To make use of this feature, the settings can be added to ``local.conf``.
198The old ``Q_XXX_EXTRA_XXX_OPTS`` variables are deprecated and will be removed
199in the near future. The ``local.conf`` headers for the replacements are:
Kyle Mesteryebfac642013-05-17 15:20:56 -0500200
Dean Troyer91baef32014-02-28 11:11:45 -0600201* ``Q_SRV_EXTRA_OPTS``:
Kyle Mesteryebfac642013-05-17 15:20:56 -0500202
Dean Troyer91baef32014-02-28 11:11:45 -0600203 [[post-config|/$Q_PLUGIN_CONF_FILE]]
204 [linuxbridge] # or [ovs]
Kyle Mesteryebfac642013-05-17 15:20:56 -0500205
Dean Troyer91baef32014-02-28 11:11:45 -0600206Example extra config in `local.conf`:
207
208 [[post-config|/$Q_PLUGIN_CONF_FILE]]
209 [agent]
210 tunnel_type=vxlan
211 vxlan_udp_port=8472
212
213 [[post-config|$NEUTRON_CONF]]
214 [DEFAULT]
215 tenant_network_type=vxlan
Kyle Mesteryebfac642013-05-17 15:20:56 -0500216
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500217DevStack also supports configuring the Neutron ML2 plugin. The ML2 plugin
Dean Troyer91baef32014-02-28 11:11:45 -0600218can run with the OVS, LinuxBridge, or Hyper-V agents on compute hosts. This
219is a simple way to configure the ml2 plugin:
Kyle Mesteryb7726592013-07-19 14:26:53 +0000220
221 # VLAN configuration
222 Q_PLUGIN=ml2
223 ENABLE_TENANT_VLANS=True
224
225 # GRE tunnel configuration
226 Q_PLUGIN=ml2
227 ENABLE_TENANT_TUNNELS=True
228
229 # VXLAN tunnel configuration
230 Q_PLUGIN=ml2
231 Q_ML2_TENANT_NETWORK_TYPE=vxlan
232
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500233The above will default in DevStack to using the OVS on each compute host.
234To change this, set the `Q_AGENT` variable to the agent you want to run
235(e.g. linuxbridge).
Kyle Mesteryb7726592013-07-19 14:26:53 +0000236
237 Variable Name Notes
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100238 ----------------------------------------------------------------------------
239 Q_AGENT This specifies which agent to run with the
YAMAMOTO Takashi10a8c882015-03-11 16:41:32 +0900240 ML2 Plugin (Typically either `openvswitch`
241 or `linuxbridge`).
242 Defaults to `openvswitch`.
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100243 Q_ML2_PLUGIN_MECHANISM_DRIVERS The ML2 MechanismDrivers to load. The default
YAMAMOTO Takashi10a8c882015-03-11 16:41:32 +0900244 is `openvswitch,linuxbridge`.
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100245 Q_ML2_PLUGIN_TYPE_DRIVERS The ML2 TypeDrivers to load. Defaults to
246 all available TypeDrivers.
YAMAMOTO Takashi10a8c882015-03-11 16:41:32 +0900247 Q_ML2_PLUGIN_GRE_TYPE_OPTIONS GRE TypeDriver options. Defaults to
248 `tunnel_id_ranges=1:1000'.
249 Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS VXLAN TypeDriver options. Defaults to
250 `vni_ranges=1001:2000`
Kyle Mesteryb7726592013-07-19 14:26:53 +0000251 Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS VLAN TypeDriver options. Defaults to none.
Kyle Mesteryb7726592013-07-19 14:26:53 +0000252
Steve Baker389b3a02013-08-01 10:44:09 +1200253# Heat
254
Davanum Srinivas97aa81d2015-04-07 16:23:53 -0400255Heat is disabled by default (see `stackrc` file). To enable it explicitly
JordanP97eb9bb2014-05-26 09:38:50 +0200256you'll need the following settings in your `localrc` section:
Steve Baker389b3a02013-08-01 10:44:09 +1200257
Davanum Srinivas97aa81d2015-04-07 16:23:53 -0400258 enable_service heat h-api h-api-cfn h-api-cw h-eng
Steve Baker389b3a02013-08-01 10:44:09 +1200259
260Heat can also run in standalone mode, and be configured to orchestrate
261on an external OpenStack cloud. To launch only Heat in standalone mode
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500262you'll need the following settings in your `localrc` section:
Steve Baker389b3a02013-08-01 10:44:09 +1200263
264 disable_all_services
265 enable_service rabbit mysql heat h-api h-api-cfn h-api-cw h-eng
266 HEAT_STANDALONE=True
267 KEYSTONE_SERVICE_HOST=...
268 KEYSTONE_AUTH_HOST=...
269
Dean Troyercc6b4432013-04-08 15:38:03 -0500270# Tempest
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700271
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100272If tempest has been successfully configured, a basic set of smoke
273tests can be run as follows:
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700274
275 $ cd /opt/stack/tempest
Joe Gordonc9b245b2015-02-10 14:32:39 -0800276 $ tox -efull tempest.scenario.test_network_basic_ops
277
278By default tempest is downloaded and the config file is generated, but the
279tempest package is not installed in the system's global site-packages (the
280package install includes installing dependences). So tempest won't run
281outside of tox. If you would like to install it add the following to your
282``localrc`` section:
283
284 INSTALL_TEMPEST=True
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700285
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500286# DevStack on Xenserver
287
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100288If you would like to use Xenserver as the hypervisor, please refer
289to the instructions in `./tools/xen/README.md`.
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500290
Dean Troyercdf3d762013-10-15 09:42:43 -0500291# Additional Projects
292
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500293DevStack has a hook mechanism to call out to a dispatch script at specific
294points in the execution of `stack.sh`, `unstack.sh` and `clean.sh`. This
295allows upper-layer projects, especially those that the lower layer projects
296have no dependency on, to be added to DevStack without modifying the core
297scripts. Tempest is built this way as an example of how to structure the
298dispatch script, see `extras.d/80-tempest.sh`. See `extras.d/README.md`
299for more information.
Dean Troyercdf3d762013-10-15 09:42:43 -0500300
Dean Troyercc6b4432013-04-08 15:38:03 -0500301# Multi-Node Setup
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700302
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100303A more interesting setup involves running multiple compute nodes, with Neutron
304networks connecting VMs on different compute nodes.
305You should run at least one "controller node", which should have a `stackrc`
306that includes at least:
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700307
308 disable_service n-net
309 enable_service q-svc
310 enable_service q-agt
311 enable_service q-dhcp
312 enable_service q-l3
313 enable_service q-meta
Mark McClainb05c8762013-07-06 23:29:39 -0400314 enable_service neutron
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700315
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500316You likely want to change your `localrc` section to run a scheduler that
317will balance VMs across hosts:
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700318
Accela Zhaoad0a5182015-05-08 23:55:31 +0800319 SCHEDULER=nova.scheduler.filter_scheduler.FilterScheduler
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700320
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100321You can then run many compute nodes, each of which should have a `stackrc`
322which includes the following, with the IP address of the above controller node:
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700323
Daniel Gonzaleze53e1582015-04-07 16:44:54 +0200324 ENABLED_SERVICES=n-cpu,rabbit,neutron,q-agt
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700325 SERVICE_HOST=[IP of controller node]
326 MYSQL_HOST=$SERVICE_HOST
327 RABBIT_HOST=$SERVICE_HOST
328 Q_HOST=$SERVICE_HOST
Eric Windisch800bf382013-05-24 11:21:11 -0400329 MATCHMAKER_REDIS_HOST=$SERVICE_HOST
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000330
Bartosz Górski0abde392014-02-28 14:15:19 +0100331# Multi-Region Setup
332
333We want to setup two devstack (RegionOne and RegionTwo) with shared keystone
334(same users and services) and horizon.
335Keystone and Horizon will be located in RegionOne.
336Full spec is available at:
337https://wiki.openstack.org/wiki/Heat/Blueprints/Multi_Region_Support_for_Heat.
338
339In RegionOne:
340
341 REGION_NAME=RegionOne
342
343In RegionTwo:
344
345 disable_service horizon
346 KEYSTONE_SERVICE_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
347 KEYSTONE_AUTH_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
348 REGION_NAME=RegionTwo
349
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000350# Cells
351
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100352Cells is a new scaling option with a full spec at:
353http://wiki.openstack.org/blueprint-nova-compute-cells.
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000354
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500355To setup a cells environment add the following to your `localrc` section:
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000356
357 enable_service n-cell
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000358
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100359Be aware that there are some features currently missing in cells, one notable
360one being security groups. The exercises have been patched to disable
361functionality not supported by cells.
Dean Troyer893e6632013-09-13 15:05:51 -0500362
Brian Haley180f5eb2015-06-16 13:14:31 -0400363# IPv6
364
365By default, most Openstack services are bound to 0.0.0.0
366and service endpoints are registered as IPv4 addresses.
367A new variable was created to control this behavior, and to
368allow for operation over IPv6 instead of IPv4.
369
370For this, add the following to `local.conf`:
371
372 SERVICE_IP_VERSION=6
373
374When set to "6" devstack services will open listen sockets on ::
375and service endpoints will be registered using HOST_IPV6 as the
376address. The default value for this setting is `4`. Dual-mode
377support, for example `4+6` is not currently supported.
378
Dean Troyer893e6632013-09-13 15:05:51 -0500379
380# Local Configuration
381
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100382Historically DevStack has used ``localrc`` to contain all local configuration
383and customizations. More and more of the configuration variables available for
384DevStack are passed-through to the individual project configuration files.
385The old mechanism for this required specific code for each file and did not
386scale well. This is handled now by a master local configuration file.
Dean Troyer893e6632013-09-13 15:05:51 -0500387
388# local.conf
389
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100390The new config file ``local.conf`` is an extended-INI format that introduces
391a new meta-section header that provides some additional information such
392as a phase name and destination config filename:
Dean Troyer893e6632013-09-13 15:05:51 -0500393
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500394 [[ <phase> | <config-file-name> ]]
Dean Troyer893e6632013-09-13 15:05:51 -0500395
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500396where ``<phase>`` is one of a set of phase names defined by ``stack.sh``
397and ``<config-file-name>`` is the configuration filename. The filename is
398eval'ed in the ``stack.sh`` context so all environment variables are
399available and may be used. Using the project config file variables in
400the header is strongly suggested (see the ``NOVA_CONF`` example below).
401If the path of the config file does not exist it is skipped.
Dean Troyer893e6632013-09-13 15:05:51 -0500402
403The defined phases are:
404
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500405* **local** - extracts ``localrc`` from ``local.conf`` before ``stackrc`` is sourced
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100406* **post-config** - runs after the layer 2 services are configured
407 and before they are started
408* **extra** - runs after services are started and before any files
409 in ``extra.d`` are executed
Ryan Hsufeb28832013-11-07 12:12:35 -0800410* **post-extra** - runs after files in ``extra.d`` are executed
Dean Troyer893e6632013-09-13 15:05:51 -0500411
Radoslaw Smigielski8c666cf2014-05-14 12:36:29 +0100412The file is processed strictly in sequence; meta-sections may be specified more
413than once but if any settings are duplicated the last to appear in the file
414will be used.
Dean Troyer893e6632013-09-13 15:05:51 -0500415
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500416 [[post-config|$NOVA_CONF]]
417 [DEFAULT]
418 use_syslog = True
Dean Troyer893e6632013-09-13 15:05:51 -0500419
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500420 [osapi_v3]
421 enabled = False
Dean Troyer893e6632013-09-13 15:05:51 -0500422
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500423A specific meta-section ``local|localrc`` is used to provide a default
424``localrc`` file (actually ``.localrc.auto``). This allows all custom
425settings for DevStack to be contained in a single file. If ``localrc``
426exists it will be used instead to preserve backward-compatibility.
Dean Troyer893e6632013-09-13 15:05:51 -0500427
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500428 [[local|localrc]]
429 FIXED_RANGE=10.254.1.0/24
430 ADMIN_PASSWORD=speciale
431 LOGFILE=$DEST/logs/stack.sh.log
Dean Troyer893e6632013-09-13 15:05:51 -0500432
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500433Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to *NOT*
434start with a ``/`` (slash) character. A slash will need to be added:
Dean Troyer893e6632013-09-13 15:05:51 -0500435
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500436 [[post-config|/$Q_PLUGIN_CONF_FILE]]