root / doc / iallocator.rst @ 88394aa7
History | View | Annotate | Download (12.8 kB)
1 | 876860a3 | Iustin Pop | Ganeti automatic instance allocation |
---|---|---|---|
2 | 876860a3 | Iustin Pop | ==================================== |
3 | 876860a3 | Iustin Pop | |
4 | 632fb7ec | Iustin Pop | Documents Ganeti version 2.1 |
5 | 876860a3 | Iustin Pop | |
6 | 876860a3 | Iustin Pop | .. contents:: |
7 | 876860a3 | Iustin Pop | |
8 | 876860a3 | Iustin Pop | Introduction |
9 | 876860a3 | Iustin Pop | ------------ |
10 | 876860a3 | Iustin Pop | |
11 | 876860a3 | Iustin Pop | Currently in Ganeti the admin has to specify the exact locations for |
12 | 876860a3 | Iustin Pop | an instance's node(s). This prevents a completely automatic node |
13 | 876860a3 | Iustin Pop | evacuation, and is in general a nuisance. |
14 | 876860a3 | Iustin Pop | |
15 | 876860a3 | Iustin Pop | The *iallocator* framework will enable automatic placement via |
16 | 876860a3 | Iustin Pop | external scripts, which allows customization of the cluster layout per |
17 | 876860a3 | Iustin Pop | the site's requirements. |
18 | 876860a3 | Iustin Pop | |
19 | 876860a3 | Iustin Pop | User-visible changes |
20 | 876860a3 | Iustin Pop | ~~~~~~~~~~~~~~~~~~~~ |
21 | 876860a3 | Iustin Pop | |
22 | 876860a3 | Iustin Pop | There are two parts of the ganeti operation that are impacted by the |
23 | 876860a3 | Iustin Pop | auto-allocation: how the cluster knows what the allocator algorithms |
24 | 876860a3 | Iustin Pop | are and how the admin uses these in creating instances. |
25 | 876860a3 | Iustin Pop | |
26 | 876860a3 | Iustin Pop | An allocation algorithm is just the filename of a program installed in |
27 | 876860a3 | Iustin Pop | a defined list of directories. |
28 | 876860a3 | Iustin Pop | |
29 | 876860a3 | Iustin Pop | Cluster configuration |
30 | 876860a3 | Iustin Pop | ~~~~~~~~~~~~~~~~~~~~~ |
31 | 876860a3 | Iustin Pop | |
32 | 876860a3 | Iustin Pop | At configure time, the list of the directories can be selected via the |
33 | 876860a3 | Iustin Pop | ``--with-iallocator-search-path=LIST`` option, where *LIST* is a |
34 | 876860a3 | Iustin Pop | comma-separated list of directories. If not given, this defaults to |
35 | 876860a3 | Iustin Pop | ``$libdir/ganeti/iallocators``, i.e. for an installation under |
36 | 876860a3 | Iustin Pop | ``/usr``, this will be ``/usr/lib/ganeti/iallocators``. |
37 | 876860a3 | Iustin Pop | |
38 | 876860a3 | Iustin Pop | Ganeti will then search for allocator script in the configured list, |
39 | 876860a3 | Iustin Pop | using the first one whose filename matches the one given by the user. |
40 | 876860a3 | Iustin Pop | |
41 | 876860a3 | Iustin Pop | Command line interface changes |
42 | 876860a3 | Iustin Pop | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
43 | 876860a3 | Iustin Pop | |
44 | 876860a3 | Iustin Pop | The node selection options in instanece add and instance replace disks |
45 | 876860a3 | Iustin Pop | can be replace by the new ``--iallocator=NAME`` option (shortened to |
46 | 876860a3 | Iustin Pop | ``-I``), which will cause the auto-assignement of nodes with the |
47 | 876860a3 | Iustin Pop | passed iallocator. The selected node(s) will be show as part of the |
48 | 876860a3 | Iustin Pop | command output. |
49 | 876860a3 | Iustin Pop | |
50 | 876860a3 | Iustin Pop | IAllocator API |
51 | 876860a3 | Iustin Pop | -------------- |
52 | 876860a3 | Iustin Pop | |
53 | 876860a3 | Iustin Pop | The protocol for communication between Ganeti and an allocator script |
54 | 876860a3 | Iustin Pop | will be the following: |
55 | 876860a3 | Iustin Pop | |
56 | 876860a3 | Iustin Pop | #. ganeti launches the program with a single argument, a filename that |
57 | 876860a3 | Iustin Pop | contains a JSON-encoded structure (the input message) |
58 | 876860a3 | Iustin Pop | |
59 | 876860a3 | Iustin Pop | #. if the script finishes with exit code different from zero, it is |
60 | 876860a3 | Iustin Pop | considered a general failure and the full output will be reported to |
61 | 876860a3 | Iustin Pop | the users; this can be the case when the allocator can't parse the |
62 | 876860a3 | Iustin Pop | input message |
63 | 876860a3 | Iustin Pop | |
64 | 876860a3 | Iustin Pop | #. if the allocator finishes with exit code zero, it is expected to |
65 | 876860a3 | Iustin Pop | output (on its stdout) a JSON-encoded structure (the response) |
66 | 876860a3 | Iustin Pop | |
67 | 876860a3 | Iustin Pop | Input message |
68 | 876860a3 | Iustin Pop | ~~~~~~~~~~~~~ |
69 | 876860a3 | Iustin Pop | |
70 | 876860a3 | Iustin Pop | The input message will be the JSON encoding of a dictionary containing |
71 | 876860a3 | Iustin Pop | the following: |
72 | 876860a3 | Iustin Pop | |
73 | 876860a3 | Iustin Pop | version |
74 | 876860a3 | Iustin Pop | the version of the protocol; this document |
75 | 77031881 | Iustin Pop | specifies version 2 |
76 | 876860a3 | Iustin Pop | |
77 | 876860a3 | Iustin Pop | cluster_name |
78 | 876860a3 | Iustin Pop | the cluster name |
79 | 876860a3 | Iustin Pop | |
80 | 876860a3 | Iustin Pop | cluster_tags |
81 | 876860a3 | Iustin Pop | the list of cluster tags |
82 | 876860a3 | Iustin Pop | |
83 | 77031881 | Iustin Pop | enabled_hypervisors |
84 | 77031881 | Iustin Pop | the list of enabled hypervisors |
85 | 77031881 | Iustin Pop | |
86 | 876860a3 | Iustin Pop | request |
87 | 876860a3 | Iustin Pop | a dictionary containing the request data: |
88 | 876860a3 | Iustin Pop | |
89 | 876860a3 | Iustin Pop | type |
90 | 632fb7ec | Iustin Pop | the request type; this can be either ``allocate``, ``relocate`` or |
91 | 632fb7ec | Iustin Pop | ``multi-evacuate``; the ``allocate`` request is used when a new |
92 | 632fb7ec | Iustin Pop | instance needs to be placed on the cluster, while the ``relocate`` |
93 | 632fb7ec | Iustin Pop | request is used when an existing instance needs to be moved within |
94 | 632fb7ec | Iustin Pop | the cluster; the ``multi-evacuate`` protocol requests that the |
95 | 632fb7ec | Iustin Pop | script computes the optimal relocate solution for all secondary |
96 | 632fb7ec | Iustin Pop | instances of the given nodes |
97 | 632fb7ec | Iustin Pop | |
98 | 632fb7ec | Iustin Pop | The following keys are needed in allocate/relocate mode: |
99 | 876860a3 | Iustin Pop | |
100 | 876860a3 | Iustin Pop | name |
101 | 632fb7ec | Iustin Pop | the name of the instance; if the request is a realocation, then this |
102 | 632fb7ec | Iustin Pop | name will be found in the list of instances (see below), otherwise |
103 | 632fb7ec | Iustin Pop | is the FQDN of the new instance |
104 | 876860a3 | Iustin Pop | |
105 | 876860a3 | Iustin Pop | required_nodes |
106 | 876860a3 | Iustin Pop | how many nodes should the algorithm return; while this information |
107 | 876860a3 | Iustin Pop | can be deduced from the instace's disk template, it's better if |
108 | 876860a3 | Iustin Pop | this computation is left to Ganeti as then allocator scripts are |
109 | 876860a3 | Iustin Pop | less sensitive to changes to the disk templates |
110 | 876860a3 | Iustin Pop | |
111 | 876860a3 | Iustin Pop | disk_space_total |
112 | 876860a3 | Iustin Pop | the total disk space that will be used by this instance on the |
113 | 876860a3 | Iustin Pop | (new) nodes; again, this information can be computed from the list |
114 | 876860a3 | Iustin Pop | of instance disks and its template type, but Ganeti is better |
115 | 876860a3 | Iustin Pop | suited to compute it |
116 | 876860a3 | Iustin Pop | |
117 | 876860a3 | Iustin Pop | If the request is an allocation, then there are extra fields in the |
118 | 876860a3 | Iustin Pop | request dictionary: |
119 | 876860a3 | Iustin Pop | |
120 | 876860a3 | Iustin Pop | disks |
121 | 876860a3 | Iustin Pop | list of dictionaries holding the disk definitions for this |
122 | 876860a3 | Iustin Pop | instance (in the order they are exported to the hypervisor): |
123 | 876860a3 | Iustin Pop | |
124 | 876860a3 | Iustin Pop | mode |
125 | 876860a3 | Iustin Pop | either ``r`` or ``w`` denoting if the disk is read-only or |
126 | 876860a3 | Iustin Pop | writable |
127 | 876860a3 | Iustin Pop | |
128 | 876860a3 | Iustin Pop | size |
129 | 876860a3 | Iustin Pop | the size of this disk in mebibytes |
130 | 876860a3 | Iustin Pop | |
131 | 876860a3 | Iustin Pop | nics |
132 | 876860a3 | Iustin Pop | a list of dictionaries holding the network interfaces for this |
133 | 876860a3 | Iustin Pop | instance, containing: |
134 | 876860a3 | Iustin Pop | |
135 | 876860a3 | Iustin Pop | ip |
136 | 876860a3 | Iustin Pop | the IP address that Ganeti know for this instance, or null |
137 | 876860a3 | Iustin Pop | |
138 | 876860a3 | Iustin Pop | mac |
139 | 876860a3 | Iustin Pop | the MAC address for this interface |
140 | 876860a3 | Iustin Pop | |
141 | 876860a3 | Iustin Pop | bridge |
142 | 876860a3 | Iustin Pop | the bridge to which this interface will be connected |
143 | 876860a3 | Iustin Pop | |
144 | 876860a3 | Iustin Pop | vcpus |
145 | 876860a3 | Iustin Pop | the number of VCPUs for the instance |
146 | 876860a3 | Iustin Pop | |
147 | 876860a3 | Iustin Pop | disk_template |
148 | 876860a3 | Iustin Pop | the disk template for the instance |
149 | 876860a3 | Iustin Pop | |
150 | 876860a3 | Iustin Pop | memory |
151 | 876860a3 | Iustin Pop | the memory size for the instance |
152 | 876860a3 | Iustin Pop | |
153 | 876860a3 | Iustin Pop | os |
154 | 876860a3 | Iustin Pop | the OS type for the instance |
155 | 876860a3 | Iustin Pop | |
156 | 876860a3 | Iustin Pop | tags |
157 | 876860a3 | Iustin Pop | the list of the instance's tags |
158 | 876860a3 | Iustin Pop | |
159 | 77031881 | Iustin Pop | hypervisor |
160 | 77031881 | Iustin Pop | the hypervisor of this instance |
161 | 77031881 | Iustin Pop | |
162 | 876860a3 | Iustin Pop | |
163 | 876860a3 | Iustin Pop | If the request is of type relocate, then there is one more entry in |
164 | 876860a3 | Iustin Pop | the request dictionary, named ``relocate_from``, and it contains a |
165 | 876860a3 | Iustin Pop | list of nodes to move the instance away from; note that with Ganeti |
166 | 876860a3 | Iustin Pop | 2.0, this list will always contain a single node, the current |
167 | 876860a3 | Iustin Pop | secondary of the instance. |
168 | 876860a3 | Iustin Pop | |
169 | 632fb7ec | Iustin Pop | The multi-evacuate mode has instead a single request argument: |
170 | 632fb7ec | Iustin Pop | |
171 | 632fb7ec | Iustin Pop | nodes |
172 | 632fb7ec | Iustin Pop | the names of the nodes to be evacuated |
173 | 632fb7ec | Iustin Pop | |
174 | 876860a3 | Iustin Pop | instances |
175 | 876860a3 | Iustin Pop | a dictionary with the data for the current existing instance on the |
176 | 876860a3 | Iustin Pop | cluster, indexed by instance name; the contents are similar to the |
177 | 876860a3 | Iustin Pop | instance definitions for the allocate mode, with the addition of: |
178 | 876860a3 | Iustin Pop | |
179 | 77031881 | Iustin Pop | admin_up |
180 | 876860a3 | Iustin Pop | if this instance is set to run (but not the actual status of the |
181 | 876860a3 | Iustin Pop | instance) |
182 | 876860a3 | Iustin Pop | |
183 | 876860a3 | Iustin Pop | nodes |
184 | 876860a3 | Iustin Pop | list of nodes on which this instance is placed; the primary node |
185 | 876860a3 | Iustin Pop | of the instance is always the first one |
186 | 876860a3 | Iustin Pop | |
187 | 876860a3 | Iustin Pop | nodes |
188 | 876860a3 | Iustin Pop | dictionary with the data for the nodes in the cluster, indexed by |
189 | 0d853843 | Iustin Pop | the node name; the dict contains [*]_ : |
190 | 876860a3 | Iustin Pop | |
191 | 876860a3 | Iustin Pop | total_disk |
192 | 876860a3 | Iustin Pop | the total disk size of this node (mebibytes) |
193 | 876860a3 | Iustin Pop | |
194 | 876860a3 | Iustin Pop | free_disk |
195 | 876860a3 | Iustin Pop | the free disk space on the node |
196 | 876860a3 | Iustin Pop | |
197 | 876860a3 | Iustin Pop | total_memory |
198 | 876860a3 | Iustin Pop | the total memory size |
199 | 876860a3 | Iustin Pop | |
200 | 876860a3 | Iustin Pop | free_memory |
201 | 876860a3 | Iustin Pop | free memory on the node; note that currently this does not take |
202 | 876860a3 | Iustin Pop | into account the instances which are down on the node |
203 | 876860a3 | Iustin Pop | |
204 | 876860a3 | Iustin Pop | total_cpus |
205 | 876860a3 | Iustin Pop | the physical number of CPUs present on the machine; depending on |
206 | 876860a3 | Iustin Pop | the hypervisor, this might or might not be equal to how many CPUs |
207 | 876860a3 | Iustin Pop | the node operating system sees; |
208 | 876860a3 | Iustin Pop | |
209 | 876860a3 | Iustin Pop | primary_ip |
210 | 876860a3 | Iustin Pop | the primary IP address of the node |
211 | 876860a3 | Iustin Pop | |
212 | 876860a3 | Iustin Pop | secondary_ip |
213 | 876860a3 | Iustin Pop | the secondary IP address of the node (the one used for the DRBD |
214 | 876860a3 | Iustin Pop | replication); note that this can be the same as the primary one |
215 | 876860a3 | Iustin Pop | |
216 | 876860a3 | Iustin Pop | tags |
217 | 876860a3 | Iustin Pop | list with the tags of the node |
218 | 876860a3 | Iustin Pop | |
219 | 77031881 | Iustin Pop | master_candidate: |
220 | 77031881 | Iustin Pop | a boolean flag denoting whether this node is a master candidate |
221 | 77031881 | Iustin Pop | |
222 | 77031881 | Iustin Pop | drained: |
223 | 77031881 | Iustin Pop | a boolean flag denoting whether this node is being drained |
224 | 77031881 | Iustin Pop | |
225 | 77031881 | Iustin Pop | offline: |
226 | 77031881 | Iustin Pop | a boolean flag denoting whether this node is offline |
227 | 77031881 | Iustin Pop | |
228 | 77031881 | Iustin Pop | i_pri_memory: |
229 | 77031881 | Iustin Pop | total memory required by primary instances |
230 | 77031881 | Iustin Pop | |
231 | 77031881 | Iustin Pop | i_pri_up_memory: |
232 | 77031881 | Iustin Pop | total memory required by running primary instances |
233 | 77031881 | Iustin Pop | |
234 | 77031881 | Iustin Pop | No allocations should be made on nodes having either the ``drained`` |
235 | 77031881 | Iustin Pop | or ``offline`` flags set. More details about these of node status |
236 | fd07c6b3 | Iustin Pop | flags is available in the manpage :manpage:`ganeti(7)`. |
237 | 77031881 | Iustin Pop | |
238 | 7faf5110 | Michael Hanselmann | .. [*] Note that no run-time data is present for offline or drained |
239 | 7faf5110 | Michael Hanselmann | nodes; this means the tags total_memory, reserved_memory, |
240 | 7faf5110 | Michael Hanselmann | free_memory, total_disk, free_disk, total_cpus, i_pri_memory and |
241 | 7faf5110 | Michael Hanselmann | i_pri_up memory will be absent |
242 | 77031881 | Iustin Pop | |
243 | 0d853843 | Iustin Pop | |
244 | 0d853843 | Iustin Pop | Response message |
245 | 0d853843 | Iustin Pop | ~~~~~~~~~~~~~~~~ |
246 | 876860a3 | Iustin Pop | |
247 | 876860a3 | Iustin Pop | The response message is much more simple than the input one. It is |
248 | 876860a3 | Iustin Pop | also a dict having three keys: |
249 | 876860a3 | Iustin Pop | |
250 | 876860a3 | Iustin Pop | success |
251 | 5bbd3f7f | Michael Hanselmann | a boolean value denoting if the allocation was successful or not |
252 | 876860a3 | Iustin Pop | |
253 | 876860a3 | Iustin Pop | info |
254 | 876860a3 | Iustin Pop | a string with information from the scripts; if the allocation fails, |
255 | 876860a3 | Iustin Pop | this will be shown to the user |
256 | 876860a3 | Iustin Pop | |
257 | 632fb7ec | Iustin Pop | result |
258 | 632fb7ec | Iustin Pop | the output of the algorithm; even if the algorithm failed |
259 | 632fb7ec | Iustin Pop | (i.e. success is false), this must be returned as an empty list |
260 | 632fb7ec | Iustin Pop | |
261 | 632fb7ec | Iustin Pop | for allocate/relocate, this is the list of node(s) for the instance; |
262 | 632fb7ec | Iustin Pop | note that the length of this list must equal the ``requested_nodes`` |
263 | 632fb7ec | Iustin Pop | entry in the input message, otherwise Ganeti will consider the result |
264 | 632fb7ec | Iustin Pop | as failed |
265 | 632fb7ec | Iustin Pop | |
266 | 632fb7ec | Iustin Pop | for multi-evacuation mode, this is a list of lists; each element of |
267 | 632fb7ec | Iustin Pop | the list is a list of instance name and the new secondary node |
268 | 632fb7ec | Iustin Pop | |
269 | 632fb7ec | Iustin Pop | .. note:: Current Ganeti version accepts either ``result`` or ``nodes`` |
270 | 632fb7ec | Iustin Pop | as a backwards-compatibility measure (older versions only supported |
271 | 632fb7ec | Iustin Pop | ``nodes``) |
272 | 876860a3 | Iustin Pop | |
273 | 876860a3 | Iustin Pop | Examples |
274 | 876860a3 | Iustin Pop | -------- |
275 | 876860a3 | Iustin Pop | |
276 | 876860a3 | Iustin Pop | Input messages to scripts |
277 | 876860a3 | Iustin Pop | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
278 | 876860a3 | Iustin Pop | |
279 | 876860a3 | Iustin Pop | Input message, new instance allocation:: |
280 | 876860a3 | Iustin Pop | |
281 | 876860a3 | Iustin Pop | { |
282 | 876860a3 | Iustin Pop | "cluster_tags": [], |
283 | 876860a3 | Iustin Pop | "request": { |
284 | 876860a3 | Iustin Pop | "required_nodes": 2, |
285 | 876860a3 | Iustin Pop | "name": "instance3.example.com", |
286 | 876860a3 | Iustin Pop | "tags": [ |
287 | 876860a3 | Iustin Pop | "type:test", |
288 | 876860a3 | Iustin Pop | "owner:foo" |
289 | 876860a3 | Iustin Pop | ], |
290 | 876860a3 | Iustin Pop | "type": "allocate", |
291 | 876860a3 | Iustin Pop | "disks": [ |
292 | 876860a3 | Iustin Pop | { |
293 | 876860a3 | Iustin Pop | "mode": "w", |
294 | 876860a3 | Iustin Pop | "size": 1024 |
295 | 876860a3 | Iustin Pop | }, |
296 | 876860a3 | Iustin Pop | { |
297 | 876860a3 | Iustin Pop | "mode": "w", |
298 | 876860a3 | Iustin Pop | "size": 2048 |
299 | 876860a3 | Iustin Pop | } |
300 | 876860a3 | Iustin Pop | ], |
301 | 876860a3 | Iustin Pop | "nics": [ |
302 | 876860a3 | Iustin Pop | { |
303 | 876860a3 | Iustin Pop | "ip": null, |
304 | 876860a3 | Iustin Pop | "mac": "00:11:22:33:44:55", |
305 | 876860a3 | Iustin Pop | "bridge": null |
306 | 876860a3 | Iustin Pop | } |
307 | 876860a3 | Iustin Pop | ], |
308 | 876860a3 | Iustin Pop | "vcpus": 1, |
309 | 876860a3 | Iustin Pop | "disk_template": "drbd", |
310 | 876860a3 | Iustin Pop | "memory": 2048, |
311 | 876860a3 | Iustin Pop | "disk_space_total": 3328, |
312 | 876860a3 | Iustin Pop | "os": "etch-image" |
313 | 876860a3 | Iustin Pop | }, |
314 | 876860a3 | Iustin Pop | "cluster_name": "cluster1.example.com", |
315 | 876860a3 | Iustin Pop | "instances": { |
316 | 876860a3 | Iustin Pop | "instance1.example.com": { |
317 | 876860a3 | Iustin Pop | "tags": [], |
318 | 876860a3 | Iustin Pop | "should_run": false, |
319 | 876860a3 | Iustin Pop | "disks": [ |
320 | 876860a3 | Iustin Pop | { |
321 | 876860a3 | Iustin Pop | "mode": "w", |
322 | 876860a3 | Iustin Pop | "size": 64 |
323 | 876860a3 | Iustin Pop | }, |
324 | 876860a3 | Iustin Pop | { |
325 | 876860a3 | Iustin Pop | "mode": "w", |
326 | 876860a3 | Iustin Pop | "size": 512 |
327 | 876860a3 | Iustin Pop | } |
328 | 876860a3 | Iustin Pop | ], |
329 | 876860a3 | Iustin Pop | "nics": [ |
330 | 876860a3 | Iustin Pop | { |
331 | 876860a3 | Iustin Pop | "ip": null, |
332 | 876860a3 | Iustin Pop | "mac": "aa:00:00:00:60:bf", |
333 | 876860a3 | Iustin Pop | "bridge": "xen-br0" |
334 | 876860a3 | Iustin Pop | } |
335 | 876860a3 | Iustin Pop | ], |
336 | 876860a3 | Iustin Pop | "vcpus": 1, |
337 | 876860a3 | Iustin Pop | "disk_template": "plain", |
338 | 876860a3 | Iustin Pop | "memory": 128, |
339 | 876860a3 | Iustin Pop | "nodes": [ |
340 | 876860a3 | Iustin Pop | "nodee1.com" |
341 | 876860a3 | Iustin Pop | ], |
342 | 876860a3 | Iustin Pop | "os": "etch-image" |
343 | 876860a3 | Iustin Pop | }, |
344 | 876860a3 | Iustin Pop | "instance2.example.com": { |
345 | 876860a3 | Iustin Pop | "tags": [], |
346 | 876860a3 | Iustin Pop | "should_run": false, |
347 | 876860a3 | Iustin Pop | "disks": [ |
348 | 876860a3 | Iustin Pop | { |
349 | 876860a3 | Iustin Pop | "mode": "w", |
350 | 876860a3 | Iustin Pop | "size": 512 |
351 | 876860a3 | Iustin Pop | }, |
352 | 876860a3 | Iustin Pop | { |
353 | 876860a3 | Iustin Pop | "mode": "w", |
354 | 876860a3 | Iustin Pop | "size": 256 |
355 | 876860a3 | Iustin Pop | } |
356 | 876860a3 | Iustin Pop | ], |
357 | 876860a3 | Iustin Pop | "nics": [ |
358 | 876860a3 | Iustin Pop | { |
359 | 876860a3 | Iustin Pop | "ip": null, |
360 | 876860a3 | Iustin Pop | "mac": "aa:00:00:55:f8:38", |
361 | 876860a3 | Iustin Pop | "bridge": "xen-br0" |
362 | 876860a3 | Iustin Pop | } |
363 | 876860a3 | Iustin Pop | ], |
364 | 876860a3 | Iustin Pop | "vcpus": 1, |
365 | 876860a3 | Iustin Pop | "disk_template": "drbd", |
366 | 876860a3 | Iustin Pop | "memory": 512, |
367 | 876860a3 | Iustin Pop | "nodes": [ |
368 | 876860a3 | Iustin Pop | "node2.example.com", |
369 | 876860a3 | Iustin Pop | "node3.example.com" |
370 | 876860a3 | Iustin Pop | ], |
371 | 876860a3 | Iustin Pop | "os": "etch-image" |
372 | 876860a3 | Iustin Pop | } |
373 | 876860a3 | Iustin Pop | }, |
374 | 876860a3 | Iustin Pop | "version": 1, |
375 | 876860a3 | Iustin Pop | "nodes": { |
376 | 876860a3 | Iustin Pop | "node1.example.com": { |
377 | 876860a3 | Iustin Pop | "total_disk": 858276, |
378 | 876860a3 | Iustin Pop | "primary_ip": "192.168.1.1", |
379 | 876860a3 | Iustin Pop | "secondary_ip": "192.168.2.1", |
380 | 876860a3 | Iustin Pop | "tags": [], |
381 | 876860a3 | Iustin Pop | "free_memory": 3505, |
382 | 876860a3 | Iustin Pop | "free_disk": 856740, |
383 | 876860a3 | Iustin Pop | "total_memory": 4095 |
384 | 876860a3 | Iustin Pop | }, |
385 | 876860a3 | Iustin Pop | "node2.example.com": { |
386 | 876860a3 | Iustin Pop | "total_disk": 858240, |
387 | 876860a3 | Iustin Pop | "primary_ip": "192.168.1.3", |
388 | 876860a3 | Iustin Pop | "secondary_ip": "192.168.2.3", |
389 | 876860a3 | Iustin Pop | "tags": ["test"], |
390 | 876860a3 | Iustin Pop | "free_memory": 3505, |
391 | 876860a3 | Iustin Pop | "free_disk": 848320, |
392 | 876860a3 | Iustin Pop | "total_memory": 4095 |
393 | 876860a3 | Iustin Pop | }, |
394 | 876860a3 | Iustin Pop | "node3.example.com.com": { |
395 | 876860a3 | Iustin Pop | "total_disk": 572184, |
396 | 876860a3 | Iustin Pop | "primary_ip": "192.168.1.3", |
397 | 876860a3 | Iustin Pop | "secondary_ip": "192.168.2.3", |
398 | 876860a3 | Iustin Pop | "tags": [], |
399 | 876860a3 | Iustin Pop | "free_memory": 3505, |
400 | 876860a3 | Iustin Pop | "free_disk": 570648, |
401 | 876860a3 | Iustin Pop | "total_memory": 4095 |
402 | 876860a3 | Iustin Pop | } |
403 | 876860a3 | Iustin Pop | } |
404 | 876860a3 | Iustin Pop | } |
405 | 876860a3 | Iustin Pop | |
406 | 876860a3 | Iustin Pop | Input message, reallocation. Since only the request entry in the input |
407 | 876860a3 | Iustin Pop | message is changed, we show only this changed entry:: |
408 | 876860a3 | Iustin Pop | |
409 | 876860a3 | Iustin Pop | "request": { |
410 | 876860a3 | Iustin Pop | "relocate_from": [ |
411 | 876860a3 | Iustin Pop | "node3.example.com" |
412 | 876860a3 | Iustin Pop | ], |
413 | 876860a3 | Iustin Pop | "required_nodes": 1, |
414 | 876860a3 | Iustin Pop | "type": "relocate", |
415 | 876860a3 | Iustin Pop | "name": "instance2.example.com", |
416 | 876860a3 | Iustin Pop | "disk_space_total": 832 |
417 | 876860a3 | Iustin Pop | }, |
418 | 876860a3 | Iustin Pop | |
419 | 876860a3 | Iustin Pop | |
420 | 632fb7ec | Iustin Pop | Input message, node evacuation:: |
421 | 632fb7ec | Iustin Pop | |
422 | 632fb7ec | Iustin Pop | "request": { |
423 | 632fb7ec | Iustin Pop | "evac_nodes": [ |
424 | 632fb7ec | Iustin Pop | "node2" |
425 | 632fb7ec | Iustin Pop | ], |
426 | 632fb7ec | Iustin Pop | "type": "multi-evacuate" |
427 | 632fb7ec | Iustin Pop | }, |
428 | 632fb7ec | Iustin Pop | |
429 | 632fb7ec | Iustin Pop | |
430 | 876860a3 | Iustin Pop | Response messages |
431 | 876860a3 | Iustin Pop | ~~~~~~~~~~~~~~~~~ |
432 | 876860a3 | Iustin Pop | Successful response message:: |
433 | 876860a3 | Iustin Pop | |
434 | 876860a3 | Iustin Pop | { |
435 | 876860a3 | Iustin Pop | "info": "Allocation successful", |
436 | 632fb7ec | Iustin Pop | "result": [ |
437 | 876860a3 | Iustin Pop | "node2.example.com", |
438 | 876860a3 | Iustin Pop | "node1.example.com" |
439 | 876860a3 | Iustin Pop | ], |
440 | 876860a3 | Iustin Pop | "success": true |
441 | 876860a3 | Iustin Pop | } |
442 | 876860a3 | Iustin Pop | |
443 | 876860a3 | Iustin Pop | Failed response message:: |
444 | 876860a3 | Iustin Pop | |
445 | 876860a3 | Iustin Pop | { |
446 | 876860a3 | Iustin Pop | "info": "Can't find a suitable node for position 2 (already selected: node2.example.com)", |
447 | 632fb7ec | Iustin Pop | "result": [], |
448 | 876860a3 | Iustin Pop | "success": false |
449 | 876860a3 | Iustin Pop | } |
450 | 876860a3 | Iustin Pop | |
451 | 632fb7ec | Iustin Pop | Successful node evacuation message:: |
452 | 632fb7ec | Iustin Pop | |
453 | 632fb7ec | Iustin Pop | { |
454 | 632fb7ec | Iustin Pop | "info": "Request successful", |
455 | 632fb7ec | Iustin Pop | "result": [ |
456 | 632fb7ec | Iustin Pop | [ |
457 | 632fb7ec | Iustin Pop | "instance1", |
458 | 632fb7ec | Iustin Pop | "node3" |
459 | 632fb7ec | Iustin Pop | ], |
460 | 632fb7ec | Iustin Pop | [ |
461 | 632fb7ec | Iustin Pop | "instance2", |
462 | 632fb7ec | Iustin Pop | "node1" |
463 | 632fb7ec | Iustin Pop | ] |
464 | 632fb7ec | Iustin Pop | ], |
465 | 632fb7ec | Iustin Pop | "success": true |
466 | 632fb7ec | Iustin Pop | } |
467 | 632fb7ec | Iustin Pop | |
468 | 632fb7ec | Iustin Pop | |
469 | 876860a3 | Iustin Pop | Command line messages |
470 | 876860a3 | Iustin Pop | ~~~~~~~~~~~~~~~~~~~~~ |
471 | 876860a3 | Iustin Pop | :: |
472 | 876860a3 | Iustin Pop | |
473 | 876860a3 | Iustin Pop | # gnt-instance add -t plain -m 2g --os-size 1g --swap-size 512m --iallocator dumb-allocator -o etch-image instance3 |
474 | 876860a3 | Iustin Pop | Selected nodes for the instance: node1.example.com |
475 | 876860a3 | Iustin Pop | * creating instance disks... |
476 | 876860a3 | Iustin Pop | [...] |
477 | 876860a3 | Iustin Pop | |
478 | 876860a3 | Iustin Pop | # gnt-instance add -t plain -m 3400m --os-size 1g --swap-size 512m --iallocator dumb-allocator -o etch-image instance4 |
479 | 876860a3 | Iustin Pop | Failure: prerequisites not met for this operation: |
480 | 876860a3 | Iustin Pop | Can't compute nodes using iallocator 'dumb-allocator': Can't find a suitable node for position 1 (already selected: ) |
481 | 876860a3 | Iustin Pop | |
482 | 876860a3 | Iustin Pop | # gnt-instance add -t drbd -m 1400m --os-size 1g --swap-size 512m --iallocator dumb-allocator -o etch-image instance5 |
483 | 876860a3 | Iustin Pop | Failure: prerequisites not met for this operation: |
484 | 876860a3 | Iustin Pop | Can't compute nodes using iallocator 'dumb-allocator': Can't find a suitable node for position 2 (already selected: node1.example.com) |
485 | 558fd122 | Michael Hanselmann | |
486 | 558fd122 | Michael Hanselmann | .. vim: set textwidth=72 : |
487 | 632fb7ec | Iustin Pop | .. Local Variables: |
488 | 632fb7ec | Iustin Pop | .. mode: rst |
489 | 632fb7ec | Iustin Pop | .. fill-column: 72 |
490 | 632fb7ec | Iustin Pop | .. End: |