Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (4.8 kB)

1
====================================
2
Moving instances accross node groups
3
====================================
4

    
5
This design document explains the changes needed in Ganeti to perform
6
instance moves across node groups. Reader familiarity with the following
7
existing documents is advised:
8

    
9
- :doc:`Current IAllocator specification <iallocator>`
10
- :doc:`Shared storage model in 2.3+ <design-shared-storage>`
11

    
12
Motivation and and design proposal
13
==================================
14

    
15
At the moment, moving instances away from their primary or secondary
16
nodes with the ``relocate`` and ``multi-evacuate`` IAllocator calls
17
restricts target nodes to those on the same node group. This ensures a
18
mobility domain is never crossed, and allows normal operation of each
19
node group to be confined within itself.
20

    
21
It is desirable, however, to have a way of moving instances across node
22
groups so that, for example, it is possible to move a set of instances
23
to another group for policy reasons, or completely empty a given group
24
to perform maintenance operations.
25

    
26
To implement this, we propose the addition of new IAllocator calls to
27
compute inter-group instance moves and group-aware node evacuation,
28
taking into account mobility domains as appropriate. The interface
29
proposed below should be enough to cover the use cases mentioned above.
30

    
31
With the implementation of this design proposal, the previous
32
``multi-evacuate`` mode will be deprecated.
33

    
34
.. _multi-reloc-detailed-design:
35

    
36
Detailed design
37
===============
38

    
39
All requests honor the groups' ``alloc_policy`` attribute.
40

    
41
Changing instance's groups
42
--------------------------
43

    
44
Takes a list of instances and a list of node group UUIDs; the instances
45
will be moved away from their current group, to any of the groups in the
46
target list. All instances need to have their primary node in the same
47
group, which may not be a target group. If the target group list is
48
empty, the request is simply "change group" and the instances are placed
49
in any group but their original one.
50

    
51
Node evacuation
52
---------------
53

    
54
Evacuates instances off their primary nodes. The evacuation mode
55
can be given as ``primary-only``, ``secondary-only`` or
56
``all``. The call is given a list of instances whose primary nodes need
57
to be in the same node group. The returned nodes need to be in the same
58
group as the original primary node.
59

    
60
.. _multi-reloc-result:
61

    
62
Result
63
------
64

    
65
In all storage models, an inter-group move can be modeled as a sequence
66
of **replace secondary**, **migration** and **failover** operations
67
(when shared storage is used, they will all be failover or migration
68
operations within the corresponding mobility domain).
69

    
70
The result of the operations described above must contain two lists of
71
instances and a list of jobsets.
72

    
73
The two lists of instances describe which instances could be
74
moved/migrated and which couldn't for some reason ("unsuccessful"). The
75
union of the instances in the two lists must be equal to the set of
76
instances given in the original request. The successful list of
77
instances contains elements as follows::
78

    
79
  (instance name, target group name, [chosen node names])
80

    
81
The choice of names is simply for readability reasons (for example,
82
Ganeti could log the computed solution in the job information) and for
83
being able to check (manually) for consistency that the generated
84
opcodes match the intended target groups/nodes. Note that for the
85
node-evacuate operation, the group is not changed, but it should still
86
be returned as such (as it's easier to have the same return type for
87
both operations).
88

    
89
The unsuccessful list of instances contains elements as follows::
90

    
91
  (instance name, explanation)
92

    
93
where ``explanation`` is a string describing why the plugin was not able
94
to relocate the instance.
95

    
96
The list of jobsets contained in the result describe how to actually
97
execute the operation. Each jobset contains lists of serialized opcodes.
98
Example::
99

    
100
  [
101
    [
102
      { "OP_ID": "OP_INSTANCE_MIGRATE",
103
        "instance_name": "inst1.example.com",
104
      },
105
      { "OP_ID": "OP_INSTANCE_MIGRATE",
106
        "instance_name": "inst2.example.com",
107
      },
108
    ],
109
    [
110
      { "OP_ID": "OP_INSTANCE_REPLACE_DISKS",
111
        "instance_name": "inst2.example.com",
112
        "mode": "replace_new_secondary",
113
        "remote_node": "node4.example.com"
114
      },
115
    ],
116
    [
117
      { "OP_ID": "OP_INSTANCE_FAILOVER",
118
        "instance_name": "inst8.example.com",
119
      },
120
    ]
121
  ]
122

    
123
Accepted opcodes:
124

    
125
- ``OP_INSTANCE_FAILOVER``
126
- ``OP_INSTANCE_MIGRATE``
127
- ``OP_INSTANCE_REPLACE_DISKS``
128

    
129
Starting with the first set, Ganeti will submit all jobs of a set at the
130
same time, enabling execution in parallel. Upon completion of all jobs
131
in a set, the process is repeated for the next one. Ganeti is at liberty
132
to abort the execution after any jobset. In such a case the user is
133
notified and can restart the operation.
134

    
135
.. vim: set textwidth=72 :
136
.. Local Variables:
137
.. mode: rst
138
.. fill-column: 72
139
.. End: