blob: 93d139621f94e3969c9156c54256b29c66810f80 [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
Dean Troyere9819d52012-03-21 11:25:06 -050033 GLANCE_REPO=https://github.com/openstack/glance.git
34 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
76that bit is now an explicit step using ``tools/create-stack-user.sh``.
77Run 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
zhang-hared98a5d02013-06-21 18:18:02 +0800127 APACHE_ENABLED_SERVICES+=keystone,swift
128
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 Troyerb8dd27b2013-10-17 12:03:55 -0500166following settings in your `localrc` section:
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
Mark McClainb05c8762013-07-06 23:29:39 -0400174 enable_service neutron
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.
182To make use of this feature, the following variables are defined and can
183be configured in your `localrc` section:
Kyle Mesteryebfac642013-05-17 15:20:56 -0500184
Simon Pasquierca96b0a2013-07-09 16:59:12 +0200185 Variable Name Config File Section Modified
Kyle Mesteryebfac642013-05-17 15:20:56 -0500186 -------------------------------------------------------------------------------------
Simon Pasquierca96b0a2013-07-09 16:59:12 +0200187 Q_SRV_EXTRA_OPTS Plugin `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge)
188 Q_AGENT_EXTRA_AGENT_OPTS Plugin AGENT
189 Q_AGENT_EXTRA_SRV_OPTS Plugin `OVS` (for Open Vswitch) or `LINUX_BRIDGE` (for LinuxBridge)
190 Q_SRV_EXTRA_DEFAULT_OPTS Service DEFAULT
Kyle Mesteryebfac642013-05-17 15:20:56 -0500191
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500192An example of using the variables in your `localrc` section is below:
Kyle Mesteryebfac642013-05-17 15:20:56 -0500193
194 Q_AGENT_EXTRA_AGENT_OPTS=(tunnel_type=vxlan vxlan_udp_port=8472)
195 Q_SRV_EXTRA_OPTS=(tenant_network_type=vxlan)
196
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500197DevStack also supports configuring the Neutron ML2 plugin. The ML2 plugin
198can run with the OVS, LinuxBridge, or Hyper-V agents on compute hosts. A
199simple way to configure the ml2 plugin is shown below:
Kyle Mesteryb7726592013-07-19 14:26:53 +0000200
201 # VLAN configuration
202 Q_PLUGIN=ml2
203 ENABLE_TENANT_VLANS=True
204
205 # GRE tunnel configuration
206 Q_PLUGIN=ml2
207 ENABLE_TENANT_TUNNELS=True
208
209 # VXLAN tunnel configuration
210 Q_PLUGIN=ml2
211 Q_ML2_TENANT_NETWORK_TYPE=vxlan
212
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500213The above will default in DevStack to using the OVS on each compute host.
214To change this, set the `Q_AGENT` variable to the agent you want to run
215(e.g. linuxbridge).
Kyle Mesteryb7726592013-07-19 14:26:53 +0000216
217 Variable Name Notes
218 -------------------------------------------------------------------------------------
219 Q_AGENT This specifies which agent to run with the ML2 Plugin (either `openvswitch` or `linuxbridge`).
220 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.
221 Q_ML2_PLUGIN_TYPE_DRIVERS The ML2 TypeDrivers to load. Defaults to all available TypeDrivers.
222 Q_ML2_PLUGIN_GRE_TYPE_OPTIONS GRE TypeDriver options. Defaults to none.
223 Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS VXLAN TypeDriver options. Defaults to none.
224 Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS VLAN TypeDriver options. Defaults to none.
225 Q_AGENT_EXTRA_AGENT_OPTS Extra configuration options to pass to the OVS or LinuxBridge Agent.
226
Steve Baker389b3a02013-08-01 10:44:09 +1200227# Heat
228
229Heat is disabled by default. To enable it you'll need the following settings
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500230in your `localrc` section:
Steve Baker389b3a02013-08-01 10:44:09 +1200231
232 enable_service heat h-api h-api-cfn h-api-cw h-eng
233
234Heat can also run in standalone mode, and be configured to orchestrate
235on an external OpenStack cloud. To launch only Heat in standalone mode
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500236you'll need the following settings in your `localrc` section:
Steve Baker389b3a02013-08-01 10:44:09 +1200237
238 disable_all_services
239 enable_service rabbit mysql heat h-api h-api-cfn h-api-cw h-eng
240 HEAT_STANDALONE=True
241 KEYSTONE_SERVICE_HOST=...
242 KEYSTONE_AUTH_HOST=...
243
Dean Troyercc6b4432013-04-08 15:38:03 -0500244# Tempest
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700245
246If tempest has been successfully configured, a basic set of smoke tests can be run as follows:
247
248 $ cd /opt/stack/tempest
Kui Shif9b47382013-08-02 05:53:58 +0800249 $ nosetests tempest/scenario/test_network_basic_ops.py
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700250
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500251# DevStack on Xenserver
252
253If you would like to use Xenserver as the hypervisor, please refer to the instructions in `./tools/xen/README.md`.
254
255# DevStack on Docker
256
257If you would like to use Docker as the hypervisor, please refer to the instructions in `./tools/docker/README.md`.
258
Dean Troyercdf3d762013-10-15 09:42:43 -0500259# Additional Projects
260
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500261DevStack has a hook mechanism to call out to a dispatch script at specific
262points in the execution of `stack.sh`, `unstack.sh` and `clean.sh`. This
263allows upper-layer projects, especially those that the lower layer projects
264have no dependency on, to be added to DevStack without modifying the core
265scripts. Tempest is built this way as an example of how to structure the
266dispatch script, see `extras.d/80-tempest.sh`. See `extras.d/README.md`
267for more information.
Dean Troyercdf3d762013-10-15 09:42:43 -0500268
Dean Troyercc6b4432013-04-08 15:38:03 -0500269# Multi-Node Setup
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700270
Mark McClainb05c8762013-07-06 23:29:39 -0400271A more interesting setup involves running multiple compute nodes, with Neutron networks connecting VMs on different compute nodes.
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700272You should run at least one "controller node", which should have a `stackrc` that includes at least:
273
274 disable_service n-net
275 enable_service q-svc
276 enable_service q-agt
277 enable_service q-dhcp
278 enable_service q-l3
279 enable_service q-meta
Mark McClainb05c8762013-07-06 23:29:39 -0400280 enable_service neutron
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700281
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500282You likely want to change your `localrc` section to run a scheduler that
283will balance VMs across hosts:
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700284
285 SCHEDULER=nova.scheduler.simple.SimpleScheduler
286
287You 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:
288
Mark McClainb05c8762013-07-06 23:29:39 -0400289 ENABLED_SERVICES=n-cpu,rabbit,g-api,neutron,q-agt
Oleg Bondarev1f11f9a2013-03-25 05:34:23 -0700290 SERVICE_HOST=[IP of controller node]
291 MYSQL_HOST=$SERVICE_HOST
292 RABBIT_HOST=$SERVICE_HOST
293 Q_HOST=$SERVICE_HOST
Eric Windisch800bf382013-05-24 11:21:11 -0400294 MATCHMAKER_REDIS_HOST=$SERVICE_HOST
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000295
296# Cells
297
298Cells is a new scaling option with a full spec at http://wiki.openstack.org/blueprint-nova-compute-cells.
299
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500300To setup a cells environment add the following to your `localrc` section:
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000301
302 enable_service n-cell
Kieran Spearfb2a3ae2013-03-11 23:55:49 +0000303
Chris Behrensc62c2b92013-07-24 03:56:13 -0700304Be 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 -0500305
306
307# Local Configuration
308
309Historically 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.
310
311# local.conf
312
313The 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:
314
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500315 [[ <phase> | <config-file-name> ]]
Dean Troyer893e6632013-09-13 15:05:51 -0500316
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500317where ``<phase>`` is one of a set of phase names defined by ``stack.sh``
318and ``<config-file-name>`` is the configuration filename. The filename is
319eval'ed in the ``stack.sh`` context so all environment variables are
320available and may be used. Using the project config file variables in
321the header is strongly suggested (see the ``NOVA_CONF`` example below).
322If the path of the config file does not exist it is skipped.
Dean Troyer893e6632013-09-13 15:05:51 -0500323
324The defined phases are:
325
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500326* **local** - extracts ``localrc`` from ``local.conf`` before ``stackrc`` is sourced
327* **post-config** - runs after the layer 2 services are configured and before they are started
328* **extra** - runs after services are started and before any files in ``extra.d`` are executed
Dean Troyer893e6632013-09-13 15:05:51 -0500329
330The 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.
331
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500332 [[post-config|$NOVA_CONF]]
333 [DEFAULT]
334 use_syslog = True
Dean Troyer893e6632013-09-13 15:05:51 -0500335
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500336 [osapi_v3]
337 enabled = False
Dean Troyer893e6632013-09-13 15:05:51 -0500338
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500339A specific meta-section ``local|localrc`` is used to provide a default
340``localrc`` file (actually ``.localrc.auto``). This allows all custom
341settings for DevStack to be contained in a single file. If ``localrc``
342exists it will be used instead to preserve backward-compatibility.
Dean Troyer893e6632013-09-13 15:05:51 -0500343
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500344 [[local|localrc]]
345 FIXED_RANGE=10.254.1.0/24
346 ADMIN_PASSWORD=speciale
347 LOGFILE=$DEST/logs/stack.sh.log
Dean Troyer893e6632013-09-13 15:05:51 -0500348
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500349Note that ``Q_PLUGIN_CONF_FILE`` is unique in that it is assumed to *NOT*
350start with a ``/`` (slash) character. A slash will need to be added:
Dean Troyer893e6632013-09-13 15:05:51 -0500351
Dean Troyerb8dd27b2013-10-17 12:03:55 -0500352 [[post-config|/$Q_PLUGIN_CONF_FILE]]