Statistics
| Branch: | Tag: | Revision:

root / doc / design-multi-reloc.rst @ fc6075dd

History | View | Annotate | Download (4.9 kB)

1 4055b109 Adeodato Simo
====================================
2 4055b109 Adeodato Simo
Moving instances accross node groups
3 4055b109 Adeodato Simo
====================================
4 4055b109 Adeodato Simo
5 4055b109 Adeodato Simo
This design document explains the changes needed in Ganeti to perform
6 4055b109 Adeodato Simo
instance moves across node groups. Reader familiarity with the following
7 4055b109 Adeodato Simo
existing documents is advised:
8 4055b109 Adeodato Simo
9 4055b109 Adeodato Simo
- :doc:`Current IAllocator specification <iallocator>`
10 4055b109 Adeodato Simo
- :doc:`Shared storage model in 2.3+ <design-shared-storage>`
11 4055b109 Adeodato Simo
12 4055b109 Adeodato Simo
Motivation and and design proposal
13 4055b109 Adeodato Simo
==================================
14 4055b109 Adeodato Simo
15 4055b109 Adeodato Simo
At the moment, moving instances away from their primary or secondary
16 4055b109 Adeodato Simo
nodes with the ``relocate`` and ``multi-evacuate`` IAllocator calls
17 4055b109 Adeodato Simo
restricts target nodes to those on the same node group. This ensures a
18 4055b109 Adeodato Simo
mobility domain is never crossed, and allows normal operation of each
19 4055b109 Adeodato Simo
node group to be confined within itself.
20 4055b109 Adeodato Simo
21 4055b109 Adeodato Simo
It is desirable, however, to have a way of moving instances across node
22 4055b109 Adeodato Simo
groups so that, for example, it is possible to move a set of instances
23 4055b109 Adeodato Simo
to another group for policy reasons, or completely empty a given group
24 4055b109 Adeodato Simo
to perform maintenance operations.
25 4055b109 Adeodato Simo
26 25ee7fd8 Michael Hanselmann
To implement this, we propose the addition of new IAllocator calls to
27 25ee7fd8 Michael Hanselmann
compute inter-group instance moves and group-aware node evacuation,
28 25ee7fd8 Michael Hanselmann
taking into account mobility domains as appropriate. The interface
29 25ee7fd8 Michael Hanselmann
proposed below should be enough to cover the use cases mentioned above.
30 25ee7fd8 Michael Hanselmann
31 25ee7fd8 Michael Hanselmann
With the implementation of this design proposal, the previous
32 25ee7fd8 Michael Hanselmann
``multi-evacuate`` mode will be deprecated.
33 4055b109 Adeodato Simo
34 6d267b81 Adeodato Simo
.. _multi-reloc-detailed-design:
35 6d267b81 Adeodato Simo
36 4055b109 Adeodato Simo
Detailed design
37 4055b109 Adeodato Simo
===============
38 4055b109 Adeodato Simo
39 25ee7fd8 Michael Hanselmann
All requests honor the groups' ``alloc_policy`` attribute.
40 4055b109 Adeodato Simo
41 25ee7fd8 Michael Hanselmann
Changing instance's groups
42 25ee7fd8 Michael Hanselmann
--------------------------
43 4055b109 Adeodato Simo
44 25ee7fd8 Michael Hanselmann
Takes a list of instances and a list of node group UUIDs; the instances
45 25ee7fd8 Michael Hanselmann
will be moved away from their current group, to any of the groups in the
46 25ee7fd8 Michael Hanselmann
target list. All instances need to have their primary node in the same
47 25ee7fd8 Michael Hanselmann
group, which may not be a target group. If the target group list is
48 25ee7fd8 Michael Hanselmann
empty, the request is simply "change group" and the instances are placed
49 25ee7fd8 Michael Hanselmann
in any group but their original one.
50 4055b109 Adeodato Simo
51 25ee7fd8 Michael Hanselmann
Node evacuation
52 25ee7fd8 Michael Hanselmann
---------------
53 4055b109 Adeodato Simo
54 25ee7fd8 Michael Hanselmann
Evacuates instances off their primary nodes. The evacuation mode
55 25ee7fd8 Michael Hanselmann
can be given as ``primary-only``, ``secondary-only`` or
56 25ee7fd8 Michael Hanselmann
``all``. The call is given a list of instances whose primary nodes need
57 25ee7fd8 Michael Hanselmann
to be in the same node group. The returned nodes need to be in the same
58 25ee7fd8 Michael Hanselmann
group as the original primary node.
59 4055b109 Adeodato Simo
60 9626f028 Michael Hanselmann
.. _multi-reloc-result:
61 9626f028 Michael Hanselmann
62 4055b109 Adeodato Simo
Result
63 4055b109 Adeodato Simo
------
64 4055b109 Adeodato Simo
65 4055b109 Adeodato Simo
In all storage models, an inter-group move can be modeled as a sequence
66 9626f028 Michael Hanselmann
of **replace secondary**, **migration** and **failover** operations
67 9626f028 Michael Hanselmann
(when shared storage is used, they will all be failover or migration
68 9626f028 Michael Hanselmann
operations within the corresponding mobility domain).
69 9626f028 Michael Hanselmann
70 25ee7fd8 Michael Hanselmann
The result of the operations described above must contain two lists of
71 fda24caf Michael Hanselmann
instances and a list of jobs (each of which is a list of serialized
72 fda24caf Michael Hanselmann
opcodes) to actually execute the operation. :doc:`Job dependencies
73 fda24caf Michael Hanselmann
<design-chained-jobs>` can be used to force jobs to run in a certain
74 fda24caf Michael Hanselmann
order while still making use of parallelism.
75 25ee7fd8 Michael Hanselmann
76 25ee7fd8 Michael Hanselmann
The two lists of instances describe which instances could be
77 25ee7fd8 Michael Hanselmann
moved/migrated and which couldn't for some reason ("unsuccessful"). The
78 0b71067a Iustin Pop
union of the instances in the two lists must be equal to the set of
79 0b71067a Iustin Pop
instances given in the original request. The successful list of
80 0b71067a Iustin Pop
instances contains elements as follows::
81 0b71067a Iustin Pop
82 0b71067a Iustin Pop
  (instance name, target group name, [chosen node names])
83 0b71067a Iustin Pop
84 0b71067a Iustin Pop
The choice of names is simply for readability reasons (for example,
85 0b71067a Iustin Pop
Ganeti could log the computed solution in the job information) and for
86 0b71067a Iustin Pop
being able to check (manually) for consistency that the generated
87 0b71067a Iustin Pop
opcodes match the intended target groups/nodes. Note that for the
88 0b71067a Iustin Pop
node-evacuate operation, the group is not changed, but it should still
89 0b71067a Iustin Pop
be returned as such (as it's easier to have the same return type for
90 0b71067a Iustin Pop
both operations).
91 0b71067a Iustin Pop
92 0b71067a Iustin Pop
The unsuccessful list of instances contains elements as follows::
93 0b71067a Iustin Pop
94 0b71067a Iustin Pop
  (instance name, explanation)
95 0b71067a Iustin Pop
96 0b71067a Iustin Pop
where ``explanation`` is a string describing why the plugin was not able
97 0b71067a Iustin Pop
to relocate the instance.
98 25ee7fd8 Michael Hanselmann
99 fda24caf Michael Hanselmann
The client is given a list of job IDs (see the :doc:`design for
100 fda24caf Michael Hanselmann
LU-generated jobs <design-lu-generated-jobs>`) which it can watch.
101 fda24caf Michael Hanselmann
Failures should be reported to the user.
102 fda24caf Michael Hanselmann
103 fda24caf Michael Hanselmann
.. highlight:: python
104 fda24caf Michael Hanselmann
105 fda24caf Michael Hanselmann
Example job list::
106 9626f028 Michael Hanselmann
107 9626f028 Michael Hanselmann
  [
108 fda24caf Michael Hanselmann
    # First job
109 9626f028 Michael Hanselmann
    [
110 9626f028 Michael Hanselmann
      { "OP_ID": "OP_INSTANCE_MIGRATE",
111 9626f028 Michael Hanselmann
        "instance_name": "inst1.example.com",
112 9626f028 Michael Hanselmann
      },
113 9626f028 Michael Hanselmann
      { "OP_ID": "OP_INSTANCE_MIGRATE",
114 9626f028 Michael Hanselmann
        "instance_name": "inst2.example.com",
115 9626f028 Michael Hanselmann
      },
116 9626f028 Michael Hanselmann
    ],
117 fda24caf Michael Hanselmann
    # Second job
118 9626f028 Michael Hanselmann
    [
119 9626f028 Michael Hanselmann
      { "OP_ID": "OP_INSTANCE_REPLACE_DISKS",
120 fda24caf Michael Hanselmann
        "depends": [
121 fda24caf Michael Hanselmann
          [-1, ["success"]],
122 fda24caf Michael Hanselmann
          ],
123 9626f028 Michael Hanselmann
        "instance_name": "inst2.example.com",
124 9626f028 Michael Hanselmann
        "mode": "replace_new_secondary",
125 fda24caf Michael Hanselmann
        "remote_node": "node4.example.com",
126 9626f028 Michael Hanselmann
      },
127 9626f028 Michael Hanselmann
    ],
128 fda24caf Michael Hanselmann
    # Third job
129 9626f028 Michael Hanselmann
    [
130 9626f028 Michael Hanselmann
      { "OP_ID": "OP_INSTANCE_FAILOVER",
131 fda24caf Michael Hanselmann
        "depends": [
132 fda24caf Michael Hanselmann
          [-2, []],
133 fda24caf Michael Hanselmann
          ],
134 9626f028 Michael Hanselmann
        "instance_name": "inst8.example.com",
135 9626f028 Michael Hanselmann
      },
136 fda24caf Michael Hanselmann
    ],
137 9626f028 Michael Hanselmann
  ]
138 9626f028 Michael Hanselmann
139 9626f028 Michael Hanselmann
Accepted opcodes:
140 9626f028 Michael Hanselmann
141 9626f028 Michael Hanselmann
- ``OP_INSTANCE_FAILOVER``
142 9626f028 Michael Hanselmann
- ``OP_INSTANCE_MIGRATE``
143 9626f028 Michael Hanselmann
- ``OP_INSTANCE_REPLACE_DISKS``
144 9626f028 Michael Hanselmann
145 4055b109 Adeodato Simo
.. vim: set textwidth=72 :
146 4055b109 Adeodato Simo
.. Local Variables:
147 4055b109 Adeodato Simo
.. mode: rst
148 4055b109 Adeodato Simo
.. fill-column: 72
149 4055b109 Adeodato Simo
.. End: