blob: f9a996e0547ef0e1c94c8adc24f300fe2fdab97b [file] [log] [blame] [view]
Dean Troyere9819d52012-03-21 11:25:06 -05001DevStack is a set of scripts and utilities to quickly deploy an OpenStack cloud.
Anthony Young63987872011-09-30 11:34:43 -07002
3# Goals
4
Dean Troyer5218d452012-02-04 02:13:23 -06005* To quickly build dev OpenStack environments in a clean Ubuntu or Fedora environment
Anthony Young073d17d2011-11-23 12:50:46 -08006* To describe working configurations of OpenStack (which code branches work together? what do config files look like for those branches?)
7* To make it easier for developers to dive into OpenStack so that they can productively contribute without having to understand every part of the system at once
Anthony Young63987872011-09-30 11:34:43 -07008* To make it easy to prototype cross-project features
Dean Troyerb8dd27b2013-10-17 12:03:55 -05009* To provide an environment for the OpenStack CI testing on every commit to the projects
Jesse Andrewsba23cc72011-09-11 03:22:13 -070010
Dean Troyerb8dd27b2013-10-17 12:03:55 -050011Read more at http://devstack.org.
Jesse Andrewsb69d6ce2011-10-13 10:36:00 -070012
Dean Troyerb8dd27b2013-10-17 12:03:55 -050013IMPORTANT: Be sure to carefully read `stack.sh` and any other scripts you
14execute before you run them, as they install software and will alter your
15networking configuration. We strongly recommend that you run `stack.sh`
16in a clean and disposable vm when you are first getting started.
Dean Troyer2aa2a892013-08-04 19:53:19 -050017
Anthony Young073d17d2011-11-23 12:50:46 -080018# Versions
19
Dean Troyerb8dd27b2013-10-17 12:03:55 -050020The DevStack master branch generally points to trunk versions of OpenStack
21components. For older, stable versions, look for branches named
22stable/[release] in the DevStack repo. For example, you can do the
23following to create a grizzly OpenStack cloud:
Anthony Young073d17d2011-11-23 12:50:46 -080024
Dean Troyerb8dd27b2013-10-17 12:03:55 -050025 git checkout stable/grizzly
Anthony Young073d17d2011-11-23 12:50:46 -080026 ./stack.sh
27
Dean Troyerb8dd27b2013-10-17 12:03:55 -050028You can also pick specific OpenStack project releases by setting the appropriate
29`*_BRANCH` variables in the ``localrc`` section of `local.conf` (look in
30`stackrc` for the default set). Usually just before a release there will be
31milestone-proposed branches that need to be tested::
Dean Troyerce043c42012-02-03 22:56:38 -060032
Steve Kowalik047cac52013-11-07 22:36:10 +110033 GLANCE_REPO=git://git.openstack.org/openstack/glance.git
Dean Troyere9819d52012-03-21 11:25:06 -050034 GLANCE_BRANCH=milestone-proposed
Dean Troyerce043c42012-02-03 22:56:38 -060035
36# Start A Dev Cloud
37
Dean Troyerb8dd27b2013-10-17 12:03:55 -050038Installing in a dedicated disposable VM is safer than installing on your
39dev machine! Plus you can pick one of the supported Linux distros for
40your VM. To start a dev cloud run the following NOT AS ROOT (see
41**DevStack Execution Environment** below for more on user accounts):
Anthony Young0e65abf2011-09-30 09:24:00 -070042
43 ./stack.sh
44
Anthony Young073d17d2011-11-23 12:50:46 -080045When the script finishes executing, you should be able to access OpenStack endpoints, like so:
Anthony Young63987872011-09-30 11:34:43 -070046
Tres Henryca85b792011-10-28 14:00:21 -070047* Horizon: http://myhost/
Anthony Young63987872011-09-30 11:34:43 -070048* Keystone: http://myhost:5000/v2.0/
49
Anthony Young073d17d2011-11-23 12:50:46 -080050We also provide an environment file that you can use to interact with your cloud via CLI:
51
Dean Troyerb8dd27b2013-10-17 12:03:55 -050052 # source openrc file to load your environment with OpenStack CLI creds
Anthony Young073d17d2011-11-23 12:50:46 -080053 . openrc
54 # list instances
55 nova list
Dean Troyer0bd24102012-03-08 00:33:54 -060056
57If the EC2 API is your cup-o-tea, you can create credentials and use euca2ools:
58
59 # source eucarc to generate EC2 credentials and set up the environment
60 . eucarc
Anthony Young073d17d2011-11-23 12:50:46 -080061 # list instances using ec2 api
62 euca-describe-instances
63
Dean Troyer23f69d82013-10-04 12:35:24 -050064# DevStack Execution Environment
65
66DevStack runs rampant over the system it runs on, installing things and uninstalling other things. Running this on a system you care about is a recipe for disappointment, or worse. Alas, we're all in the virtualization business here, so run it in a VM. And take advantage of the snapshot capabilities of your hypervisor of choice to reduce testing cycle times. You might even save enough time to write one more feature before the next feature freeze...
67
Dean Troyerb8dd27b2013-10-17 12:03:55 -050068``stack.sh`` needs to have root access for a lot of tasks, but uses ``sudo``
69for all of those tasks. However, it needs to be not-root for most of its
70work and for all of the OpenStack services. ``stack.sh`` specifically
71does not run if started as root.
72
73This is a recent change (Oct 2013) from the previous behaviour of
74automatically creating a ``stack`` user. Automatically creating
75user accounts is not the right response to running as root, so
Sean Dague7d4c7e02014-03-12 08:05:08 -040076that bit is now an explicit step using ``tools/create-stack-user.sh``.
Dean Troyerb8dd27b2013-10-17 12:03:55 -050077Run that (as root!) or just check it out to see what DevStack's
78expectations are for the account it runs under. Many people simply
79use their usual login (the default 'ubuntu' login on a UEC image
80for example).
Dean Troyer23f69d82013-10-04 12:35:24 -050081
Anthony Young63987872011-09-30 11:34:43 -070082# Customizing
83
Dean Troyerb8dd27b2013-10-17 12:03:55 -050084You can override environment variables used in `stack.sh` by creating file
Roman Bogorodskiy4df4a152013-11-12 12:09:40 +000085name `local.conf` with a ``localrc`` section as shown below. It is likely
Dean Troyerb8dd27b2013-10-17 12:03:55 -050086that you will need to do this to tweak your networking configuration should
87you need to access your cloud from a different host.
88
89 [[local|localrc]]
90 VARIABLE=value
91
92See the **Local Configuration** section below for more details.
Chmouel Boudjnah782f24e2012-02-29 13:42:44 +000093
Terry Wilson428af5a2012-11-01 16:12:39 -040094# Database Backend
95
96Multiple database backends are available. The available databases are defined in the lib/databases directory.
Dean Troyerb8dd27b2013-10-17 12:03:55 -050097`mysql` is the default database, choose a different one by putting the
98following in the `localrc` section:
Terry Wilson428af5a2012-11-01 16:12:39 -040099
Dean Troyerafc29fe2013-02-07 15:56:24 -0600100 disable_service mysql
101 enable_service postgresql
Terry Wilson428af5a2012-11-01 16:12:39 -0400102
Dean Troyerafc29fe2013-02-07 15:56:24 -0600103`mysql` is the default database.
Terry Wilson428af5a2012-11-01 16:12:39 -0400104
ewindisch3bae7c22012-01-18 11:18:35 -0500105# RPC Backend
106
107Multiple RPC backends are available. Currently, this
108includes RabbitMQ (default), Qpid, and ZeroMQ. Your backend of
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500109choice may be selected via the `localrc` section.
ewindisch3bae7c22012-01-18 11:18:35 -0500110
111Note that selecting more than one RPC backend will result in a failure.
112
113Example (ZeroMQ):
114
115 ENABLED_SERVICES="$ENABLED_SERVICES,-rabbit,-qpid,zeromq"
116
117Example (Qpid):
118
119 ENABLED_SERVICES="$ENABLED_SERVICES,-rabbit,-zeromq,qpid"
120
zhang-hared98a5d02013-06-21 18:18:02 +0800121# Apache Frontend
122
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500123Apache web server is enabled for wsgi services by setting
124`APACHE_ENABLED_SERVICES` in your ``localrc`` section. Remember to
125enable these services at first as above.
zhang-hared98a5d02013-06-21 18:18:02 +0800126
Gabriel Assis Bezerra71fd1c42014-04-30 13:08:25 -0300127 APACHE_ENABLED_SERVICES+=key,swift
zhang-hared98a5d02013-06-21 18:18:02 +0800128
Chmouel Boudjnah782f24e2012-02-29 13:42:44 +0000129# Swift
130
Ian Wienand0352f582013-07-24 13:01:32 +1000131Swift is disabled by default. When enabled, it is configured with
132only one replica to avoid being IO/memory intensive on a small
133vm. When running with only one replica the account, container and
134object services will run directly in screen. The others services like
135replicator, updaters or auditor runs in background.
Chmouel Boudjnah782f24e2012-02-29 13:42:44 +0000136
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500137If you would like to enable Swift you can add this to your `localrc` section:
Chmouel Boudjnah0c3a5582013-03-06 10:58:33 +0100138
Ian Wienand0352f582013-07-24 13:01:32 +1000139 enable_service s-proxy s-object s-container s-account
Chmouel Boudjnah782f24e2012-02-29 13:42:44 +0000140
Ian Wienand0352f582013-07-24 13:01:32 +1000141If you want a minimal Swift install with only Swift and Keystone you
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500142can have this instead in your `localrc` section:
Chmouel Boudjnah504f8712012-03-15 20:43:26 +0000143
Doug Hellmannf04178f2012-07-05 17:10:03 -0400144 disable_all_services
Chmouel Boudjnah0c3a5582013-03-06 10:58:33 +0100145 enable_service key mysql s-proxy s-object s-container s-account
Chmouel Boudjnah504f8712012-03-15 20:43:26 +0000146
Ian Wienand0352f582013-07-24 13:01:32 +1000147If you only want to do some testing of a real normal swift cluster
148with multiple replicas you can do so by customizing the variable
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500149`SWIFT_REPLICAS` in your `localrc` section (usually to 3).
Chmouel Boudjnah0c3a5582013-03-06 10:58:33 +0100150
151# Swift S3
Chmouel Boudjnah504f8712012-03-15 20:43:26 +0000152
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500153If you are enabling `swift3` in `ENABLED_SERVICES` DevStack will
Ian Wienand0352f582013-07-24 13:01:32 +1000154install the swift3 middleware emulation. Swift will be configured to
155act as a S3 endpoint for Keystone so effectively replacing the
156`nova-objectstore`.
Chmouel Boudjnah504f8712012-03-15 20:43:26 +0000157
Ian Wienand0352f582013-07-24 13:01:32 +1000158Only Swift proxy server is launched in the screen session all other
159services are started in background and managed by `swift-init` tool.
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700160
Mark McClainb05c8762013-07-06 23:29:39 -0400161# Neutron
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700162
163Basic Setup
164
Ian Wienand0352f582013-07-24 13:01:32 +1000165In order to enable Neutron a single node setup, you'll need the
Dean Troyer91baef32014-02-28 11:11:45 -0600166following settings in your `local.conf`:
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700167
168 disable_service n-net
169 enable_service q-svc
170 enable_service q-agt
171 enable_service q-dhcp
172 enable_service q-l3
173 enable_service q-meta
Emilien Macchi40546f72013-09-24 15:10:25 +0200174 enable_service q-metering
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500175 # Optional, to enable tempest configuration as part of DevStack
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700176 enable_service tempest
177
Dean Troyercc6b4432013-04-08 15:38:03 -0500178Then run `stack.sh` as normal.
179
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500180DevStack supports setting specific Neutron configuration flags to the
181service, Open vSwitch plugin and LinuxBridge plugin configuration files.
Dean Troyer91baef32014-02-28 11:11:45 -0600182To make use of this feature, the settings can be added to ``local.conf``.
183The old ``Q_XXX_EXTRA_XXX_OPTS`` variables are deprecated and will be removed
184in the near future. The ``local.conf`` headers for the replacements are:
Kyle Mesteryebfac642013-05-17 15:20:56 -0500185
Dean Troyer91baef32014-02-28 11:11:45 -0600186* ``Q_SRV_EXTRA_OPTS``:
Kyle Mesteryebfac642013-05-17 15:20:56 -0500187
Dean Troyer91baef32014-02-28 11:11:45 -0600188 [[post-config|/$Q_PLUGIN_CONF_FILE]]
189 [linuxbridge] # or [ovs]
Kyle Mesteryebfac642013-05-17 15:20:56 -0500190
Dean Troyer91baef32014-02-28 11:11:45 -0600191* ``Q_AGENT_EXTRA_AGENT_OPTS``:
192
193 [[post-config|/$Q_PLUGIN_CONF_FILE]]
194 [agent]
195
196* ``Q_AGENT_EXTRA_SRV_OPTS``:
197
198 [[post-config|/$Q_PLUGIN_CONF_FILE]]
199 [linuxbridge] # or [ovs]
200
201* ``Q_SRV_EXTRA_DEFAULT_OPTS``:
202
203 [[post-config|$NEUTRON_CONF]]
204 [DEFAULT]
205
206Example extra config in `local.conf`:
207
208 [[post-config|/$Q_PLUGIN_CONF_FILE]]
209 [agent]
210 tunnel_type=vxlan
211 vxlan_udp_port=8472
212
213 [[post-config|$NEUTRON_CONF]]
214 [DEFAULT]
215 tenant_network_type=vxlan
Kyle Mesteryebfac642013-05-17 15:20:56 -0500216
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500217DevStack also supports configuring the Neutron ML2 plugin. The ML2 plugin
Dean Troyer91baef32014-02-28 11:11:45 -0600218can run with the OVS, LinuxBridge, or Hyper-V agents on compute hosts. This
219is a simple way to configure the ml2 plugin:
Kyle Mesteryb7726592013-07-19 14:26:53 +0000220
221 # VLAN configuration
222 Q_PLUGIN=ml2
223 ENABLE_TENANT_VLANS=True
224
225 # GRE tunnel configuration
226 Q_PLUGIN=ml2
227 ENABLE_TENANT_TUNNELS=True
228
229 # VXLAN tunnel configuration
230 Q_PLUGIN=ml2
231 Q_ML2_TENANT_NETWORK_TYPE=vxlan
232
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500233The above will default in DevStack to using the OVS on each compute host.
234To change this, set the `Q_AGENT` variable to the agent you want to run
235(e.g. linuxbridge).
Kyle Mesteryb7726592013-07-19 14:26:53 +0000236
237 Variable Name Notes
238 -------------------------------------------------------------------------------------
239 Q_AGENT This specifies which agent to run with the ML2 Plugin (either `openvswitch` or `linuxbridge`).
240 Q_ML2_PLUGIN_MECHANISM_DRIVERS The ML2 MechanismDrivers to load. The default is none. Note, ML2 will work with the OVS and LinuxBridge agents by default.
241 Q_ML2_PLUGIN_TYPE_DRIVERS The ML2 TypeDrivers to load. Defaults to all available TypeDrivers.
242 Q_ML2_PLUGIN_GRE_TYPE_OPTIONS GRE TypeDriver options. Defaults to none.
243 Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS VXLAN TypeDriver options. Defaults to none.
244 Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS VLAN TypeDriver options. Defaults to none.
Kyle Mesteryb7726592013-07-19 14:26:53 +0000245
Steve Baker389b3a02013-08-01 10:44:09 +1200246# Heat
247
248Heat is disabled by default. To enable it you'll need the following settings
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500249in your `localrc` section:
Steve Baker389b3a02013-08-01 10:44:09 +1200250
251 enable_service heat h-api h-api-cfn h-api-cw h-eng
252
253Heat can also run in standalone mode, and be configured to orchestrate
254on an external OpenStack cloud. To launch only Heat in standalone mode
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500255you'll need the following settings in your `localrc` section:
Steve Baker389b3a02013-08-01 10:44:09 +1200256
257 disable_all_services
258 enable_service rabbit mysql heat h-api h-api-cfn h-api-cw h-eng
259 HEAT_STANDALONE=True
260 KEYSTONE_SERVICE_HOST=...
261 KEYSTONE_AUTH_HOST=...
262
Dean Troyercc6b4432013-04-08 15:38:03 -0500263# Tempest
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700264
265If tempest has been successfully configured, a basic set of smoke tests can be run as follows:
266
267 $ cd /opt/stack/tempest
Kui Shif9b47382013-08-02 05:53:58 +0800268 $ nosetests tempest/scenario/test_network_basic_ops.py
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700269
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500270# DevStack on Xenserver
271
272If you would like to use Xenserver as the hypervisor, please refer to the instructions in `./tools/xen/README.md`.
273
Dean Troyercdf3d762013-10-15 09:42:43 -0500274# Additional Projects
275
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500276DevStack has a hook mechanism to call out to a dispatch script at specific
277points in the execution of `stack.sh`, `unstack.sh` and `clean.sh`. This
278allows upper-layer projects, especially those that the lower layer projects
279have no dependency on, to be added to DevStack without modifying the core
280scripts. Tempest is built this way as an example of how to structure the
281dispatch script, see `extras.d/80-tempest.sh`. See `extras.d/README.md`
282for more information.
Dean Troyercdf3d762013-10-15 09:42:43 -0500283
Dean Troyercc6b4432013-04-08 15:38:03 -0500284# Multi-Node Setup
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700285
Mark McClainb05c8762013-07-06 23:29:39 -0400286A more interesting setup involves running multiple compute nodes, with Neutron networks connecting VMs on different compute nodes.
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700287You should run at least one "controller node", which should have a `stackrc` that includes at least:
288
289 disable_service n-net
290 enable_service q-svc
291 enable_service q-agt
292 enable_service q-dhcp
293 enable_service q-l3
294 enable_service q-meta
Mark McClainb05c8762013-07-06 23:29:39 -0400295 enable_service neutron
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700296
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500297You likely want to change your `localrc` section to run a scheduler that
298will balance VMs across hosts:
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700299
300 SCHEDULER=nova.scheduler.simple.SimpleScheduler
301
302You can then run many compute nodes, each of which should have a `stackrc` which includes the following, with the IP address of the above controller node:
303
Mark McClainb05c8762013-07-06 23:29:39 -0400304 ENABLED_SERVICES=n-cpu,rabbit,g-api,neutron,q-agt
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700305 SERVICE_HOST=[IP of controller node]
306 MYSQL_HOST=$SERVICE_HOST
307 RABBIT_HOST=$SERVICE_HOST
308 Q_HOST=$SERVICE_HOST
Eric Windisch800bf382013-05-24 11:21:11 -0400309 MATCHMAKER_REDIS_HOST=$SERVICE_HOST
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000310
311# Cells
312
313Cells is a new scaling option with a full spec at http://wiki.openstack.org/blueprint-nova-compute-cells.
314
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500315To setup a cells environment add the following to your `localrc` section:
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000316
317 enable_service n-cell
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000318
Chris Behrensc62c2b92013-07-24 03:56:13 -0700319Be aware that there are some features currently missing in cells, one notable one being security groups. The exercises have been patched to disable functionality not supported by cells.
Dean Troyer893e6632013-09-13 15:05:51 -0500320
321
322# Local Configuration
323
324Historically DevStack has used ``localrc`` to contain all local configuration and customizations. More and more of the configuration variables available for DevStack are passed-through to the individual project configuration files. The old mechanism for this required specific code for each file and did not scale well. This is handled now by a master local configuration file.
325
326# local.conf
327
328The new config file ``local.conf`` is an extended-INI format that introduces a new meta-section header that provides some additional information such as a phase name and destination config filename:
329
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500330 [[ <phase> | <config-file-name> ]]
Dean Troyer893e6632013-09-13 15:05:51 -0500331
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500332where ``<phase>`` is one of a set of phase names defined by ``stack.sh``
333and ``<config-file-name>`` is the configuration filename. The filename is
334eval'ed in the ``stack.sh`` context so all environment variables are
335available and may be used. Using the project config file variables in
336the header is strongly suggested (see the ``NOVA_CONF`` example below).
337If the path of the config file does not exist it is skipped.
Dean Troyer893e6632013-09-13 15:05:51 -0500338
339The defined phases are:
340
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500341* **local** - extracts ``localrc`` from ``local.conf`` before ``stackrc`` is sourced
342* **post-config** - runs after the layer 2 services are configured and before they are started
343* **extra** - runs after services are started and before any files in ``extra.d`` are executed
Ryan Hsufeb28832013-11-07 12:12:35 -0800344* **post-extra** - runs after files in ``extra.d`` are executed
Dean Troyer893e6632013-09-13 15:05:51 -0500345
346The file is processed strictly in sequence; meta-sections may be specified more than once but if any settings are duplicated the last to appear in the file will be used.
347
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500348 [[post-config|$NOVA_CONF]]
349 [DEFAULT]
350 use_syslog = True
Dean Troyer893e6632013-09-13 15:05:51 -0500351
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500352 [osapi_v3]
353 enabled = False
Dean Troyer893e6632013-09-13 15:05:51 -0500354
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500355A specific meta-section ``local|localrc`` is used to provide a default
356``localrc`` file (actually ``.localrc.auto``). This allows all custom
357settings for DevStack to be contained in a single file. If ``localrc``
358exists it will be used instead to preserve backward-compatibility.
Dean Troyer893e6632013-09-13 15:05:51 -0500359
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500360 [[local|localrc]]
361 FIXED_RANGE=10.254.1.0/24
362 ADMIN_PASSWORD=speciale
363 LOGFILE=$DEST/logs/stack.sh.log
Dean Troyer893e6632013-09-13 15:05:51 -0500364
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500365Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to *NOT*
366start with a ``/`` (slash) character. A slash will need to be added:
Dean Troyer893e6632013-09-13 15:05:51 -0500367
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500368 [[post-config|/$Q_PLUGIN_CONF_FILE]]