blob: ed17924d45d691b8bde4a51b78c36d8ecc99c449 [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 Wienand7d5be292015-08-10 13:39:17 +1000151Examples
152========
153
154- Eliminate a Cinder pass-through (``CINDER_PERIODIC_INTERVAL``):
155
156 ::
157
158 [[post-config|$CINDER_CONF]]
159 [DEFAULT]
160 periodic_interval = 60
161
162- Sample ``local.conf`` with screen logging enabled:
163
164 ::
165
166 [[local|localrc]]
167 FIXED_RANGE=10.254.1.0/24
168 NETWORK_GATEWAY=10.254.1.1
169 LOGDAYS=1
170 LOGDIR=$DEST/logs
171 LOGFILE=$LOGDIR/stack.sh.log
172 ADMIN_PASSWORD=quiet
173 DATABASE_PASSWORD=$ADMIN_PASSWORD
174 RABBIT_PASSWORD=$ADMIN_PASSWORD
175 SERVICE_PASSWORD=$ADMIN_PASSWORD
176 SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50
177
178
Ian Wienand815db162015-08-06 10:25:45 +1000179Configuration Notes
180===================
181
182.. contents::
183 :local:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400184
Sean Dague07d7e5b2014-11-17 07:10:14 -0500185Installation Directory
186----------------------
187
Ian Wienand815db162015-08-06 10:25:45 +1000188The DevStack install directory is set by the ``DEST`` variable. By
189default it is ``/opt/stack``.
190
191By setting it early in the ``localrc`` section you can reference it in
192later variables. It can be useful to set it even though it is not
193changed from the default value.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400194
195 ::
196
197 DEST=/opt/stack
198
Ian Wienand815db162015-08-06 10:25:45 +1000199Logging
200-------
201
202Enable Logging
203~~~~~~~~~~~~~~
204
205By default ``stack.sh`` output is only written to the console where it
206runs. It can be sent to a file in addition to the console by setting
207``LOGFILE`` to the fully-qualified name of the destination log file. A
208timestamp will be appended to the given filename for each run of
209``stack.sh``.
210
211 ::
212
213 LOGFILE=$DEST/logs/stack.sh.log
214
215Old log files are cleaned automatically if ``LOGDAYS`` is set to the
216number of days of old log files to keep.
217
218 ::
219
220 LOGDAYS=1
221
222The some of the project logs (Nova, Cinder, etc) will be colorized by
223default (if ``SYSLOG`` is not set below); this can be turned off by
224setting ``LOG_COLOR`` to ``False``.
225
226 ::
227
228 LOG_COLOR=False
229
230Logging the Service Output
231~~~~~~~~~~~~~~~~~~~~~~~~~~
232
233DevStack will log the ``stdout`` output of the services it starts.
234When using ``screen`` this logs the output in the screen windows to a
235file. Without ``screen`` this simply redirects stdout of the service
236process to a file in ``LOGDIR``.
237
238 ::
239
240 LOGDIR=$DEST/logs
241
242*Note the use of ``DEST`` to locate the main install directory; this
243is why we suggest setting it in ``local.conf``.*
244
245Enabling Syslog
246~~~~~~~~~~~~~~~
247
248Logging all services to a single syslog can be convenient. Enable
249syslogging by setting ``SYSLOG`` to ``True``. If the destination log
250host is not localhost ``SYSLOG_HOST`` and ``SYSLOG_PORT`` can be used
251to direct the message stream to the log host. |
252
253 ::
254
255 SYSLOG=True
256 SYSLOG_HOST=$HOST_IP
257 SYSLOG_PORT=516
258
Ian Wienand7d5be292015-08-10 13:39:17 +1000259
260Database Backend
261----------------
262
263Multiple database backends are available. The available databases are defined
264in the lib/databases directory.
265`mysql` is the default database, choose a different one by putting the
266following in the `localrc` section:
267
268 ::
269
270 disable_service mysql
271 enable_service postgresql
272
273`mysql` is the default database.
274
275RPC Backend
276-----------
277
278Support for a RabbitMQ RPC backend is included. Additional RPC
279backends may be available via external plugins. Enabling or disabling
280RabbitMQ is handled via the usual service functions and
281``ENABLED_SERVICES``.
282
283Example disabling RabbitMQ in ``local.conf``:
284
285::
286 disable_service rabbit
287
288
289Apache Frontend
290---------------
291
292The Apache web server can be enabled for wsgi services that support
293being deployed under HTTPD + mod_wsgi. By default, services that
294recommend running under HTTPD + mod_wsgi are deployed under Apache. To
295use an alternative deployment strategy (e.g. eventlet) for services
296that support an alternative to HTTPD + mod_wsgi set
297``ENABLE_HTTPD_MOD_WSGI_SERVICES`` to ``False`` in your
298``local.conf``.
299
300Each service that can be run under HTTPD + mod_wsgi also has an
301override toggle available that can be set in your ``local.conf``.
302
303Keystone is run under Apache with ``mod_wsgi`` by default.
304
305Example (Keystone)
306
307::
308
309 KEYSTONE_USE_MOD_WSGI="True"
310
311Example (Nova):
312
313::
314
315 NOVA_USE_MOD_WSGI="True"
316
317Example (Swift):
318
319::
320
321 SWIFT_USE_MOD_WSGI="True"
322
323
324
Sean Dague07d7e5b2014-11-17 07:10:14 -0500325Libraries from Git
326------------------
327
Ian Wienand815db162015-08-06 10:25:45 +1000328By default devstack installs OpenStack server components from git,
329however it installs client libraries from released versions on pypi.
330This is appropriate if you are working on server development, but if
331you want to see how an unreleased version of the client affects the
332system you can have devstack install it from upstream, or from local
333git trees by specifying it in ``LIBS_FROM_GIT``. Multiple libraries
334can be specified as a comma separated list.
Sean Dague07d7e5b2014-11-17 07:10:14 -0500335
336 ::
337
338 LIBS_FROM_GIT=python-keystoneclient,oslo.config
339
Dean Troyer5686dbc2015-03-09 14:27:51 -0500340Virtual Environments
341--------------------
342
Ian Wienand815db162015-08-06 10:25:45 +1000343Enable the use of Python virtual environments by setting ``USE_VENV``
344to ``True``. This will enable the creation of venvs for each project
345that is defined in the ``PROJECT_VENV`` array.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500346
Ian Wienand815db162015-08-06 10:25:45 +1000347Each entry in the ``PROJECT_VENV`` array contains the directory name
348of a venv to be used for the project. The array index is the project
349name. Multiple projects can use the same venv if desired.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500350
351 ::
352
353 PROJECT_VENV["glance"]=${GLANCE_DIR}.venv
354
Ian Wienand815db162015-08-06 10:25:45 +1000355``ADDITIONAL_VENV_PACKAGES`` is a comma-separated list of additional
356packages to be installed into each venv. Often projects will not have
357certain packages listed in its ``requirements.txt`` file because they
358are 'optional' requirements, i.e. only needed for certain
359configurations. By default, the enabled databases will have their
360Python bindings added when they are enabled.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500361
Ian Wienand815db162015-08-06 10:25:45 +1000362 ::
Sean Dague07d7e5b2014-11-17 07:10:14 -0500363
Ian Wienand815db162015-08-06 10:25:45 +1000364 ADDITIONAL_VENV_PACKAGES="python-foo, python-bar"
Sean M. Collins09e550c2014-10-21 11:40:08 -0400365
Sean M. Collins09e550c2014-10-21 11:40:08 -0400366
367A clean install every time
Sean Dague07d7e5b2014-11-17 07:10:14 -0500368--------------------------
369
Ian Wienand815db162015-08-06 10:25:45 +1000370By default ``stack.sh`` only clones the project repos if they do not
371exist in ``$DEST``. ``stack.sh`` will freshen each repo on each run if
372``RECLONE`` is set to ``yes``. This avoids having to manually remove
373repos in order to get the current branch from ``$GIT_BASE``.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400374
375 ::
376
377 RECLONE=yes
378
Chris Dentebdd9ac2015-03-04 12:35:14 +0000379Upgrade packages installed by pip
380---------------------------------
381
Ian Wienand815db162015-08-06 10:25:45 +1000382By default ``stack.sh`` only installs Python packages if no version is
383currently installed or the current version does not match a specified
384requirement. If ``PIP_UPGRADE`` is set to ``True`` then existing
385required Python packages will be upgraded to the most recent version
386that matches requirements.
Chris Dentebdd9ac2015-03-04 12:35:14 +0000387
388 ::
389
390 PIP_UPGRADE=True
391
Sean M. Collins09e550c2014-10-21 11:40:08 -0400392
393Service Catalog Backend
Sean Dague07d7e5b2014-11-17 07:10:14 -0500394-----------------------
395
Ian Wienand815db162015-08-06 10:25:45 +1000396By default DevStack uses Keystone's ``sql`` service catalog backend.
397An alternate ``template`` backend is also available, however, it does
398not support the ``service-*`` and ``endpoint-*`` commands of the
399``keystone`` CLI. To do so requires the ``sql`` backend be enabled
400with ``KEYSTONE_CATALOG_BACKEND``:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400401
402 ::
403
404 KEYSTONE_CATALOG_BACKEND=template
405
Ian Wienand815db162015-08-06 10:25:45 +1000406DevStack's default configuration in ``sql`` mode is set in
407``files/keystone_data.sh``
Sean M. Collins09e550c2014-10-21 11:40:08 -0400408
Sean M. Collins09e550c2014-10-21 11:40:08 -0400409
John Davidge21529a52014-06-30 09:55:11 -0400410IP Version
Brian Haley180f5eb2015-06-16 13:14:31 -0400411----------
412
Ian Wienand815db162015-08-06 10:25:45 +1000413``IP_VERSION`` can be used to configure DevStack to create either an
414IPv4, IPv6, or dual-stack tenant data-network by with either
415``IP_VERSION=4``, ``IP_VERSION=6``, or ``IP_VERSION=4+6``
416respectively. This functionality requires that the Neutron networking
417service is enabled by setting the following options:
John Davidge21529a52014-06-30 09:55:11 -0400418
419 ::
420
421 disable_service n-net
422 enable_service q-svc q-agt q-dhcp q-l3
423
Ian Wienand815db162015-08-06 10:25:45 +1000424The following optional variables can be used to alter the default IPv6
425behavior:
John Davidge21529a52014-06-30 09:55:11 -0400426
427 ::
428
429 IPV6_RA_MODE=slaac
430 IPV6_ADDRESS_MODE=slaac
431 FIXED_RANGE_V6=fd$IPV6_GLOBAL_ID::/64
432 IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1
433
Ian Wienand815db162015-08-06 10:25:45 +1000434*Note*: ``FIXED_RANGE_V6`` and ``IPV6_PRIVATE_NETWORK_GATEWAY`` can be
435configured with any valid IPv6 prefix. The default values make use of
436an auto-generated ``IPV6_GLOBAL_ID`` to comply with RFC4193.
Brian Haley180f5eb2015-06-16 13:14:31 -0400437
Ian Wienand815db162015-08-06 10:25:45 +1000438Service Version
439~~~~~~~~~~~~~~~
440
441DevStack can enable service operation over either IPv4 or IPv6 by
442setting ``SERVICE_IP_VERSION`` to either ``SERVICE_IP_VERSION=4`` or
443``SERVICE_IP_VERSION=6`` respectively.
444
445When set to ``4`` devstack services will open listen sockets on
446``0.0.0.0`` and service endpoints will be registered using ``HOST_IP``
447as the address.
448
449When set to ``6`` devstack services will open listen sockets on ``::``
450and service endpoints will be registered using ``HOST_IPV6`` as the
451address.
452
453The default value for this setting is ``4``. Dual-mode support, for
454example ``4+6`` is not currently supported. ``HOST_IPV6`` can
455optionally be used to alter the default IPv6 address
Brian Haley180f5eb2015-06-16 13:14:31 -0400456
457 ::
458
459 HOST_IPV6=${some_local_ipv6_address}
John Davidge21529a52014-06-30 09:55:11 -0400460
Ian Wienand7d5be292015-08-10 13:39:17 +1000461Multi-node setup
462~~~~~~~~~~~~~~~~
Sean M. Collins09e550c2014-10-21 11:40:08 -0400463
Ian Wienand7d5be292015-08-10 13:39:17 +1000464See the :doc:`multi-node lab guide<guides/multinode-lab>`
Sean M. Collins09e550c2014-10-21 11:40:08 -0400465
Ian Wienand7d5be292015-08-10 13:39:17 +1000466Projects
467--------
Sean M. Collins09e550c2014-10-21 11:40:08 -0400468
Ian Wienand7d5be292015-08-10 13:39:17 +1000469Neutron
470~~~~~~~
Sean M. Collins09e550c2014-10-21 11:40:08 -0400471
Ian Wienand7d5be292015-08-10 13:39:17 +1000472See the :doc:`neutron configuration guide<guides/neutron>` for
473details on configuration of Neutron
Sean M. Collins09e550c2014-10-21 11:40:08 -0400474
Sean M. Collins09e550c2014-10-21 11:40:08 -0400475
Ian Wienand7d5be292015-08-10 13:39:17 +1000476Swift
477~~~~~
478
479Swift is disabled by default. When enabled, it is configured with
480only one replica to avoid being IO/memory intensive on a small
481VM. When running with only one replica the account, container and
482object services will run directly in screen. The others services like
483replicator, updaters or auditor runs in background.
484
485If you would like to enable Swift you can add this to your `localrc`
486section:
487
488::
489
490 enable_service s-proxy s-object s-container s-account
491
492If you want a minimal Swift install with only Swift and Keystone you
493can have this instead in your `localrc` section:
494
495::
496
497 disable_all_services
498 enable_service key mysql s-proxy s-object s-container s-account
499
500If you only want to do some testing of a real normal swift cluster
501with multiple replicas you can do so by customizing the variable
502`SWIFT_REPLICAS` in your `localrc` section (usually to 3).
503
504Swift S3
505++++++++
506
507If you are enabling `swift3` in `ENABLED_SERVICES` DevStack will
508install the swift3 middleware emulation. Swift will be configured to
509act as a S3 endpoint for Keystone so effectively replacing the
510`nova-objectstore`.
511
512Only Swift proxy server is launched in the screen session all other
513services are started in background and managed by `swift-init` tool.
514
515Heat
516~~~~
517
518Heat is disabled by default (see `stackrc` file). To enable it
519explicitly you'll need the following settings in your `localrc`
520section
521
522::
523
524 enable_service heat h-api h-api-cfn h-api-cw h-eng
525
526Heat can also run in standalone mode, and be configured to orchestrate
527on an external OpenStack cloud. To launch only Heat in standalone mode
528you'll need the following settings in your `localrc` section
529
530::
531
532 disable_all_services
533 enable_service rabbit mysql heat h-api h-api-cfn h-api-cw h-eng
534 HEAT_STANDALONE=True
535 KEYSTONE_SERVICE_HOST=...
536 KEYSTONE_AUTH_HOST=...
537
538Tempest
539~~~~~~~
540
541If tempest has been successfully configured, a basic set of smoke
542tests can be run as follows:
543
544::
545
546 $ cd /opt/stack/tempest
547 $ tox -efull tempest.scenario.test_network_basic_ops
548
549By default tempest is downloaded and the config file is generated, but the
550tempest package is not installed in the system's global site-packages (the
551package install includes installing dependences). So tempest won't run
552outside of tox. If you would like to install it add the following to your
553``localrc`` section:
554
555::
556
557 INSTALL_TEMPEST=True
558
559
560Xenserver
561~~~~~~~~~
562
563If you would like to use Xenserver as the hypervisor, please refer to
564the instructions in `./tools/xen/README.md`.
565
566Cells
567~~~~~
568
569`Cells <http://wiki.openstack.org/blueprint-nova-compute-cells>`__ is
570an alternative scaling option. To setup a cells environment add the
571following to your `localrc` section:
572
573::
574
575 enable_service n-cell
576
577Be aware that there are some features currently missing in cells, one
578notable one being security groups. The exercises have been patched to
579disable functionality not supported by cells.
580
581Cinder
582~~~~~~
583
584The logical volume group used to hold the Cinder-managed volumes is
585set by ``VOLUME_GROUP``, the logical volume name prefix is set with
586``VOLUME_NAME_PREFIX`` and the size of the volume backing file is set
587with ``VOLUME_BACKING_FILE_SIZE``.
588
589 ::
590
591 VOLUME_GROUP="stack-volumes"
592 VOLUME_NAME_PREFIX="volume-"
593 VOLUME_BACKING_FILE_SIZE=10250M
594
595
596Keystone
597~~~~~~~~
598
599Multi-Region Setup
600++++++++++++++++++
601
602We want to setup two devstack (RegionOne and RegionTwo) with shared
603keystone (same users and services) and horizon. Keystone and Horizon
604will be located in RegionOne. Full spec is available at:
605`<https://wiki.openstack.org/wiki/Heat/Blueprints/Multi_Region_Support_for_Heat>`__.
606
607In RegionOne:
608
609::
610
611 REGION_NAME=RegionOne
612
613In RegionTwo:
614
615::
616
617 disable_service horizon
618 KEYSTONE_SERVICE_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
619 KEYSTONE_AUTH_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
620 REGION_NAME=RegionTwo