Extending the example of f8d4db63d62e45957e60caa2e055fb8276f3fd50, demonstrate the effect of default assumptions. If we assume idle defaults, a high CPU load of the instances on the node with the two big instances forces one of them to be moved away; without idle defaults, the default assumption of full disk/memory/network utilisation of all instances still pushes an instance on that node. Also, --ignore-dynu still overrides everything.
Signed-off-by: Klaus Aehlig <[email protected]> --- Makefile.am | 1 + test/data/htools/dyn1.json | 38 ++++++++++++++++++++++++++++++++ test/hs/shelltests/htools-balancing.test | 34 ++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 test/data/htools/dyn1.json diff --git a/Makefile.am b/Makefile.am index 50bc5d4..d642c88 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1724,6 +1724,7 @@ TEST_FILES = \ test/autotools/autotools-check-news.test \ test/data/htools/clean-nonzero-score.data \ test/data/htools/common-suffix.data \ + test/data/htools/dyn1.json \ test/data/htools/empty-cluster.data \ test/data/htools/hail-alloc-dedicated-1.json \ test/data/htools/hail-alloc-drbd.json \ diff --git a/test/data/htools/dyn1.json b/test/data/htools/dyn1.json new file mode 100644 index 0000000..ab0e89d --- /dev/null +++ b/test/data/htools/dyn1.json @@ -0,0 +1,38 @@ +[ + { + "node": "node-01-000", + "reports": [ + { + "category": null, + "data": { + "inst-00": 0.1, + "inst-01": 0.1, + "inst-02": 0.1, + "inst-03": 0.1 + }, + "format_version": 1, + "kind": 0, + "name": "xen-cpu-avg-load", + "timestamp": 1444910125282702000, + "version": "B" + } + ] + }, + { + "node": "node-01-001", + "reports": [ + { + "category": null, + "data": { + "inst-10": 2.0, + "inst-11": 2.0 + }, + "format_version": 1, + "kind": 0, + "name": "xen-cpu-avg-load", + "timestamp": 1444910125282702000, + "version": "B" + } + ] + } +] diff --git a/test/hs/shelltests/htools-balancing.test b/test/hs/shelltests/htools-balancing.test index 383cb8e..ffc167b 100644 --- a/test/hs/shelltests/htools-balancing.test +++ b/test/hs/shelltests/htools-balancing.test @@ -133,11 +133,45 @@ diff -u $T/simu-rebal-merged.tiered $T/simu-rebal.tiered.original >>>/Solution length=1/ >>>=0 +./test/hs/hbal -t$TESTDATA_DIR/hbal-dyn.data -C +>>>/gnt-instance migrate -f -n node-01-001 inst-0./ +>>>=0 + # ...but the --ignore-dynu option should be honored ./test/hs/hbal -t$TESTDATA_DIR/hbal-dyn.data --ignore-dynu >>>/Cluster is already well balanced/ >>>=0 +# Assuming idle default also gives 0 utilisation +./test/hs/hbal -t$TESTDATA_DIR/hbal-dyn.data --idle-default +>>>/Cluster is already well balanced/ +>>>=0 + +# Heavy CPU load can even push instances on the more +# crowded node +./test/hs/hbal -t$TESTDATA_DIR/hbal-dyn.data --idle-default --mond --mond-xen --mond-data=$TESTDATA_DIR/dyn1.json +>>>/Solution length=[1-9]/ +>>>=0 + +./test/hs/hbal -t$TESTDATA_DIR/hbal-dyn.data --idle-default --mond --mond-xen --mond-data=$TESTDATA_DIR/dyn1.json -C +>>>/gnt-instance migrate -f -n node-01-000 inst-1./ +>>>=0 + +# ...but with default assumption about disk/net/mem fully used the move is in +# the other direction. +./test/hs/hbal -t$TESTDATA_DIR/hbal-dyn.data --mond --mond-xen --mond-data=$TESTDATA_DIR/dyn1.json +>>>/Solution length=1/ +>>>=0 + +./test/hs/hbal -t$TESTDATA_DIR/hbal-dyn.data --mond --mond-xen --mond-data=$TESTDATA_DIR/dyn1.json -C +>>>/gnt-instance migrate -f -n node-01-001 inst-0./ +>>>=0 + +# Still, --ignore-dynu overrides everything +./test/hs/hbal -t$TESTDATA_DIR/hbal-dyn.data --idle-default --mond --mond-xen --mond-data=$TESTDATA_DIR/dyn1.json --ignore-dynu +>>>/Cluster is already well balanced/ +>>>=0 + # Test CPU speed is taken into account ./test/hs/hbal -t$TESTDATA_DIR/hbal-cpu-speed.data --ignore-dynu >>>/inst[12] node-slow:node-fast => node-fast:node-slow/ -- 2.6.0.rc2.230.g3dd15c0
