Dean Troyer | 0986a7b | 2014-10-29 22:08:13 -0500 | [diff] [blame] | 1 | ============= |
| 2 | Configuration |
| 3 | ============= |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 4 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 5 | .. contents:: |
| 6 | :local: |
| 7 | :depth: 1 |
| 8 | |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 9 | local.conf |
Sean Dague | 07d7e5b | 2014-11-17 07:10:14 -0500 | [diff] [blame] | 10 | ========== |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 11 | |
Ian Wienand | a35391e | 2015-08-10 13:53:40 +1000 | [diff] [blame] | 12 | DevStack configuration is modified via the file ``local.conf``. It is |
| 13 | a modified INI format file that introduces a meta-section header to |
| 14 | carry additional information regarding the configuration files to be |
| 15 | changed. |
| 16 | |
| 17 | A sample is provided in ``devstack/samples`` |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 18 | |
| 19 | The new header is similar to a normal INI section header but with double |
| 20 | brackets (``[[ ... ]]``) and two internal fields separated by a pipe |
dieterly | 7c7679e | 2015-09-18 15:10:48 -0600 | [diff] [blame] | 21 | (``|``). Note that there are no spaces between the double brackets and the |
| 22 | internal fields. Likewise, there are no spaces between the pipe and the |
| 23 | internal fields: |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 24 | :: |
| 25 | |
dieterly | 7c7679e | 2015-09-18 15:10:48 -0600 | [diff] [blame] | 26 | '[[' <phase> '|' <config-file-name> ']]' |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 27 | |
| 28 | where ``<phase>`` is one of a set of phase names defined by ``stack.sh`` |
| 29 | and ``<config-file-name>`` is the configuration filename. The filename |
| 30 | is eval'ed in the ``stack.sh`` context so all environment variables are |
| 31 | available and may be used. Using the project config file variables in |
| 32 | the header is strongly suggested (see the ``NOVA_CONF`` example below). |
| 33 | If the path of the config file does not exist it is skipped. |
| 34 | |
| 35 | The defined phases are: |
| 36 | |
| 37 | - **local** - extracts ``localrc`` from ``local.conf`` before |
| 38 | ``stackrc`` is sourced |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 39 | - **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 Takashi | 961643e | 2015-07-31 13:45:27 +0900 | [diff] [blame] | 43 | - **post-extra** - runs after files in ``extra.d`` are executed |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 44 | |
| 45 | The file is processed strictly in sequence; meta-sections may be |
| 46 | specified more than once but if any settings are duplicated the last to |
| 47 | appear in the file will be used. |
| 48 | |
| 49 | :: |
| 50 | |
| 51 | [[post-config|$NOVA_CONF]] |
| 52 | [DEFAULT] |
| 53 | use_syslog = True |
| 54 | |
| 55 | [osapi_v3] |
| 56 | enabled = False |
| 57 | |
| 58 | A specific meta-section ``local|localrc`` is used to provide a default |
| 59 | ``localrc`` file (actually ``.localrc.auto``). This allows all custom |
| 60 | settings for DevStack to be contained in a single file. If ``localrc`` |
Ian Wienand | 7cd16ce | 2016-04-08 09:40:56 +1000 | [diff] [blame] | 61 | exists it will be used instead to preserve backward-compatibility. |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 62 | |
| 63 | :: |
| 64 | |
| 65 | [[local|localrc]] |
Kevin Benton | 4bfbc29 | 2016-11-15 17:26:05 -0800 | [diff] [blame] | 66 | IPV4_ADDRS_SAFE_TO_USE=10.254.1.0/24 |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 67 | ADMIN_PASSWORD=speciale |
| 68 | LOGFILE=$DEST/logs/stack.sh.log |
| 69 | |
| 70 | Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to |
| 71 | *NOT* start with a ``/`` (slash) character. A slash will need to be |
| 72 | added: |
| 73 | |
| 74 | :: |
| 75 | |
| 76 | [[post-config|/$Q_PLUGIN_CONF_FILE]] |
| 77 | |
| 78 | Also note that the ``localrc`` section is sourced as a shell script |
Juan Antonio Osorio Robles | fe6dccb | 2014-11-28 13:12:14 +0200 | [diff] [blame] | 79 | fragment and MUST conform to the shell requirements, specifically no |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 80 | whitespace around ``=`` (equals). |
| 81 | |
Ian Wienand | 7cd16ce | 2016-04-08 09:40:56 +1000 | [diff] [blame] | 82 | openrc |
| 83 | ====== |
| 84 | |
| 85 | ``openrc`` configures login credentials suitable for use with the |
| 86 | OpenStack command-line tools. ``openrc`` sources ``stackrc`` at the |
| 87 | beginning (which in turn sources the ``localrc`` section of |
| 88 | ``local.conf``) in order to pick up ``HOST_IP`` and/or ``SERVICE_HOST`` |
| 89 | to use in the endpoints. The values shown below are the default values. |
| 90 | |
| 91 | OS\_PROJECT\_NAME (OS\_TENANT\_NAME) |
| 92 | Keystone has |
| 93 | standardized the term *project* as the entity that owns resources. In |
| 94 | some places references still exist to the previous term |
| 95 | *tenant* for this use. Also, *project\_name* is preferred to |
| 96 | *project\_id*. OS\_TENANT\_NAME remains supported for compatibility |
| 97 | with older tools. |
| 98 | |
| 99 | :: |
| 100 | |
| 101 | OS_PROJECT_NAME=demo |
| 102 | |
| 103 | OS\_USERNAME |
| 104 | In addition to the owning entity (project), OpenStack calls the entity |
| 105 | performing the action *user*. |
| 106 | |
| 107 | :: |
| 108 | |
| 109 | OS_USERNAME=demo |
| 110 | |
| 111 | OS\_PASSWORD |
| 112 | Keystone's default authentication requires a password be provided. |
| 113 | The usual cautions about putting passwords in environment variables |
| 114 | apply, for most DevStack uses this may be an acceptable tradeoff. |
| 115 | |
| 116 | :: |
| 117 | |
| 118 | OS_PASSWORD=secret |
| 119 | |
| 120 | HOST\_IP, SERVICE\_HOST |
| 121 | Set API endpoint host using ``HOST_IP``. ``SERVICE_HOST`` may also |
| 122 | be used to specify the endpoint, which is convenient for some |
| 123 | ``local.conf`` configurations. Typically, ``HOST_IP`` is set in the |
| 124 | ``localrc`` section. |
| 125 | |
| 126 | :: |
| 127 | |
| 128 | HOST_IP=127.0.0.1 |
| 129 | SERVICE_HOST=$HOST_IP |
| 130 | |
| 131 | OS\_AUTH\_URL |
| 132 | Authenticating against an OpenStack cloud using Keystone returns a |
| 133 | *Token* and *Service Catalog*. The catalog contains the endpoints |
| 134 | for all services the user/tenant has access to - including Nova, |
| 135 | Glance, Keystone and Swift. |
| 136 | |
| 137 | :: |
| 138 | |
| 139 | OS_AUTH_URL=http://$SERVICE_HOST:5000/v2.0 |
| 140 | |
| 141 | KEYSTONECLIENT\_DEBUG, NOVACLIENT\_DEBUG |
| 142 | Set command-line client log level to ``DEBUG``. These are commented |
| 143 | out by default. |
| 144 | |
| 145 | :: |
| 146 | |
| 147 | # export KEYSTONECLIENT_DEBUG=1 |
| 148 | # export NOVACLIENT_DEBUG=1 |
| 149 | |
| 150 | |
| 151 | |
James Polley | 5f2eb6d | 2015-03-30 17:36:26 +1100 | [diff] [blame] | 152 | .. _minimal-configuration: |
| 153 | |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 154 | Minimal Configuration |
Sean Dague | 07d7e5b | 2014-11-17 07:10:14 -0500 | [diff] [blame] | 155 | ===================== |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 156 | |
| 157 | While ``stack.sh`` is happy to run without a ``localrc`` section in |
| 158 | ``local.conf``, devlife is better when there are a few minimal variables |
| 159 | set. This is an example of a minimal configuration that touches the |
| 160 | values that most often need to be set. |
| 161 | |
| 162 | - no logging |
| 163 | - pre-set the passwords to prevent interactive prompts |
Kevin Benton | 4bfbc29 | 2016-11-15 17:26:05 -0800 | [diff] [blame] | 164 | - move network ranges away from the local network (``IPV4_ADDRS_SAFE_TO_USE`` |
| 165 | and ``FLOATING_RANGE``, commented out below) |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 166 | - set the host IP if detection is unreliable (``HOST_IP``, commented |
| 167 | out below) |
| 168 | |
| 169 | :: |
| 170 | |
| 171 | [[local|localrc]] |
Balagopal | 7ed812c | 2016-03-01 04:43:31 +0000 | [diff] [blame] | 172 | ADMIN_PASSWORD=secret |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 173 | DATABASE_PASSWORD=$ADMIN_PASSWORD |
| 174 | RABBIT_PASSWORD=$ADMIN_PASSWORD |
| 175 | SERVICE_PASSWORD=$ADMIN_PASSWORD |
Kevin Benton | 4bfbc29 | 2016-11-15 17:26:05 -0800 | [diff] [blame] | 176 | #IPV4_ADDRS_SAFE_TO_USE=172.31.1.0/24 |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 177 | #FLOATING_RANGE=192.168.20.0/25 |
| 178 | #HOST_IP=10.3.4.5 |
| 179 | |
| 180 | If the ``*_PASSWORD`` variables are not set here you will be prompted to |
| 181 | enter values for them by ``stack.sh``. |
| 182 | |
| 183 | The network ranges must not overlap with any networks in use on the |
| 184 | host. Overlap is not uncommon as RFC-1918 'private' ranges are commonly |
| 185 | used for both the local networking and Nova's fixed and floating ranges. |
| 186 | |
| 187 | ``HOST_IP`` is normally detected on the first run of ``stack.sh`` but |
| 188 | often is indeterminate on later runs due to the IP being moved from an |
Juan Antonio Osorio Robles | fe6dccb | 2014-11-28 13:12:14 +0200 | [diff] [blame] | 189 | Ethernet interface to a bridge on the host. Setting it here also makes it |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 190 | available for ``openrc`` to set ``OS_AUTH_URL``. ``HOST_IP`` is not set |
| 191 | by default. |
| 192 | |
Brian Haley | 180f5eb | 2015-06-16 13:14:31 -0400 | [diff] [blame] | 193 | ``HOST_IPV6`` is normally detected on the first run of ``stack.sh`` but |
| 194 | will not be set if there is no IPv6 address on the default Ethernet interface. |
| 195 | Setting it here also makes it available for ``openrc`` to set ``OS_AUTH_URL``. |
| 196 | ``HOST_IPV6`` is not set by default. |
| 197 | |
Ian Wienand | a35391e | 2015-08-10 13:53:40 +1000 | [diff] [blame] | 198 | Historical Notes |
| 199 | ================ |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 200 | |
Ian Wienand | a35391e | 2015-08-10 13:53:40 +1000 | [diff] [blame] | 201 | Historically DevStack obtained all local configuration and |
| 202 | customizations from a ``localrc`` file. In Oct 2013 the |
| 203 | ``local.conf`` configuration method was introduced (in `review 46768 |
| 204 | <https://review.openstack.org/#/c/46768/>`__) to simplify this |
| 205 | process. |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 206 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 207 | Configuration Notes |
| 208 | =================== |
| 209 | |
| 210 | .. contents:: |
| 211 | :local: |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 212 | |
Ian Wienand | 7cd16ce | 2016-04-08 09:40:56 +1000 | [diff] [blame] | 213 | Service Repos |
| 214 | ------------- |
| 215 | |
| 216 | The Git repositories used to check out the source for each service are |
| 217 | controlled by a pair of variables set for each service. ``*_REPO`` |
| 218 | points to the repository and ``*_BRANCH`` selects which branch to |
| 219 | check out. These may be overridden in ``local.conf`` to pull source |
| 220 | from a different repo for testing, such as a Gerrit branch |
| 221 | proposal. ``GIT_BASE`` points to the primary repository server. |
| 222 | |
| 223 | :: |
| 224 | |
| 225 | NOVA_REPO=$GIT_BASE/openstack/nova.git |
| 226 | NOVA_BRANCH=master |
| 227 | |
| 228 | To pull a branch directly from Gerrit, get the repo and branch from |
| 229 | the Gerrit review page: |
| 230 | |
| 231 | :: |
| 232 | |
| 233 | git fetch https://review.openstack.org/p/openstack/nova refs/changes/50/5050/1 && git checkout FETCH_HEAD |
| 234 | |
| 235 | The repo is the stanza following ``fetch`` and the branch is the |
| 236 | stanza following that: |
| 237 | |
| 238 | :: |
| 239 | |
| 240 | NOVA_REPO=https://review.openstack.org/p/openstack/nova |
| 241 | NOVA_BRANCH=refs/changes/50/5050/1 |
| 242 | |
| 243 | |
Sean Dague | 07d7e5b | 2014-11-17 07:10:14 -0500 | [diff] [blame] | 244 | Installation Directory |
| 245 | ---------------------- |
| 246 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 247 | The DevStack install directory is set by the ``DEST`` variable. By |
| 248 | default it is ``/opt/stack``. |
| 249 | |
| 250 | By setting it early in the ``localrc`` section you can reference it in |
| 251 | later variables. It can be useful to set it even though it is not |
| 252 | changed from the default value. |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 253 | |
| 254 | :: |
| 255 | |
| 256 | DEST=/opt/stack |
| 257 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 258 | Logging |
| 259 | ------- |
| 260 | |
| 261 | Enable Logging |
| 262 | ~~~~~~~~~~~~~~ |
| 263 | |
| 264 | By default ``stack.sh`` output is only written to the console where it |
| 265 | runs. It can be sent to a file in addition to the console by setting |
| 266 | ``LOGFILE`` to the fully-qualified name of the destination log file. A |
| 267 | timestamp will be appended to the given filename for each run of |
| 268 | ``stack.sh``. |
| 269 | |
| 270 | :: |
| 271 | |
| 272 | LOGFILE=$DEST/logs/stack.sh.log |
| 273 | |
| 274 | Old log files are cleaned automatically if ``LOGDAYS`` is set to the |
| 275 | number of days of old log files to keep. |
| 276 | |
| 277 | :: |
| 278 | |
| 279 | LOGDAYS=1 |
| 280 | |
Sean Dague | 8b8441f | 2017-05-02 06:14:11 -0400 | [diff] [blame] | 281 | Some coloring is used during the DevStack runs to make it easier to |
| 282 | see what is going on. This can be disabled with:: |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 283 | |
| 284 | LOG_COLOR=False |
| 285 | |
| 286 | Logging the Service Output |
| 287 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 288 | |
Sean Dague | 8b8441f | 2017-05-02 06:14:11 -0400 | [diff] [blame] | 289 | By default, services run under ``systemd`` and are natively logging to |
| 290 | the systemd journal. |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 291 | |
Sean Dague | 8b8441f | 2017-05-02 06:14:11 -0400 | [diff] [blame] | 292 | To query the logs use the ``journalctl`` command, such as:: |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 293 | |
Sean Dague | 8b8441f | 2017-05-02 06:14:11 -0400 | [diff] [blame] | 294 | journalctl --unit devstack@* |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 295 | |
Sean Dague | 8b8441f | 2017-05-02 06:14:11 -0400 | [diff] [blame] | 296 | More examples can be found in :ref:`journalctl-examples`. |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 297 | |
Ian Wienand | a35391e | 2015-08-10 13:53:40 +1000 | [diff] [blame] | 298 | Example Logging Configuration |
| 299 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 300 | |
| 301 | For example, non-interactive installs probably wish to save output to |
| 302 | a file, keep service logs and disable color in the stored files. |
| 303 | |
| 304 | :: |
| 305 | |
| 306 | [[local|localrc]] |
| 307 | DEST=/opt/stack/ |
Ian Wienand | a35391e | 2015-08-10 13:53:40 +1000 | [diff] [blame] | 308 | LOGFILE=$LOGDIR/stack.sh.log |
| 309 | LOG_COLOR=False |
| 310 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 311 | Database Backend |
| 312 | ---------------- |
| 313 | |
| 314 | Multiple database backends are available. The available databases are defined |
| 315 | in the lib/databases directory. |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 316 | ``mysql`` is the default database, choose a different one by putting the |
| 317 | following in the ``localrc`` section: |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 318 | |
| 319 | :: |
| 320 | |
| 321 | disable_service mysql |
| 322 | enable_service postgresql |
| 323 | |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 324 | ``mysql`` is the default database. |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 325 | |
| 326 | RPC Backend |
| 327 | ----------- |
| 328 | |
| 329 | Support for a RabbitMQ RPC backend is included. Additional RPC |
| 330 | backends may be available via external plugins. Enabling or disabling |
| 331 | RabbitMQ is handled via the usual service functions and |
| 332 | ``ENABLED_SERVICES``. |
| 333 | |
| 334 | Example disabling RabbitMQ in ``local.conf``: |
| 335 | |
| 336 | :: |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 337 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 338 | disable_service rabbit |
| 339 | |
| 340 | |
| 341 | Apache Frontend |
| 342 | --------------- |
| 343 | |
| 344 | The Apache web server can be enabled for wsgi services that support |
| 345 | being deployed under HTTPD + mod_wsgi. By default, services that |
| 346 | recommend running under HTTPD + mod_wsgi are deployed under Apache. To |
| 347 | use an alternative deployment strategy (e.g. eventlet) for services |
| 348 | that support an alternative to HTTPD + mod_wsgi set |
| 349 | ``ENABLE_HTTPD_MOD_WSGI_SERVICES`` to ``False`` in your |
| 350 | ``local.conf``. |
| 351 | |
| 352 | Each service that can be run under HTTPD + mod_wsgi also has an |
| 353 | override toggle available that can be set in your ``local.conf``. |
| 354 | |
| 355 | Keystone is run under Apache with ``mod_wsgi`` by default. |
| 356 | |
| 357 | Example (Keystone) |
| 358 | |
| 359 | :: |
| 360 | |
| 361 | KEYSTONE_USE_MOD_WSGI="True" |
| 362 | |
| 363 | Example (Nova): |
| 364 | |
| 365 | :: |
| 366 | |
| 367 | NOVA_USE_MOD_WSGI="True" |
| 368 | |
| 369 | Example (Swift): |
| 370 | |
| 371 | :: |
| 372 | |
| 373 | SWIFT_USE_MOD_WSGI="True" |
| 374 | |
Oleksii Chuprykov | a692810 | 2015-06-11 08:56:58 -0400 | [diff] [blame] | 375 | Example (Heat): |
| 376 | |
| 377 | :: |
| 378 | |
| 379 | HEAT_USE_MOD_WSGI="True" |
| 380 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 381 | |
Anton Arefiev | 651cb1a | 2015-09-01 10:55:20 +0300 | [diff] [blame] | 382 | Example (Cinder): |
| 383 | |
| 384 | :: |
| 385 | |
| 386 | CINDER_USE_MOD_WSGI="True" |
| 387 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 388 | |
Sean Dague | 07d7e5b | 2014-11-17 07:10:14 -0500 | [diff] [blame] | 389 | Libraries from Git |
| 390 | ------------------ |
| 391 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 392 | By default devstack installs OpenStack server components from git, |
| 393 | however it installs client libraries from released versions on pypi. |
| 394 | This is appropriate if you are working on server development, but if |
| 395 | you want to see how an unreleased version of the client affects the |
| 396 | system you can have devstack install it from upstream, or from local |
| 397 | git trees by specifying it in ``LIBS_FROM_GIT``. Multiple libraries |
| 398 | can be specified as a comma separated list. |
Sean Dague | 07d7e5b | 2014-11-17 07:10:14 -0500 | [diff] [blame] | 399 | |
| 400 | :: |
| 401 | |
| 402 | LIBS_FROM_GIT=python-keystoneclient,oslo.config |
| 403 | |
Marc Koderer | 46f8cb7 | 2016-05-13 09:08:16 +0200 | [diff] [blame] | 404 | Setting the variable to ``ALL`` will activate the download for all |
| 405 | libraries. |
| 406 | |
Dean Troyer | 5686dbc | 2015-03-09 14:27:51 -0500 | [diff] [blame] | 407 | Virtual Environments |
| 408 | -------------------- |
| 409 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 410 | Enable the use of Python virtual environments by setting ``USE_VENV`` |
| 411 | to ``True``. This will enable the creation of venvs for each project |
| 412 | that is defined in the ``PROJECT_VENV`` array. |
Dean Troyer | 5686dbc | 2015-03-09 14:27:51 -0500 | [diff] [blame] | 413 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 414 | Each entry in the ``PROJECT_VENV`` array contains the directory name |
| 415 | of a venv to be used for the project. The array index is the project |
| 416 | name. Multiple projects can use the same venv if desired. |
Dean Troyer | 5686dbc | 2015-03-09 14:27:51 -0500 | [diff] [blame] | 417 | |
| 418 | :: |
| 419 | |
| 420 | PROJECT_VENV["glance"]=${GLANCE_DIR}.venv |
| 421 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 422 | ``ADDITIONAL_VENV_PACKAGES`` is a comma-separated list of additional |
| 423 | packages to be installed into each venv. Often projects will not have |
| 424 | certain packages listed in its ``requirements.txt`` file because they |
| 425 | are 'optional' requirements, i.e. only needed for certain |
| 426 | configurations. By default, the enabled databases will have their |
| 427 | Python bindings added when they are enabled. |
Dean Troyer | 5686dbc | 2015-03-09 14:27:51 -0500 | [diff] [blame] | 428 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 429 | :: |
Sean Dague | 07d7e5b | 2014-11-17 07:10:14 -0500 | [diff] [blame] | 430 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 431 | ADDITIONAL_VENV_PACKAGES="python-foo, python-bar" |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 432 | |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 433 | |
| 434 | A clean install every time |
Sean Dague | 07d7e5b | 2014-11-17 07:10:14 -0500 | [diff] [blame] | 435 | -------------------------- |
| 436 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 437 | By default ``stack.sh`` only clones the project repos if they do not |
| 438 | exist in ``$DEST``. ``stack.sh`` will freshen each repo on each run if |
| 439 | ``RECLONE`` is set to ``yes``. This avoids having to manually remove |
| 440 | repos in order to get the current branch from ``$GIT_BASE``. |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 441 | |
| 442 | :: |
| 443 | |
| 444 | RECLONE=yes |
| 445 | |
Chris Dent | ebdd9ac | 2015-03-04 12:35:14 +0000 | [diff] [blame] | 446 | Upgrade packages installed by pip |
| 447 | --------------------------------- |
| 448 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 449 | By default ``stack.sh`` only installs Python packages if no version is |
| 450 | currently installed or the current version does not match a specified |
| 451 | requirement. If ``PIP_UPGRADE`` is set to ``True`` then existing |
| 452 | required Python packages will be upgraded to the most recent version |
| 453 | that matches requirements. |
Chris Dent | ebdd9ac | 2015-03-04 12:35:14 +0000 | [diff] [blame] | 454 | |
| 455 | :: |
| 456 | |
| 457 | PIP_UPGRADE=True |
| 458 | |
John Hua | a4693b5 | 2015-08-06 13:53:35 +0100 | [diff] [blame] | 459 | Guest Images |
| 460 | ------------ |
| 461 | |
| 462 | Images provided in URLS via the comma-separated ``IMAGE_URLS`` |
| 463 | variable will be downloaded and uploaded to glance by DevStack. |
| 464 | |
| 465 | Default guest-images are predefined for each type of hypervisor and |
| 466 | their testing-requirements in ``stack.sh``. Setting |
| 467 | ``DOWNLOAD_DEFAULT_IMAGES=False`` will prevent DevStack downloading |
| 468 | these default images; in that case, you will want to populate |
| 469 | ``IMAGE_URLS`` with sufficient images to satisfy testing-requirements. |
| 470 | |
| 471 | :: |
| 472 | |
| 473 | DOWNLOAD_DEFAULT_IMAGES=False |
| 474 | IMAGE_URLS="http://foo.bar.com/image.qcow," |
| 475 | IMAGE_URLS+="http://foo.bar.com/image2.qcow" |
| 476 | |
Rafael Folco | f0131e1 | 2015-09-23 12:55:02 -0500 | [diff] [blame] | 477 | |
| 478 | Instance Type |
| 479 | ------------- |
| 480 | |
| 481 | ``DEFAULT_INSTANCE_TYPE`` can be used to configure the default instance |
| 482 | type. When this parameter is not specified, Devstack creates additional |
| 483 | micro & nano flavors for really small instances to run Tempest tests. |
| 484 | |
| 485 | For guests with larger memory requirements, ``DEFAULT_INSTANCE_TYPE`` |
| 486 | should be specified in the configuration file so Tempest selects the |
| 487 | default flavors instead. |
| 488 | |
| 489 | KVM on Power with QEMU 2.4 requires 512 MB to load the firmware - |
| 490 | `QEMU 2.4 - PowerPC <http://wiki.qemu.org/ChangeLog/2.4>`__ so users |
| 491 | running instances on ppc64/ppc64le can choose one of the default |
| 492 | created flavors as follows: |
| 493 | |
| 494 | :: |
| 495 | |
| 496 | DEFAULT_INSTANCE_TYPE=m1.tiny |
| 497 | |
| 498 | |
John Davidge | 21529a5 | 2014-06-30 09:55:11 -0400 | [diff] [blame] | 499 | IP Version |
Brian Haley | 180f5eb | 2015-06-16 13:14:31 -0400 | [diff] [blame] | 500 | ---------- |
| 501 | |
Clay Gerrard | 148d0e6 | 2016-09-01 02:38:06 -0700 | [diff] [blame] | 502 | ``IP_VERSION`` can be used to configure Neutron to create either an |
| 503 | IPv4, IPv6, or dual-stack self-service project data-network by with |
Sean Dague | db48db1 | 2016-04-06 08:09:31 -0400 | [diff] [blame] | 504 | either ``IP_VERSION=4``, ``IP_VERSION=6``, or ``IP_VERSION=4+6`` |
Clay Gerrard | 148d0e6 | 2016-09-01 02:38:06 -0700 | [diff] [blame] | 505 | respectively. |
John Davidge | 21529a5 | 2014-06-30 09:55:11 -0400 | [diff] [blame] | 506 | |
| 507 | :: |
| 508 | |
Clay Gerrard | 148d0e6 | 2016-09-01 02:38:06 -0700 | [diff] [blame] | 509 | IP_VERSION=4+6 |
John Davidge | 21529a5 | 2014-06-30 09:55:11 -0400 | [diff] [blame] | 510 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 511 | The following optional variables can be used to alter the default IPv6 |
| 512 | behavior: |
John Davidge | 21529a5 | 2014-06-30 09:55:11 -0400 | [diff] [blame] | 513 | |
| 514 | :: |
| 515 | |
| 516 | IPV6_RA_MODE=slaac |
| 517 | IPV6_ADDRESS_MODE=slaac |
Kevin Benton | 4bfbc29 | 2016-11-15 17:26:05 -0800 | [diff] [blame] | 518 | IPV6_ADDRS_SAFE_TO_USE=fd$IPV6_GLOBAL_ID::/56 |
John Davidge | 21529a5 | 2014-06-30 09:55:11 -0400 | [diff] [blame] | 519 | IPV6_PRIVATE_NETWORK_GATEWAY=fd$IPV6_GLOBAL_ID::1 |
| 520 | |
Kevin Benton | 4bfbc29 | 2016-11-15 17:26:05 -0800 | [diff] [blame] | 521 | *Note*: ``IPV6_ADDRS_SAFE_TO_USE`` and ``IPV6_PRIVATE_NETWORK_GATEWAY`` |
| 522 | can be configured with any valid IPv6 prefix. The default values make |
| 523 | use of an auto-generated ``IPV6_GLOBAL_ID`` to comply with RFC4193. |
Brian Haley | 180f5eb | 2015-06-16 13:14:31 -0400 | [diff] [blame] | 524 | |
Ian Wienand | 815db16 | 2015-08-06 10:25:45 +1000 | [diff] [blame] | 525 | Service Version |
| 526 | ~~~~~~~~~~~~~~~ |
| 527 | |
| 528 | DevStack can enable service operation over either IPv4 or IPv6 by |
| 529 | setting ``SERVICE_IP_VERSION`` to either ``SERVICE_IP_VERSION=4`` or |
| 530 | ``SERVICE_IP_VERSION=6`` respectively. |
| 531 | |
| 532 | When set to ``4`` devstack services will open listen sockets on |
| 533 | ``0.0.0.0`` and service endpoints will be registered using ``HOST_IP`` |
| 534 | as the address. |
| 535 | |
| 536 | When set to ``6`` devstack services will open listen sockets on ``::`` |
| 537 | and service endpoints will be registered using ``HOST_IPV6`` as the |
| 538 | address. |
| 539 | |
| 540 | The default value for this setting is ``4``. Dual-mode support, for |
| 541 | example ``4+6`` is not currently supported. ``HOST_IPV6`` can |
| 542 | optionally be used to alter the default IPv6 address |
Brian Haley | 180f5eb | 2015-06-16 13:14:31 -0400 | [diff] [blame] | 543 | |
| 544 | :: |
| 545 | |
| 546 | HOST_IPV6=${some_local_ipv6_address} |
John Davidge | 21529a5 | 2014-06-30 09:55:11 -0400 | [diff] [blame] | 547 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 548 | Multi-node setup |
| 549 | ~~~~~~~~~~~~~~~~ |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 550 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 551 | See the :doc:`multi-node lab guide<guides/multinode-lab>` |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 552 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 553 | Projects |
| 554 | -------- |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 555 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 556 | Neutron |
| 557 | ~~~~~~~ |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 558 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 559 | See the :doc:`neutron configuration guide<guides/neutron>` for |
| 560 | details on configuration of Neutron |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 561 | |
Sean M. Collins | 09e550c | 2014-10-21 11:40:08 -0400 | [diff] [blame] | 562 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 563 | Swift |
| 564 | ~~~~~ |
| 565 | |
| 566 | Swift is disabled by default. When enabled, it is configured with |
| 567 | only one replica to avoid being IO/memory intensive on a small |
Sean Dague | 8b8441f | 2017-05-02 06:14:11 -0400 | [diff] [blame] | 568 | VM. |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 569 | |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 570 | If you would like to enable Swift you can add this to your ``localrc`` |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 571 | section: |
| 572 | |
| 573 | :: |
| 574 | |
| 575 | enable_service s-proxy s-object s-container s-account |
| 576 | |
| 577 | If you want a minimal Swift install with only Swift and Keystone you |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 578 | can have this instead in your ``localrc`` section: |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 579 | |
| 580 | :: |
| 581 | |
| 582 | disable_all_services |
| 583 | enable_service key mysql s-proxy s-object s-container s-account |
| 584 | |
| 585 | If you only want to do some testing of a real normal swift cluster |
| 586 | with multiple replicas you can do so by customizing the variable |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 587 | ``SWIFT_REPLICAS`` in your ``localrc`` section (usually to 3). |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 588 | |
Christian Schwede | 91d2245 | 2016-04-12 10:53:46 +0200 | [diff] [blame] | 589 | You can manually override the ring building to use specific storage |
| 590 | nodes, for example when you want to test a multinode environment. In |
| 591 | this case you have to set a space-separated list of IPs in |
| 592 | ``SWIFT_STORAGE_IPS`` in your ``localrc`` section that should be used |
| 593 | as Swift storage nodes. |
| 594 | Please note that this does not create a multinode setup, it is only |
| 595 | used when adding nodes to the Swift rings. |
| 596 | |
| 597 | :: |
| 598 | |
| 599 | SWIFT_STORAGE_IPS="192.168.1.10 192.168.1.11 192.168.1.12" |
| 600 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 601 | Swift S3 |
| 602 | ++++++++ |
| 603 | |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 604 | If you are enabling ``swift3`` in ``ENABLED_SERVICES`` DevStack will |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 605 | install the swift3 middleware emulation. Swift will be configured to |
| 606 | act as a S3 endpoint for Keystone so effectively replacing the |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 607 | ``nova-objectstore``. |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 608 | |
Sean Dague | 8b8441f | 2017-05-02 06:14:11 -0400 | [diff] [blame] | 609 | Only Swift proxy server is launched in the systemd system all other |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 610 | services are started in background and managed by ``swift-init`` tool. |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 611 | |
| 612 | Heat |
| 613 | ~~~~ |
| 614 | |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 615 | Heat is disabled by default (see ``stackrc`` file). To enable it |
| 616 | explicitly you'll need the following settings in your ``localrc`` |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 617 | section |
| 618 | |
| 619 | :: |
| 620 | |
| 621 | enable_service heat h-api h-api-cfn h-api-cw h-eng |
| 622 | |
| 623 | Heat can also run in standalone mode, and be configured to orchestrate |
| 624 | on an external OpenStack cloud. To launch only Heat in standalone mode |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 625 | you'll need the following settings in your ``localrc`` section |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 626 | |
| 627 | :: |
| 628 | |
| 629 | disable_all_services |
| 630 | enable_service rabbit mysql heat h-api h-api-cfn h-api-cw h-eng |
| 631 | HEAT_STANDALONE=True |
| 632 | KEYSTONE_SERVICE_HOST=... |
| 633 | KEYSTONE_AUTH_HOST=... |
| 634 | |
| 635 | Tempest |
| 636 | ~~~~~~~ |
| 637 | |
| 638 | If tempest has been successfully configured, a basic set of smoke |
| 639 | tests can be run as follows: |
| 640 | |
| 641 | :: |
| 642 | |
| 643 | $ cd /opt/stack/tempest |
| 644 | $ tox -efull tempest.scenario.test_network_basic_ops |
| 645 | |
| 646 | By default tempest is downloaded and the config file is generated, but the |
| 647 | tempest package is not installed in the system's global site-packages (the |
| 648 | package install includes installing dependences). So tempest won't run |
| 649 | outside of tox. If you would like to install it add the following to your |
| 650 | ``localrc`` section: |
| 651 | |
| 652 | :: |
| 653 | |
| 654 | INSTALL_TEMPEST=True |
| 655 | |
| 656 | |
| 657 | Xenserver |
| 658 | ~~~~~~~~~ |
| 659 | |
| 660 | If you would like to use Xenserver as the hypervisor, please refer to |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 661 | the instructions in ``./tools/xen/README.md``. |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 662 | |
| 663 | Cells |
| 664 | ~~~~~ |
| 665 | |
| 666 | `Cells <http://wiki.openstack.org/blueprint-nova-compute-cells>`__ is |
| 667 | an alternative scaling option. To setup a cells environment add the |
Markus Zoeller | c30657d | 2015-11-02 11:27:46 +0100 | [diff] [blame] | 668 | following to your ``localrc`` section: |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 669 | |
| 670 | :: |
| 671 | |
| 672 | enable_service n-cell |
| 673 | |
| 674 | Be aware that there are some features currently missing in cells, one |
| 675 | notable one being security groups. The exercises have been patched to |
| 676 | disable functionality not supported by cells. |
| 677 | |
| 678 | Cinder |
| 679 | ~~~~~~ |
| 680 | |
| 681 | The logical volume group used to hold the Cinder-managed volumes is |
Jordan Pittier | f5069f3 | 2016-11-08 12:10:12 +0100 | [diff] [blame] | 682 | set by ``VOLUME_GROUP_NAME``, the logical volume name prefix is set with |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 683 | ``VOLUME_NAME_PREFIX`` and the size of the volume backing file is set |
| 684 | with ``VOLUME_BACKING_FILE_SIZE``. |
| 685 | |
| 686 | :: |
| 687 | |
Jordan Pittier | f5069f3 | 2016-11-08 12:10:12 +0100 | [diff] [blame] | 688 | VOLUME_GROUP_NAME="stack-volumes" |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 689 | VOLUME_NAME_PREFIX="volume-" |
| 690 | VOLUME_BACKING_FILE_SIZE=10250M |
| 691 | |
| 692 | |
| 693 | Keystone |
| 694 | ~~~~~~~~ |
| 695 | |
| 696 | Multi-Region Setup |
| 697 | ++++++++++++++++++ |
| 698 | |
| 699 | We want to setup two devstack (RegionOne and RegionTwo) with shared |
| 700 | keystone (same users and services) and horizon. Keystone and Horizon |
| 701 | will be located in RegionOne. Full spec is available at: |
| 702 | `<https://wiki.openstack.org/wiki/Heat/Blueprints/Multi_Region_Support_for_Heat>`__. |
| 703 | |
| 704 | In RegionOne: |
| 705 | |
| 706 | :: |
| 707 | |
| 708 | REGION_NAME=RegionOne |
| 709 | |
| 710 | In RegionTwo: |
| 711 | |
| 712 | :: |
henriquetruta | f212622 | 2016-01-05 13:43:18 -0300 | [diff] [blame] | 713 | |
Ian Wienand | 7d5be29 | 2015-08-10 13:39:17 +1000 | [diff] [blame] | 714 | disable_service horizon |
| 715 | KEYSTONE_SERVICE_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE> |
| 716 | KEYSTONE_AUTH_HOST=<KEYSTONE_IP_ADDRESS_FROM_REGION_ONE> |
| 717 | REGION_NAME=RegionTwo |
zhiyuan_cai | 6f1781f | 2016-04-07 18:36:46 +0800 | [diff] [blame] | 718 | KEYSTONE_REGION_NAME=RegionOne |
| 719 | |
| 720 | In the devstack for RegionOne, we set REGION_NAME as RegionOne, so region of |
| 721 | the services started in this devstack are registered as RegionOne. In devstack |
| 722 | for RegionTwo, similarly, we set REGION_NAME as RegionTwo since we want |
| 723 | services started in this devstack to be registered in RegionTwo. But Keystone |
| 724 | service is started and registered in RegionOne, not RegionTwo, so we use |
| 725 | KEYSTONE_REGION_NAME to specify the region of Keystone service. |
| 726 | KEYSTONE_REGION_NAME has a default value the same as REGION_NAME thus we omit |
| 727 | it in the configuration of RegionOne. |
henriquetruta | f212622 | 2016-01-05 13:43:18 -0300 | [diff] [blame] | 728 | |
| 729 | Disabling Identity API v2 |
| 730 | +++++++++++++++++++++++++ |
| 731 | |
| 732 | The Identity API v2 is deprecated as of Mitaka and it is recommended to only |
| 733 | use the v3 API. It is possible to setup keystone without v2 API, by doing: |
| 734 | |
| 735 | :: |
| 736 | |
| 737 | ENABLE_IDENTITY_V2=False |
Ian Wienand | 7cd16ce | 2016-04-08 09:40:56 +1000 | [diff] [blame] | 738 | |
| 739 | Exercises |
| 740 | ~~~~~~~~~ |
| 741 | |
| 742 | ``exerciserc`` is used to configure settings for the exercise scripts. |
| 743 | The values shown below are the default values. These can all be |
| 744 | overridden by setting them in the ``localrc`` section. |
| 745 | |
| 746 | * Max time to wait while vm goes from build to active state |
| 747 | |
| 748 | :: |
| 749 | |
| 750 | ACTIVE_TIMEOUT==30 |
| 751 | |
| 752 | * Max time to wait for proper IP association and dis-association. |
| 753 | |
| 754 | :: |
| 755 | |
| 756 | ASSOCIATE_TIMEOUT=15 |
| 757 | |
| 758 | * Max time till the vm is bootable |
| 759 | |
| 760 | :: |
| 761 | |
| 762 | BOOT_TIMEOUT=30 |
| 763 | |
| 764 | * Max time from run instance command until it is running |
| 765 | |
| 766 | :: |
| 767 | |
| 768 | RUNNING_TIMEOUT=$(($BOOT_TIMEOUT + $ACTIVE_TIMEOUT)) |
| 769 | |
| 770 | * Max time to wait for a vm to terminate |
| 771 | |
| 772 | :: |
| 773 | |
| 774 | TERMINATE_TIMEOUT=30 |