root / doc / design-2.3.rst @ 14bde528
History | View | Annotate | Download (6.2 kB)
1 |
================= |
---|---|
2 |
Ganeti 2.3 design |
3 |
================= |
4 |
|
5 |
This document describes the major changes in Ganeti 2.3 compared to |
6 |
the 2.2 version. |
7 |
|
8 |
.. contents:: :depth: 4 |
9 |
|
10 |
Detailed design |
11 |
=============== |
12 |
|
13 |
As for 2.1 and 2.2 we divide the 2.3 design into three areas: |
14 |
|
15 |
- core changes, which affect the master daemon/job queue/locking or |
16 |
all/most logical units |
17 |
- logical unit/feature changes |
18 |
- external interface changes (e.g. command line, os api, hooks, ...) |
19 |
|
20 |
Core changes |
21 |
------------ |
22 |
|
23 |
Job priorities |
24 |
~~~~~~~~~~~~~~ |
25 |
|
26 |
Current state and shortcomings |
27 |
++++++++++++++++++++++++++++++ |
28 |
|
29 |
.. TODO: Describe current situation |
30 |
|
31 |
Proposed changes |
32 |
++++++++++++++++ |
33 |
|
34 |
.. TODO: Describe changes to job queue and potentially client programs |
35 |
|
36 |
Worker pool |
37 |
^^^^^^^^^^^ |
38 |
|
39 |
To support job priorities in the job queue, the worker pool underlying |
40 |
the job queue must be enhanced to support task priorities. Currently |
41 |
tasks are processed in the order they are added to the queue (but, due |
42 |
to their nature, they don't necessarily finish in that order). All tasks |
43 |
are equal. To support tasks with higher or lower priority, a few changes |
44 |
have to be made to the queue inside a worker pool. |
45 |
|
46 |
Each task is assigned a priority when added to the queue. This priority |
47 |
can not be changed until the task is executed (this is fine as in all |
48 |
current use-cases, tasks are added to a pool and then forgotten about |
49 |
until they're done). |
50 |
|
51 |
A task's priority can be compared to Unix' process priorities. The lower |
52 |
the priority number, the closer to the queue's front it is. A task with |
53 |
priority 0 is going to be run before one with priority 10. Tasks with |
54 |
the same priority are executed in the order in which they were added. |
55 |
|
56 |
While a task is running it can query its own priority. If it's not ready |
57 |
yet for finishing, it can raise an exception to defer itself, optionally |
58 |
changing its own priority. This is useful for the following cases: |
59 |
|
60 |
- A task is trying to acquire locks, but those locks are still held by |
61 |
other tasks. By deferring itself, the task gives others a chance to |
62 |
run. This is especially useful when all workers are busy. |
63 |
- If a task decides it hasn't gotten its locks in a long time, it can |
64 |
start to increase its own priority. |
65 |
- Tasks waiting for long-running operations running asynchronously could |
66 |
defer themselves while waiting for a long-running operation. |
67 |
|
68 |
With these changes, the job queue will be able to implement per-job |
69 |
priorities. |
70 |
|
71 |
IPv6 support |
72 |
~~~~~~~~~~~~ |
73 |
|
74 |
Currently Ganeti does not support IPv6. This is true for nodes as well |
75 |
as instances. Due to the fact that IPv4 exhaustion is threateningly near |
76 |
the need of using IPv6 is increasing, especially given that bigger and |
77 |
bigger clusters are supported. |
78 |
|
79 |
Supported IPv6 setup |
80 |
++++++++++++++++++++ |
81 |
|
82 |
In Ganeti 2.3 we introduce additionally to the ordinary pure IPv4 |
83 |
setup a hybrid IPv6/IPv4 mode. The latter works as follows: |
84 |
|
85 |
- all nodes in a cluster have a primary IPv6 address |
86 |
- the master has a IPv6 address |
87 |
- all nodes **must** have a secondary IPv4 address |
88 |
|
89 |
The reason for this hybrid setup is that key components that Ganeti |
90 |
depends on do not or only partially support IPv6. More precisely, Xen |
91 |
does not support instance migration via IPv6 in version 3.4 and 4.0. |
92 |
Similarly, KVM does not support instance migration nor VNC access for |
93 |
IPv6 at the time of this writing. |
94 |
|
95 |
This led to the decision of not supporting pure IPv6 Ganeti clusters, as |
96 |
very important cluster operations would not have been possible. Using |
97 |
IPv4 as secondary address does not affect any of the goals |
98 |
of the IPv6 support: since secondary addresses do not need to be |
99 |
publicly accessible, they need not be globally unique. In other words, |
100 |
one can practically use private IPv4 secondary addresses just for |
101 |
intra-cluster communication without propagating them across layer 3 |
102 |
boundaries. |
103 |
|
104 |
netutils: Utilities for handling common network tasks |
105 |
+++++++++++++++++++++++++++++++++++++++++++++++++++++ |
106 |
|
107 |
Currently common util functions are kept in the utils modules. Since |
108 |
this module grows bigger and bigger network-related functions are moved |
109 |
to a separate module named *netutils*. Additionally all these utilities |
110 |
will be IPv6-enabled. |
111 |
|
112 |
Cluster initialization |
113 |
++++++++++++++++++++++ |
114 |
|
115 |
As mentioned above there will be two different setups in terms of IP |
116 |
addressing: pure IPv4 and hybrid IPv6/IPv4 address. To choose that a |
117 |
new cluster init parameter *--primary-ip-version* is introduced. This is |
118 |
needed as a given name can resolve to both an IPv4 and IPv6 address on a |
119 |
dual-stack host effectively making it impossible to infer that bit. |
120 |
|
121 |
Once a cluster is initialized and the primary IP version chosen all |
122 |
nodes that join have to conform to that setup. In the case of our |
123 |
IPv6/IPv4 setup all nodes *must* have a secondary IPv4 address. |
124 |
|
125 |
Furthermore we store the primary IP version in ssconf which is consulted |
126 |
every time a daemon starts to determine the default bind address (either |
127 |
*0.0.0.0* or *::*. In a IPv6/IPv4 setup we need to bind the Ganeti |
128 |
daemon listening on network sockets to the IPv6 address. |
129 |
|
130 |
Node addition |
131 |
+++++++++++++ |
132 |
|
133 |
When adding a new node to a IPv6/IPv4 cluster it must have a IPv6 |
134 |
address to be used as primary and a IPv4 address used as secondary. As |
135 |
explained above, every time a daemon is started we use the cluster |
136 |
primary IP version to determine to which any address to bind to. The |
137 |
only exception to this is when a node is added to the cluster. In this |
138 |
case there is no ssconf available when noded is started and therefore |
139 |
the correct address needs to be passed to it. |
140 |
|
141 |
Name resolution |
142 |
+++++++++++++++ |
143 |
|
144 |
Since the gethostbyname*() functions do not support IPv6 name resolution |
145 |
will be done by using the recommended getaddrinfo(). |
146 |
|
147 |
IPv4-only components |
148 |
++++++++++++++++++++ |
149 |
|
150 |
============================ =================== ==================== |
151 |
Component IPv6 Status Planned Version |
152 |
============================ =================== ==================== |
153 |
Xen instance migration Not supported Xen 4.1: libxenlight |
154 |
KVM instance migration Not supported Unknown |
155 |
KVM VNC access Not supported Unknown |
156 |
============================ =================== ==================== |
157 |
|
158 |
|
159 |
Feature changes |
160 |
--------------- |
161 |
|
162 |
|
163 |
External interface changes |
164 |
-------------------------- |
165 |
|
166 |
|
167 |
.. vim: set textwidth=72 : |
168 |
.. Local Variables: |
169 |
.. mode: rst |
170 |
.. fill-column: 72 |
171 |
.. End: |