blob: 90b7d44dec26396ff5861f3847bf186be199f958 [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
venkatamaheshb237b932015-08-10 16:07:03 +053031The new configuration file is ``local.conf`` and should reside in the
32root Devstack directory. An example of such ``local.conf`` file
33is provided in the ``devstack/samples`` directory. Copy this file into
34the root Devstack directory and adapt it to your needs. It is a modified INI
Sean M. Collins09e550c2014-10-21 11:40:08 -040035format file that introduces a meta-section header to carry additional
36information regarding the configuration files to be changed.
37
38The new header is similar to a normal INI section header but with double
39brackets (``[[ ... ]]``) and two internal fields separated by a pipe
40(``|``):
41
42::
43
44 [[ <phase> | <config-file-name> ]]
45
46where ``<phase>`` is one of a set of phase names defined by ``stack.sh``
47and ``<config-file-name>`` is the configuration filename. The filename
48is eval'ed in the ``stack.sh`` context so all environment variables are
49available and may be used. Using the project config file variables in
50the header is strongly suggested (see the ``NOVA_CONF`` example below).
51If the path of the config file does not exist it is skipped.
52
53The defined phases are:
54
55- **local** - extracts ``localrc`` from ``local.conf`` before
56 ``stackrc`` is sourced
57- **pre-install** - runs after the system packages are installed but
58 before any of the source repositories are installed
59- **install** - runs immediately after the repo installations are
60 complete
61- **post-config** - runs after the layer 2 services are configured and
62 before they are started
63- **extra** - runs after services are started and before any files in
64 ``extra.d`` are executed
65
66The file is processed strictly in sequence; meta-sections may be
67specified more than once but if any settings are duplicated the last to
68appear in the file will be used.
69
70::
71
72 [[post-config|$NOVA_CONF]]
73 [DEFAULT]
74 use_syslog = True
75
76 [osapi_v3]
77 enabled = False
78
79A specific meta-section ``local|localrc`` is used to provide a default
80``localrc`` file (actually ``.localrc.auto``). This allows all custom
81settings for DevStack to be contained in a single file. If ``localrc``
82exists it will be used instead to preserve backward-compatibility. More
Dean Troyerea3cdfa2014-11-08 08:29:16 -060083details on the :doc:`contents of local.conf <local.conf>` are available.
Sean M. Collins09e550c2014-10-21 11:40:08 -040084
85::
86
87 [[local|localrc]]
88 FIXED_RANGE=10.254.1.0/24
89 ADMIN_PASSWORD=speciale
90 LOGFILE=$DEST/logs/stack.sh.log
91
92Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to
93*NOT* start with a ``/`` (slash) character. A slash will need to be
94added:
95
96::
97
98 [[post-config|/$Q_PLUGIN_CONF_FILE]]
99
100Also note that the ``localrc`` section is sourced as a shell script
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +0200101fragment and MUST conform to the shell requirements, specifically no
Sean M. Collins09e550c2014-10-21 11:40:08 -0400102whitespace around ``=`` (equals).
103
James Polley5f2eb6d2015-03-30 17:36:26 +1100104.. _minimal-configuration:
105
Sean M. Collins09e550c2014-10-21 11:40:08 -0400106Minimal Configuration
Sean Dague07d7e5b2014-11-17 07:10:14 -0500107=====================
Sean M. Collins09e550c2014-10-21 11:40:08 -0400108
109While ``stack.sh`` is happy to run without a ``localrc`` section in
110``local.conf``, devlife is better when there are a few minimal variables
111set. This is an example of a minimal configuration that touches the
112values that most often need to be set.
113
114- no logging
115- pre-set the passwords to prevent interactive prompts
116- move network ranges away from the local network (``FIXED_RANGE`` and
117 ``FLOATING_RANGE``, commented out below)
118- set the host IP if detection is unreliable (``HOST_IP``, commented
119 out below)
120
121::
122
123 [[local|localrc]]
124 ADMIN_PASSWORD=secrete
125 DATABASE_PASSWORD=$ADMIN_PASSWORD
126 RABBIT_PASSWORD=$ADMIN_PASSWORD
127 SERVICE_PASSWORD=$ADMIN_PASSWORD
128 SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50
129 #FIXED_RANGE=172.31.1.0/24
130 #FLOATING_RANGE=192.168.20.0/25
131 #HOST_IP=10.3.4.5
132
133If the ``*_PASSWORD`` variables are not set here you will be prompted to
134enter values for them by ``stack.sh``.
135
136The network ranges must not overlap with any networks in use on the
137host. Overlap is not uncommon as RFC-1918 'private' ranges are commonly
138used for both the local networking and Nova's fixed and floating ranges.
139
140``HOST_IP`` is normally detected on the first run of ``stack.sh`` but
141often is indeterminate on later runs due to the IP being moved from an
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +0200142Ethernet interface to a bridge on the host. Setting it here also makes it
Sean M. Collins09e550c2014-10-21 11:40:08 -0400143available for ``openrc`` to set ``OS_AUTH_URL``. ``HOST_IP`` is not set
144by default.
145
Brian Haley180f5eb2015-06-16 13:14:31 -0400146``HOST_IPV6`` is normally detected on the first run of ``stack.sh`` but
147will not be set if there is no IPv6 address on the default Ethernet interface.
148Setting it here also makes it available for ``openrc`` to set ``OS_AUTH_URL``.
149``HOST_IPV6`` is not set by default.
150
Ian Wienand815db162015-08-06 10:25:45 +1000151Configuration Notes
152===================
153
154.. contents::
155 :local:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400156
Sean Dague07d7e5b2014-11-17 07:10:14 -0500157Installation Directory
158----------------------
159
Ian Wienand815db162015-08-06 10:25:45 +1000160The DevStack install directory is set by the ``DEST`` variable. By
161default it is ``/opt/stack``.
162
163By setting it early in the ``localrc`` section you can reference it in
164later variables. It can be useful to set it even though it is not
165changed from the default value.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400166
167 ::
168
169 DEST=/opt/stack
170
Ian Wienand815db162015-08-06 10:25:45 +1000171Logging
172-------
173
174Enable Logging
175~~~~~~~~~~~~~~
176
177By default ``stack.sh`` output is only written to the console where it
178runs. It can be sent to a file in addition to the console by setting
179``LOGFILE`` to the fully-qualified name of the destination log file. A
180timestamp will be appended to the given filename for each run of
181``stack.sh``.
182
183 ::
184
185 LOGFILE=$DEST/logs/stack.sh.log
186
187Old log files are cleaned automatically if ``LOGDAYS`` is set to the
188number of days of old log files to keep.
189
190 ::
191
192 LOGDAYS=1
193
194The some of the project logs (Nova, Cinder, etc) will be colorized by
195default (if ``SYSLOG`` is not set below); this can be turned off by
196setting ``LOG_COLOR`` to ``False``.
197
198 ::
199
200 LOG_COLOR=False
201
202Logging the Service Output
203~~~~~~~~~~~~~~~~~~~~~~~~~~
204
205DevStack will log the ``stdout`` output of the services it starts.
206When using ``screen`` this logs the output in the screen windows to a
207file. Without ``screen`` this simply redirects stdout of the service
208process to a file in ``LOGDIR``.
209
210 ::
211
212 LOGDIR=$DEST/logs
213
214*Note the use of ``DEST`` to locate the main install directory; this
215is why we suggest setting it in ``local.conf``.*
216
217Enabling Syslog
218~~~~~~~~~~~~~~~
219
220Logging all services to a single syslog can be convenient. Enable
221syslogging by setting ``SYSLOG`` to ``True``. If the destination log
222host is not localhost ``SYSLOG_HOST`` and ``SYSLOG_PORT`` can be used
223to direct the message stream to the log host. |
224
225 ::
226
227 SYSLOG=True
228 SYSLOG_HOST=$HOST_IP
229 SYSLOG_PORT=516
230
Sean Dague07d7e5b2014-11-17 07:10:14 -0500231Libraries from Git
232------------------
233
Ian Wienand815db162015-08-06 10:25:45 +1000234By default devstack installs OpenStack server components from git,
235however it installs client libraries from released versions on pypi.
236This is appropriate if you are working on server development, but if
237you want to see how an unreleased version of the client affects the
238system you can have devstack install it from upstream, or from local
239git trees by specifying it in ``LIBS_FROM_GIT``. Multiple libraries
240can be specified as a comma separated list.
Sean Dague07d7e5b2014-11-17 07:10:14 -0500241
242 ::
243
244 LIBS_FROM_GIT=python-keystoneclient,oslo.config
245
Dean Troyer5686dbc2015-03-09 14:27:51 -0500246Virtual Environments
247--------------------
248
Ian Wienand815db162015-08-06 10:25:45 +1000249Enable the use of Python virtual environments by setting ``USE_VENV``
250to ``True``. This will enable the creation of venvs for each project
251that is defined in the ``PROJECT_VENV`` array.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500252
Ian Wienand815db162015-08-06 10:25:45 +1000253Each entry in the ``PROJECT_VENV`` array contains the directory name
254of a venv to be used for the project. The array index is the project
255name. Multiple projects can use the same venv if desired.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500256
257 ::
258
259 PROJECT_VENV["glance"]=${GLANCE_DIR}.venv
260
Ian Wienand815db162015-08-06 10:25:45 +1000261``ADDITIONAL_VENV_PACKAGES`` is a comma-separated list of additional
262packages to be installed into each venv. Often projects will not have
263certain packages listed in its ``requirements.txt`` file because they
264are 'optional' requirements, i.e. only needed for certain
265configurations. By default, the enabled databases will have their
266Python bindings added when they are enabled.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500267
Ian Wienand815db162015-08-06 10:25:45 +1000268 ::
Sean Dague07d7e5b2014-11-17 07:10:14 -0500269
Ian Wienand815db162015-08-06 10:25:45 +1000270 ADDITIONAL_VENV_PACKAGES="python-foo, python-bar"
Sean M. Collins09e550c2014-10-21 11:40:08 -0400271
Sean M. Collins09e550c2014-10-21 11:40:08 -0400272
273A clean install every time
Sean Dague07d7e5b2014-11-17 07:10:14 -0500274--------------------------
275
Ian Wienand815db162015-08-06 10:25:45 +1000276By default ``stack.sh`` only clones the project repos if they do not
277exist in ``$DEST``. ``stack.sh`` will freshen each repo on each run if
278``RECLONE`` is set to ``yes``. This avoids having to manually remove
279repos in order to get the current branch from ``$GIT_BASE``.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400280
281 ::
282
283 RECLONE=yes
284
Chris Dentebdd9ac2015-03-04 12:35:14 +0000285Upgrade packages installed by pip
286---------------------------------
287
Ian Wienand815db162015-08-06 10:25:45 +1000288By default ``stack.sh`` only installs Python packages if no version is
289currently installed or the current version does not match a specified
290requirement. If ``PIP_UPGRADE`` is set to ``True`` then existing
291required Python packages will be upgraded to the most recent version
292that matches requirements.
Chris Dentebdd9ac2015-03-04 12:35:14 +0000293
294 ::
295
296 PIP_UPGRADE=True
297
Sean Dague07d7e5b2014-11-17 07:10:14 -0500298Swift
299-----
300
Ian Wienand815db162015-08-06 10:25:45 +1000301Swift is now used as the back-end for the S3-like object store. When
302enabled Nova's objectstore (``n-obj`` in ``ENABLED_SERVICES``) is
303automatically disabled. Enable Swift by adding it services to
304``ENABLED_SERVICES``
Sean Dague07d7e5b2014-11-17 07:10:14 -0500305
Ian Wienand815db162015-08-06 10:25:45 +1000306 ::
Sean M. Collins09e550c2014-10-21 11:40:08 -0400307
Ian Wienand815db162015-08-06 10:25:45 +1000308 enable_service s-proxy s-object s-container s-account
309
310Setting Swift's hash value is required and you will be prompted for it
311if Swift is enabled so just set it to something already:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400312
313 ::
314
315 SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
316
Ian Wienand815db162015-08-06 10:25:45 +1000317For development purposes the default number of replicas is set to
318``1`` to reduce the overhead required. To better simulate a production
319deployment set this to ``3`` or more.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400320
321 ::
322
323 SWIFT_REPLICAS=3
324
Ian Wienand815db162015-08-06 10:25:45 +1000325The data for Swift is stored in the source tree by default (in
326``$DEST/swift/data``) and can be moved by setting
327``SWIFT_DATA_DIR``. The specified directory will be created if it does
328not exist.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400329
330 ::
331
332 SWIFT_DATA_DIR=$DEST/data/swift
333
Ian Wienand815db162015-08-06 10:25:45 +1000334*Note*: Previously just enabling ``swift`` was sufficient to start the
335Swift services. That does not provide proper service granularity,
336particularly in multi-host configurations, and is considered
337deprecated. Some service combination tests now check for specific
338Swift services and the old blanket acceptance will longer work
339correctly.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400340
341Service Catalog Backend
Sean Dague07d7e5b2014-11-17 07:10:14 -0500342-----------------------
343
Ian Wienand815db162015-08-06 10:25:45 +1000344By default DevStack uses Keystone's ``sql`` service catalog backend.
345An alternate ``template`` backend is also available, however, it does
346not support the ``service-*`` and ``endpoint-*`` commands of the
347``keystone`` CLI. To do so requires the ``sql`` backend be enabled
348with ``KEYSTONE_CATALOG_BACKEND``:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400349
350 ::
351
352 KEYSTONE_CATALOG_BACKEND=template
353
Ian Wienand815db162015-08-06 10:25:45 +1000354DevStack's default configuration in ``sql`` mode is set in
355``files/keystone_data.sh``
Sean M. Collins09e550c2014-10-21 11:40:08 -0400356
357Cinder
Sean Dague07d7e5b2014-11-17 07:10:14 -0500358------
359
Ian Wienand815db162015-08-06 10:25:45 +1000360The logical volume group used to hold the Cinder-managed volumes is
361set by ``VOLUME_GROUP``, the logical volume name prefix is set with
362``VOLUME_NAME_PREFIX`` and the size of the volume backing file is set
363with ``VOLUME_BACKING_FILE_SIZE``.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400364
365 ::
366
367 VOLUME_GROUP="stack-volumes"
368 VOLUME_NAME_PREFIX="volume-"
369 VOLUME_BACKING_FILE_SIZE=10250M
370
371Multi-host DevStack
Sean Dague07d7e5b2014-11-17 07:10:14 -0500372-------------------
373
Ian Wienand815db162015-08-06 10:25:45 +1000374Running DevStack with multiple hosts requires a custom ``local.conf``
375section for each host. The master is the same as a single host
376installation with ``MULTI_HOST=True``. The slaves have fewer services
377enabled and a couple of host variables pointing to the master.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400378
Ian Wienand815db162015-08-06 10:25:45 +1000379Master
380~~~~~~
381
382Set ``MULTI_HOST`` to true
Sean M. Collins09e550c2014-10-21 11:40:08 -0400383 ::
384
385 MULTI_HOST=True
386
Ian Wienand815db162015-08-06 10:25:45 +1000387Slave
388~~~~~
389
390Set the following options to point to the master
Sean M. Collins09e550c2014-10-21 11:40:08 -0400391
392 ::
393
394 MYSQL_HOST=w.x.y.z
395 RABBIT_HOST=w.x.y.z
396 GLANCE_HOSTPORT=w.x.y.z:9292
397 ENABLED_SERVICES=n-vol,n-cpu,n-net,n-api
398
John Davidge21529a52014-06-30 09:55:11 -0400399IP Version
Brian Haley180f5eb2015-06-16 13:14:31 -0400400----------
401
Ian Wienand815db162015-08-06 10:25:45 +1000402``IP_VERSION`` can be used to configure DevStack to create either an
403IPv4, IPv6, or dual-stack tenant data-network by with either
404``IP_VERSION=4``, ``IP_VERSION=6``, or ``IP_VERSION=4+6``
405respectively. This functionality requires that the Neutron networking
406service is enabled by setting the following options:
John Davidge21529a52014-06-30 09:55:11 -0400407
408 ::
409
410 disable_service n-net
411 enable_service q-svc q-agt q-dhcp q-l3
412
Ian Wienand815db162015-08-06 10:25:45 +1000413The following optional variables can be used to alter the default IPv6
414behavior:
John Davidge21529a52014-06-30 09:55:11 -0400415
416 ::
417
418 IPV6_RA_MODE=slaac
419 IPV6_ADDRESS_MODE=slaac
420 FIXED_RANGE_V6=fd$IPV6_GLOBAL_ID::/64
421 IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1
422
Ian Wienand815db162015-08-06 10:25:45 +1000423*Note*: ``FIXED_RANGE_V6`` and ``IPV6_PRIVATE_NETWORK_GATEWAY`` can be
424configured with any valid IPv6 prefix. The default values make use of
425an auto-generated ``IPV6_GLOBAL_ID`` to comply with RFC4193.
Brian Haley180f5eb2015-06-16 13:14:31 -0400426
Ian Wienand815db162015-08-06 10:25:45 +1000427Service Version
428~~~~~~~~~~~~~~~
429
430DevStack can enable service operation over either IPv4 or IPv6 by
431setting ``SERVICE_IP_VERSION`` to either ``SERVICE_IP_VERSION=4`` or
432``SERVICE_IP_VERSION=6`` respectively.
433
434When set to ``4`` devstack services will open listen sockets on
435``0.0.0.0`` and service endpoints will be registered using ``HOST_IP``
436as the address.
437
438When set to ``6`` devstack services will open listen sockets on ``::``
439and service endpoints will be registered using ``HOST_IPV6`` as the
440address.
441
442The default value for this setting is ``4``. Dual-mode support, for
443example ``4+6`` is not currently supported. ``HOST_IPV6`` can
444optionally be used to alter the default IPv6 address
Brian Haley180f5eb2015-06-16 13:14:31 -0400445
446 ::
447
448 HOST_IPV6=${some_local_ipv6_address}
John Davidge21529a52014-06-30 09:55:11 -0400449
Sean M. Collins09e550c2014-10-21 11:40:08 -0400450Examples
Sean Dague07d7e5b2014-11-17 07:10:14 -0500451========
Sean M. Collins09e550c2014-10-21 11:40:08 -0400452
453- Eliminate a Cinder pass-through (``CINDER_PERIODIC_INTERVAL``):
454
455 ::
456
457 [[post-config|$CINDER_CONF]]
458 [DEFAULT]
459 periodic_interval = 60
460
461- Sample ``local.conf`` with screen logging enabled:
462
463 ::
464
465 [[local|localrc]]
466 FIXED_RANGE=10.254.1.0/24
467 NETWORK_GATEWAY=10.254.1.1
468 LOGDAYS=1
Dean Troyerdde41d02014-12-09 17:47:57 -0600469 LOGDIR=$DEST/logs
470 LOGFILE=$LOGDIR/stack.sh.log
Sean M. Collins09e550c2014-10-21 11:40:08 -0400471 ADMIN_PASSWORD=quiet
472 DATABASE_PASSWORD=$ADMIN_PASSWORD
473 RABBIT_PASSWORD=$ADMIN_PASSWORD
474 SERVICE_PASSWORD=$ADMIN_PASSWORD
475 SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50