iallocator: use lookup by disk template
authorHelga Velroyen <helgav@google.com>
Tue, 8 Oct 2013 12:20:43 +0000 (14:20 +0200)
committerHelga Velroyen <helgav@google.com>
Wed, 9 Oct 2013 10:40:28 +0000 (12:40 +0200)
commite8936ef7cbfc83a39eaef95995ad1fb40cb48f18
treeffde67f8d2ee2687b2f825fd5df1b172d32287e9
parentb669aa4156e85676ba540879de78dedbaa1a9659
iallocator: use lookup by disk template

So far, the iallocator requested storage information
about all enabled disk templates but discarded all but
the LVM information, even if it was allocating space
for a non-LVM instance. With this patch, it now only
asks for the one that is relevant for
the allocation request.

This has the following advantages:
- less load in the RPC call
- meaningful storage information is used for non-LVM
  instance and thus better allocation

Note that this so far works only for instance allocation.
The code introduces some FIXMEs which will be resolved
when utilizing the improvements in other iallocator
requests as well.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
lib/masterd/iallocator.py
test/py/ganeti.masterd.iallocator_unittest.py