Am 5. Juli 2011 14:50 schrieb Iustin Pop <[email protected]>:
> On Mon, Jun 06, 2011 at 05:11:15PM +0200, Michael Hanselmann wrote:
>> +The result of the operations described above must contain two lists of
>> +instances and a list of jobsets.
>> +
>> +The two lists of instances describe which instances could be
>> +moved/migrated and which couldn't for some reason ("unsuccessful"). The
>> +union of the two lists must be equal to the set of instances given in
>> +the original request.
>
> As I read this, the result will be something like (with tuples for
> readability, even though in JSON they are also lists):
>
> ([failed-instance-names], [moved-instances-names], [[opcode]])
>
> Note: the iallocator code as submitted and sent for review seems to
> ignore the instance lists, but that's beside the point.

In practice the result should be dictionary anyway. Should we ever
have to, extending a tuple/list is a pain, whereas a dictionary is
cheap to have from the beginning.

> The problem with the above definition is twofold.
>
> First, [[opcode]] is a list of jobs, not of jobsets. Proper jobsets
> would be [[job]] i.e. [[[opcode]]]. Do we care about jobsets or can we
> just talk about jobs?

True, either way is fine with me.

> Second, from my experience [failed-instance-names] is a bad data
> structure for the user, since there's no way to extract more information
> from the iallocator plugin about failures. I propose that we change this
> to the following: [(instance-name, details)], where 'details' is a
> string holding any information the IAllocator might (already) have for
> the failure reason.

LGTM, please send a patch.

Michael

Reply via email to