Revision e0d15aae

b/Makefile.am
959 959
	test/data/htools/common-suffix.data \
960 960
	test/data/htools/empty-cluster.data \
961 961
	test/data/htools/hail-alloc-drbd.json \
962
	test/data/htools/hail-alloc-invalid-twodisks.json \
963
	test/data/htools/hail-alloc-twodisks.json \
962 964
	test/data/htools/hail-change-group.json \
963 965
	test/data/htools/hail-invalid-reloc.json \
964 966
	test/data/htools/hail-node-evac.json \
b/test/data/htools/hail-alloc-invalid-twodisks.json
1
{
2
  "cluster_tags": [],
3
  "instances": {},
4
  "ipolicy": {
5
    "max": {
6
      "disk-size": 2048
7
    },
8
    "min": {
9
      "disk-size": 1024
10
    }
11
  },
12
  "nodegroups": {
13
    "uuid-group-1": {
14
      "alloc_policy": "preferred",
15
      "ipolicy": {
16
        "disk-templates": [
17
          "file"
18
        ],
19
        "max": {
20
          "cpu-count": 2,
21
          "disk-count": 8,
22
          "disk-size": 2048,
23
          "memory-size": 12800,
24
          "nic-count": 8,
25
          "spindle-use": 8
26
        },
27
        "min": {
28
          "cpu-count": 1,
29
          "disk-count": 1,
30
          "disk-size": 1024,
31
          "memory-size": 128,
32
          "nic-count": 1,
33
          "spindle-use": 1
34
        },
35
        "spindle-ratio": 32.0,
36
        "std": {
37
          "cpu-count": 1,
38
          "disk-count": 1,
39
          "disk-size": 1024,
40
          "memory-size": 128,
41
          "nic-count": 1,
42
          "spindle-use": 1
43
        },
44
        "vcpu-ratio": 4.0
45
      },
46
      "name": "default",
47
      "tags": []
48
    }
49
  },
50
  "nodes": {
51
    "node1": {
52
      "drained": false,
53
      "free_disk": 1377280,
54
      "free_memory": 31389,
55
      "group": "uuid-group-1",
56
      "ndparams": {
57
        "spindle_count": 1
58
      },
59
      "offline": false,
60
      "reserved_memory": 1017,
61
      "total_cpus": 4,
62
      "total_disk": 1377280,
63
      "total_memory": 32763
64
    }
65
  },
66
  "request": {
67
    "disk_space_total": 1536,
68
    "disk_template": "file",
69
    "disks": [
70
      {
71
        "size": 768
72
      },
73
      {
74
        "size": 768
75
      }
76
    ],
77
    "memory": 1024,
78
    "name": "instance1",
79
    "required_nodes": 1,
80
    "spindle_use": 2,
81
    "tags": [],
82
    "type": "allocate",
83
    "vcpus": 1
84
  },
85
  "version": 2
86
}
b/test/data/htools/hail-alloc-twodisks.json
1
{
2
  "cluster_tags": [],
3
  "instances": {},
4
  "ipolicy": {
5
    "max": {
6
      "disk-size": 2048
7
    },
8
    "min": {
9
      "disk-size": 1024
10
    }
11
  },
12
  "nodegroups": {
13
    "uuid-group-1": {
14
      "alloc_policy": "preferred",
15
      "ipolicy": {
16
        "disk-templates": [
17
          "file"
18
        ],
19
        "max": {
20
          "cpu-count": 2,
21
          "disk-count": 8,
22
          "disk-size": 2048,
23
          "memory-size": 12800,
24
          "nic-count": 8,
25
          "spindle-use": 8
26
        },
27
        "min": {
28
          "cpu-count": 1,
29
          "disk-count": 1,
30
          "disk-size": 1024,
31
          "memory-size": 128,
32
          "nic-count": 1,
33
          "spindle-use": 1
34
        },
35
        "spindle-ratio": 32.0,
36
        "std": {
37
          "cpu-count": 1,
38
          "disk-count": 1,
39
          "disk-size": 1024,
40
          "memory-size": 128,
41
          "nic-count": 1,
42
          "spindle-use": 1
43
        },
44
        "vcpu-ratio": 4.0
45
      },
46
      "name": "default",
47
      "tags": []
48
    }
49
  },
50
  "nodes": {
51
    "node1": {
52
      "drained": false,
53
      "free_disk": 1377280,
54
      "free_memory": 31389,
55
      "group": "uuid-group-1",
56
      "ndparams": {
57
        "spindle_count": 1
58
      },
59
      "offline": false,
60
      "reserved_memory": 1017,
61
      "total_cpus": 4,
62
      "total_disk": 1377280,
63
      "total_memory": 32763
64
    }
65
  },
66
  "request": {
67
    "disk_space_total": 3072,
68
    "disk_template": "file",
69
    "disks": [
70
      {
71
        "size": 1536
72
      },
73
      {
74
        "size": 1536
75
      }
76
    ],
77
    "memory": 1024,
78
    "name": "instance1",
79
    "required_nodes": 1,
80
    "spindle_use": 2,
81
    "tags": [],
82
    "type": "allocate",
83
    "vcpus": 1
84
  },
85
  "version": 2
86
}
b/test/hs/shelltests/htools-hail.test
38 38
>>> /"success":true,"info":"Request successful: 0 instances failed to move and 1 were moved successfully"/
39 39
>>>= 0
40 40

  
41
# check that hail correctly applies the disk policy on a per-disk basis
42
./test/hs/hail $TESTDATA_DIR/hail-alloc-twodisks.json
43
>>> /"success":true,.*,"result":\["node1"\]/
44
>>>= 0
45

  
46
./test/hs/hail $TESTDATA_DIR/hail-alloc-invalid-twodisks.json
47
>>> /"success":false,.*FailDisk: 1/
48
>>>= 0
49

  
41 50
# check that hail can use the simu backend
42 51
./test/hs/hail --simu p,8,8T,16g,16 $TESTDATA_DIR/hail-alloc-drbd.json
43 52
>>> /"success":true,/

Also available in: Unified diff