Statistics
| Branch: | Tag: | Revision:

root / doc / design-multi-reloc.rst @ 0b71067a

History | View | Annotate | Download (4.8 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 25ee7fd8 Michael Hanselmann
instances and a list of jobsets.
72 25ee7fd8 Michael Hanselmann
73 25ee7fd8 Michael Hanselmann
The two lists of instances describe which instances could be
74 25ee7fd8 Michael Hanselmann
moved/migrated and which couldn't for some reason ("unsuccessful"). The
75 0b71067a Iustin Pop
union of the instances in the two lists must be equal to the set of
76 0b71067a Iustin Pop
instances given in the original request. The successful list of
77 0b71067a Iustin Pop
instances contains elements as follows::
78 0b71067a Iustin Pop
79 0b71067a Iustin Pop
  (instance name, target group name, [chosen node names])
80 0b71067a Iustin Pop
81 0b71067a Iustin Pop
The choice of names is simply for readability reasons (for example,
82 0b71067a Iustin Pop
Ganeti could log the computed solution in the job information) and for
83 0b71067a Iustin Pop
being able to check (manually) for consistency that the generated
84 0b71067a Iustin Pop
opcodes match the intended target groups/nodes. Note that for the
85 0b71067a Iustin Pop
node-evacuate operation, the group is not changed, but it should still
86 0b71067a Iustin Pop
be returned as such (as it's easier to have the same return type for
87 0b71067a Iustin Pop
both operations).
88 0b71067a Iustin Pop
89 0b71067a Iustin Pop
The unsuccessful list of instances contains elements as follows::
90 0b71067a Iustin Pop
91 0b71067a Iustin Pop
  (instance name, explanation)
92 0b71067a Iustin Pop
93 0b71067a Iustin Pop
where ``explanation`` is a string describing why the plugin was not able
94 0b71067a Iustin Pop
to relocate the instance.
95 25ee7fd8 Michael Hanselmann
96 25ee7fd8 Michael Hanselmann
The list of jobsets contained in the result describe how to actually
97 25ee7fd8 Michael Hanselmann
execute the operation. Each jobset contains lists of serialized opcodes.
98 25ee7fd8 Michael Hanselmann
Example::
99 9626f028 Michael Hanselmann
100 9626f028 Michael Hanselmann
  [
101 9626f028 Michael Hanselmann
    [
102 9626f028 Michael Hanselmann
      { "OP_ID": "OP_INSTANCE_MIGRATE",
103 9626f028 Michael Hanselmann
        "instance_name": "inst1.example.com",
104 9626f028 Michael Hanselmann
      },
105 9626f028 Michael Hanselmann
      { "OP_ID": "OP_INSTANCE_MIGRATE",
106 9626f028 Michael Hanselmann
        "instance_name": "inst2.example.com",
107 9626f028 Michael Hanselmann
      },
108 9626f028 Michael Hanselmann
    ],
109 9626f028 Michael Hanselmann
    [
110 9626f028 Michael Hanselmann
      { "OP_ID": "OP_INSTANCE_REPLACE_DISKS",
111 9626f028 Michael Hanselmann
        "instance_name": "inst2.example.com",
112 9626f028 Michael Hanselmann
        "mode": "replace_new_secondary",
113 9626f028 Michael Hanselmann
        "remote_node": "node4.example.com"
114 9626f028 Michael Hanselmann
      },
115 9626f028 Michael Hanselmann
    ],
116 9626f028 Michael Hanselmann
    [
117 9626f028 Michael Hanselmann
      { "OP_ID": "OP_INSTANCE_FAILOVER",
118 9626f028 Michael Hanselmann
        "instance_name": "inst8.example.com",
119 9626f028 Michael Hanselmann
      },
120 9626f028 Michael Hanselmann
    ]
121 9626f028 Michael Hanselmann
  ]
122 9626f028 Michael Hanselmann
123 9626f028 Michael Hanselmann
Accepted opcodes:
124 9626f028 Michael Hanselmann
125 9626f028 Michael Hanselmann
- ``OP_INSTANCE_FAILOVER``
126 9626f028 Michael Hanselmann
- ``OP_INSTANCE_MIGRATE``
127 9626f028 Michael Hanselmann
- ``OP_INSTANCE_REPLACE_DISKS``
128 9626f028 Michael Hanselmann
129 9626f028 Michael Hanselmann
Starting with the first set, Ganeti will submit all jobs of a set at the
130 9626f028 Michael Hanselmann
same time, enabling execution in parallel. Upon completion of all jobs
131 9626f028 Michael Hanselmann
in a set, the process is repeated for the next one. Ganeti is at liberty
132 25ee7fd8 Michael Hanselmann
to abort the execution after any jobset. In such a case the user is
133 25ee7fd8 Michael Hanselmann
notified and can restart the operation.
134 4055b109 Adeodato Simo
135 4055b109 Adeodato Simo
.. vim: set textwidth=72 :
136 4055b109 Adeodato Simo
.. Local Variables:
137 4055b109 Adeodato Simo
.. mode: rst
138 4055b109 Adeodato Simo
.. fill-column: 72
139 4055b109 Adeodato Simo
.. End: