Merge branch 'stable-2.7' into stable-2.8
authorKlaus Aehlig <aehlig@google.com>
Fri, 14 Jun 2013 08:29:40 +0000 (10:29 +0200)
committerKlaus Aehlig <aehlig@google.com>
Fri, 14 Jun 2013 09:16:15 +0000 (11:16 +0200)
* stable-2.7
  Make shrinkByType aware of individual disks
  Add a test for hspace to respect instance policy

Conflicts: (trival, take union of added files/tests)
Makefile.am
test/hs/shelltests/htools-hspace.test

Semantic conflicts:
test/data/htools/hspace-tiered-ipolicy.data
(adapt to changed text format)

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

1  2 
Makefile.am
src/Ganeti/HTools/Instance.hs
test/data/htools/hspace-tiered-ipolicy.data
test/hs/Test/Ganeti/HTools/Instance.hs
test/hs/shelltests/htools-hspace.test

diff --cc Makefile.am
@@@ -1034,11 -972,9 +1034,12 @@@ TEST_FILES = 
        test/data/htools/hail-reloc-drbd.json \
        test/data/htools/hbal-excl-tags.data \
        test/data/htools/hbal-split-insts.data \
 +      test/data/htools/hspace-tiered-dualspec.data \
+       test/data/htools/hspace-tiered-ipolicy.data \
 +      test/data/htools/hspace-tiered.data \
        test/data/htools/invalid-node.data \
        test/data/htools/missing-resources.data \
 +      test/data/htools/multiple-master.data \
        test/data/htools/n1-failure.data \
        test/data/htools/rapi/groups.json \
        test/data/htools/rapi/info.json \
Simple merge
index 0000000,9cb4829..35363a3
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,11 +1,11 @@@
+ group-01|fake-uuid-01|preferred|
+ node-01-001|2000|200|1800|4300|4300|8|N|fake-uuid-01
+ node-01-002|2000|4|1996|3900|3900|8|N|fake-uuid-01
+ node-01-003|2000|4|1996|3900|3900|8|N|fake-uuid-01
+ node-01-004|2000|4|1996|3900|3900|8|N|fake-uuid-01
 -|936,4,1064,1,1,1|900,4,2200,1,1,1|1000,4,2600,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0
 -group-01|900,4,2200,1,1,1|900,4,2200,1,1,1|1000,4,2600,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0
++|936,4,1064,1,1,1|900,4,2200,1,1,1;1000,4,2600,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0
++group-01|900,4,2200,1,1,1|900,4,2200,1,1,1;1000,4,2600,16,8,12|plain,diskless,file,sharedfile,blockdev,drbd,rbd,ext|4.0|32.0
@@@ -7,11 -7,18 +7,26 @@@
  ./test/hs/hspace --simu p,4,8T,64g,16 --machine-readable --disk-template drbd -l 8 > $T/capacity && sh -c ". $T/capacity && test x\$HTS_OK = x1"
  >>>= 0
  
 +# standard & tiered allocation, using shell parsing to do multiple checks
 +./test/hs/hspace --machine-readable -t $TESTDATA_DIR/hspace-tiered.data > $T/capacity && sh -c ". $T/capacity && test \"\${HTS_TSPEC}\" = '131072,1048576,4=4 129984,1048320,4=2' && test \"\${HTS_ALLOC_INSTANCES}\" = 6"
 +>>>=0
 +
 +# again, but with a policy containing two min/max specs pairs
 +./test/hs/hspace --machine-readable -t $TESTDATA_DIR/hspace-tiered-dualspec.data > $T/capacity && sh -c ". $T/capacity && test \"\${HTS_TSPEC}\" = '131072,1048576,4=4 129984,1048320,4=2 65472,524288,2=2' && test \"\${HTS_ALLOC_INSTANCES}\" = 14"
 +>>>2
 +>>>=0
++
+ # Verify that instance policy for disks is adhered to
+ ./test/hs/hspace --machine-readable -t $TESTDATA_DIR/hspace-tiered-ipolicy.data
+ >>>/HTS_TRL_INST_CNT=4/
+ >>>=0
+ # ...and instance positioning in human-readable form
+ ./test/hs/hspace -pname,pcnt -t $TESTDATA_DIR/hspace-tiered-ipolicy.data
+ >>>2/Tiered allocation status:
+  Name        pcnt
+  node-01-001    1
+  node-01-002    1
+  node-01-003    1
+  node-01-004    1/
+ >>>=0
 -