In this example, there is one big instance (.75 of a node) and
otherwise small instances (.25 of a node). One node is only
used to 25% whereas the rest to 75%. Nevertheless, the mostly
empty node cannot be used for allocating a new instance, as
that would prevent the big instance from being evacuated should
its node fail. Note that the mostly empty node would be the most
balanced allocation.
Signed-off-by: Klaus Aehlig <[email protected]>
---
Makefile.am | 1 +
test/data/htools/plain-n1-restriction.data | 18 ++++++++++++++++++
test/hs/shelltests/htools-hail.test | 8 ++++++++
3 files changed, 27 insertions(+)
create mode 100644 test/data/htools/plain-n1-restriction.data
diff --git a/Makefile.am b/Makefile.am
index 546f18a..0b74e2f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1739,6 +1739,7 @@ TEST_FILES = \
test/data/htools/hsqueeze-mixed-instances.data \
test/data/htools/hsqueeze-overutilized.data \
test/data/htools/hsqueeze-underutilized.data \
+ test/data/htools/plain-n1-restriction.data \
test/data/htools/shared-n1-failure.data \
test/data/htools/shared-n1-restriction.data \
test/data/htools/unique-reboot-order.data \
diff --git a/test/data/htools/plain-n1-restriction.data
b/test/data/htools/plain-n1-restriction.data
new file mode 100644
index 0000000..0e907d8
--- /dev/null
+++ b/test/data/htools/plain-n1-restriction.data
@@ -0,0 +1,18 @@
+group-01|fake-uuid-01|preferred||
+
+nodeA|4096|0|3096|409600|309600|4|M|fake-uuid-01|4
+nodeB|4096|0|1096|409600|109600|4|N|fake-uuid-01|4
+nodeC|4096|0|1096|409600|109600|4|N|fake-uuid-01|4
+nodeD|4096|0|1096|409600|109600|4|N|fake-uuid-01|4
+
+instA1|1000|100000|1|running|Y|nodeA||plain||1
+instB1|1000|100000|1|running|Y|nodeB||plain||1
+instB2|1000|100000|1|running|Y|nodeB||plain||1
+instB3|1000|100000|1|running|Y|nodeB||plain||1
+instC1|3000|300000|3|running|Y|nodeC||plain||3
+instD1|1000|100000|1|running|Y|nodeD||plain||1
+instD2|1000|100000|1|running|Y|nodeD||plain||1
+instD3|1000|100000|1|running|Y|nodeD||plain||1
+
+|128,1,1024,1,1,1|128,1,1024,1,1,1;32768,8,1048576,16,8,12|diskless,file,sharedfile,plain,blockdev,drbd,rbd,ext|4.0|32.0
+group-01|128,1,1024,1,1,1|128,1,1024,1,1,1;32768,8,1048576,16,8,12|diskless,file,sharedfile,plain,blockdev,drbd,rbd,ext|4.0|32.0
diff --git a/test/hs/shelltests/htools-hail.test
b/test/hs/shelltests/htools-hail.test
index a425eb7..9402a34 100644
--- a/test/hs/shelltests/htools-hail.test
+++ b/test/hs/shelltests/htools-hail.test
@@ -191,6 +191,14 @@ cat $TESTDATA_DIR/hail-alloc-invalid-network.json | grep -v -e
'"network":"uuid-
>>> /"success":true.*"result":\["nodeA"\]/
>>>= 0
+./test/hs/hail -t $TESTDATA_DIR/plain-n1-restriction.data
$TESTDATA_DIR/hail-alloc-ext.json
+>>> /"success":true.*"result":\["node[BCD]"\]/
+>>>= 0
+
+./test/hs/hail -t $TESTDATA_DIR/plain-n1-restriction.data
$TESTDATA_DIR/hail-alloc-ext.json --no-capacity-checks
+>>> /"success":true.*"result":\["nodeA"\]/
+>>>= 0
+
# Verify that allocation restrications are honored
./test/hs/hail -t $TESTDATA_DIR/partly-used.data
$TESTDATA_DIR/hail-alloc-drbd.json
>>> /successes 20,.*"result":\["node-0[45]","node-0[45]"\]/
--
2.4.3.573.g4eafbef