Commit 0167bd6b authored by Klaus Aehlig's avatar Klaus Aehlig

Add a test for global N+1 redundancy in allocation

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: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 86fd7769
......@@ -1677,6 +1677,7 @@ TEST_FILES = \
test/data/htools/empty-cluster.data \
test/data/htools/hail-alloc-dedicated-1.json \
test/data/htools/hail-alloc-drbd.json \
test/data/htools/hail-alloc-ext.json \
test/data/htools/hail-alloc-invalid-network.json \
test/data/htools/hail-alloc-invalid-twodisks.json \
test/data/htools/hail-alloc-restricted-network.json \
......@@ -1727,6 +1728,7 @@ TEST_FILES = \
test/data/htools/hsqueeze-overutilized.data \
test/data/htools/hsqueeze-underutilized.data \
test/data/htools/shared-n1-failure.data \
test/data/htools/shared-n1-restriction.data \
test/data/htools/unique-reboot-order.data \
test/data/mond-data.txt \
test/hs/shelltests/htools-balancing.test \
......
{
"cluster_tags": [],
"instances": {},
"nodegroups": {},
"nodes": {},
"request": {
"disk_space_total": 0,
"disk_template": "ext",
"disks": [
{
"size": 1024
}
],
"hypervisor": "xen-pvm",
"memory": 1000,
"name": "instance-new",
"nics": [],
"os": "instance-debootstrap",
"required_nodes": 1,
"spindle_use": 1,
"tags": [],
"type": "allocate",
"vcpus": 1
}
}
group-01|fake-uuid-01|preferred||
nodeA|4096|0|3096|200|200|4|M|fake-uuid-01|4
nodeB|4096|0|1096|200|200|4|N|fake-uuid-01|4
nodeC|4096|0|1096|200|200|4|N|fake-uuid-01|4
nodeD|4096|0|1096|200|200|4|N|fake-uuid-01|4
instA1|1000|0|1|running|Y|nodeA||ext||1
instB1|1000|0|1|running|Y|nodeB||ext||1
instB2|1000|0|1|running|Y|nodeB||ext||1
instB3|1000|0|1|running|Y|nodeB||ext||1
instC1|3000|0|3|running|Y|nodeC||ext||3
instD1|1000|0|1|running|Y|nodeD||ext||1
instD2|1000|0|1|running|Y|nodeD||ext||1
instD3|1000|0|1|running|Y|nodeD||ext||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
......@@ -181,3 +181,12 @@ cat $TESTDATA_DIR/hail-alloc-invalid-network.json | grep -v -e '"network":"uuid-
./test/hs/hail $TESTDATA_DIR/hail-multialloc-dedicated.json
>>> /"success":true.*"result":\[\[\[.*\["node2-quarter"\]/
>>>= 0
# Verify that global N+1 redundancy is honored, unless requested not to
./test/hs/hail -t $TESTDATA_DIR/shared-n1-restriction.data $TESTDATA_DIR/hail-alloc-ext.json
>>> /"success":true.*"result":\["node[BCD]"\]/
>>>= 0
./test/hs/hail -t $TESTDATA_DIR/shared-n1-restriction.data $TESTDATA_DIR/hail-alloc-ext.json --no-capacity-checks
>>> /"success":true.*"result":\["nodeA"\]/
>>>= 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment