blob: 05a8d95f51c5e4c5d6fc5558bde59cb2b0c228f7 [file] [log] [blame]
Dean Troyer0986a7b2014-10-29 22:08:13 -05001=============
2Configuration
3=============
Sean M. Collins09e550c2014-10-21 11:40:08 -04004
Ian Wienand815db162015-08-06 10:25:45 +10005.. contents::
6 :local:
7 :depth: 1
8
Sean M. Collins09e550c2014-10-21 11:40:08 -04009DevStack has always tried to be mostly-functional with a minimal amount
10of configuration. The number of options has ballooned as projects add
11features, new projects added and more combinations need to be tested.
12Historically DevStack obtained all local configuration and
13customizations from a ``localrc`` file. The number of configuration
14variables that are simply passed-through to the individual project
15configuration files is also increasing. The old mechanism for this
16(``EXTRAS_OPTS`` and friends) required specific code for each file and
17did not scale well.
18
19In Oct 2013 a new configuration method was introduced (in `review
2046768 <https://review.openstack.org/#/c/46768/>`__) to hopefully
21simplify this process and meet the following goals:
22
23- contain all non-default local configuration in a single file
24- be backward-compatible with ``localrc`` to smooth the transition
25 process
26- allow settings in arbitrary configuration files to be changed
27
28local.conf
Sean Dague07d7e5b2014-11-17 07:10:14 -050029==========
Sean M. Collins09e550c2014-10-21 11:40:08 -040030
31The new configuration file is ``local.conf`` and resides in the root
32DevStack directory like the old ``localrc`` file. It is a modified INI
33format file that introduces a meta-section header to carry additional
34information regarding the configuration files to be changed.
35
36The new header is similar to a normal INI section header but with double
37brackets (``[[ ... ]]``) and two internal fields separated by a pipe
38(``|``):
39
40::
41
42 [[ <phase> | <config-file-name> ]]
43
44where ``<phase>`` is one of a set of phase names defined by ``stack.sh``
45and ``<config-file-name>`` is the configuration filename. The filename
46is eval'ed in the ``stack.sh`` context so all environment variables are
47available and may be used. Using the project config file variables in
48the header is strongly suggested (see the ``NOVA_CONF`` example below).
49If the path of the config file does not exist it is skipped.
50
51The defined phases are:
52
53- **local** - extracts ``localrc`` from ``local.conf`` before
54 ``stackrc`` is sourced
55- **pre-install** - runs after the system packages are installed but
56 before any of the source repositories are installed
57- **install** - runs immediately after the repo installations are
58 complete
59- **post-config** - runs after the layer 2 services are configured and
60 before they are started
61- **extra** - runs after services are started and before any files in
62 ``extra.d`` are executed
63
64The file is processed strictly in sequence; meta-sections may be
65specified more than once but if any settings are duplicated the last to
66appear in the file will be used.
67
68::
69
70 [[post-config|$NOVA_CONF]]
71 [DEFAULT]
72 use_syslog = True
73
74 [osapi_v3]
75 enabled = False
76
77A specific meta-section ``local|localrc`` is used to provide a default
78``localrc`` file (actually ``.localrc.auto``). This allows all custom
79settings for DevStack to be contained in a single file. If ``localrc``
80exists it will be used instead to preserve backward-compatibility. More
Dean Troyerea3cdfa2014-11-08 08:29:16 -060081details on the :doc:`contents of local.conf <local.conf>` are available.
Sean M. Collins09e550c2014-10-21 11:40:08 -040082
83::
84
85 [[local|localrc]]
86 FIXED_RANGE=10.254.1.0/24
87 ADMIN_PASSWORD=speciale
88 LOGFILE=$DEST/logs/stack.sh.log
89
90Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to
91*NOT* start with a ``/`` (slash) character. A slash will need to be
92added:
93
94::
95
96 [[post-config|/$Q_PLUGIN_CONF_FILE]]
97
98Also note that the ``localrc`` section is sourced as a shell script
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +020099fragment and MUST conform to the shell requirements, specifically no
Sean M. Collins09e550c2014-10-21 11:40:08 -0400100whitespace around ``=`` (equals).
101
James Polley5f2eb6d2015-03-30 17:36:26 +1100102.. _minimal-configuration:
103
Sean M. Collins09e550c2014-10-21 11:40:08 -0400104Minimal Configuration
Sean Dague07d7e5b2014-11-17 07:10:14 -0500105=====================
Sean M. Collins09e550c2014-10-21 11:40:08 -0400106
107While ``stack.sh`` is happy to run without a ``localrc`` section in
108``local.conf``, devlife is better when there are a few minimal variables
109set. This is an example of a minimal configuration that touches the
110values that most often need to be set.
111
112- no logging
113- pre-set the passwords to prevent interactive prompts
114- move network ranges away from the local network (``FIXED_RANGE`` and
115 ``FLOATING_RANGE``, commented out below)
116- set the host IP if detection is unreliable (``HOST_IP``, commented
117 out below)
118
119::
120
121 [[local|localrc]]
122 ADMIN_PASSWORD=secrete
123 DATABASE_PASSWORD=$ADMIN_PASSWORD
124 RABBIT_PASSWORD=$ADMIN_PASSWORD
125 SERVICE_PASSWORD=$ADMIN_PASSWORD
126 SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50
127 #FIXED_RANGE=172.31.1.0/24
128 #FLOATING_RANGE=192.168.20.0/25
129 #HOST_IP=10.3.4.5
130
131If the ``*_PASSWORD`` variables are not set here you will be prompted to
132enter values for them by ``stack.sh``.
133
134The network ranges must not overlap with any networks in use on the
135host. Overlap is not uncommon as RFC-1918 'private' ranges are commonly
136used for both the local networking and Nova's fixed and floating ranges.
137
138``HOST_IP`` is normally detected on the first run of ``stack.sh`` but
139often is indeterminate on later runs due to the IP being moved from an
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +0200140Ethernet interface to a bridge on the host. Setting it here also makes it
Sean M. Collins09e550c2014-10-21 11:40:08 -0400141available for ``openrc`` to set ``OS_AUTH_URL``. ``HOST_IP`` is not set
142by default.
143
Brian Haley180f5eb2015-06-16 13:14:31 -0400144``HOST_IPV6`` is normally detected on the first run of ``stack.sh`` but
145will not be set if there is no IPv6 address on the default Ethernet interface.
146Setting it here also makes it available for ``openrc`` to set ``OS_AUTH_URL``.
147``HOST_IPV6`` is not set by default.
148
Ian Wienand815db162015-08-06 10:25:45 +1000149Configuration Notes
150===================
151
152.. contents::
153 :local:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400154
Sean Dague07d7e5b2014-11-17 07:10:14 -0500155Installation Directory
156----------------------
157
Ian Wienand815db162015-08-06 10:25:45 +1000158The DevStack install directory is set by the ``DEST`` variable. By
159default it is ``/opt/stack``.
160
161By setting it early in the ``localrc`` section you can reference it in
162later variables. It can be useful to set it even though it is not
163changed from the default value.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400164
165 ::
166
167 DEST=/opt/stack
168
Ian Wienand815db162015-08-06 10:25:45 +1000169Logging
170-------
171
172Enable Logging
173~~~~~~~~~~~~~~
174
175By default ``stack.sh`` output is only written to the console where it
176runs. It can be sent to a file in addition to the console by setting
177``LOGFILE`` to the fully-qualified name of the destination log file. A
178timestamp will be appended to the given filename for each run of
179``stack.sh``.
180
181 ::
182
183 LOGFILE=$DEST/logs/stack.sh.log
184
185Old log files are cleaned automatically if ``LOGDAYS`` is set to the
186number of days of old log files to keep.
187
188 ::
189
190 LOGDAYS=1
191
192The some of the project logs (Nova, Cinder, etc) will be colorized by
193default (if ``SYSLOG`` is not set below); this can be turned off by
194setting ``LOG_COLOR`` to ``False``.
195
196 ::
197
198 LOG_COLOR=False
199
200Logging the Service Output
201~~~~~~~~~~~~~~~~~~~~~~~~~~
202
203DevStack will log the ``stdout`` output of the services it starts.
204When using ``screen`` this logs the output in the screen windows to a
205file. Without ``screen`` this simply redirects stdout of the service
206process to a file in ``LOGDIR``.
207
208 ::
209
210 LOGDIR=$DEST/logs
211
212*Note the use of ``DEST`` to locate the main install directory; this
213is why we suggest setting it in ``local.conf``.*
214
215Enabling Syslog
216~~~~~~~~~~~~~~~
217
218Logging all services to a single syslog can be convenient. Enable
219syslogging by setting ``SYSLOG`` to ``True``. If the destination log
220host is not localhost ``SYSLOG_HOST`` and ``SYSLOG_PORT`` can be used
221to direct the message stream to the log host. |
222
223 ::
224
225 SYSLOG=True
226 SYSLOG_HOST=$HOST_IP
227 SYSLOG_PORT=516
228
Sean Dague07d7e5b2014-11-17 07:10:14 -0500229Libraries from Git
230------------------
231
Ian Wienand815db162015-08-06 10:25:45 +1000232By default devstack installs OpenStack server components from git,
233however it installs client libraries from released versions on pypi.
234This is appropriate if you are working on server development, but if
235you want to see how an unreleased version of the client affects the
236system you can have devstack install it from upstream, or from local
237git trees by specifying it in ``LIBS_FROM_GIT``. Multiple libraries
238can be specified as a comma separated list.
Sean Dague07d7e5b2014-11-17 07:10:14 -0500239
240 ::
241
242 LIBS_FROM_GIT=python-keystoneclient,oslo.config
243
Dean Troyer5686dbc2015-03-09 14:27:51 -0500244Virtual Environments
245--------------------
246
Ian Wienand815db162015-08-06 10:25:45 +1000247Enable the use of Python virtual environments by setting ``USE_VENV``
248to ``True``. This will enable the creation of venvs for each project
249that is defined in the ``PROJECT_VENV`` array.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500250
Ian Wienand815db162015-08-06 10:25:45 +1000251Each entry in the ``PROJECT_VENV`` array contains the directory name
252of a venv to be used for the project. The array index is the project
253name. Multiple projects can use the same venv if desired.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500254
255 ::
256
257 PROJECT_VENV["glance"]=${GLANCE_DIR}.venv
258
Ian Wienand815db162015-08-06 10:25:45 +1000259``ADDITIONAL_VENV_PACKAGES`` is a comma-separated list of additional
260packages to be installed into each venv. Often projects will not have
261certain packages listed in its ``requirements.txt`` file because they
262are 'optional' requirements, i.e. only needed for certain
263configurations. By default, the enabled databases will have their
264Python bindings added when they are enabled.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500265
Ian Wienand815db162015-08-06 10:25:45 +1000266 ::
Sean Dague07d7e5b2014-11-17 07:10:14 -0500267
Ian Wienand815db162015-08-06 10:25:45 +1000268 ADDITIONAL_VENV_PACKAGES="python-foo, python-bar"
Sean M. Collins09e550c2014-10-21 11:40:08 -0400269
Sean M. Collins09e550c2014-10-21 11:40:08 -0400270
271A clean install every time
Sean Dague07d7e5b2014-11-17 07:10:14 -0500272--------------------------
273
Ian Wienand815db162015-08-06 10:25:45 +1000274By default ``stack.sh`` only clones the project repos if they do not
275exist in ``$DEST``. ``stack.sh`` will freshen each repo on each run if
276``RECLONE`` is set to ``yes``. This avoids having to manually remove
277repos in order to get the current branch from ``$GIT_BASE``.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400278
279 ::
280
281 RECLONE=yes
282
Chris Dentebdd9ac2015-03-04 12:35:14 +0000283Upgrade packages installed by pip
284---------------------------------
285
Ian Wienand815db162015-08-06 10:25:45 +1000286By default ``stack.sh`` only installs Python packages if no version is
287currently installed or the current version does not match a specified
288requirement. If ``PIP_UPGRADE`` is set to ``True`` then existing
289required Python packages will be upgraded to the most recent version
290that matches requirements.
Chris Dentebdd9ac2015-03-04 12:35:14 +0000291
292 ::
293
294 PIP_UPGRADE=True
295
Sean Dague07d7e5b2014-11-17 07:10:14 -0500296Swift
297-----
298
Ian Wienand815db162015-08-06 10:25:45 +1000299Swift is now used as the back-end for the S3-like object store. When
300enabled Nova's objectstore (``n-obj`` in ``ENABLED_SERVICES``) is
301automatically disabled. Enable Swift by adding it services to
302``ENABLED_SERVICES``
Sean Dague07d7e5b2014-11-17 07:10:14 -0500303
Ian Wienand815db162015-08-06 10:25:45 +1000304 ::
Sean M. Collins09e550c2014-10-21 11:40:08 -0400305
Ian Wienand815db162015-08-06 10:25:45 +1000306 enable_service s-proxy s-object s-container s-account
307
308Setting Swift's hash value is required and you will be prompted for it
309if Swift is enabled so just set it to something already:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400310
311 ::
312
313 SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
314
Ian Wienand815db162015-08-06 10:25:45 +1000315For development purposes the default number of replicas is set to
316``1`` to reduce the overhead required. To better simulate a production
317deployment set this to ``3`` or more.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400318
319 ::
320
321 SWIFT_REPLICAS=3
322
Ian Wienand815db162015-08-06 10:25:45 +1000323The data for Swift is stored in the source tree by default (in
324``$DEST/swift/data``) and can be moved by setting
325``SWIFT_DATA_DIR``. The specified directory will be created if it does
326not exist.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400327
328 ::
329
330 SWIFT_DATA_DIR=$DEST/data/swift
331
Ian Wienand815db162015-08-06 10:25:45 +1000332*Note*: Previously just enabling ``swift`` was sufficient to start the
333Swift services. That does not provide proper service granularity,
334particularly in multi-host configurations, and is considered
335deprecated. Some service combination tests now check for specific
336Swift services and the old blanket acceptance will longer work
337correctly.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400338
339Service Catalog Backend
Sean Dague07d7e5b2014-11-17 07:10:14 -0500340-----------------------
341
Ian Wienand815db162015-08-06 10:25:45 +1000342By default DevStack uses Keystone's ``sql`` service catalog backend.
343An alternate ``template`` backend is also available, however, it does
344not support the ``service-*`` and ``endpoint-*`` commands of the
345``keystone`` CLI. To do so requires the ``sql`` backend be enabled
346with ``KEYSTONE_CATALOG_BACKEND``:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400347
348 ::
349
350 KEYSTONE_CATALOG_BACKEND=template
351
Ian Wienand815db162015-08-06 10:25:45 +1000352DevStack's default configuration in ``sql`` mode is set in
353``files/keystone_data.sh``
Sean M. Collins09e550c2014-10-21 11:40:08 -0400354
355Cinder
Sean Dague07d7e5b2014-11-17 07:10:14 -0500356------
357
Ian Wienand815db162015-08-06 10:25:45 +1000358The logical volume group used to hold the Cinder-managed volumes is
359set by ``VOLUME_GROUP``, the logical volume name prefix is set with
360``VOLUME_NAME_PREFIX`` and the size of the volume backing file is set
361with ``VOLUME_BACKING_FILE_SIZE``.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400362
363 ::
364
365 VOLUME_GROUP="stack-volumes"
366 VOLUME_NAME_PREFIX="volume-"
367 VOLUME_BACKING_FILE_SIZE=10250M
368
369Multi-host DevStack
Sean Dague07d7e5b2014-11-17 07:10:14 -0500370-------------------
371
Ian Wienand815db162015-08-06 10:25:45 +1000372Running DevStack with multiple hosts requires a custom ``local.conf``
373section for each host. The master is the same as a single host
374installation with ``MULTI_HOST=True``. The slaves have fewer services
375enabled and a couple of host variables pointing to the master.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400376
Ian Wienand815db162015-08-06 10:25:45 +1000377Master
378~~~~~~
379
380Set ``MULTI_HOST`` to true
Sean M. Collins09e550c2014-10-21 11:40:08 -0400381 ::
382
383 MULTI_HOST=True
384
Ian Wienand815db162015-08-06 10:25:45 +1000385Slave
386~~~~~
387
388Set the following options to point to the master
Sean M. Collins09e550c2014-10-21 11:40:08 -0400389
390 ::
391
392 MYSQL_HOST=w.x.y.z
393 RABBIT_HOST=w.x.y.z
394 GLANCE_HOSTPORT=w.x.y.z:9292
395 ENABLED_SERVICES=n-vol,n-cpu,n-net,n-api
396
John Davidge21529a52014-06-30 09:55:11 -0400397IP Version
Brian Haley180f5eb2015-06-16 13:14:31 -0400398----------
399
Ian Wienand815db162015-08-06 10:25:45 +1000400``IP_VERSION`` can be used to configure DevStack to create either an
401IPv4, IPv6, or dual-stack tenant data-network by with either
402``IP_VERSION=4``, ``IP_VERSION=6``, or ``IP_VERSION=4+6``
403respectively. This functionality requires that the Neutron networking
404service is enabled by setting the following options:
John Davidge21529a52014-06-30 09:55:11 -0400405
406 ::
407
408 disable_service n-net
409 enable_service q-svc q-agt q-dhcp q-l3
410
Ian Wienand815db162015-08-06 10:25:45 +1000411The following optional variables can be used to alter the default IPv6
412behavior:
John Davidge21529a52014-06-30 09:55:11 -0400413
414 ::
415
416 IPV6_RA_MODE=slaac
417 IPV6_ADDRESS_MODE=slaac
418 FIXED_RANGE_V6=fd$IPV6_GLOBAL_ID::/64
419 IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1
420
Ian Wienand815db162015-08-06 10:25:45 +1000421*Note*: ``FIXED_RANGE_V6`` and ``IPV6_PRIVATE_NETWORK_GATEWAY`` can be
422configured with any valid IPv6 prefix. The default values make use of
423an auto-generated ``IPV6_GLOBAL_ID`` to comply with RFC4193.
Brian Haley180f5eb2015-06-16 13:14:31 -0400424
Ian Wienand815db162015-08-06 10:25:45 +1000425Service Version
426~~~~~~~~~~~~~~~
427
428DevStack can enable service operation over either IPv4 or IPv6 by
429setting ``SERVICE_IP_VERSION`` to either ``SERVICE_IP_VERSION=4`` or
430``SERVICE_IP_VERSION=6`` respectively.
431
432When set to ``4`` devstack services will open listen sockets on
433``0.0.0.0`` and service endpoints will be registered using ``HOST_IP``
434as the address.
435
436When set to ``6`` devstack services will open listen sockets on ``::``
437and service endpoints will be registered using ``HOST_IPV6`` as the
438address.
439
440The default value for this setting is ``4``. Dual-mode support, for
441example ``4+6`` is not currently supported. ``HOST_IPV6`` can
442optionally be used to alter the default IPv6 address
Brian Haley180f5eb2015-06-16 13:14:31 -0400443
444 ::
445
446 HOST_IPV6=${some_local_ipv6_address}
John Davidge21529a52014-06-30 09:55:11 -0400447
Sean M. Collins09e550c2014-10-21 11:40:08 -0400448Examples
Sean Dague07d7e5b2014-11-17 07:10:14 -0500449========
Sean M. Collins09e550c2014-10-21 11:40:08 -0400450
451- Eliminate a Cinder pass-through (``CINDER_PERIODIC_INTERVAL``):
452
453 ::
454
455 [[post-config|$CINDER_CONF]]
456 [DEFAULT]
457 periodic_interval = 60
458
459- Sample ``local.conf`` with screen logging enabled:
460
461 ::
462
463 [[local|localrc]]
464 FIXED_RANGE=10.254.1.0/24
465 NETWORK_GATEWAY=10.254.1.1
466 LOGDAYS=1
Dean Troyerdde41d02014-12-09 17:47:57 -0600467 LOGDIR=$DEST/logs
468 LOGFILE=$LOGDIR/stack.sh.log
Sean M. Collins09e550c2014-10-21 11:40:08 -0400469 ADMIN_PASSWORD=quiet
470 DATABASE_PASSWORD=$ADMIN_PASSWORD
471 RABBIT_PASSWORD=$ADMIN_PASSWORD
472 SERVICE_PASSWORD=$ADMIN_PASSWORD
473 SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50