Instance policy for disks applies on a per-disk basis. However, htools were applying it to the total disk usage when verifying where a new instance could be placed. This worked for single-disk instances, but could lead to wrong allocations or spurious allocation failures for multi-disk instances. This patch series extends the htools representation of an instance by a list of individual disk sizes and fixes the verification condition.
Fixes Issue 418. Klaus Aehlig (3): Verify individual disks in Instance Make the disks parameter available to the constructor Add shelltests verifying hail applies disk ipolicy per disk Makefile.am | 2 + src/Ganeti/HTools/Backend/IAlloc.hs | 7 +- src/Ganeti/HTools/Backend/Luxi.hs | 2 +- src/Ganeti/HTools/Backend/Rapi.hs | 3 +- src/Ganeti/HTools/Backend/Text.hs | 2 +- src/Ganeti/HTools/Instance.hs | 12 ++-- src/Ganeti/HTools/Program/Hspace.hs | 5 +- test/data/htools/hail-alloc-invalid-twodisks.json | 86 +++++++++++++++++++++++ test/data/htools/hail-alloc-twodisks.json | 86 +++++++++++++++++++++++ test/hs/Test/Ganeti/HTools/Instance.hs | 2 +- test/hs/Test/Ganeti/TestHTools.hs | 4 +- test/hs/shelltests/htools-hail.test | 9 +++ 12 files changed, 206 insertions(+), 14 deletions(-) create mode 100644 test/data/htools/hail-alloc-invalid-twodisks.json create mode 100644 test/data/htools/hail-alloc-twodisks.json -- 1.8.1.3
