Allocator framework, 1st part: allocator input generation
authorIustin Pop <iustin@google.com>
Wed, 16 Apr 2008 13:56:00 +0000 (13:56 +0000)
committerIustin Pop <iustin@google.com>
Wed, 16 Apr 2008 13:56:00 +0000 (13:56 +0000)
commitd61df03ef2d9353a2e146a454acda02b9a642bb6
treea5175bffcc2e87b1cf1a0be589aa563cf96cf3c2
parentb62ddbe5f4ec2fbd781abd1ff7b5fb7dc0598d1e
Allocator framework, 1st part: allocator input generation

In preparation for the introduction of automatic instance allocator,
this patch adds an allocator simulation opcode, that based on the input
parameters, will return either the input message to the allocator
(implemented) or the result of the allocator run (not yet implemented).

This allows algorithm tests against simulated allocations and the
current cluster state.

The patch adds the following:
  - a function that generates the generic cluster information for the
    allocator
  - a function that generates the 'new instance' information
  - a function that generates the 'replace_secondary' information

These three functions will be used by the allocator framework later to
generate the actual information for the external algorithms. Currently
we just return the json-serialized text.

Reviewed-by: imsnah
lib/cmdlib.py
lib/constants.py
lib/mcpu.py
lib/opcodes.py
scripts/gnt-debug