blob: 3cfba716ca9909e140b78b682f3d237ba8cc8435 [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
Abhishek Kekanef8dbfd32020-07-06 18:42:30 +0000140 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
Dr. Jens Harbott781fbf42022-10-11 15:41:02 +0200184.. warning:: Only use alphanumeric characters in your passwords, as some
185 services fail to work when using special characters.
186
Sean M. Collins09e550c2014-10-21 11:40:08 -0400187The network ranges must not overlap with any networks in use on the
188host. Overlap is not uncommon as RFC-1918 'private' ranges are commonly
189used for both the local networking and Nova's fixed and floating ranges.
190
191``HOST_IP`` is normally detected on the first run of ``stack.sh`` but
192often is indeterminate on later runs due to the IP being moved from an
Juan Antonio Osorio Roblesfe6dccb2014-11-28 13:12:14 +0200193Ethernet interface to a bridge on the host. Setting it here also makes it
Sean M. Collins09e550c2014-10-21 11:40:08 -0400194available for ``openrc`` to set ``OS_AUTH_URL``. ``HOST_IP`` is not set
195by default.
196
Brian Haley180f5eb2015-06-16 13:14:31 -0400197``HOST_IPV6`` is normally detected on the first run of ``stack.sh`` but
198will not be set if there is no IPv6 address on the default Ethernet interface.
199Setting it here also makes it available for ``openrc`` to set ``OS_AUTH_URL``.
200``HOST_IPV6`` is not set by default.
201
Markus Zoeller14728c72017-05-29 15:39:21 +0200202For architecture specific configurations which differ from the x86 default
203here, see `arch-configuration`_.
204
Ian Wienanda35391e2015-08-10 13:53:40 +1000205Historical Notes
206================
Ian Wienand7d5be292015-08-10 13:39:17 +1000207
Ian Wienanda35391e2015-08-10 13:53:40 +1000208Historically DevStack obtained all local configuration and
209customizations from a ``localrc`` file. In Oct 2013 the
210``local.conf`` configuration method was introduced (in `review 46768
Matt Riedemann9b6d2f22019-06-18 10:43:16 -0400211<https://review.opendev.org/#/c/46768/>`__) to simplify this
Ian Wienanda35391e2015-08-10 13:53:40 +1000212process.
Ian Wienand7d5be292015-08-10 13:39:17 +1000213
Ian Wienand815db162015-08-06 10:25:45 +1000214Configuration Notes
215===================
216
217.. contents::
218 :local:
Sean M. Collins09e550c2014-10-21 11:40:08 -0400219
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000220Service Repos
221-------------
222
223The Git repositories used to check out the source for each service are
224controlled by a pair of variables set for each service. ``*_REPO``
225points to the repository and ``*_BRANCH`` selects which branch to
226check out. These may be overridden in ``local.conf`` to pull source
227from a different repo for testing, such as a Gerrit branch
228proposal. ``GIT_BASE`` points to the primary repository server.
229
Sean McGinnisf7302e12019-06-19 11:49:40 -0500230::
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000231
Sean McGinnisf7302e12019-06-19 11:49:40 -0500232 NOVA_REPO=$GIT_BASE/openstack/nova.git
233 NOVA_BRANCH=master
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000234
235To pull a branch directly from Gerrit, get the repo and branch from
Sean McGinnisf7302e12019-06-19 11:49:40 -0500236the Gerrit review page::
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000237
Matt Riedemann9b6d2f22019-06-18 10:43:16 -0400238 git fetch https://review.opendev.org/openstack/nova \
Sean McGinnisf7302e12019-06-19 11:49:40 -0500239 refs/changes/50/5050/1 && git checkout FETCH_HEAD
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000240
Sean McGinnisf7302e12019-06-19 11:49:40 -0500241The repo is the stanza following ``fetch`` and the branch is the
242stanza following that::
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000243
Matt Riedemann9b6d2f22019-06-18 10:43:16 -0400244 NOVA_REPO=https://review.opendev.org/openstack/nova
Sean McGinnisf7302e12019-06-19 11:49:40 -0500245 NOVA_BRANCH=refs/changes/50/5050/1
Ian Wienand7cd16ce2016-04-08 09:40:56 +1000246
247
Sean Dague07d7e5b2014-11-17 07:10:14 -0500248Installation Directory
249----------------------
250
Ian Wienand815db162015-08-06 10:25:45 +1000251The DevStack install directory is set by the ``DEST`` variable. By
252default it is ``/opt/stack``.
253
254By setting it early in the ``localrc`` section you can reference it in
255later variables. It can be useful to set it even though it is not
256changed from the default value.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400257
Sean McGinnisf7302e12019-06-19 11:49:40 -0500258::
Sean M. Collins09e550c2014-10-21 11:40:08 -0400259
Sean McGinnisf7302e12019-06-19 11:49:40 -0500260 DEST=/opt/stack
Sean M. Collins09e550c2014-10-21 11:40:08 -0400261
Ian Wienand815db162015-08-06 10:25:45 +1000262Logging
263-------
264
Andreas Jaeger8dd89e52019-08-11 16:00:12 +0200265.. _enable_logging:
266
Ian Wienand815db162015-08-06 10:25:45 +1000267Enable Logging
268~~~~~~~~~~~~~~
269
270By default ``stack.sh`` output is only written to the console where it
271runs. It can be sent to a file in addition to the console by setting
272``LOGFILE`` to the fully-qualified name of the destination log file. A
273timestamp will be appended to the given filename for each run of
274``stack.sh``.
275
Sean McGinnisf7302e12019-06-19 11:49:40 -0500276::
Ian Wienand815db162015-08-06 10:25:45 +1000277
Sean McGinnisf7302e12019-06-19 11:49:40 -0500278 LOGFILE=$DEST/logs/stack.sh.log
Ian Wienand815db162015-08-06 10:25:45 +1000279
280Old log files are cleaned automatically if ``LOGDAYS`` is set to the
281number of days of old log files to keep.
282
Sean McGinnisf7302e12019-06-19 11:49:40 -0500283::
Ian Wienand815db162015-08-06 10:25:45 +1000284
Zhou Yanbing44234502022-04-21 15:00:41 +0800285 LOGDAYS=2
Ian Wienand815db162015-08-06 10:25:45 +1000286
Sean Dague8b8441f2017-05-02 06:14:11 -0400287Some coloring is used during the DevStack runs to make it easier to
288see what is going on. This can be disabled with::
Ian Wienand815db162015-08-06 10:25:45 +1000289
Sean McGinnisf7302e12019-06-19 11:49:40 -0500290 LOG_COLOR=False
Ian Wienand815db162015-08-06 10:25:45 +1000291
Ian Wienand83ecb972018-02-06 10:03:34 +1100292When using the logfile, by default logs are sent to the console and
293the file. You can set ``VERBOSE`` to ``false`` if you only wish the
294logs to be sent to the file (this may avoid having double-logging in
295some cases where you are capturing the script output and the log
296files). If ``VERBOSE`` is ``true`` you can additionally set
297``VERBOSE_NO_TIMESTAMP`` to avoid timestamps being added to each
298output line sent to the console. This can be useful in some
299situations where the console output is being captured by a runner or
300framework (e.g. Ansible) that adds its own timestamps. Note that the
301log lines sent to the ``LOGFILE`` will still be prefixed with a
302timestamp.
303
Ian Wienand815db162015-08-06 10:25:45 +1000304Logging the Service Output
305~~~~~~~~~~~~~~~~~~~~~~~~~~
306
Sean Dague8b8441f2017-05-02 06:14:11 -0400307By default, services run under ``systemd`` and are natively logging to
308the systemd journal.
Ian Wienand815db162015-08-06 10:25:45 +1000309
Sean Dague8b8441f2017-05-02 06:14:11 -0400310To query the logs use the ``journalctl`` command, such as::
Ian Wienand815db162015-08-06 10:25:45 +1000311
caowei32eccca2017-11-01 11:45:21 +0800312 sudo journalctl --unit devstack@*
Ian Wienand815db162015-08-06 10:25:45 +1000313
Sean Dague8b8441f2017-05-02 06:14:11 -0400314More examples can be found in :ref:`journalctl-examples`.
Ian Wienand7d5be292015-08-10 13:39:17 +1000315
Ian Wienanda35391e2015-08-10 13:53:40 +1000316Example Logging Configuration
317~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
318
319For example, non-interactive installs probably wish to save output to
320a file, keep service logs and disable color in the stored files.
321
Sean McGinnisf7302e12019-06-19 11:49:40 -0500322::
Ian Wienanda35391e2015-08-10 13:53:40 +1000323
Sean McGinnisf7302e12019-06-19 11:49:40 -0500324 [[local|localrc]]
325 DEST=/opt/stack/
0wengdf0bfe42024-11-12 11:44:13 -0800326 LOGFILE=$DEST/stack.sh.log
Sean McGinnisf7302e12019-06-19 11:49:40 -0500327 LOG_COLOR=False
Ian Wienanda35391e2015-08-10 13:53:40 +1000328
Ian Wienand7d5be292015-08-10 13:39:17 +1000329Database Backend
330----------------
331
Matt Riedemannb14665f2019-10-17 19:34:05 +0000332Multiple database backends are available. The available databases are defined
333in the lib/databases directory.
334``mysql`` is the default database, choose a different one by putting the
335following in the ``localrc`` section::
Ian Wienand7d5be292015-08-10 13:39:17 +1000336
Sean McGinnisf7302e12019-06-19 11:49:40 -0500337 disable_service mysql
Matt Riedemannb14665f2019-10-17 19:34:05 +0000338 enable_service postgresql
339
340``mysql`` is the default database.
Ian Wienand7d5be292015-08-10 13:39:17 +1000341
342RPC Backend
343-----------
344
Matt Riedemannb14665f2019-10-17 19:34:05 +0000345Support for a RabbitMQ RPC backend is included. Additional RPC
346backends may be available via external plugins. Enabling or disabling
347RabbitMQ is handled via the usual service functions and
348``ENABLED_SERVICES``.
349
350Example disabling RabbitMQ in ``local.conf``::
Ian Wienand7d5be292015-08-10 13:39:17 +1000351
Sean McGinnisf7302e12019-06-19 11:49:40 -0500352 disable_service rabbit
Ian Wienand7d5be292015-08-10 13:39:17 +1000353
Ian Wienand7d5be292015-08-10 13:39:17 +1000354Apache Frontend
355---------------
356
Stephen Finucanee8e3eb62024-10-11 15:20:17 +0100357The Apache web server is enabled for services that support via WSGI. Today this
358means HTTPD and uWSGI but historically this meant HTTPD + mod_wsgi. This
359historical legacy is captured by the naming of many variables, which include
360``MOD_WSGI`` rather than ``UWSGI``.
Ian Wienand7d5be292015-08-10 13:39:17 +1000361
Stephen Finucanee8e3eb62024-10-11 15:20:17 +0100362Some services support alternative deployment strategies (e.g. eventlet). You
363can enable these ``ENABLE_HTTPD_MOD_WSGI_SERVICES`` to ``False`` in your
364``local.conf``. In addition, each service that can be run under HTTPD +
365mod_wsgi also has an override toggle available that can be set in your
366``local.conf``. These are, however, slowly being removed as services have
367adopted standardized deployment mechanisms and more generally moved away from
368eventlet.
Ian Wienand7d5be292015-08-10 13:39:17 +1000369
Sean McGinnisf7302e12019-06-19 11:49:40 -0500370Example (Swift)::
Ian Wienand7d5be292015-08-10 13:39:17 +1000371
372 SWIFT_USE_MOD_WSGI="True"
373
Sean McGinnisf7302e12019-06-19 11:49:40 -0500374Example (Heat)::
Oleksii Chuprykova6928102015-06-11 08:56:58 -0400375
376 HEAT_USE_MOD_WSGI="True"
377
Sean Dague07d7e5b2014-11-17 07:10:14 -0500378Libraries from Git
379------------------
380
Ian Wienand815db162015-08-06 10:25:45 +1000381By default devstack installs OpenStack server components from git,
382however it installs client libraries from released versions on pypi.
383This is appropriate if you are working on server development, but if
384you want to see how an unreleased version of the client affects the
385system you can have devstack install it from upstream, or from local
386git trees by specifying it in ``LIBS_FROM_GIT``. Multiple libraries
387can be specified as a comma separated list.
Sean Dague07d7e5b2014-11-17 07:10:14 -0500388
Sean McGinnisf7302e12019-06-19 11:49:40 -0500389::
Sean Dague07d7e5b2014-11-17 07:10:14 -0500390
Sean McGinnisf7302e12019-06-19 11:49:40 -0500391 LIBS_FROM_GIT=python-keystoneclient,oslo.config
Sean Dague07d7e5b2014-11-17 07:10:14 -0500392
Marc Koderer46f8cb72016-05-13 09:08:16 +0200393Setting the variable to ``ALL`` will activate the download for all
394libraries.
395
Dean Troyer5686dbc2015-03-09 14:27:51 -0500396Virtual Environments
397--------------------
398
Ian Wienand815db162015-08-06 10:25:45 +1000399Enable the use of Python virtual environments by setting ``USE_VENV``
400to ``True``. This will enable the creation of venvs for each project
401that is defined in the ``PROJECT_VENV`` array.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500402
Ian Wienand815db162015-08-06 10:25:45 +1000403Each entry in the ``PROJECT_VENV`` array contains the directory name
404of a venv to be used for the project. The array index is the project
405name. Multiple projects can use the same venv if desired.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500406
Sean McGinnisf7302e12019-06-19 11:49:40 -0500407::
Dean Troyer5686dbc2015-03-09 14:27:51 -0500408
Sean McGinnisf7302e12019-06-19 11:49:40 -0500409 PROJECT_VENV["glance"]=${GLANCE_DIR}.venv
Dean Troyer5686dbc2015-03-09 14:27:51 -0500410
Ian Wienand815db162015-08-06 10:25:45 +1000411``ADDITIONAL_VENV_PACKAGES`` is a comma-separated list of additional
412packages to be installed into each venv. Often projects will not have
413certain packages listed in its ``requirements.txt`` file because they
414are 'optional' requirements, i.e. only needed for certain
415configurations. By default, the enabled databases will have their
416Python bindings added when they are enabled.
Dean Troyer5686dbc2015-03-09 14:27:51 -0500417
Sean McGinnisf7302e12019-06-19 11:49:40 -0500418::
Sean Dague07d7e5b2014-11-17 07:10:14 -0500419
Sean McGinnisf7302e12019-06-19 11:49:40 -0500420 ADDITIONAL_VENV_PACKAGES="python-foo, python-bar"
Sean M. Collins09e550c2014-10-21 11:40:08 -0400421
Sean M. Collins09e550c2014-10-21 11:40:08 -0400422A clean install every time
Sean Dague07d7e5b2014-11-17 07:10:14 -0500423--------------------------
424
Ian Wienand815db162015-08-06 10:25:45 +1000425By default ``stack.sh`` only clones the project repos if they do not
426exist in ``$DEST``. ``stack.sh`` will freshen each repo on each run if
427``RECLONE`` is set to ``yes``. This avoids having to manually remove
428repos in order to get the current branch from ``$GIT_BASE``.
Sean M. Collins09e550c2014-10-21 11:40:08 -0400429
Sean McGinnisf7302e12019-06-19 11:49:40 -0500430::
Sean M. Collins09e550c2014-10-21 11:40:08 -0400431
Sean McGinnisf7302e12019-06-19 11:49:40 -0500432 RECLONE=yes
Sean M. Collins09e550c2014-10-21 11:40:08 -0400433
Chris Dentebdd9ac2015-03-04 12:35:14 +0000434Upgrade packages installed by pip
435---------------------------------
436
Ian Wienand815db162015-08-06 10:25:45 +1000437By default ``stack.sh`` only installs Python packages if no version is
438currently installed or the current version does not match a specified
439requirement. If ``PIP_UPGRADE`` is set to ``True`` then existing
440required Python packages will be upgraded to the most recent version
441that matches requirements.
Chris Dentebdd9ac2015-03-04 12:35:14 +0000442
Sean McGinnisf7302e12019-06-19 11:49:40 -0500443::
Chris Dentebdd9ac2015-03-04 12:35:14 +0000444
Sean McGinnisf7302e12019-06-19 11:49:40 -0500445 PIP_UPGRADE=True
Chris Dentebdd9ac2015-03-04 12:35:14 +0000446
John Huaa4693b52015-08-06 13:53:35 +0100447Guest Images
448------------
449
450Images provided in URLS via the comma-separated ``IMAGE_URLS``
451variable will be downloaded and uploaded to glance by DevStack.
452
453Default guest-images are predefined for each type of hypervisor and
454their testing-requirements in ``stack.sh``. Setting
455``DOWNLOAD_DEFAULT_IMAGES=False`` will prevent DevStack downloading
456these default images; in that case, you will want to populate
457``IMAGE_URLS`` with sufficient images to satisfy testing-requirements.
458
Sean McGinnisf7302e12019-06-19 11:49:40 -0500459::
John Huaa4693b52015-08-06 13:53:35 +0100460
Sean McGinnisf7302e12019-06-19 11:49:40 -0500461 DOWNLOAD_DEFAULT_IMAGES=False
462 IMAGE_URLS="http://foo.bar.com/image.qcow,"
463 IMAGE_URLS+="http://foo.bar.com/image2.qcow"
John Huaa4693b52015-08-06 13:53:35 +0100464
Rafael Folcof0131e12015-09-23 12:55:02 -0500465
466Instance Type
467-------------
468
469``DEFAULT_INSTANCE_TYPE`` can be used to configure the default instance
470type. When this parameter is not specified, Devstack creates additional
471micro & nano flavors for really small instances to run Tempest tests.
472
473For guests with larger memory requirements, ``DEFAULT_INSTANCE_TYPE``
474should be specified in the configuration file so Tempest selects the
475default flavors instead.
476
477KVM on Power with QEMU 2.4 requires 512 MB to load the firmware -
Andreas Jaeger8dd89e52019-08-11 16:00:12 +0200478`QEMU 2.4 - PowerPC <https://wiki.qemu.org/ChangeLog/2.4>`__ so users
Rafael Folcof0131e12015-09-23 12:55:02 -0500479running instances on ppc64/ppc64le can choose one of the default
480created flavors as follows:
481
Sean McGinnisf7302e12019-06-19 11:49:40 -0500482::
Rafael Folcof0131e12015-09-23 12:55:02 -0500483
Sean McGinnisf7302e12019-06-19 11:49:40 -0500484 DEFAULT_INSTANCE_TYPE=m1.tiny
Rafael Folcof0131e12015-09-23 12:55:02 -0500485
486
John Davidge21529a52014-06-30 09:55:11 -0400487IP Version
Brian Haley180f5eb2015-06-16 13:14:31 -0400488----------
489
Clay Gerrard148d0e62016-09-01 02:38:06 -0700490``IP_VERSION`` can be used to configure Neutron to create either an
491IPv4, IPv6, or dual-stack self-service project data-network by with
Sean Daguedb48db12016-04-06 08:09:31 -0400492either ``IP_VERSION=4``, ``IP_VERSION=6``, or ``IP_VERSION=4+6``
Clay Gerrard148d0e62016-09-01 02:38:06 -0700493respectively.
John Davidge21529a52014-06-30 09:55:11 -0400494
Sean McGinnisf7302e12019-06-19 11:49:40 -0500495::
John Davidge21529a52014-06-30 09:55:11 -0400496
Sean McGinnisf7302e12019-06-19 11:49:40 -0500497 IP_VERSION=4+6
John Davidge21529a52014-06-30 09:55:11 -0400498
Ian Wienand815db162015-08-06 10:25:45 +1000499The following optional variables can be used to alter the default IPv6
500behavior:
John Davidge21529a52014-06-30 09:55:11 -0400501
Sean McGinnisf7302e12019-06-19 11:49:40 -0500502::
John Davidge21529a52014-06-30 09:55:11 -0400503
Sean McGinnisf7302e12019-06-19 11:49:40 -0500504 IPV6_RA_MODE=slaac
505 IPV6_ADDRESS_MODE=slaac
506 IPV6_ADDRS_SAFE_TO_USE=fd$IPV6_GLOBAL_ID::/56
507 IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1
John Davidge21529a52014-06-30 09:55:11 -0400508
Kevin Benton4bfbc292016-11-15 17:26:05 -0800509*Note*: ``IPV6_ADDRS_SAFE_TO_USE`` and ``IPV6_PRIVATE_NETWORK_GATEWAY``
510can be configured with any valid IPv6 prefix. The default values make
511use of an auto-generated ``IPV6_GLOBAL_ID`` to comply with RFC4193.
Brian Haley180f5eb2015-06-16 13:14:31 -0400512
Brian Haleyc869d592020-02-28 14:55:08 -0500513Service IP Version
514~~~~~~~~~~~~~~~~~~
Ian Wienand815db162015-08-06 10:25:45 +1000515
516DevStack can enable service operation over either IPv4 or IPv6 by
517setting ``SERVICE_IP_VERSION`` to either ``SERVICE_IP_VERSION=4`` or
518``SERVICE_IP_VERSION=6`` respectively.
519
520When set to ``4`` devstack services will open listen sockets on
521``0.0.0.0`` and service endpoints will be registered using ``HOST_IP``
522as the address.
523
524When set to ``6`` devstack services will open listen sockets on ``::``
525and service endpoints will be registered using ``HOST_IPV6`` as the
526address.
527
528The default value for this setting is ``4``. Dual-mode support, for
529example ``4+6`` is not currently supported. ``HOST_IPV6`` can
Sean McGinnisf7302e12019-06-19 11:49:40 -0500530optionally be used to alter the default IPv6 address::
Brian Haley180f5eb2015-06-16 13:14:31 -0400531
Sean McGinnisf7302e12019-06-19 11:49:40 -0500532 HOST_IPV6=${some_local_ipv6_address}
John Davidge21529a52014-06-30 09:55:11 -0400533
Brian Haleyc869d592020-02-28 14:55:08 -0500534Tunnel IP Version
535~~~~~~~~~~~~~~~~~
536
537DevStack can enable tunnel operation over either IPv4 or IPv6 by
538setting ``TUNNEL_IP_VERSION`` to either ``TUNNEL_IP_VERSION=4`` or
539``TUNNEL_IP_VERSION=6`` respectively.
540
541When set to ``4`` Neutron will use an IPv4 address for tunnel endpoints,
542for example, ``HOST_IP``.
543
544When set to ``6`` Neutron will use an IPv6 address for tunnel endpoints,
545for example, ``HOST_IPV6``.
546
547The default value for this setting is ``4``. Dual-mode support, for
548example ``4+6`` is not supported, as this value must match the address
549family of the local tunnel endpoint IP(v6) address.
550
551The value of ``TUNNEL_IP_VERSION`` has a direct relationship to the
552setting of ``TUNNEL_ENDPOINT_IP``, which will default to ``HOST_IP``
553when set to ``4``, and ``HOST_IPV6`` when set to ``6``.
554
Ian Wienand7d5be292015-08-10 13:39:17 +1000555Multi-node setup
556~~~~~~~~~~~~~~~~
Sean M. Collins09e550c2014-10-21 11:40:08 -0400557
Ian Wienand7d5be292015-08-10 13:39:17 +1000558See the :doc:`multi-node lab guide<guides/multinode-lab>`
Sean M. Collins09e550c2014-10-21 11:40:08 -0400559
Ian Wienand7d5be292015-08-10 13:39:17 +1000560Projects
561--------
Sean M. Collins09e550c2014-10-21 11:40:08 -0400562
Ian Wienand7d5be292015-08-10 13:39:17 +1000563Neutron
564~~~~~~~
Sean M. Collins09e550c2014-10-21 11:40:08 -0400565
Ian Wienand7d5be292015-08-10 13:39:17 +1000566See the :doc:`neutron configuration guide<guides/neutron>` for
567details on configuration of Neutron
Sean M. Collins09e550c2014-10-21 11:40:08 -0400568
Sean M. Collins09e550c2014-10-21 11:40:08 -0400569
Ian Wienand7d5be292015-08-10 13:39:17 +1000570Swift
571~~~~~
572
573Swift is disabled by default. When enabled, it is configured with
574only one replica to avoid being IO/memory intensive on a small
Sean Dague8b8441f2017-05-02 06:14:11 -0400575VM.
Ian Wienand7d5be292015-08-10 13:39:17 +1000576
Markus Zoellerc30657d2015-11-02 11:27:46 +0100577If you would like to enable Swift you can add this to your ``localrc``
Ian Wienand7d5be292015-08-10 13:39:17 +1000578section:
579
580::
581
582 enable_service s-proxy s-object s-container s-account
583
584If you want a minimal Swift install with only Swift and Keystone you
Markus Zoellerc30657d2015-11-02 11:27:46 +0100585can have this instead in your ``localrc`` section:
Ian Wienand7d5be292015-08-10 13:39:17 +1000586
587::
588
589 disable_all_services
590 enable_service key mysql s-proxy s-object s-container s-account
591
592If you only want to do some testing of a real normal swift cluster
593with multiple replicas you can do so by customizing the variable
Markus Zoellerc30657d2015-11-02 11:27:46 +0100594``SWIFT_REPLICAS`` in your ``localrc`` section (usually to 3).
Ian Wienand7d5be292015-08-10 13:39:17 +1000595
Christian Schwede91d22452016-04-12 10:53:46 +0200596You can manually override the ring building to use specific storage
597nodes, for example when you want to test a multinode environment. In
598this case you have to set a space-separated list of IPs in
599``SWIFT_STORAGE_IPS`` in your ``localrc`` section that should be used
600as Swift storage nodes.
601Please note that this does not create a multinode setup, it is only
602used when adding nodes to the Swift rings.
603
604::
605
606 SWIFT_STORAGE_IPS="192.168.1.10 192.168.1.11 192.168.1.12"
607
Ian Wienand7d5be292015-08-10 13:39:17 +1000608Swift S3
609++++++++
610
Kota Tsuyuzaki070e4ee2018-09-13 03:08:19 +0900611If you are enabling ``s3api`` in ``ENABLED_SERVICES`` DevStack will
612install the s3api middleware emulation. Swift will be configured to
Ian Wienand7d5be292015-08-10 13:39:17 +1000613act as a S3 endpoint for Keystone so effectively replacing the
Markus Zoellerc30657d2015-11-02 11:27:46 +0100614``nova-objectstore``.
Ian Wienand7d5be292015-08-10 13:39:17 +1000615
Sean Dague8b8441f2017-05-02 06:14:11 -0400616Only Swift proxy server is launched in the systemd system all other
Markus Zoellerc30657d2015-11-02 11:27:46 +0100617services are started in background and managed by ``swift-init`` tool.
Ian Wienand7d5be292015-08-10 13:39:17 +1000618
Ian Wienand7d5be292015-08-10 13:39:17 +1000619Tempest
620~~~~~~~
621
622If tempest has been successfully configured, a basic set of smoke
623tests can be run as follows:
624
625::
626
627 $ cd /opt/stack/tempest
Masayuki Igawa7d1ba832022-10-11 12:35:18 +0900628 $ tox -e smoke
Ian Wienand7d5be292015-08-10 13:39:17 +1000629
630By default tempest is downloaded and the config file is generated, but the
631tempest package is not installed in the system's global site-packages (the
632package install includes installing dependences). So tempest won't run
633outside of tox. If you would like to install it add the following to your
634``localrc`` section:
635
636::
637
638 INSTALL_TEMPEST=True
639
640
Ian Wienand7d5be292015-08-10 13:39:17 +1000641Cinder
642~~~~~~
643
644The logical volume group used to hold the Cinder-managed volumes is
Jordan Pittierf5069f32016-11-08 12:10:12 +0100645set by ``VOLUME_GROUP_NAME``, the logical volume name prefix is set with
Ian Wienand7d5be292015-08-10 13:39:17 +1000646``VOLUME_NAME_PREFIX`` and the size of the volume backing file is set
647with ``VOLUME_BACKING_FILE_SIZE``.
648
Sean McGinnisf7302e12019-06-19 11:49:40 -0500649::
Ian Wienand7d5be292015-08-10 13:39:17 +1000650
Sean McGinnisf7302e12019-06-19 11:49:40 -0500651 VOLUME_GROUP_NAME="stack-volumes"
652 VOLUME_NAME_PREFIX="volume-"
653 VOLUME_BACKING_FILE_SIZE=24G
Ian Wienand7d5be292015-08-10 13:39:17 +1000654
Brian Rosmaitaf44aa0c2021-08-04 18:27:48 -0400655When running highly concurrent tests, the default per-project quotas
656for volumes, backups, or snapshots may be too small. These can be
657adjusted by setting ``CINDER_QUOTA_VOLUMES``, ``CINDER_QUOTA_BACKUPS``,
658or ``CINDER_QUOTA_SNAPSHOTS`` to the desired value. (The default for
659each is 10.)
660
Gorka Eguileor97061c92021-10-14 09:55:56 +0200661DevStack's Cinder LVM configuration module currently supports both iSCSI and
662NVMe connections, and we can choose which one to use with options
663``CINDER_TARGET_HELPER``, ``CINDER_TARGET_PROTOCOL``, ``CINDER_TARGET_PREFIX``,
664and ``CINDER_TARGET_PORT``.
665
666Defaults use iSCSI with the LIO target manager::
667
668 CINDER_TARGET_HELPER="lioadm"
669 CINDER_TARGET_PROTOCOL="iscsi"
670 CINDER_TARGET_PREFIX="iqn.2010-10.org.openstack:"
671 CINDER_TARGET_PORT=3260
672
673Additionally there are 3 supported transport protocols for NVMe,
674``nvmet_rdma``, ``nvmet_tcp``, and ``nvmet_fc``, and when the ``nvmet`` target
675is selected the protocol, prefix, and port defaults will change to more
676sensible defaults for NVMe::
677
678 CINDER_TARGET_HELPER="nvmet"
679 CINDER_TARGET_PROTOCOL="nvmet_rdma"
680 CINDER_TARGET_PREFIX="nvme-subsystem-1"
681 CINDER_TARGET_PORT=4420
682
683When selecting the RDMA transport protocol DevStack will create on Cinder nodes
684a Software RoCE device on top of the ``HOST_IP_IFACE`` and if it is not defined
685then on top of the interface with IP address ``HOST_IP`` or ``HOST_IPV6``.
686
687This Soft-RoCE device will always be created on the Nova compute side since we
688cannot tell beforehand whether there will be an RDMA connection or not.
689
Ian Wienand7d5be292015-08-10 13:39:17 +1000690
691Keystone
692~~~~~~~~
693
694Multi-Region Setup
695++++++++++++++++++
696
697We want to setup two devstack (RegionOne and RegionTwo) with shared
698keystone (same users and services) and horizon. Keystone and Horizon
699will be located in RegionOne. Full spec is available at:
700`<https://wiki.openstack.org/wiki/Heat/Blueprints/Multi_Region_Support_for_Heat>`__.
701
702In RegionOne:
703
704::
705
706 REGION_NAME=RegionOne
707
708In RegionTwo:
709
710::
henriquetrutaf2126222016-01-05 13:43:18 -0300711
Ian Wienand7d5be292015-08-10 13:39:17 +1000712 disable_service horizon
713 KEYSTONE_SERVICE_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE>
Ian Wienand7d5be292015-08-10 13:39:17 +1000714 REGION_NAME=RegionTwo
zhiyuan_cai6f1781f2016-04-07 18:36:46 +0800715 KEYSTONE_REGION_NAME=RegionOne
716
717In the devstack for RegionOne, we set REGION_NAME as RegionOne, so region of
718the services started in this devstack are registered as RegionOne. In devstack
719for RegionTwo, similarly, we set REGION_NAME as RegionTwo since we want
720services started in this devstack to be registered in RegionTwo. But Keystone
721service is started and registered in RegionOne, not RegionTwo, so we use
722KEYSTONE_REGION_NAME to specify the region of Keystone service.
723KEYSTONE_REGION_NAME has a default value the same as REGION_NAME thus we omit
724it in the configuration of RegionOne.
henriquetrutaf2126222016-01-05 13:43:18 -0300725
Dan Smithc8b66ff2021-07-19 11:14:18 -0700726Glance
727++++++
728
729The default image size quota of 1GiB may be too small if larger images
730are to be used. Change the default at setup time with:
731
732::
733
734 GLANCE_LIMIT_IMAGE_SIZE_TOTAL=5000
735
736or at runtime via:
737
738::
739
Masayuki Igawaf49b4352022-09-22 11:22:21 +0900740 openstack --os-cloud devstack-system-admin registered limit set \
Dan Smithc8b66ff2021-07-19 11:14:18 -0700741 --service glance --default-limit 5000 --region RegionOne image_size_total
742
Markus Zoeller14728c72017-05-29 15:39:21 +0200743.. _arch-configuration:
744
745Architectures
746-------------
747
748The upstream CI runs exclusively on nodes with x86 architectures, but
749OpenStack supports even more architectures. Some of them need to configure
750Devstack in a certain way.
751
752KVM on s390x (IBM z Systems)
753~~~~~~~~~~~~~~~~~~~~~~~~~~~~
754
755KVM on s390x (IBM z Systems) is supported since the *Kilo* release. For
756an all-in-one setup, these minimal settings in the ``local.conf`` file
757are needed::
758
759 [[local|localrc]]
760 ADMIN_PASSWORD=secret
761 DATABASE_PASSWORD=$ADMIN_PASSWORD
762 RABBIT_PASSWORD=$ADMIN_PASSWORD
763 SERVICE_PASSWORD=$ADMIN_PASSWORD
764
765 DOWNLOAD_DEFAULT_IMAGES=False
766 IMAGE_URLS="https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-s390x-disk1.img"
767
Andreas Scheuring941940a2017-09-13 00:24:02 +0200768 # Provide a custom etcd3 binary download URL and ints sha256.
769 # The binary must be located under '/<etcd version>/etcd-<etcd-version>-linux-s390x.tar.gz'
770 # on this URL.
771 # Build instructions for etcd3: https://github.com/linux-on-ibm-z/docs/wiki/Building-etcd
772 ETCD_DOWNLOAD_URL=<your-etcd-download-url>
773 ETCD_SHA256=<your-etcd3-sha256>
774
Markus Zoeller14728c72017-05-29 15:39:21 +0200775 enable_service n-sproxy
776 disable_service n-novnc
Markus Zoeller14728c72017-05-29 15:39:21 +0200777
778 [[post-config|$NOVA_CONF]]
779
780 [serial_console]
781 base_url=ws://$HOST_IP:6083/ # optional
782
783Reasoning:
784
785* The default image of Devstack is x86 only, so we deactivate the download
786 with ``DOWNLOAD_DEFAULT_IMAGES``. The referenced guest image
787 in the code above (``IMAGE_URLS``) serves as an example. The list of
788 possible s390x guest images is not limited to that.
789
790* This platform doesn't support a graphical console like VNC or SPICE.
791 The technical reason is the missing framebuffer on the platform. This
792 means we rely on the substitute feature *serial console* which needs the
793 proxy service ``n-sproxy``. We also disable VNC's proxy ``n-novnc`` for
794 that reason . The configuration in the ``post-config`` section is only
795 needed if you want to use the *serial console* outside of the all-in-one
796 setup.
797
Andreas Scheuring941940a2017-09-13 00:24:02 +0200798* A link to an etcd3 binary and its sha256 needs to be provided as the
799 binary for s390x is not hosted on github like it is for other
800 architectures. For more details see
801 https://bugs.launchpad.net/devstack/+bug/1693192. Etcd3 can easily be
802 built along https://github.com/linux-on-ibm-z/docs/wiki/Building-etcd.
Markus Zoeller14728c72017-05-29 15:39:21 +0200803
804.. note:: To run *Tempest* against this *Devstack* all-in-one, you'll need
805 to use a guest image which is smaller than 1GB when uncompressed.
806 The example image from above is bigger than that!