This patch series addresses bug 355. In order to have hail honor networks connected to node groups, this information has to be exported via the iallocator interface. Equally, the network an instances NIC should be connected to is exported via the interface as well, and then parsed by hail. Finally, node groups are filtered before a node allocation is tried.
Thomas Thrainer (5): Export connected networks to IAllocator Parse node group networks Parse NIC data from allocation request in hail Honor network connections in hail Add tests for network-aware allocation Makefile.am | 3 + lib/masterd/iallocator.py | 1 + src/Ganeti/HTools/Backend/IAlloc.hs | 26 +- src/Ganeti/HTools/Backend/Luxi.hs | 4 +- src/Ganeti/HTools/Backend/Rapi.hs | 6 +- src/Ganeti/HTools/Backend/Simu.hs | 2 +- src/Ganeti/HTools/Backend/Text.hs | 4 +- src/Ganeti/HTools/Cluster.hs | 83 +++--- src/Ganeti/HTools/Group.hs | 12 +- src/Ganeti/HTools/Instance.hs | 7 +- src/Ganeti/HTools/Nic.hs | 77 ++++++ src/Ganeti/HTools/Program/Hspace.hs | 4 +- src/Ganeti/HTools/Types.hs | 4 + test/data/htools/hail-alloc-drbd.json | 1 + test/data/htools/hail-alloc-invalid-network.json | 155 ++++++++++++ test/data/htools/hail-alloc-invalid-twodisks.json | 4 +- .../data/htools/hail-alloc-restricted-network.json | 277 +++++++++++++++++++++ test/data/htools/hail-alloc-twodisks.json | 4 +- test/data/htools/hail-change-group.json | 2 + test/data/htools/hail-node-evac.json | 1 + test/data/htools/hail-reloc-drbd.json | 1 + test/hs/Test/Ganeti/HTools/Instance.hs | 2 +- test/hs/Test/Ganeti/TestHTools.hs | 4 +- test/hs/shelltests/htools-hail.test | 10 + 24 files changed, 642 insertions(+), 52 deletions(-) create mode 100644 src/Ganeti/HTools/Nic.hs create mode 100644 test/data/htools/hail-alloc-invalid-network.json create mode 100644 test/data/htools/hail-alloc-restricted-network.json -- 1.8.2.1
