Merge lp:~sandy-walsh/nova/zone-docs into lp:~hudson-openstack/nova/trunk

Proposed by Sandy Walsh
Status: Merged
Approved by: Paul Voccio
Approved revision: 954
Merged at revision: 970
Proposed branch: lp:~sandy-walsh/nova/zone-docs
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 131 lines (+127/-0)
1 file modified
doc/source/devref/zone.rst (+127/-0)
To merge this branch: bzr merge lp:~sandy-walsh/nova/zone-docs
Reviewer Review Type Date Requested Status
Paul Voccio (community) Approve
Eric Day (community) Approve
Review via email: mp+56924@code.launchpad.net

Description of the change

Added RST file on using Zones.

To post a comment you must log in.
Revision history for this message
Ed Leafe (ed-leafe) wrote :

Some additional explanation of the 'key:value;value;value' construct should be added, as normally KV pairs are single-valued.

The final paragraph re: zone-delete should emphasize that this is a parent db-only action, and has no effect on the child zone.

Revision history for this message
Anne Gentle (annegentle) wrote :

Great info, very helpful.

There's an explanation of how to create a child zone prior to creating the first/parent zone - unless you have a parent zone by default? Seems like in the Zone administrative functions section you could add a paragraph describing how to set up the parent zone using the OS API.

Apropos to Ed's comment, if you delete a parent zone does it maintain hierarchy info?

I believe that you have to use zones if you want to run multiple hypervisors - is that your understanding? Would a mention of the use cases for zones be helpful?

Revision history for this message
Sandy Walsh (sandy-walsh) wrote :

Thanks Anne. Added some clarification around Parent Zones (any zone can be a parent zone) and what happens on delete. A zone may run multiple hypervisors. It's really just a logical partitioning. I do talk about that in the beginning of the doc.

Revision history for this message
Eric Day (eday) wrote :

Looks good! Just one tiny thing was found:

24: "A Zone allows you partition" should be "A Zone allows you to partition"? (added "to")

review: Approve
Revision history for this message
Sandy Walsh (sandy-walsh) wrote :

Thx Eric ... fixed.

Revision history for this message
Paul Voccio (pvo) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'doc/source/devref/zone.rst'
2--- doc/source/devref/zone.rst 1970-01-01 00:00:00 +0000
3+++ doc/source/devref/zone.rst 2011-04-08 19:42:33 +0000
4@@ -0,0 +1,127 @@
5+..
6+ Copyright 2010-2011 OpenStack LLC
7+ All Rights Reserved.
8+
9+ Licensed under the Apache License, Version 2.0 (the "License"); you may
10+ not use this file except in compliance with the License. You may obtain
11+ a copy of the License at
12+
13+ http://www.apache.org/licenses/LICENSE-2.0
14+
15+ Unless required by applicable law or agreed to in writing, software
16+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
18+ License for the specific language governing permissions and limitations
19+ under the License.
20+
21+Zones
22+=====
23+
24+A Nova deployment is called a Zone. At the very least a Zone requires an API node, a Scheduler node, a database and RabbitMQ. Pushed further a Zone may contain many API nodes, many Scheduler, Volume, Network and Compute nodes as well as a cluster of databases and RabbitMQ servers. A Zone allows you to partition your deployments into logical groups for load balancing and instance distribution.
25+
26+The idea behind Zones is, if a particular deployment is not capable of servicing a particular request, the request may be forwarded to (child) Zones for possible processing. Zones may be nested in a tree fashion.
27+
28+Zones only know about their immediate children, they do not know about their parent Zones and may in fact have more than one parent. Likewise, a Zone's children may themselves have child Zones.
29+
30+Zones share nothing. They communicate via the public OpenStack API only. No database, queue, user or project definition is shared between Zones.
31+
32+
33+Capabilities
34+------------
35+Routing between Zones is based on the Capabilities of that Zone. Capabilities are nothing more than key/value pairs. Values are multi-value, with each value separated with a semicolon (`;`). When expressed as a string they take the form:
36+
37+::
38+
39+ key=value;value;value, key=value;value;value
40+
41+Zones have Capabilities which are general to the Zone and are set via `--zone-capabilities` flag. Zones also have dynamic per-service Capabilities. Services derived from `nova.manager.SchedulerDependentManager` (such as Compute, Volume and Network) can set these capabilities by calling the `update_service_capabilities()` method on their `Manager` base class. These capabilities will be periodically sent to the Scheduler service automatically. The rate at which these updates are sent is controlled by the `--periodic_interval` flag.
42+
43+Flow within a Zone
44+------------------
45+The brunt of the work within a Zone is done in the Scheduler Service. The Scheduler is responsible for:
46+- collecting capability messages from the Compute, Volume and Network nodes,
47+- polling the child Zones for their status and
48+- providing data to the Distributed Scheduler for performing load balancing calculations
49+
50+Inter-service communication within a Zone is done with RabbitMQ. Each class of Service (Compute, Volume and Network) has both a named message exchange (particular to that host) and a general message exchange (particular to that class of service). Messages sent to these exchanges are picked off in round-robin fashion. Zones introduce a new fan-out exchange per service. Messages sent to the fan-out exchange are picked up by all services of a particular class. This fan-out exchange is used by the Scheduler services to receive capability messages from the Compute, Volume and Network nodes.
51+
52+These capability messages are received by the Scheduler services and stored in the `ZoneManager` object. The SchedulerManager object has a reference to the `ZoneManager` it can use for load balancing.
53+
54+The `ZoneManager` also polls the child Zones periodically to gather their capabilities to aid in decision making. This is done via the OpenStack API `/v1.0/zones/info` REST call. This also captures the name of each child Zone. The Zone name is set via the `--zone-name` flag (and defaults to "nova").
55+
56+Zone administrative functions
57+-----------------------------
58+Zone administrative operations are usually done using python-novaclient_
59+
60+.. _python-novaclient: https://github.com/rackspace/python-novaclient
61+
62+In order to use the Zone operations, be sure to enable administrator operations in OpenStack API by setting the `--allow_admin_api=true` flag.
63+
64+Finally you need to enable Zone Forwarding. This will be used by the Distributed Scheduler initiative currently underway. Set `--enable_zone_routing=true` to enable this feature.
65+
66+Find out about this Zone
67+------------------------
68+In any Zone you can find the Zone's name and capabilities with the ``nova zone-info`` command.
69+
70+::
71+
72+ alice@novadev:~$ nova zone-info
73+ +-----------------+---------------+
74+ | Property | Value |
75+ +-----------------+---------------+
76+ | compute_cpu | 0.7,0.7 |
77+ | compute_disk | 123000,123000 |
78+ | compute_network | 800,800 |
79+ | hypervisor | xenserver |
80+ | name | nova |
81+ | network_cpu | 0.7,0.7 |
82+ | network_disk | 123000,123000 |
83+ | network_network | 800,800 |
84+ | os | linux |
85+ +-----------------+---------------+
86+
87+This equates to a GET operation on `.../zones/info`. If you have no child Zones defined you'll usually only get back the default `name`, `hypervisor` and `os` capabilities. Otherwise you'll get back a tuple of min, max values for each capabilities of all the hosts of all the services running in the child zone. These take the `<service>_<capability> = <min>,<max>` format.
88+
89+Adding a child Zone
90+-------------------
91+Any Zone can be a parent Zone. Children are associated to a Zone. The Zone where this command originates from is known as the Parent Zone. Routing is only ever conducted from a Zone to its children, never the other direction. From a parent zone you can add a child zone with the following command:
92+
93+::
94+
95+ nova zone-add <child zone api url> <username> <nova api key>
96+
97+You can get the `child zone api url`, `nova api key` and `username` from the `novarc` file in the child zone. For example:
98+
99+::
100+
101+ export NOVA_API_KEY="3bd1af06-6435-4e23-a827-413b2eb86934"
102+ export NOVA_USERNAME="alice"
103+ export NOVA_URL="http://192.168.2.120:8774/v1.0/"
104+
105+
106+This equates to a POST operation to `.../zones/` to add a new zone. No connection attempt to the child zone is done when this command. It only puts an entry in the db at this point. After about 30 seconds the `ZoneManager` in the Scheduler services will attempt to talk to the child zone and get its information.
107+
108+Getting a list of child Zones
109+-----------------------------
110+
111+::
112+
113+ nova zone-list
114+
115+ alice@novadev:~$ nova zone-list
116+ +----+-------+-----------+--------------------------------------------+---------------------------------+
117+ | ID | Name | Is Active | Capabilities | API URL |
118+ +----+-------+-----------+--------------------------------------------+---------------------------------+
119+ | 2 | zone1 | True | hypervisor=xenserver;kvm, os=linux;windows | http://192.168.2.108:8774/v1.0/ |
120+ | 3 | zone2 | True | hypervisor=xenserver;kvm, os=linux;windows | http://192.168.2.115:8774/v1.0/ |
121+ +----+-------+-----------+--------------------------------------------+---------------------------------+
122+
123+This equates to a GET operation to `.../zones`.
124+
125+Removing a child Zone
126+---------------------
127+::
128+
129+ nova zone-delete <N>
130+
131+This equates to a DELETE call to `.../zones/N`. The Zone with ID=N will be removed. This will only remove the zone entry from the current (parent) Zone, no child Zones are affected. Removing a Child Zone doesn't affect any other part of the hierarchy.