blob: 96f91ec77433dc848bed970662355be2b115f10b [file] [log] [blame]
Dean Troyer0986a7b2014-10-29 22:08:13 -05001=============
2Configuration
3=============
Sean M. Collins09e550c2014-10-21 11:40:08 -04004
5DevStack has always tried to be mostly-functional with a minimal amount
6of configuration. The number of options has ballooned as projects add
7features, new projects added and more combinations need to be tested.
8Historically DevStack obtained all local configuration and
9customizations from a ``localrc`` file. The number of configuration
10variables that are simply passed-through to the individual project
11configuration files is also increasing. The old mechanism for this
12(``EXTRAS_OPTS`` and friends) required specific code for each file and
13did not scale well.
14
15In Oct 2013 a new configuration method was introduced (in `review
1646768 <https://review.openstack.org/#/c/46768/>`__) to hopefully
17simplify this process and meet the following goals:
18
19- contain all non-default local configuration in a single file
20- be backward-compatible with ``localrc`` to smooth the transition
21 process
22- allow settings in arbitrary configuration files to be changed
23
24local.conf
Sean Dague07d7e5b2014-11-17 07:10:14 -050025==========
Sean M. Collins09e550c2014-10-21 11:40:08 -040026
27The new configuration file is ``local.conf`` and resides in the root
28DevStack directory like the old ``localrc`` file. It is a modified INI
29format file that introduces a meta-section header to carry additional
30information regarding the configuration files to be changed.
31
32The new header is similar to a normal INI section header but with double
33brackets (``[[ ... ]]``) and two internal fields separated by a pipe
34(``|``):
35
36::
37
38 [[ <phase> | <config-file-name> ]]
39
40where ``<phase>`` is one of a set of phase names defined by ``stack.sh``
41and ``<config-file-name>`` is the configuration filename. The filename
42is eval'ed in the ``stack.sh`` context so all environment variables are
43available and may be used. Using the project config file variables in
44the header is strongly suggested (see the ``NOVA_CONF`` example below).
45If the path of the config file does not exist it is skipped.
46
47The defined phases are:
48
49- **local** - extracts ``localrc`` from ``local.conf`` before
50 ``stackrc`` is sourced
51- **pre-install** - runs after the system packages are installed but
52 before any of the source repositories are installed
53- **install** - runs immediately after the repo installations are
54 complete
55- **post-config** - runs after the layer 2 services are configured and
56 before they are started
57- **extra** - runs after services are started and before any files in
58 ``extra.d`` are executed
YAMAMOTO Takashi961643e2015-07-31 13:45:27 +090059- **post-extra** - runs after files in ``extra.d`` are executed
Sean M. Collins09e550c2014-10-21 11:40:08 -040060
61The file is processed strictly in sequence; meta-sections may be
62specified more than once but if any settings are duplicated the last to
63appear in the file will be used.
64
65::
66
67 [[post-config|$NOVA_CONF]]
68 [DEFAULT]
69 use_syslog = True
70
71 [osapi_v3]
72 enabled = False
73
74A specific meta-section ``local|localrc`` is used to provide a default
75``localrc`` file (actually ``.localrc.auto``). This allows all custom
76settings for DevStack to be contained in a single file. If ``localrc``
77exists it will be used instead to preserve backward-compatibility. More
Dean Troyerea3cdfa2014-11-08 08:29:16 -060078details on the :doc:`contents of local.conf <local.conf>` are available.
Sean M. Collins09e550c2014-10-21 11:40:08 -040079
80::
81
82 [[local|localrc]]
83 FIXED_RANGE=10.254.1.0/24
84 ADMIN_PASSWORD=speciale
85 LOGFILE=$DEST/logs/stack.sh.log
86
87Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to
88*NOT* start with a ``/`` (slash) character. A slash will need to be
89added:
90
91::
92
93 [[post-config|/$Q_PLUGIN_CONF_FILE]]
94
95Also note that the ``localrc`` section is sourced as a shell script
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +020096fragment and MUST conform to the shell requirements, specifically no
Sean M. Collins09e550c2014-10-21 11:40:08 -040097whitespace around ``=`` (equals).
98
James Polley5f2eb6d2015-03-30 17:36:26 +110099.. _minimal-configuration:
100
Sean M. Collins09e550c2014-10-21 11:40:08 -0400101Minimal Configuration
Sean Dague07d7e5b2014-11-17 07:10:14 -0500102=====================
Sean M. Collins09e550c2014-10-21 11:40:08 -0400103
104While ``stack.sh`` is happy to run without a ``localrc`` section in
105``local.conf``, devlife is better when there are a few minimal variables
106set. This is an example of a minimal configuration that touches the
107values that most often need to be set.
108
109- no logging
110- pre-set the passwords to prevent interactive prompts
111- move network ranges away from the local network (``FIXED_RANGE`` and
112 ``FLOATING_RANGE``, commented out below)
113- set the host IP if detection is unreliable (``HOST_IP``, commented
114 out below)
115
116::
117
118 [[local|localrc]]
119 ADMIN_PASSWORD=secrete
120 DATABASE_PASSWORD=$ADMIN_PASSWORD
121 RABBIT_PASSWORD=$ADMIN_PASSWORD
122 SERVICE_PASSWORD=$ADMIN_PASSWORD
123 SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50
124 #FIXED_RANGE=172.31.1.0/24
125 #FLOATING_RANGE=192.168.20.0/25
126 #HOST_IP=10.3.4.5
127
128If the ``*_PASSWORD`` variables are not set here you will be prompted to
129enter values for them by ``stack.sh``.
130
131The network ranges must not overlap with any networks in use on the
132host. Overlap is not uncommon as RFC-1918 'private' ranges are commonly
133used for both the local networking and Nova's fixed and floating ranges.
134
135``HOST_IP`` is normally detected on the first run of ``stack.sh`` but
136often is indeterminate on later runs due to the IP being moved from an
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +0200137Ethernet interface to a bridge on the host. Setting it here also makes it
Sean M. Collins09e550c2014-10-21 11:40:08 -0400138available for ``openrc`` to set ``OS_AUTH_URL``. ``HOST_IP`` is not set
139by default.
140
Brian Haley180f5eb2015-06-16 13:14:31 -0400141``HOST_IPV6`` is normally detected on the first run of ``stack.sh`` but
142will not be set if there is no IPv6 address on the default Ethernet interface.
143Setting it here also makes it available for ``openrc`` to set ``OS_AUTH_URL``.
144``HOST_IPV6`` is not set by default.
145
Sean M. Collins09e550c2014-10-21 11:40:08 -0400146Common Configuration Variables
Sean Dague07d7e5b2014-11-17 07:10:14 -0500147==============================
Sean M. Collins09e550c2014-10-21 11:40:08 -0400148
Sean Dague07d7e5b2014-11-17 07:10:14 -0500149Installation Directory
150----------------------
151
Sean M. Collins09e550c2014-10-21 11:40:08 -0400152 | *Default: ``DEST=/opt/stack``*
153 | The DevStack install directory is set by the ``DEST`` variable.
154 | By setting it early in the ``localrc`` section you can reference it
155 in later variables. It can be useful to set it even though it is not
156 changed from the default value.
157 |
158
159 ::
160
161 DEST=/opt/stack
162
Sean Dague07d7e5b2014-11-17 07:10:14 -0500163Libraries from Git
164------------------
165
166 | *Default: ``LIBS_FROM_GIT=""``*
167
168 | By default devstack installs OpenStack server components from
169 git, however it installs client libraries from released versions
170 on pypi. This is appropriate if you are working on server
171 development, but if you want to see how an unreleased version of
172 the client affects the system you can have devstack install it
173 from upstream, or from local git trees.
174 | Multiple libraries can be specified as a comma separated list.
175 |
176
177 ::
178
179 LIBS_FROM_GIT=python-keystoneclient,oslo.config
180
Dean Troyer5686dbc2015-03-09 14:27:51 -0500181Virtual Environments
182--------------------
183
184 | *Default: ``USE_VENV=False``*
185 | Enable the use of Python virtual environments by setting ``USE_VENV``
186 to ``True``. This will enable the creation of venvs for each project
187 that is defined in the ``PROJECT_VENV`` array.
188
189 | *Default: ``PROJECT_VENV['<project>']='<project-dir>.venv'*
190 | Each entry in the ``PROJECT_VENV`` array contains the directory name
191 of a venv to be used for the project. The array index is the project
192 name. Multiple projects can use the same venv if desired.
193
194 ::
195
196 PROJECT_VENV["glance"]=${GLANCE_DIR}.venv
197
198 | *Default: ``ADDITIONAL_VENV_PACKAGES=""``*
199 | A comma-separated list of additional packages to be installed into each
200 venv. Often projects will not have certain packages listed in its
201 ``requirements.txt`` file because they are 'optional' requirements,
202 i.e. only needed for certain configurations. By default, the enabled
203 databases will have their Python bindings added when they are enabled.
204
Sean Dague07d7e5b2014-11-17 07:10:14 -0500205Enable Logging
206--------------
207
Sean M. Collins09e550c2014-10-21 11:40:08 -0400208 | *Defaults: ``LOGFILE="" LOGDAYS=7 LOG_COLOR=True``*
209 | By default ``stack.sh`` output is only written to the console
Tomoki Sekine1e3a89e2015-06-25 06:35:07 +0900210 where it runs. It can be sent to a file in addition to the console
Sean M. Collins09e550c2014-10-21 11:40:08 -0400211 by setting ``LOGFILE`` to the fully-qualified name of the
212 destination log file. A timestamp will be appended to the given
213 filename for each run of ``stack.sh``.
214 |
215
216 ::
217
218 LOGFILE=$DEST/logs/stack.sh.log
219
220 Old log files are cleaned automatically if ``LOGDAYS`` is set to the
221 number of days of old log files to keep.
222
223 ::
224
225 LOGDAYS=1
226
227 The some of the project logs (Nova, Cinder, etc) will be colorized
228 by default (if ``SYSLOG`` is not set below); this can be turned off
229 by setting ``LOG_COLOR`` False.
230
231 ::
232
233 LOG_COLOR=False
234
Dean Troyerdde41d02014-12-09 17:47:57 -0600235Logging the Service Output
236--------------------------
Sean Dague07d7e5b2014-11-17 07:10:14 -0500237
Dean Troyerdde41d02014-12-09 17:47:57 -0600238 | *Default: ``LOGDIR=""``*
239 | DevStack will log the stdout output of the services it starts.
240 When using ``screen`` this logs the output in the screen windows
241 to a file. Without ``screen`` this simply redirects stdout of
242 the service process to a file in ``LOGDIR``.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400243 |
244
245 ::
246
Dean Troyerdde41d02014-12-09 17:47:57 -0600247 LOGDIR=$DEST/logs
Sean M. Collins09e550c2014-10-21 11:40:08 -0400248
249 *Note the use of ``DEST`` to locate the main install directory; this
250 is why we suggest setting it in ``local.conf``.*
251
Sean Dague07d7e5b2014-11-17 07:10:14 -0500252Enabling Syslog
253---------------
254
Sean M. Collins09e550c2014-10-21 11:40:08 -0400255 | *Default: ``SYSLOG=False SYSLOG_HOST=$HOST_IP SYSLOG_PORT=516``*
256 | Logging all services to a single syslog can be convenient. Enable
257 syslogging by setting ``SYSLOG`` to ``True``. If the destination log
258 host is not localhost ``SYSLOG_HOST`` and ``SYSLOG_PORT`` can be
259 used to direct the message stream to the log host.
260 |
261
262 ::
263
264 SYSLOG=True
265 SYSLOG_HOST=$HOST_IP
266 SYSLOG_PORT=516
267
268A clean install every time
Sean Dague07d7e5b2014-11-17 07:10:14 -0500269--------------------------
270
Sean M. Collins09e550c2014-10-21 11:40:08 -0400271 | *Default: ``RECLONE=""``*
272 | By default ``stack.sh`` only clones the project repos if they do
273 not exist in ``$DEST``. ``stack.sh`` will freshen each repo on each
274 run if ``RECLONE`` is set to ``yes``. This avoids having to manually
275 remove repos in order to get the current branch from ``$GIT_BASE``.
276 |
277
278 ::
279
280 RECLONE=yes
281
Chris Dentebdd9ac2015-03-04 12:35:14 +0000282Upgrade packages installed by pip
283---------------------------------
284
285 | *Default: ``PIP_UPGRADE=""``*
286 | By default ``stack.sh`` only installs Python packages if no version
287 is currently installed or the current version does not match a specified
288 requirement. If ``PIP_UPGRADE`` is set to ``True`` then existing required
289 Python packages will be upgraded to the most recent version that
290 matches requirements.
291 |
292
293 ::
294
295 PIP_UPGRADE=True
296
Sean Dague07d7e5b2014-11-17 07:10:14 -0500297Swift
298-----
299
300 | Default: SWIFT_HASH=""
301 | SWIFT_REPLICAS=1
302 | SWIFT_DATA_DIR=$DEST/data/swift
303
304 | Swift is now used as the back-end for the S3-like object store.
305 When enabled Nova's objectstore (n-obj in ENABLED_SERVICES) is
306 automatically disabled. Enable Swift by adding it services to
307 ENABLED_SERVICES: enable_service s-proxy s-object s-container
308 s-account
Sean M. Collins09e550c2014-10-21 11:40:08 -0400309
310 Setting Swift's hash value is required and you will be prompted for
311 it if Swift is enabled so just set it to something already:
312
313 ::
314
315 SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
316
317 For development purposes the default number of replicas is set to
318 ``1`` to reduce the overhead required. To better simulate a
319 production deployment set this to ``3`` or more.
320
321 ::
322
323 SWIFT_REPLICAS=3
324
325 The 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
328 does not exist.
329
330 ::
331
332 SWIFT_DATA_DIR=$DEST/data/swift
333
334 *Note: Previously just enabling ``swift`` was sufficient to start
335 the Swift services. That does not provide proper service
336 granularity, particularly in multi-host configurations, and is
337 considered deprecated. Some service combination tests now check for
338 specific Swift services and the old blanket acceptance will longer
339 work correctly.*
340
341Service Catalog Backend
Sean Dague07d7e5b2014-11-17 07:10:14 -0500342-----------------------
343
Sean M. Collins09e550c2014-10-21 11:40:08 -0400344 | *Default: ``KEYSTONE_CATALOG_BACKEND=sql``*
345 | DevStack uses Keystone's ``sql`` service catalog backend. An
346 alternate ``template`` backend is also available. However, it does
347 not support the ``service-*`` and ``endpoint-*`` commands of the
348 ``keystone`` CLI. To do so requires the ``sql`` backend be enabled:
349 |
350
351 ::
352
353 KEYSTONE_CATALOG_BACKEND=template
354
355 DevStack's default configuration in ``sql`` mode is set in
356 ``files/keystone_data.sh``
357
358Cinder
Sean Dague07d7e5b2014-11-17 07:10:14 -0500359------
360
Sean M. Collins09e550c2014-10-21 11:40:08 -0400361 | Default:
362 | VOLUME_GROUP="stack-volumes" VOLUME_NAME_PREFIX="volume-" VOLUME_BACKING_FILE_SIZE=10250M
363 | The logical volume group used to hold the Cinder-managed volumes
364 is set by ``VOLUME_GROUP``, the logical volume name prefix is set
365 with ``VOLUME_NAME_PREFIX`` and the size of the volume backing file
366 is set with ``VOLUME_BACKING_FILE_SIZE``.
367 |
368
369 ::
370
371 VOLUME_GROUP="stack-volumes"
372 VOLUME_NAME_PREFIX="volume-"
373 VOLUME_BACKING_FILE_SIZE=10250M
374
375Multi-host DevStack
Sean Dague07d7e5b2014-11-17 07:10:14 -0500376-------------------
377
Sean M. Collins09e550c2014-10-21 11:40:08 -0400378 | *Default: ``MULTI_HOST=False``*
379 | Running DevStack with multiple hosts requires a custom
380 ``local.conf`` section for each host. The master is the same as a
381 single host installation with ``MULTI_HOST=True``. The slaves have
382 fewer services enabled and a couple of host variables pointing to
383 the master.
384 | **Master**
385
386 ::
387
388 MULTI_HOST=True
389
390 **Slave**
391
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
Guillaume Giamarchi93ee8c82015-05-26 02:08:44 +0200402 | Default: ``IP_VERSION=4+6``
John Davidge21529a52014-06-30 09:55:11 -0400403 | This setting can be used to configure DevStack to create either an IPv4,
404 IPv6, or dual stack tenant data network by setting ``IP_VERSION`` to
405 either ``IP_VERSION=4``, ``IP_VERSION=6``, or ``IP_VERSION=4+6``
406 respectively. This functionality requires that the Neutron networking
407 service is enabled by setting the following options:
408 |
409
410 ::
411
412 disable_service n-net
413 enable_service q-svc q-agt q-dhcp q-l3
414
415 | The following optional variables can be used to alter the default IPv6
416 behavior:
417 |
418
419 ::
420
421 IPV6_RA_MODE=slaac
422 IPV6_ADDRESS_MODE=slaac
423 FIXED_RANGE_V6=fd$IPV6_GLOBAL_ID::/64
424 IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1
425
426 | *Note: ``FIXED_RANGE_V6`` and ``IPV6_PRIVATE_NETWORK_GATEWAY``
427 can be configured with any valid IPv6 prefix. The default values make
428 use of an auto-generated ``IPV6_GLOBAL_ID`` to comply with RFC 4193.*
Brian Haley180f5eb2015-06-16 13:14:31 -0400429 |
430
431 | Default: ``SERVICE_IP_VERSION=4``
432 | This setting can be used to configure DevStack to enable services to
433 operate over either IPv4 or IPv6, by setting ``SERVICE_IP_VERSION`` to
434 either ``SERVICE_IP_VERSION=4`` or ``SERVICE_IP_VERSION=6`` respectively.
435 When set to ``4`` devstack services will open listen sockets on 0.0.0.0
436 and service endpoints will be registered using ``HOST_IP`` as the address.
437 When set to ``6`` devstack services will open listen sockets on :: and
438 service endpoints will be registered using ``HOST_IPV6`` as the address.
439 The default value for this setting is ``4``. Dual-mode support, for
440 example ``4+6`` is not currently supported.
441 | The following optional variable can be used to alter the default IPv6
442 address used:
443 |
444
445 ::
446
447 HOST_IPV6=${some_local_ipv6_address}
John Davidge21529a52014-06-30 09:55:11 -0400448
Sean M. Collins09e550c2014-10-21 11:40:08 -0400449Examples
Sean Dague07d7e5b2014-11-17 07:10:14 -0500450========
Sean M. Collins09e550c2014-10-21 11:40:08 -0400451
452- Eliminate a Cinder pass-through (``CINDER_PERIODIC_INTERVAL``):
453
454 ::
455
456 [[post-config|$CINDER_CONF]]
457 [DEFAULT]
458 periodic_interval = 60
459
460- Sample ``local.conf`` with screen logging enabled:
461
462 ::
463
464 [[local|localrc]]
465 FIXED_RANGE=10.254.1.0/24
466 NETWORK_GATEWAY=10.254.1.1
467 LOGDAYS=1
Dean Troyerdde41d02014-12-09 17:47:57 -0600468 LOGDIR=$DEST/logs
469 LOGFILE=$LOGDIR/stack.sh.log
Sean M. Collins09e550c2014-10-21 11:40:08 -0400470 ADMIN_PASSWORD=quiet
471 DATABASE_PASSWORD=$ADMIN_PASSWORD
472 RABBIT_PASSWORD=$ADMIN_PASSWORD
473 SERVICE_PASSWORD=$ADMIN_PASSWORD
474 SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50