blob: a0d0840263c558dde2777a9a5e8016aa7df89430 [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
59
60The file is processed strictly in sequence; meta-sections may be
61specified more than once but if any settings are duplicated the last to
62appear in the file will be used.
63
64::
65
66 [[post-config|$NOVA_CONF]]
67 [DEFAULT]
68 use_syslog = True
69
70 [osapi_v3]
71 enabled = False
72
73A specific meta-section ``local|localrc`` is used to provide a default
74``localrc`` file (actually ``.localrc.auto``). This allows all custom
75settings for DevStack to be contained in a single file. If ``localrc``
76exists it will be used instead to preserve backward-compatibility. More
Dean Troyerea3cdfa2014-11-08 08:29:16 -060077details on the :doc:`contents of local.conf <local.conf>` are available.
Sean M. Collins09e550c2014-10-21 11:40:08 -040078
79::
80
81 [[local|localrc]]
82 FIXED_RANGE=10.254.1.0/24
83 ADMIN_PASSWORD=speciale
84 LOGFILE=$DEST/logs/stack.sh.log
85
86Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to
87*NOT* start with a ``/`` (slash) character. A slash will need to be
88added:
89
90::
91
92 [[post-config|/$Q_PLUGIN_CONF_FILE]]
93
94Also note that the ``localrc`` section is sourced as a shell script
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +020095fragment and MUST conform to the shell requirements, specifically no
Sean M. Collins09e550c2014-10-21 11:40:08 -040096whitespace around ``=`` (equals).
97
98Minimal Configuration
Sean Dague07d7e5b2014-11-17 07:10:14 -050099=====================
Sean M. Collins09e550c2014-10-21 11:40:08 -0400100
101While ``stack.sh`` is happy to run without a ``localrc`` section in
102``local.conf``, devlife is better when there are a few minimal variables
103set. This is an example of a minimal configuration that touches the
104values that most often need to be set.
105
106- no logging
107- pre-set the passwords to prevent interactive prompts
108- move network ranges away from the local network (``FIXED_RANGE`` and
109 ``FLOATING_RANGE``, commented out below)
110- set the host IP if detection is unreliable (``HOST_IP``, commented
111 out below)
112
113::
114
115 [[local|localrc]]
116 ADMIN_PASSWORD=secrete
117 DATABASE_PASSWORD=$ADMIN_PASSWORD
118 RABBIT_PASSWORD=$ADMIN_PASSWORD
119 SERVICE_PASSWORD=$ADMIN_PASSWORD
120 SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50
121 #FIXED_RANGE=172.31.1.0/24
122 #FLOATING_RANGE=192.168.20.0/25
123 #HOST_IP=10.3.4.5
124
125If the ``*_PASSWORD`` variables are not set here you will be prompted to
126enter values for them by ``stack.sh``.
127
128The network ranges must not overlap with any networks in use on the
129host. Overlap is not uncommon as RFC-1918 'private' ranges are commonly
130used for both the local networking and Nova's fixed and floating ranges.
131
132``HOST_IP`` is normally detected on the first run of ``stack.sh`` but
133often is indeterminate on later runs due to the IP being moved from an
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +0200134Ethernet interface to a bridge on the host. Setting it here also makes it
Sean M. Collins09e550c2014-10-21 11:40:08 -0400135available for ``openrc`` to set ``OS_AUTH_URL``. ``HOST_IP`` is not set
136by default.
137
138Common Configuration Variables
Sean Dague07d7e5b2014-11-17 07:10:14 -0500139==============================
Sean M. Collins09e550c2014-10-21 11:40:08 -0400140
Sean Dague07d7e5b2014-11-17 07:10:14 -0500141Installation Directory
142----------------------
143
Sean M. Collins09e550c2014-10-21 11:40:08 -0400144 | *Default: ``DEST=/opt/stack``*
145 | The DevStack install directory is set by the ``DEST`` variable.
146 | By setting it early in the ``localrc`` section you can reference it
147 in later variables. It can be useful to set it even though it is not
148 changed from the default value.
149 |
150
151 ::
152
153 DEST=/opt/stack
154
Sean Dague07d7e5b2014-11-17 07:10:14 -0500155Libraries from Git
156------------------
157
158 | *Default: ``LIBS_FROM_GIT=""``*
159
160 | By default devstack installs OpenStack server components from
161 git, however it installs client libraries from released versions
162 on pypi. This is appropriate if you are working on server
163 development, but if you want to see how an unreleased version of
164 the client affects the system you can have devstack install it
165 from upstream, or from local git trees.
166 | Multiple libraries can be specified as a comma separated list.
167 |
168
169 ::
170
171 LIBS_FROM_GIT=python-keystoneclient,oslo.config
172
Dean Troyer5686dbc2015-03-09 14:27:51 -0500173Virtual Environments
174--------------------
175
176 | *Default: ``USE_VENV=False``*
177 | Enable the use of Python virtual environments by setting ``USE_VENV``
178 to ``True``. This will enable the creation of venvs for each project
179 that is defined in the ``PROJECT_VENV`` array.
180
181 | *Default: ``PROJECT_VENV['<project>']='<project-dir>.venv'*
182 | Each entry in the ``PROJECT_VENV`` array contains the directory name
183 of a venv to be used for the project. The array index is the project
184 name. Multiple projects can use the same venv if desired.
185
186 ::
187
188 PROJECT_VENV["glance"]=${GLANCE_DIR}.venv
189
190 | *Default: ``ADDITIONAL_VENV_PACKAGES=""``*
191 | A comma-separated list of additional packages to be installed into each
192 venv. Often projects will not have certain packages listed in its
193 ``requirements.txt`` file because they are 'optional' requirements,
194 i.e. only needed for certain configurations. By default, the enabled
195 databases will have their Python bindings added when they are enabled.
196
Sean Dague07d7e5b2014-11-17 07:10:14 -0500197Enable Logging
198--------------
199
Sean M. Collins09e550c2014-10-21 11:40:08 -0400200 | *Defaults: ``LOGFILE="" LOGDAYS=7 LOG_COLOR=True``*
201 | By default ``stack.sh`` output is only written to the console
202 where is runs. It can be sent to a file in addition to the console
203 by setting ``LOGFILE`` to the fully-qualified name of the
204 destination log file. A timestamp will be appended to the given
205 filename for each run of ``stack.sh``.
206 |
207
208 ::
209
210 LOGFILE=$DEST/logs/stack.sh.log
211
212 Old log files are cleaned automatically if ``LOGDAYS`` is set to the
213 number of days of old log files to keep.
214
215 ::
216
217 LOGDAYS=1
218
219 The some of the project logs (Nova, Cinder, etc) will be colorized
220 by default (if ``SYSLOG`` is not set below); this can be turned off
221 by setting ``LOG_COLOR`` False.
222
223 ::
224
225 LOG_COLOR=False
226
Dean Troyerdde41d02014-12-09 17:47:57 -0600227Logging the Service Output
228--------------------------
Sean Dague07d7e5b2014-11-17 07:10:14 -0500229
Dean Troyerdde41d02014-12-09 17:47:57 -0600230 | *Default: ``LOGDIR=""``*
231 | DevStack will log the stdout output of the services it starts.
232 When using ``screen`` this logs the output in the screen windows
233 to a file. Without ``screen`` this simply redirects stdout of
234 the service process to a file in ``LOGDIR``.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400235 |
236
237 ::
238
Dean Troyerdde41d02014-12-09 17:47:57 -0600239 LOGDIR=$DEST/logs
Sean M. Collins09e550c2014-10-21 11:40:08 -0400240
241 *Note the use of ``DEST`` to locate the main install directory; this
242 is why we suggest setting it in ``local.conf``.*
243
Sean Dague07d7e5b2014-11-17 07:10:14 -0500244Enabling Syslog
245---------------
246
Sean M. Collins09e550c2014-10-21 11:40:08 -0400247 | *Default: ``SYSLOG=False SYSLOG_HOST=$HOST_IP SYSLOG_PORT=516``*
248 | Logging all services to a single syslog can be convenient. Enable
249 syslogging by setting ``SYSLOG`` to ``True``. If the destination log
250 host is not localhost ``SYSLOG_HOST`` and ``SYSLOG_PORT`` can be
251 used to direct the message stream to the log host.
252 |
253
254 ::
255
256 SYSLOG=True
257 SYSLOG_HOST=$HOST_IP
258 SYSLOG_PORT=516
259
260A clean install every time
Sean Dague07d7e5b2014-11-17 07:10:14 -0500261--------------------------
262
Sean M. Collins09e550c2014-10-21 11:40:08 -0400263 | *Default: ``RECLONE=""``*
264 | By default ``stack.sh`` only clones the project repos if they do
265 not exist in ``$DEST``. ``stack.sh`` will freshen each repo on each
266 run if ``RECLONE`` is set to ``yes``. This avoids having to manually
267 remove repos in order to get the current branch from ``$GIT_BASE``.
268 |
269
270 ::
271
272 RECLONE=yes
273
Chris Dentebdd9ac2015-03-04 12:35:14 +0000274Upgrade packages installed by pip
275---------------------------------
276
277 | *Default: ``PIP_UPGRADE=""``*
278 | By default ``stack.sh`` only installs Python packages if no version
279 is currently installed or the current version does not match a specified
280 requirement. If ``PIP_UPGRADE`` is set to ``True`` then existing required
281 Python packages will be upgraded to the most recent version that
282 matches requirements.
283 |
284
285 ::
286
287 PIP_UPGRADE=True
288
Sean Dague07d7e5b2014-11-17 07:10:14 -0500289Swift
290-----
291
292 | Default: SWIFT_HASH=""
293 | SWIFT_REPLICAS=1
294 | SWIFT_DATA_DIR=$DEST/data/swift
295
296 | Swift is now used as the back-end for the S3-like object store.
297 When enabled Nova's objectstore (n-obj in ENABLED_SERVICES) is
298 automatically disabled. Enable Swift by adding it services to
299 ENABLED_SERVICES: enable_service s-proxy s-object s-container
300 s-account
Sean M. Collins09e550c2014-10-21 11:40:08 -0400301
302 Setting Swift's hash value is required and you will be prompted for
303 it if Swift is enabled so just set it to something already:
304
305 ::
306
307 SWIFT_HASH=66a3d6b56c1f479c8b4e70ab5c2000f5
308
309 For development purposes the default number of replicas is set to
310 ``1`` to reduce the overhead required. To better simulate a
311 production deployment set this to ``3`` or more.
312
313 ::
314
315 SWIFT_REPLICAS=3
316
317 The data for Swift is stored in the source tree by default (in
318 ``$DEST/swift/data``) and can be moved by setting
319 ``SWIFT_DATA_DIR``. The specified directory will be created if it
320 does not exist.
321
322 ::
323
324 SWIFT_DATA_DIR=$DEST/data/swift
325
326 *Note: Previously just enabling ``swift`` was sufficient to start
327 the Swift services. That does not provide proper service
328 granularity, particularly in multi-host configurations, and is
329 considered deprecated. Some service combination tests now check for
330 specific Swift services and the old blanket acceptance will longer
331 work correctly.*
332
333Service Catalog Backend
Sean Dague07d7e5b2014-11-17 07:10:14 -0500334-----------------------
335
Sean M. Collins09e550c2014-10-21 11:40:08 -0400336 | *Default: ``KEYSTONE_CATALOG_BACKEND=sql``*
337 | DevStack uses Keystone's ``sql`` service catalog backend. An
338 alternate ``template`` backend is also available. However, it does
339 not support the ``service-*`` and ``endpoint-*`` commands of the
340 ``keystone`` CLI. To do so requires the ``sql`` backend be enabled:
341 |
342
343 ::
344
345 KEYSTONE_CATALOG_BACKEND=template
346
347 DevStack's default configuration in ``sql`` mode is set in
348 ``files/keystone_data.sh``
349
350Cinder
Sean Dague07d7e5b2014-11-17 07:10:14 -0500351------
352
Sean M. Collins09e550c2014-10-21 11:40:08 -0400353 | Default:
354 | VOLUME_GROUP="stack-volumes" VOLUME_NAME_PREFIX="volume-" VOLUME_BACKING_FILE_SIZE=10250M
355 | The logical volume group used to hold the Cinder-managed volumes
356 is set by ``VOLUME_GROUP``, the logical volume name prefix is set
357 with ``VOLUME_NAME_PREFIX`` and the size of the volume backing file
358 is set with ``VOLUME_BACKING_FILE_SIZE``.
359 |
360
361 ::
362
363 VOLUME_GROUP="stack-volumes"
364 VOLUME_NAME_PREFIX="volume-"
365 VOLUME_BACKING_FILE_SIZE=10250M
366
367Multi-host DevStack
Sean Dague07d7e5b2014-11-17 07:10:14 -0500368-------------------
369
Sean M. Collins09e550c2014-10-21 11:40:08 -0400370 | *Default: ``MULTI_HOST=False``*
371 | Running DevStack with multiple hosts requires a custom
372 ``local.conf`` section for each host. The master is the same as a
373 single host installation with ``MULTI_HOST=True``. The slaves have
374 fewer services enabled and a couple of host variables pointing to
375 the master.
376 | **Master**
377
378 ::
379
380 MULTI_HOST=True
381
382 **Slave**
383
384 ::
385
386 MYSQL_HOST=w.x.y.z
387 RABBIT_HOST=w.x.y.z
388 GLANCE_HOSTPORT=w.x.y.z:9292
389 ENABLED_SERVICES=n-vol,n-cpu,n-net,n-api
390
John Davidge21529a52014-06-30 09:55:11 -0400391IP Version
392 | Default: ``IP_VERSION=4``
393 | This setting can be used to configure DevStack to create either an IPv4,
394 IPv6, or dual stack tenant data network by setting ``IP_VERSION`` to
395 either ``IP_VERSION=4``, ``IP_VERSION=6``, or ``IP_VERSION=4+6``
396 respectively. This functionality requires that the Neutron networking
397 service is enabled by setting the following options:
398 |
399
400 ::
401
402 disable_service n-net
403 enable_service q-svc q-agt q-dhcp q-l3
404
405 | The following optional variables can be used to alter the default IPv6
406 behavior:
407 |
408
409 ::
410
411 IPV6_RA_MODE=slaac
412 IPV6_ADDRESS_MODE=slaac
413 FIXED_RANGE_V6=fd$IPV6_GLOBAL_ID::/64
414 IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1
415
416 | *Note: ``FIXED_RANGE_V6`` and ``IPV6_PRIVATE_NETWORK_GATEWAY``
417 can be configured with any valid IPv6 prefix. The default values make
418 use of an auto-generated ``IPV6_GLOBAL_ID`` to comply with RFC 4193.*
419
Sean M. Collins09e550c2014-10-21 11:40:08 -0400420Examples
Sean Dague07d7e5b2014-11-17 07:10:14 -0500421========
Sean M. Collins09e550c2014-10-21 11:40:08 -0400422
423- Eliminate a Cinder pass-through (``CINDER_PERIODIC_INTERVAL``):
424
425 ::
426
427 [[post-config|$CINDER_CONF]]
428 [DEFAULT]
429 periodic_interval = 60
430
431- Sample ``local.conf`` with screen logging enabled:
432
433 ::
434
435 [[local|localrc]]
436 FIXED_RANGE=10.254.1.0/24
437 NETWORK_GATEWAY=10.254.1.1
438 LOGDAYS=1
Dean Troyerdde41d02014-12-09 17:47:57 -0600439 LOGDIR=$DEST/logs
440 LOGFILE=$LOGDIR/stack.sh.log
Sean M. Collins09e550c2014-10-21 11:40:08 -0400441 ADMIN_PASSWORD=quiet
442 DATABASE_PASSWORD=$ADMIN_PASSWORD
443 RABBIT_PASSWORD=$ADMIN_PASSWORD
444 SERVICE_PASSWORD=$ADMIN_PASSWORD
445 SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50