blob: 098e994ccdabfa1ba1902dad45969c5e06c3b3e7 [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
dieterly7c7679e2015-09-18 15:10:48 -060021(``|``). Note that there are no spaces between the double brackets and the
22internal fields. Likewise, there are no spaces between the pipe and the
23internal fields:
Sean M. Collins09e550c2014-10-21 11:40:08 -040024::
25
dieterly7c7679e2015-09-18 15:10:48 -060026 '[[' <phase> '|' <config-file-name> ']]'
Sean M. Collins09e550c2014-10-21 11:40:08 -040027
28where ``<phase>`` is one of a set of phase names defined by ``stack.sh``
29and ``<config-file-name>`` is the configuration filename. The filename
30is eval'ed in the ``stack.sh`` context so all environment variables are
31available and may be used. Using the project config file variables in
32the header is strongly suggested (see the ``NOVA_CONF`` example below).
33If the path of the config file does not exist it is skipped.
34
35The defined phases are:
36
37- **local** - extracts ``localrc`` from ``local.conf`` before
38 ``stackrc`` is sourced
Sean M. Collins09e550c2014-10-21 11:40:08 -040039- **post-config** - runs after the layer 2 services are configured and
40 before they are started
41- **extra** - runs after services are started and before any files in
42 ``extra.d`` are executed
YAMAMOTO Takashi961643e2015-07-31 13:45:27 +090043- **post-extra** - runs after files in ``extra.d`` are executed
Matt Riedemann18abffb2018-03-14 20:09:14 -040044- **test-config** - runs after tempest (and plugins) are configured
Sean M. Collins09e550c2014-10-21 11:40:08 -040045
46The file is processed strictly in sequence; meta-sections may be
47specified more than once but if any settings are duplicated the last to
48appear in the file will be used.
49
50::
51
52 [[post-config|$NOVA_CONF]]
53 [DEFAULT]
54 use_syslog = True
55
56 [osapi_v3]
57 enabled = False
58
59A specific meta-section ``local|localrc`` is used to provide a default
60``localrc`` file (actually ``.localrc.auto``). This allows all custom
61settings for DevStack to be contained in a single file. If ``localrc``
Ian Wienand7cd16ce2016-04-08 09:40:56 +100062exists it will be used instead to preserve backward-compatibility.
Sean M. Collins09e550c2014-10-21 11:40:08 -040063
64::
65
66 [[local|localrc]]
Kevin Benton4bfbc292016-11-15 17:26:05 -080067 IPV4_ADDRS_SAFE_TO_USE=10.254.1.0/24
Sean M. Collins09e550c2014-10-21 11:40:08 -040068 ADMIN_PASSWORD=speciale
69 LOGFILE=$DEST/logs/stack.sh.log
70
71Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to
72*NOT* start with a ``/`` (slash) character. A slash will need to be
73added:
74
75::
76
77 [[post-config|/$Q_PLUGIN_CONF_FILE]]
78
79Also note that the ``localrc`` section is sourced as a shell script
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +020080fragment and MUST conform to the shell requirements, specifically no
Sean M. Collins09e550c2014-10-21 11:40:08 -040081whitespace around ``=`` (equals).
82
Ian Wienand7cd16ce2016-04-08 09:40:56 +100083openrc
84======
85
86``openrc`` configures login credentials suitable for use with the
87OpenStack command-line tools. ``openrc`` sources ``stackrc`` at the
88beginning (which in turn sources the ``localrc`` section of
89``local.conf``) in order to pick up ``HOST_IP`` and/or ``SERVICE_HOST``
90to use in the endpoints. The values shown below are the default values.
91
92OS\_PROJECT\_NAME (OS\_TENANT\_NAME)
93 Keystone has
94 standardized the term *project* as the entity that owns resources. In
95 some places references still exist to the previous term
96 *tenant* for this use. Also, *project\_name* is preferred to
97 *project\_id*. OS\_TENANT\_NAME remains supported for compatibility
98 with older tools.
99
100 ::
101
102 OS_PROJECT_NAME=demo
103
104OS\_USERNAME
105 In addition to the owning entity (project), OpenStack calls the entity
106 performing the action *user*.
107
108 ::
109
110 OS_USERNAME=demo
111
112OS\_PASSWORD
113 Keystone's default authentication requires a password be provided.
114 The usual cautions about putting passwords in environment variables
115 apply, for most DevStack uses this may be an acceptable tradeoff.
116
117 ::
118
119 OS_PASSWORD=secret
120
121HOST\_IP, SERVICE\_HOST
122 Set API endpoint host using ``HOST_IP``. ``SERVICE_HOST`` may also
123 be used to specify the endpoint, which is convenient for some
124 ``local.conf`` configurations. Typically, ``HOST_IP`` is set in the
125 ``localrc`` section.
126
127 ::
128
129 HOST_IP=127.0.0.1
130 SERVICE_HOST=$HOST_IP
131
132OS\_AUTH\_URL
133 Authenticating against an OpenStack cloud using Keystone returns a
134 *Token* and *Service Catalog*. The catalog contains the endpoints
135 for all services the user/tenant has access to - including Nova,
136 Glance, Keystone and Swift.
137
138 ::
139
Le Houc09eaf82017-08-28 17:25:38 +0800140 OS_AUTH_URL=http://$SERVICE_HOST:5000/v3.0
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000141
142KEYSTONECLIENT\_DEBUG, NOVACLIENT\_DEBUG
143 Set command-line client log level to ``DEBUG``. These are commented
144 out by default.
145
146 ::
147
148 # export KEYSTONECLIENT_DEBUG=1
149 # export NOVACLIENT_DEBUG=1
150
151
152
James Polley5f2eb6d2015-03-30 17:36:26 +1100153.. _minimal-configuration:
154
Sean M. Collins09e550c2014-10-21 11:40:08 -0400155Minimal Configuration
Sean Dague07d7e5b2014-11-17 07:10:14 -0500156=====================
Sean M. Collins09e550c2014-10-21 11:40:08 -0400157
158While ``stack.sh`` is happy to run without a ``localrc`` section in
159``local.conf``, devlife is better when there are a few minimal variables
160set. This is an example of a minimal configuration that touches the
161values that most often need to be set.
162
163- no logging
164- pre-set the passwords to prevent interactive prompts
Kevin Benton4bfbc292016-11-15 17:26:05 -0800165- move network ranges away from the local network (``IPV4_ADDRS_SAFE_TO_USE``
166 and ``FLOATING_RANGE``, commented out below)
Sean M. Collins09e550c2014-10-21 11:40:08 -0400167- set the host IP if detection is unreliable (``HOST_IP``, commented
168 out below)
169
170::
171
172 [[local|localrc]]
Balagopal7ed812c2016-03-01 04:43:31 +0000173 ADMIN_PASSWORD=secret
Sean M. Collins09e550c2014-10-21 11:40:08 -0400174 DATABASE_PASSWORD=$ADMIN_PASSWORD
175 RABBIT_PASSWORD=$ADMIN_PASSWORD
176 SERVICE_PASSWORD=$ADMIN_PASSWORD
Kevin Benton4bfbc292016-11-15 17:26:05 -0800177 #IPV4_ADDRS_SAFE_TO_USE=172.31.1.0/24
Sean M. Collins09e550c2014-10-21 11:40:08 -0400178 #FLOATING_RANGE=192.168.20.0/25
179 #HOST_IP=10.3.4.5
180
181If the ``*_PASSWORD`` variables are not set here you will be prompted to
182enter values for them by ``stack.sh``.
183
184The network ranges must not overlap with any networks in use on the
185host. Overlap is not uncommon as RFC-1918 'private' ranges are commonly
186used for both the local networking and Nova's fixed and floating ranges.
187
188``HOST_IP`` is normally detected on the first run of ``stack.sh`` but
189often is indeterminate on later runs due to the IP being moved from an
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +0200190Ethernet interface to a bridge on the host. Setting it here also makes it
Sean M. Collins09e550c2014-10-21 11:40:08 -0400191available for ``openrc`` to set ``OS_AUTH_URL``. ``HOST_IP`` is not set
192by default.
193
Brian Haley180f5eb2015-06-16 13:14:31 -0400194``HOST_IPV6`` is normally detected on the first run of ``stack.sh`` but
195will not be set if there is no IPv6 address on the default Ethernet interface.
196Setting it here also makes it available for ``openrc`` to set ``OS_AUTH_URL``.
197``HOST_IPV6`` is not set by default.
198
Markus Zoeller14728c72017-05-29 15:39:21 +0200199For architecture specific configurations which differ from the x86 default
200here, see `arch-configuration`_.
201
Ian Wienanda35391e2015-08-10 13:53:40 +1000202Historical Notes
203================
Ian Wienand7d5be292015-08-10 13:39:17 +1000204
Ian Wienanda35391e2015-08-10 13:53:40 +1000205Historically DevStack obtained all local configuration and
206customizations from a ``localrc`` file. In Oct 2013 the
207``local.conf`` configuration method was introduced (in `review 46768
208<https://review.openstack.org/#/c/46768/>`__) to simplify this
209process.
Ian Wienand7d5be292015-08-10 13:39:17 +1000210
Ian Wienand815db162015-08-06 10:25:45 +1000211Configuration Notes
212===================
213
214.. contents::
215 :local:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400216
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000217Service Repos
218-------------
219
220The Git repositories used to check out the source for each service are
221controlled by a pair of variables set for each service. ``*_REPO``
222points to the repository and ``*_BRANCH`` selects which branch to
223check out. These may be overridden in ``local.conf`` to pull source
224from a different repo for testing, such as a Gerrit branch
225proposal. ``GIT_BASE`` points to the primary repository server.
226
Sean McGinnisf7302e12019-06-19 11:49:40 -0500227::
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000228
Sean McGinnisf7302e12019-06-19 11:49:40 -0500229 NOVA_REPO=$GIT_BASE/openstack/nova.git
230 NOVA_BRANCH=master
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000231
232To pull a branch directly from Gerrit, get the repo and branch from
Sean McGinnisf7302e12019-06-19 11:49:40 -0500233the Gerrit review page::
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000234
Sean McGinnisf7302e12019-06-19 11:49:40 -0500235 git fetch https://review.openstack.org/p/openstack/nova \
236 refs/changes/50/5050/1 && git checkout FETCH_HEAD
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000237
Sean McGinnisf7302e12019-06-19 11:49:40 -0500238The repo is the stanza following ``fetch`` and the branch is the
239stanza following that::
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000240
Sean McGinnisf7302e12019-06-19 11:49:40 -0500241 NOVA_REPO=https://review.openstack.org/p/openstack/nova
242 NOVA_BRANCH=refs/changes/50/5050/1
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000243
244
Sean Dague07d7e5b2014-11-17 07:10:14 -0500245Installation Directory
246----------------------
247
Ian Wienand815db162015-08-06 10:25:45 +1000248The DevStack install directory is set by the ``DEST`` variable. By
249default it is ``/opt/stack``.
250
251By setting it early in the ``localrc`` section you can reference it in
252later variables. It can be useful to set it even though it is not
253changed from the default value.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400254
Sean McGinnisf7302e12019-06-19 11:49:40 -0500255::
Sean M. Collins09e550c2014-10-21 11:40:08 -0400256
Sean McGinnisf7302e12019-06-19 11:49:40 -0500257 DEST=/opt/stack
Sean M. Collins09e550c2014-10-21 11:40:08 -0400258
Ian Wienand815db162015-08-06 10:25:45 +1000259Logging
260-------
261
262Enable Logging
263~~~~~~~~~~~~~~
264
265By default ``stack.sh`` output is only written to the console where it
266runs. It can be sent to a file in addition to the console by setting
267``LOGFILE`` to the fully-qualified name of the destination log file. A
268timestamp will be appended to the given filename for each run of
269``stack.sh``.
270
Sean McGinnisf7302e12019-06-19 11:49:40 -0500271::
Ian Wienand815db162015-08-06 10:25:45 +1000272
Sean McGinnisf7302e12019-06-19 11:49:40 -0500273 LOGFILE=$DEST/logs/stack.sh.log
Ian Wienand815db162015-08-06 10:25:45 +1000274
275Old log files are cleaned automatically if ``LOGDAYS`` is set to the
276number of days of old log files to keep.
277
Sean McGinnisf7302e12019-06-19 11:49:40 -0500278::
Ian Wienand815db162015-08-06 10:25:45 +1000279
Sean McGinnisf7302e12019-06-19 11:49:40 -0500280 LOGDAYS=1
Ian Wienand815db162015-08-06 10:25:45 +1000281
Sean Dague8b8441f2017-05-02 06:14:11 -0400282Some coloring is used during the DevStack runs to make it easier to
283see what is going on. This can be disabled with::
Ian Wienand815db162015-08-06 10:25:45 +1000284
Sean McGinnisf7302e12019-06-19 11:49:40 -0500285 LOG_COLOR=False
Ian Wienand815db162015-08-06 10:25:45 +1000286
Ian Wienand83ecb972018-02-06 10:03:34 +1100287When using the logfile, by default logs are sent to the console and
288the file. You can set ``VERBOSE`` to ``false`` if you only wish the
289logs to be sent to the file (this may avoid having double-logging in
290some cases where you are capturing the script output and the log
291files). If ``VERBOSE`` is ``true`` you can additionally set
292``VERBOSE_NO_TIMESTAMP`` to avoid timestamps being added to each
293output line sent to the console. This can be useful in some
294situations where the console output is being captured by a runner or
295framework (e.g. Ansible) that adds its own timestamps. Note that the
296log lines sent to the ``LOGFILE`` will still be prefixed with a
297timestamp.
298
Ian Wienand815db162015-08-06 10:25:45 +1000299Logging the Service Output
300~~~~~~~~~~~~~~~~~~~~~~~~~~
301
Sean Dague8b8441f2017-05-02 06:14:11 -0400302By default, services run under ``systemd`` and are natively logging to
303the systemd journal.
Ian Wienand815db162015-08-06 10:25:45 +1000304
Sean Dague8b8441f2017-05-02 06:14:11 -0400305To query the logs use the ``journalctl`` command, such as::
Ian Wienand815db162015-08-06 10:25:45 +1000306
caowei32eccca2017-11-01 11:45:21 +0800307 sudo journalctl --unit devstack@*
Ian Wienand815db162015-08-06 10:25:45 +1000308
Sean Dague8b8441f2017-05-02 06:14:11 -0400309More examples can be found in :ref:`journalctl-examples`.
Ian Wienand7d5be292015-08-10 13:39:17 +1000310
Ian Wienanda35391e2015-08-10 13:53:40 +1000311Example Logging Configuration
312~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
313
314For example, non-interactive installs probably wish to save output to
315a file, keep service logs and disable color in the stored files.
316
Sean McGinnisf7302e12019-06-19 11:49:40 -0500317::
Ian Wienanda35391e2015-08-10 13:53:40 +1000318
Sean McGinnisf7302e12019-06-19 11:49:40 -0500319 [[local|localrc]]
320 DEST=/opt/stack/
321 LOGFILE=$LOGDIR/stack.sh.log
322 LOG_COLOR=False
Ian Wienanda35391e2015-08-10 13:53:40 +1000323
Ian Wienand7d5be292015-08-10 13:39:17 +1000324Database Backend
325----------------
326
327Multiple database backends are available. The available databases are defined
328in the lib/databases directory.
Markus Zoellerc30657d2015-11-02 11:27:46 +0100329``mysql`` is the default database, choose a different one by putting the
Sean McGinnisf7302e12019-06-19 11:49:40 -0500330following in the ``localrc`` section::
Ian Wienand7d5be292015-08-10 13:39:17 +1000331
Sean McGinnisf7302e12019-06-19 11:49:40 -0500332 disable_service mysql
333 enable_service postgresql
Ian Wienand7d5be292015-08-10 13:39:17 +1000334
Markus Zoellerc30657d2015-11-02 11:27:46 +0100335``mysql`` is the default database.
Ian Wienand7d5be292015-08-10 13:39:17 +1000336
337RPC Backend
338-----------
339
340Support for a RabbitMQ RPC backend is included. Additional RPC
341backends may be available via external plugins. Enabling or disabling
342RabbitMQ is handled via the usual service functions and
343``ENABLED_SERVICES``.
344
Sean McGinnisf7302e12019-06-19 11:49:40 -0500345Example disabling RabbitMQ in ``local.conf``::
Ian Wienand7d5be292015-08-10 13:39:17 +1000346
Sean McGinnisf7302e12019-06-19 11:49:40 -0500347 disable_service rabbit
Ian Wienand7d5be292015-08-10 13:39:17 +1000348
349
350Apache Frontend
351---------------
352
353The Apache web server can be enabled for wsgi services that support
354being deployed under HTTPD + mod_wsgi. By default, services that
355recommend running under HTTPD + mod_wsgi are deployed under Apache. To
356use an alternative deployment strategy (e.g. eventlet) for services
357that support an alternative to HTTPD + mod_wsgi set
358``ENABLE_HTTPD_MOD_WSGI_SERVICES`` to ``False`` in your
359``local.conf``.
360
361Each service that can be run under HTTPD + mod_wsgi also has an
362override toggle available that can be set in your ``local.conf``.
363
364Keystone is run under Apache with ``mod_wsgi`` by default.
365
Sean McGinnisf7302e12019-06-19 11:49:40 -0500366Example (Keystone)::
Ian Wienand7d5be292015-08-10 13:39:17 +1000367
368 KEYSTONE_USE_MOD_WSGI="True"
369
Sean McGinnisf7302e12019-06-19 11:49:40 -0500370Example (Nova)::
Ian Wienand7d5be292015-08-10 13:39:17 +1000371
372 NOVA_USE_MOD_WSGI="True"
373
Sean McGinnisf7302e12019-06-19 11:49:40 -0500374Example (Swift)::
Ian Wienand7d5be292015-08-10 13:39:17 +1000375
376 SWIFT_USE_MOD_WSGI="True"
377
Sean McGinnisf7302e12019-06-19 11:49:40 -0500378Example (Heat)::
Oleksii Chuprykova6928102015-06-11 08:56:58 -0400379
380 HEAT_USE_MOD_WSGI="True"
381
Sean McGinnisf7302e12019-06-19 11:49:40 -0500382Example (Cinder)::
Anton Arefiev651cb1a2015-09-01 10:55:20 +0300383
384 CINDER_USE_MOD_WSGI="True"
385
Ian Wienand7d5be292015-08-10 13:39:17 +1000386
Sean Dague07d7e5b2014-11-17 07:10:14 -0500387Libraries from Git
388------------------
389
Ian Wienand815db162015-08-06 10:25:45 +1000390By default devstack installs OpenStack server components from git,
391however it installs client libraries from released versions on pypi.
392This is appropriate if you are working on server development, but if
393you want to see how an unreleased version of the client affects the
394system you can have devstack install it from upstream, or from local
395git trees by specifying it in ``LIBS_FROM_GIT``. Multiple libraries
396can be specified as a comma separated list.
Sean Dague07d7e5b2014-11-17 07:10:14 -0500397
Sean McGinnisf7302e12019-06-19 11:49:40 -0500398::
Sean Dague07d7e5b2014-11-17 07:10:14 -0500399
Sean McGinnisf7302e12019-06-19 11:49:40 -0500400 LIBS_FROM_GIT=python-keystoneclient,oslo.config
Sean Dague07d7e5b2014-11-17 07:10:14 -0500401
Marc Koderer46f8cb72016-05-13 09:08:16 +0200402Setting the variable to ``ALL`` will activate the download for all
403libraries.
404
Dean Troyer5686dbc2015-03-09 14:27:51 -0500405Virtual Environments
406--------------------
407
Ian Wienand815db162015-08-06 10:25:45 +1000408Enable the use of Python virtual environments by setting ``USE_VENV``
409to ``True``. This will enable the creation of venvs for each project
410that is defined in the ``PROJECT_VENV`` array.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500411
Ian Wienand815db162015-08-06 10:25:45 +1000412Each entry in the ``PROJECT_VENV`` array contains the directory name
413of a venv to be used for the project. The array index is the project
414name. Multiple projects can use the same venv if desired.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500415
Sean McGinnisf7302e12019-06-19 11:49:40 -0500416::
Dean Troyer5686dbc2015-03-09 14:27:51 -0500417
Sean McGinnisf7302e12019-06-19 11:49:40 -0500418 PROJECT_VENV["glance"]=${GLANCE_DIR}.venv
Dean Troyer5686dbc2015-03-09 14:27:51 -0500419
Ian Wienand815db162015-08-06 10:25:45 +1000420``ADDITIONAL_VENV_PACKAGES`` is a comma-separated list of additional
421packages to be installed into each venv. Often projects will not have
422certain packages listed in its ``requirements.txt`` file because they
423are 'optional' requirements, i.e. only needed for certain
424configurations. By default, the enabled databases will have their
425Python bindings added when they are enabled.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500426
Sean McGinnisf7302e12019-06-19 11:49:40 -0500427::
Sean Dague07d7e5b2014-11-17 07:10:14 -0500428
Sean McGinnisf7302e12019-06-19 11:49:40 -0500429 ADDITIONAL_VENV_PACKAGES="python-foo, python-bar"
Sean M. Collins09e550c2014-10-21 11:40:08 -0400430
Lajos Katonadae10412018-09-21 10:51:47 +0200431Use python3
432------------
433
434By default ``stack.sh`` uses python2 (the exact version set by the
435``PYTHON2_VERSION``). This can be overriden so devstack will run
436python3 (the exact version set by ``PYTHON3_VERSION``).
437
Sean McGinnisf7302e12019-06-19 11:49:40 -0500438::
Lajos Katonadae10412018-09-21 10:51:47 +0200439
Sean McGinnisf7302e12019-06-19 11:49:40 -0500440 USE_PYTHON3=True
Sean M. Collins09e550c2014-10-21 11:40:08 -0400441
442A clean install every time
Sean Dague07d7e5b2014-11-17 07:10:14 -0500443--------------------------
444
Ian Wienand815db162015-08-06 10:25:45 +1000445By default ``stack.sh`` only clones the project repos if they do not
446exist in ``$DEST``. ``stack.sh`` will freshen each repo on each run if
447``RECLONE`` is set to ``yes``. This avoids having to manually remove
448repos in order to get the current branch from ``$GIT_BASE``.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400449
Sean McGinnisf7302e12019-06-19 11:49:40 -0500450::
Sean M. Collins09e550c2014-10-21 11:40:08 -0400451
Sean McGinnisf7302e12019-06-19 11:49:40 -0500452 RECLONE=yes
Sean M. Collins09e550c2014-10-21 11:40:08 -0400453
Chris Dentebdd9ac2015-03-04 12:35:14 +0000454Upgrade packages installed by pip
455---------------------------------
456
Ian Wienand815db162015-08-06 10:25:45 +1000457By default ``stack.sh`` only installs Python packages if no version is
458currently installed or the current version does not match a specified
459requirement. If ``PIP_UPGRADE`` is set to ``True`` then existing
460required Python packages will be upgraded to the most recent version
461that matches requirements.
Chris Dentebdd9ac2015-03-04 12:35:14 +0000462
Sean McGinnisf7302e12019-06-19 11:49:40 -0500463::
Chris Dentebdd9ac2015-03-04 12:35:14 +0000464
Sean McGinnisf7302e12019-06-19 11:49:40 -0500465 PIP_UPGRADE=True
Chris Dentebdd9ac2015-03-04 12:35:14 +0000466
John Huaa4693b52015-08-06 13:53:35 +0100467Guest Images
468------------
469
470Images provided in URLS via the comma-separated ``IMAGE_URLS``
471variable will be downloaded and uploaded to glance by DevStack.
472
473Default guest-images are predefined for each type of hypervisor and
474their testing-requirements in ``stack.sh``. Setting
475``DOWNLOAD_DEFAULT_IMAGES=False`` will prevent DevStack downloading
476these default images; in that case, you will want to populate
477``IMAGE_URLS`` with sufficient images to satisfy testing-requirements.
478
Sean McGinnisf7302e12019-06-19 11:49:40 -0500479::
John Huaa4693b52015-08-06 13:53:35 +0100480
Sean McGinnisf7302e12019-06-19 11:49:40 -0500481 DOWNLOAD_DEFAULT_IMAGES=False
482 IMAGE_URLS="http://foo.bar.com/image.qcow,"
483 IMAGE_URLS+="http://foo.bar.com/image2.qcow"
John Huaa4693b52015-08-06 13:53:35 +0100484
Rafael Folcof0131e12015-09-23 12:55:02 -0500485
486Instance Type
487-------------
488
489``DEFAULT_INSTANCE_TYPE`` can be used to configure the default instance
490type. When this parameter is not specified, Devstack creates additional
491micro & nano flavors for really small instances to run Tempest tests.
492
493For guests with larger memory requirements, ``DEFAULT_INSTANCE_TYPE``
494should be specified in the configuration file so Tempest selects the
495default flavors instead.
496
497KVM on Power with QEMU 2.4 requires 512 MB to load the firmware -
498`QEMU 2.4 - PowerPC <http://wiki.qemu.org/ChangeLog/2.4>`__ so users
499running instances on ppc64/ppc64le can choose one of the default
500created flavors as follows:
501
Sean McGinnisf7302e12019-06-19 11:49:40 -0500502::
Rafael Folcof0131e12015-09-23 12:55:02 -0500503
Sean McGinnisf7302e12019-06-19 11:49:40 -0500504 DEFAULT_INSTANCE_TYPE=m1.tiny
Rafael Folcof0131e12015-09-23 12:55:02 -0500505
506
John Davidge21529a52014-06-30 09:55:11 -0400507IP Version
Brian Haley180f5eb2015-06-16 13:14:31 -0400508----------
509
Clay Gerrard148d0e62016-09-01 02:38:06 -0700510``IP_VERSION`` can be used to configure Neutron to create either an
511IPv4, IPv6, or dual-stack self-service project data-network by with
Sean Daguedb48db12016-04-06 08:09:31 -0400512either ``IP_VERSION=4``, ``IP_VERSION=6``, or ``IP_VERSION=4+6``
Clay Gerrard148d0e62016-09-01 02:38:06 -0700513respectively.
John Davidge21529a52014-06-30 09:55:11 -0400514
Sean McGinnisf7302e12019-06-19 11:49:40 -0500515::
John Davidge21529a52014-06-30 09:55:11 -0400516
Sean McGinnisf7302e12019-06-19 11:49:40 -0500517 IP_VERSION=4+6
John Davidge21529a52014-06-30 09:55:11 -0400518
Ian Wienand815db162015-08-06 10:25:45 +1000519The following optional variables can be used to alter the default IPv6
520behavior:
John Davidge21529a52014-06-30 09:55:11 -0400521
Sean McGinnisf7302e12019-06-19 11:49:40 -0500522::
John Davidge21529a52014-06-30 09:55:11 -0400523
Sean McGinnisf7302e12019-06-19 11:49:40 -0500524 IPV6_RA_MODE=slaac
525 IPV6_ADDRESS_MODE=slaac
526 IPV6_ADDRS_SAFE_TO_USE=fd$IPV6_GLOBAL_ID::/56
527 IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1
John Davidge21529a52014-06-30 09:55:11 -0400528
Kevin Benton4bfbc292016-11-15 17:26:05 -0800529*Note*: ``IPV6_ADDRS_SAFE_TO_USE`` and ``IPV6_PRIVATE_NETWORK_GATEWAY``
530can be configured with any valid IPv6 prefix. The default values make
531use of an auto-generated ``IPV6_GLOBAL_ID`` to comply with RFC4193.
Brian Haley180f5eb2015-06-16 13:14:31 -0400532
Ian Wienand815db162015-08-06 10:25:45 +1000533Service Version
534~~~~~~~~~~~~~~~
535
536DevStack can enable service operation over either IPv4 or IPv6 by
537setting ``SERVICE_IP_VERSION`` to either ``SERVICE_IP_VERSION=4`` or
538``SERVICE_IP_VERSION=6`` respectively.
539
540When set to ``4`` devstack services will open listen sockets on
541``0.0.0.0`` and service endpoints will be registered using ``HOST_IP``
542as the address.
543
544When set to ``6`` devstack services will open listen sockets on ``::``
545and service endpoints will be registered using ``HOST_IPV6`` as the
546address.
547
548The default value for this setting is ``4``. Dual-mode support, for
549example ``4+6`` is not currently supported. ``HOST_IPV6`` can
Sean McGinnisf7302e12019-06-19 11:49:40 -0500550optionally be used to alter the default IPv6 address::
Brian Haley180f5eb2015-06-16 13:14:31 -0400551
Sean McGinnisf7302e12019-06-19 11:49:40 -0500552 HOST_IPV6=${some_local_ipv6_address}
John Davidge21529a52014-06-30 09:55:11 -0400553
Ian Wienand7d5be292015-08-10 13:39:17 +1000554Multi-node setup
555~~~~~~~~~~~~~~~~
Sean M. Collins09e550c2014-10-21 11:40:08 -0400556
Ian Wienand7d5be292015-08-10 13:39:17 +1000557See the :doc:`multi-node lab guide<guides/multinode-lab>`
Sean M. Collins09e550c2014-10-21 11:40:08 -0400558
Ian Wienand7d5be292015-08-10 13:39:17 +1000559Projects
560--------
Sean M. Collins09e550c2014-10-21 11:40:08 -0400561
Ian Wienand7d5be292015-08-10 13:39:17 +1000562Neutron
563~~~~~~~
Sean M. Collins09e550c2014-10-21 11:40:08 -0400564
Ian Wienand7d5be292015-08-10 13:39:17 +1000565See the :doc:`neutron configuration guide<guides/neutron>` for
566details on configuration of Neutron
Sean M. Collins09e550c2014-10-21 11:40:08 -0400567
Sean M. Collins09e550c2014-10-21 11:40:08 -0400568
Ian Wienand7d5be292015-08-10 13:39:17 +1000569Swift
570~~~~~
571
572Swift is disabled by default. When enabled, it is configured with
573only one replica to avoid being IO/memory intensive on a small
Sean Dague8b8441f2017-05-02 06:14:11 -0400574VM.
Ian Wienand7d5be292015-08-10 13:39:17 +1000575
Markus Zoellerc30657d2015-11-02 11:27:46 +0100576If you would like to enable Swift you can add this to your ``localrc``
Ian Wienand7d5be292015-08-10 13:39:17 +1000577section:
578
579::
580
581 enable_service s-proxy s-object s-container s-account
582
583If you want a minimal Swift install with only Swift and Keystone you
Markus Zoellerc30657d2015-11-02 11:27:46 +0100584can have this instead in your ``localrc`` section:
Ian Wienand7d5be292015-08-10 13:39:17 +1000585
586::
587
588 disable_all_services
589 enable_service key mysql s-proxy s-object s-container s-account
590
591If you only want to do some testing of a real normal swift cluster
592with multiple replicas you can do so by customizing the variable
Markus Zoellerc30657d2015-11-02 11:27:46 +0100593``SWIFT_REPLICAS`` in your ``localrc`` section (usually to 3).
Ian Wienand7d5be292015-08-10 13:39:17 +1000594
Christian Schwede91d22452016-04-12 10:53:46 +0200595You can manually override the ring building to use specific storage
596nodes, for example when you want to test a multinode environment. In
597this case you have to set a space-separated list of IPs in
598``SWIFT_STORAGE_IPS`` in your ``localrc`` section that should be used
599as Swift storage nodes.
600Please note that this does not create a multinode setup, it is only
601used when adding nodes to the Swift rings.
602
603::
604
605 SWIFT_STORAGE_IPS="192.168.1.10 192.168.1.11 192.168.1.12"
606
Ian Wienand7d5be292015-08-10 13:39:17 +1000607Swift S3
608++++++++
609
Kota Tsuyuzaki070e4ee2018-09-13 03:08:19 +0900610If you are enabling ``s3api`` in ``ENABLED_SERVICES`` DevStack will
611install the s3api middleware emulation. Swift will be configured to
Ian Wienand7d5be292015-08-10 13:39:17 +1000612act as a S3 endpoint for Keystone so effectively replacing the
Markus Zoellerc30657d2015-11-02 11:27:46 +0100613``nova-objectstore``.
Ian Wienand7d5be292015-08-10 13:39:17 +1000614
Sean Dague8b8441f2017-05-02 06:14:11 -0400615Only Swift proxy server is launched in the systemd system all other
Markus Zoellerc30657d2015-11-02 11:27:46 +0100616services are started in background and managed by ``swift-init`` tool.
Ian Wienand7d5be292015-08-10 13:39:17 +1000617
Ian Wienand7d5be292015-08-10 13:39:17 +1000618Tempest
619~~~~~~~
620
621If tempest has been successfully configured, a basic set of smoke
622tests can be run as follows:
623
624::
625
626 $ cd /opt/stack/tempest
627 $ tox -efull tempest.scenario.test_network_basic_ops
628
629By default tempest is downloaded and the config file is generated, but the
630tempest package is not installed in the system's global site-packages (the
631package install includes installing dependences). So tempest won't run
632outside of tox. If you would like to install it add the following to your
633``localrc`` section:
634
635::
636
637 INSTALL_TEMPEST=True
638
639
640Xenserver
641~~~~~~~~~
642
643If you would like to use Xenserver as the hypervisor, please refer to
Markus Zoellerc30657d2015-11-02 11:27:46 +0100644the instructions in ``./tools/xen/README.md``.
Ian Wienand7d5be292015-08-10 13:39:17 +1000645
Ian Wienand7d5be292015-08-10 13:39:17 +1000646Cinder
647~~~~~~
648
649The logical volume group used to hold the Cinder-managed volumes is
Jordan Pittierf5069f32016-11-08 12:10:12 +0100650set by ``VOLUME_GROUP_NAME``, the logical volume name prefix is set with
Ian Wienand7d5be292015-08-10 13:39:17 +1000651``VOLUME_NAME_PREFIX`` and the size of the volume backing file is set
652with ``VOLUME_BACKING_FILE_SIZE``.
653
Sean McGinnisf7302e12019-06-19 11:49:40 -0500654::
Ian Wienand7d5be292015-08-10 13:39:17 +1000655
Sean McGinnisf7302e12019-06-19 11:49:40 -0500656 VOLUME_GROUP_NAME="stack-volumes"
657 VOLUME_NAME_PREFIX="volume-"
658 VOLUME_BACKING_FILE_SIZE=24G
Ian Wienand7d5be292015-08-10 13:39:17 +1000659
660
661Keystone
662~~~~~~~~
663
664Multi-Region Setup
665++++++++++++++++++
666
667We want to setup two devstack (RegionOne and RegionTwo) with shared
668keystone (same users and services) and horizon. Keystone and Horizon
669will be located in RegionOne. Full spec is available at:
670`<https://wiki.openstack.org/wiki/Heat/Blueprints/Multi_Region_Support_for_Heat>`__.
671
672In RegionOne:
673
674::
675
676 REGION_NAME=RegionOne
677
678In RegionTwo:
679
680::
henriquetrutaf2126222016-01-05 13:43:18 -0300681
Ian Wienand7d5be292015-08-10 13:39:17 +1000682 disable_service horizon
683 KEYSTONE_SERVICE_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
684 KEYSTONE_AUTH_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
685 REGION_NAME=RegionTwo
zhiyuan_cai6f1781f2016-04-07 18:36:46 +0800686 KEYSTONE_REGION_NAME=RegionOne
687
688In the devstack for RegionOne, we set REGION_NAME as RegionOne, so region of
689the services started in this devstack are registered as RegionOne. In devstack
690for RegionTwo, similarly, we set REGION_NAME as RegionTwo since we want
691services started in this devstack to be registered in RegionTwo. But Keystone
692service is started and registered in RegionOne, not RegionTwo, so we use
693KEYSTONE_REGION_NAME to specify the region of Keystone service.
694KEYSTONE_REGION_NAME has a default value the same as REGION_NAME thus we omit
695it in the configuration of RegionOne.
henriquetrutaf2126222016-01-05 13:43:18 -0300696
697Disabling Identity API v2
698+++++++++++++++++++++++++
699
700The Identity API v2 is deprecated as of Mitaka and it is recommended to only
701use the v3 API. It is possible to setup keystone without v2 API, by doing:
702
703::
704
705 ENABLE_IDENTITY_V2=False
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000706
Markus Zoeller14728c72017-05-29 15:39:21 +0200707.. _arch-configuration:
708
709Architectures
710-------------
711
712The upstream CI runs exclusively on nodes with x86 architectures, but
713OpenStack supports even more architectures. Some of them need to configure
714Devstack in a certain way.
715
716KVM on s390x (IBM z Systems)
717~~~~~~~~~~~~~~~~~~~~~~~~~~~~
718
719KVM on s390x (IBM z Systems) is supported since the *Kilo* release. For
720an all-in-one setup, these minimal settings in the ``local.conf`` file
721are needed::
722
723 [[local|localrc]]
724 ADMIN_PASSWORD=secret
725 DATABASE_PASSWORD=$ADMIN_PASSWORD
726 RABBIT_PASSWORD=$ADMIN_PASSWORD
727 SERVICE_PASSWORD=$ADMIN_PASSWORD
728
729 DOWNLOAD_DEFAULT_IMAGES=False
730 IMAGE_URLS="https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-s390x-disk1.img"
731
Andreas Scheuring941940a2017-09-13 00:24:02 +0200732 # Provide a custom etcd3 binary download URL and ints sha256.
733 # The binary must be located under '/<etcd version>/etcd-<etcd-version>-linux-s390x.tar.gz'
734 # on this URL.
735 # Build instructions for etcd3: https://github.com/linux-on-ibm-z/docs/wiki/Building-etcd
736 ETCD_DOWNLOAD_URL=<your-etcd-download-url>
737 ETCD_SHA256=<your-etcd3-sha256>
738
Markus Zoeller14728c72017-05-29 15:39:21 +0200739 enable_service n-sproxy
740 disable_service n-novnc
Markus Zoeller14728c72017-05-29 15:39:21 +0200741
742 [[post-config|$NOVA_CONF]]
743
744 [serial_console]
745 base_url=ws://$HOST_IP:6083/ # optional
746
747Reasoning:
748
749* The default image of Devstack is x86 only, so we deactivate the download
750 with ``DOWNLOAD_DEFAULT_IMAGES``. The referenced guest image
751 in the code above (``IMAGE_URLS``) serves as an example. The list of
752 possible s390x guest images is not limited to that.
753
754* This platform doesn't support a graphical console like VNC or SPICE.
755 The technical reason is the missing framebuffer on the platform. This
756 means we rely on the substitute feature *serial console* which needs the
757 proxy service ``n-sproxy``. We also disable VNC's proxy ``n-novnc`` for
758 that reason . The configuration in the ``post-config`` section is only
759 needed if you want to use the *serial console* outside of the all-in-one
760 setup.
761
Andreas Scheuring941940a2017-09-13 00:24:02 +0200762* A link to an etcd3 binary and its sha256 needs to be provided as the
763 binary for s390x is not hosted on github like it is for other
764 architectures. For more details see
765 https://bugs.launchpad.net/devstack/+bug/1693192. Etcd3 can easily be
766 built along https://github.com/linux-on-ibm-z/docs/wiki/Building-etcd.
Markus Zoeller14728c72017-05-29 15:39:21 +0200767
768.. note:: To run *Tempest* against this *Devstack* all-in-one, you'll need
769 to use a guest image which is smaller than 1GB when uncompressed.
770 The example image from above is bigger than that!