blob: 983f5c0aae0252ff3ff898d11aea68a77227877c [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 -04009local.conf
Sean Dague07d7e5b2014-11-17 07:10:14 -050010==========
Sean M. Collins09e550c2014-10-21 11:40:08 -040011
Ian Wienanda35391e2015-08-10 13:53:40 +100012DevStack configuration is modified via the file ``local.conf``. It is
13a modified INI format file that introduces a meta-section header to
14carry additional information regarding the configuration files to be
15changed.
16
17A sample is provided in ``devstack/samples``
Sean M. Collins09e550c2014-10-21 11:40:08 -040018
19The new header is similar to a normal INI section header but with double
20brackets (``[[ ... ]]``) and two internal fields separated by a pipe
21(``|``):
22
23::
24
25 [[ <phase> | <config-file-name> ]]
26
27where ``<phase>`` is one of a set of phase names defined by ``stack.sh``
28and ``<config-file-name>`` is the configuration filename. The filename
29is eval'ed in the ``stack.sh`` context so all environment variables are
30available and may be used. Using the project config file variables in
31the header is strongly suggested (see the ``NOVA_CONF`` example below).
32If the path of the config file does not exist it is skipped.
33
34The defined phases are:
35
36- **local** - extracts ``localrc`` from ``local.conf`` before
37 ``stackrc`` is sourced
38- **pre-install** - runs after the system packages are installed but
39 before any of the source repositories are installed
40- **install** - runs immediately after the repo installations are
41 complete
42- **post-config** - runs after the layer 2 services are configured and
43 before they are started
44- **extra** - runs after services are started and before any files in
45 ``extra.d`` are executed
46
47The file is processed strictly in sequence; meta-sections may be
48specified more than once but if any settings are duplicated the last to
49appear in the file will be used.
50
51::
52
53 [[post-config|$NOVA_CONF]]
54 [DEFAULT]
55 use_syslog = True
56
57 [osapi_v3]
58 enabled = False
59
60A specific meta-section ``local|localrc`` is used to provide a default
61``localrc`` file (actually ``.localrc.auto``). This allows all custom
62settings for DevStack to be contained in a single file. If ``localrc``
63exists it will be used instead to preserve backward-compatibility. More
Dean Troyerea3cdfa2014-11-08 08:29:16 -060064details on the :doc:`contents of local.conf <local.conf>` are available.
Sean M. Collins09e550c2014-10-21 11:40:08 -040065
66::
67
68 [[local|localrc]]
69 FIXED_RANGE=10.254.1.0/24
70 ADMIN_PASSWORD=speciale
71 LOGFILE=$DEST/logs/stack.sh.log
72
73Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to
74*NOT* start with a ``/`` (slash) character. A slash will need to be
75added:
76
77::
78
79 [[post-config|/$Q_PLUGIN_CONF_FILE]]
80
81Also note that the ``localrc`` section is sourced as a shell script
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +020082fragment and MUST conform to the shell requirements, specifically no
Sean M. Collins09e550c2014-10-21 11:40:08 -040083whitespace around ``=`` (equals).
84
James Polley5f2eb6d2015-03-30 17:36:26 +110085.. _minimal-configuration:
86
Sean M. Collins09e550c2014-10-21 11:40:08 -040087Minimal Configuration
Sean Dague07d7e5b2014-11-17 07:10:14 -050088=====================
Sean M. Collins09e550c2014-10-21 11:40:08 -040089
90While ``stack.sh`` is happy to run without a ``localrc`` section in
91``local.conf``, devlife is better when there are a few minimal variables
92set. This is an example of a minimal configuration that touches the
93values that most often need to be set.
94
95- no logging
96- pre-set the passwords to prevent interactive prompts
97- move network ranges away from the local network (``FIXED_RANGE`` and
98 ``FLOATING_RANGE``, commented out below)
99- set the host IP if detection is unreliable (``HOST_IP``, commented
100 out below)
101
102::
103
104 [[local|localrc]]
105 ADMIN_PASSWORD=secrete
106 DATABASE_PASSWORD=$ADMIN_PASSWORD
107 RABBIT_PASSWORD=$ADMIN_PASSWORD
108 SERVICE_PASSWORD=$ADMIN_PASSWORD
109 SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50
110 #FIXED_RANGE=172.31.1.0/24
111 #FLOATING_RANGE=192.168.20.0/25
112 #HOST_IP=10.3.4.5
113
114If the ``*_PASSWORD`` variables are not set here you will be prompted to
115enter values for them by ``stack.sh``.
116
117The network ranges must not overlap with any networks in use on the
118host. Overlap is not uncommon as RFC-1918 'private' ranges are commonly
119used for both the local networking and Nova's fixed and floating ranges.
120
121``HOST_IP`` is normally detected on the first run of ``stack.sh`` but
122often is indeterminate on later runs due to the IP being moved from an
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +0200123Ethernet interface to a bridge on the host. Setting it here also makes it
Sean M. Collins09e550c2014-10-21 11:40:08 -0400124available for ``openrc`` to set ``OS_AUTH_URL``. ``HOST_IP`` is not set
125by default.
126
Brian Haley180f5eb2015-06-16 13:14:31 -0400127``HOST_IPV6`` is normally detected on the first run of ``stack.sh`` but
128will not be set if there is no IPv6 address on the default Ethernet interface.
129Setting it here also makes it available for ``openrc`` to set ``OS_AUTH_URL``.
130``HOST_IPV6`` is not set by default.
131
Ian Wienanda35391e2015-08-10 13:53:40 +1000132Historical Notes
133================
Ian Wienand7d5be292015-08-10 13:39:17 +1000134
Ian Wienanda35391e2015-08-10 13:53:40 +1000135Historically DevStack obtained all local configuration and
136customizations from a ``localrc`` file. In Oct 2013 the
137``local.conf`` configuration method was introduced (in `review 46768
138<https://review.openstack.org/#/c/46768/>`__) to simplify this
139process.
Ian Wienand7d5be292015-08-10 13:39:17 +1000140
Ian Wienand815db162015-08-06 10:25:45 +1000141Configuration Notes
142===================
143
144.. contents::
145 :local:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400146
Sean Dague07d7e5b2014-11-17 07:10:14 -0500147Installation Directory
148----------------------
149
Ian Wienand815db162015-08-06 10:25:45 +1000150The DevStack install directory is set by the ``DEST`` variable. By
151default it is ``/opt/stack``.
152
153By setting it early in the ``localrc`` section you can reference it in
154later variables. It can be useful to set it even though it is not
155changed from the default value.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400156
157 ::
158
159 DEST=/opt/stack
160
Ian Wienand815db162015-08-06 10:25:45 +1000161Logging
162-------
163
164Enable Logging
165~~~~~~~~~~~~~~
166
167By default ``stack.sh`` output is only written to the console where it
168runs. It can be sent to a file in addition to the console by setting
169``LOGFILE`` to the fully-qualified name of the destination log file. A
170timestamp will be appended to the given filename for each run of
171``stack.sh``.
172
173 ::
174
175 LOGFILE=$DEST/logs/stack.sh.log
176
177Old log files are cleaned automatically if ``LOGDAYS`` is set to the
178number of days of old log files to keep.
179
180 ::
181
182 LOGDAYS=1
183
184The some of the project logs (Nova, Cinder, etc) will be colorized by
185default (if ``SYSLOG`` is not set below); this can be turned off by
186setting ``LOG_COLOR`` to ``False``.
187
188 ::
189
190 LOG_COLOR=False
191
192Logging the Service Output
193~~~~~~~~~~~~~~~~~~~~~~~~~~
194
195DevStack will log the ``stdout`` output of the services it starts.
196When using ``screen`` this logs the output in the screen windows to a
197file. Without ``screen`` this simply redirects stdout of the service
198process to a file in ``LOGDIR``.
199
200 ::
201
202 LOGDIR=$DEST/logs
203
204*Note the use of ``DEST`` to locate the main install directory; this
205is why we suggest setting it in ``local.conf``.*
206
207Enabling Syslog
208~~~~~~~~~~~~~~~
209
210Logging all services to a single syslog can be convenient. Enable
211syslogging by setting ``SYSLOG`` to ``True``. If the destination log
212host is not localhost ``SYSLOG_HOST`` and ``SYSLOG_PORT`` can be used
213to direct the message stream to the log host. |
214
215 ::
216
217 SYSLOG=True
218 SYSLOG_HOST=$HOST_IP
219 SYSLOG_PORT=516
220
Ian Wienand7d5be292015-08-10 13:39:17 +1000221
Ian Wienanda35391e2015-08-10 13:53:40 +1000222Example Logging Configuration
223~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
224
225For example, non-interactive installs probably wish to save output to
226a file, keep service logs and disable color in the stored files.
227
228 ::
229
230 [[local|localrc]]
231 DEST=/opt/stack/
232 LOGDIR=$DEST/logs
233 LOGFILE=$LOGDIR/stack.sh.log
234 LOG_COLOR=False
235
Ian Wienand7d5be292015-08-10 13:39:17 +1000236Database Backend
237----------------
238
239Multiple database backends are available. The available databases are defined
240in the lib/databases directory.
241`mysql` is the default database, choose a different one by putting the
242following in the `localrc` section:
243
244 ::
245
246 disable_service mysql
247 enable_service postgresql
248
249`mysql` is the default database.
250
251RPC Backend
252-----------
253
254Support for a RabbitMQ RPC backend is included. Additional RPC
255backends may be available via external plugins. Enabling or disabling
256RabbitMQ is handled via the usual service functions and
257``ENABLED_SERVICES``.
258
259Example disabling RabbitMQ in ``local.conf``:
260
261::
262 disable_service rabbit
263
264
265Apache Frontend
266---------------
267
268The Apache web server can be enabled for wsgi services that support
269being deployed under HTTPD + mod_wsgi. By default, services that
270recommend running under HTTPD + mod_wsgi are deployed under Apache. To
271use an alternative deployment strategy (e.g. eventlet) for services
272that support an alternative to HTTPD + mod_wsgi set
273``ENABLE_HTTPD_MOD_WSGI_SERVICES`` to ``False`` in your
274``local.conf``.
275
276Each service that can be run under HTTPD + mod_wsgi also has an
277override toggle available that can be set in your ``local.conf``.
278
279Keystone is run under Apache with ``mod_wsgi`` by default.
280
281Example (Keystone)
282
283::
284
285 KEYSTONE_USE_MOD_WSGI="True"
286
287Example (Nova):
288
289::
290
291 NOVA_USE_MOD_WSGI="True"
292
293Example (Swift):
294
295::
296
297 SWIFT_USE_MOD_WSGI="True"
298
299
300
Sean Dague07d7e5b2014-11-17 07:10:14 -0500301Libraries from Git
302------------------
303
Ian Wienand815db162015-08-06 10:25:45 +1000304By default devstack installs OpenStack server components from git,
305however it installs client libraries from released versions on pypi.
306This is appropriate if you are working on server development, but if
307you want to see how an unreleased version of the client affects the
308system you can have devstack install it from upstream, or from local
309git trees by specifying it in ``LIBS_FROM_GIT``. Multiple libraries
310can be specified as a comma separated list.
Sean Dague07d7e5b2014-11-17 07:10:14 -0500311
312 ::
313
314 LIBS_FROM_GIT=python-keystoneclient,oslo.config
315
Dean Troyer5686dbc2015-03-09 14:27:51 -0500316Virtual Environments
317--------------------
318
Ian Wienand815db162015-08-06 10:25:45 +1000319Enable the use of Python virtual environments by setting ``USE_VENV``
320to ``True``. This will enable the creation of venvs for each project
321that is defined in the ``PROJECT_VENV`` array.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500322
Ian Wienand815db162015-08-06 10:25:45 +1000323Each entry in the ``PROJECT_VENV`` array contains the directory name
324of a venv to be used for the project. The array index is the project
325name. Multiple projects can use the same venv if desired.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500326
327 ::
328
329 PROJECT_VENV["glance"]=${GLANCE_DIR}.venv
330
Ian Wienand815db162015-08-06 10:25:45 +1000331``ADDITIONAL_VENV_PACKAGES`` is a comma-separated list of additional
332packages to be installed into each venv. Often projects will not have
333certain packages listed in its ``requirements.txt`` file because they
334are 'optional' requirements, i.e. only needed for certain
335configurations. By default, the enabled databases will have their
336Python bindings added when they are enabled.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500337
Ian Wienand815db162015-08-06 10:25:45 +1000338 ::
Sean Dague07d7e5b2014-11-17 07:10:14 -0500339
Ian Wienand815db162015-08-06 10:25:45 +1000340 ADDITIONAL_VENV_PACKAGES="python-foo, python-bar"
Sean M. Collins09e550c2014-10-21 11:40:08 -0400341
Sean M. Collins09e550c2014-10-21 11:40:08 -0400342
343A clean install every time
Sean Dague07d7e5b2014-11-17 07:10:14 -0500344--------------------------
345
Ian Wienand815db162015-08-06 10:25:45 +1000346By default ``stack.sh`` only clones the project repos if they do not
347exist in ``$DEST``. ``stack.sh`` will freshen each repo on each run if
348``RECLONE`` is set to ``yes``. This avoids having to manually remove
349repos in order to get the current branch from ``$GIT_BASE``.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400350
351 ::
352
353 RECLONE=yes
354
Chris Dentebdd9ac2015-03-04 12:35:14 +0000355Upgrade packages installed by pip
356---------------------------------
357
Ian Wienand815db162015-08-06 10:25:45 +1000358By default ``stack.sh`` only installs Python packages if no version is
359currently installed or the current version does not match a specified
360requirement. If ``PIP_UPGRADE`` is set to ``True`` then existing
361required Python packages will be upgraded to the most recent version
362that matches requirements.
Chris Dentebdd9ac2015-03-04 12:35:14 +0000363
364 ::
365
366 PIP_UPGRADE=True
367
Sean M. Collins09e550c2014-10-21 11:40:08 -0400368
369Service Catalog Backend
Sean Dague07d7e5b2014-11-17 07:10:14 -0500370-----------------------
371
Ian Wienand815db162015-08-06 10:25:45 +1000372By default DevStack uses Keystone's ``sql`` service catalog backend.
373An alternate ``template`` backend is also available, however, it does
374not support the ``service-*`` and ``endpoint-*`` commands of the
375``keystone`` CLI. To do so requires the ``sql`` backend be enabled
376with ``KEYSTONE_CATALOG_BACKEND``:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400377
378 ::
379
380 KEYSTONE_CATALOG_BACKEND=template
381
Ian Wienand815db162015-08-06 10:25:45 +1000382DevStack's default configuration in ``sql`` mode is set in
383``files/keystone_data.sh``
Sean M. Collins09e550c2014-10-21 11:40:08 -0400384
Sean M. Collins09e550c2014-10-21 11:40:08 -0400385
John Huaa4693b52015-08-06 13:53:35 +0100386Guest Images
387------------
388
389Images provided in URLS via the comma-separated ``IMAGE_URLS``
390variable will be downloaded and uploaded to glance by DevStack.
391
392Default guest-images are predefined for each type of hypervisor and
393their testing-requirements in ``stack.sh``. Setting
394``DOWNLOAD_DEFAULT_IMAGES=False`` will prevent DevStack downloading
395these default images; in that case, you will want to populate
396``IMAGE_URLS`` with sufficient images to satisfy testing-requirements.
397
398 ::
399
400 DOWNLOAD_DEFAULT_IMAGES=False
401 IMAGE_URLS="http://foo.bar.com/image.qcow,"
402 IMAGE_URLS+="http://foo.bar.com/image2.qcow"
403
John Davidge21529a52014-06-30 09:55:11 -0400404IP Version
Brian Haley180f5eb2015-06-16 13:14:31 -0400405----------
406
Ian Wienand815db162015-08-06 10:25:45 +1000407``IP_VERSION`` can be used to configure DevStack to create either an
408IPv4, IPv6, or dual-stack tenant data-network by with either
409``IP_VERSION=4``, ``IP_VERSION=6``, or ``IP_VERSION=4+6``
410respectively. This functionality requires that the Neutron networking
411service is enabled by setting the following options:
John Davidge21529a52014-06-30 09:55:11 -0400412
413 ::
414
415 disable_service n-net
416 enable_service q-svc q-agt q-dhcp q-l3
417
Ian Wienand815db162015-08-06 10:25:45 +1000418The following optional variables can be used to alter the default IPv6
419behavior:
John Davidge21529a52014-06-30 09:55:11 -0400420
421 ::
422
423 IPV6_RA_MODE=slaac
424 IPV6_ADDRESS_MODE=slaac
425 FIXED_RANGE_V6=fd$IPV6_GLOBAL_ID::/64
426 IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1
427
Ian Wienand815db162015-08-06 10:25:45 +1000428*Note*: ``FIXED_RANGE_V6`` and ``IPV6_PRIVATE_NETWORK_GATEWAY`` can be
429configured with any valid IPv6 prefix. The default values make use of
430an auto-generated ``IPV6_GLOBAL_ID`` to comply with RFC4193.
Brian Haley180f5eb2015-06-16 13:14:31 -0400431
Ian Wienand815db162015-08-06 10:25:45 +1000432Service Version
433~~~~~~~~~~~~~~~
434
435DevStack can enable service operation over either IPv4 or IPv6 by
436setting ``SERVICE_IP_VERSION`` to either ``SERVICE_IP_VERSION=4`` or
437``SERVICE_IP_VERSION=6`` respectively.
438
439When set to ``4`` devstack services will open listen sockets on
440``0.0.0.0`` and service endpoints will be registered using ``HOST_IP``
441as the address.
442
443When set to ``6`` devstack services will open listen sockets on ``::``
444and service endpoints will be registered using ``HOST_IPV6`` as the
445address.
446
447The default value for this setting is ``4``. Dual-mode support, for
448example ``4+6`` is not currently supported. ``HOST_IPV6`` can
449optionally be used to alter the default IPv6 address
Brian Haley180f5eb2015-06-16 13:14:31 -0400450
451 ::
452
453 HOST_IPV6=${some_local_ipv6_address}
John Davidge21529a52014-06-30 09:55:11 -0400454
Ian Wienand7d5be292015-08-10 13:39:17 +1000455Multi-node setup
456~~~~~~~~~~~~~~~~
Sean M. Collins09e550c2014-10-21 11:40:08 -0400457
Ian Wienand7d5be292015-08-10 13:39:17 +1000458See the :doc:`multi-node lab guide<guides/multinode-lab>`
Sean M. Collins09e550c2014-10-21 11:40:08 -0400459
Ian Wienand7d5be292015-08-10 13:39:17 +1000460Projects
461--------
Sean M. Collins09e550c2014-10-21 11:40:08 -0400462
Ian Wienand7d5be292015-08-10 13:39:17 +1000463Neutron
464~~~~~~~
Sean M. Collins09e550c2014-10-21 11:40:08 -0400465
Ian Wienand7d5be292015-08-10 13:39:17 +1000466See the :doc:`neutron configuration guide<guides/neutron>` for
467details on configuration of Neutron
Sean M. Collins09e550c2014-10-21 11:40:08 -0400468
Sean M. Collins09e550c2014-10-21 11:40:08 -0400469
Ian Wienand7d5be292015-08-10 13:39:17 +1000470Swift
471~~~~~
472
473Swift is disabled by default. When enabled, it is configured with
474only one replica to avoid being IO/memory intensive on a small
475VM. When running with only one replica the account, container and
476object services will run directly in screen. The others services like
477replicator, updaters or auditor runs in background.
478
479If you would like to enable Swift you can add this to your `localrc`
480section:
481
482::
483
484 enable_service s-proxy s-object s-container s-account
485
486If you want a minimal Swift install with only Swift and Keystone you
487can have this instead in your `localrc` section:
488
489::
490
491 disable_all_services
492 enable_service key mysql s-proxy s-object s-container s-account
493
494If you only want to do some testing of a real normal swift cluster
495with multiple replicas you can do so by customizing the variable
496`SWIFT_REPLICAS` in your `localrc` section (usually to 3).
497
498Swift S3
499++++++++
500
501If you are enabling `swift3` in `ENABLED_SERVICES` DevStack will
502install the swift3 middleware emulation. Swift will be configured to
503act as a S3 endpoint for Keystone so effectively replacing the
504`nova-objectstore`.
505
506Only Swift proxy server is launched in the screen session all other
507services are started in background and managed by `swift-init` tool.
508
509Heat
510~~~~
511
512Heat is disabled by default (see `stackrc` file). To enable it
513explicitly you'll need the following settings in your `localrc`
514section
515
516::
517
518 enable_service heat h-api h-api-cfn h-api-cw h-eng
519
520Heat can also run in standalone mode, and be configured to orchestrate
521on an external OpenStack cloud. To launch only Heat in standalone mode
522you'll need the following settings in your `localrc` section
523
524::
525
526 disable_all_services
527 enable_service rabbit mysql heat h-api h-api-cfn h-api-cw h-eng
528 HEAT_STANDALONE=True
529 KEYSTONE_SERVICE_HOST=...
530 KEYSTONE_AUTH_HOST=...
531
532Tempest
533~~~~~~~
534
535If tempest has been successfully configured, a basic set of smoke
536tests can be run as follows:
537
538::
539
540 $ cd /opt/stack/tempest
541 $ tox -efull tempest.scenario.test_network_basic_ops
542
543By default tempest is downloaded and the config file is generated, but the
544tempest package is not installed in the system's global site-packages (the
545package install includes installing dependences). So tempest won't run
546outside of tox. If you would like to install it add the following to your
547``localrc`` section:
548
549::
550
551 INSTALL_TEMPEST=True
552
553
554Xenserver
555~~~~~~~~~
556
557If you would like to use Xenserver as the hypervisor, please refer to
558the instructions in `./tools/xen/README.md`.
559
560Cells
561~~~~~
562
563`Cells <http://wiki.openstack.org/blueprint-nova-compute-cells>`__ is
564an alternative scaling option. To setup a cells environment add the
565following to your `localrc` section:
566
567::
568
569 enable_service n-cell
570
571Be aware that there are some features currently missing in cells, one
572notable one being security groups. The exercises have been patched to
573disable functionality not supported by cells.
574
575Cinder
576~~~~~~
577
578The logical volume group used to hold the Cinder-managed volumes is
579set by ``VOLUME_GROUP``, the logical volume name prefix is set with
580``VOLUME_NAME_PREFIX`` and the size of the volume backing file is set
581with ``VOLUME_BACKING_FILE_SIZE``.
582
583 ::
584
585 VOLUME_GROUP="stack-volumes"
586 VOLUME_NAME_PREFIX="volume-"
587 VOLUME_BACKING_FILE_SIZE=10250M
588
589
590Keystone
591~~~~~~~~
592
593Multi-Region Setup
594++++++++++++++++++
595
596We want to setup two devstack (RegionOne and RegionTwo) with shared
597keystone (same users and services) and horizon. Keystone and Horizon
598will be located in RegionOne. Full spec is available at:
599`<https://wiki.openstack.org/wiki/Heat/Blueprints/Multi_Region_Support_for_Heat>`__.
600
601In RegionOne:
602
603::
604
605 REGION_NAME=RegionOne
606
607In RegionTwo:
608
609::
610
611 disable_service horizon
612 KEYSTONE_SERVICE_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
613 KEYSTONE_AUTH_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
614 REGION_NAME=RegionTwo