Commit d7976f54 authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

Unit tests for spindles and exclusive storage in htools



Everything should work the same when exclusive storage is active, as
spindles are not yet handled as a resource. A new test has been added for
the interactions between spindles and policies.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 5a13489b
......@@ -1044,6 +1044,7 @@ TEST_FILES = \
test/data/htools/hail-alloc-invalid-network.json \
test/data/htools/hail-alloc-invalid-twodisks.json \
test/data/htools/hail-alloc-restricted-network.json \
test/data/htools/hail-alloc-spindles.json \
test/data/htools/hail-alloc-twodisks.json \
test/data/htools/hail-change-group.json \
test/data/htools/hail-invalid-reloc.json \
......
......@@ -102,6 +102,7 @@
"instance14": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -132,6 +133,7 @@
"instance13": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 512
}
......@@ -161,6 +163,7 @@
"instance18": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -190,6 +193,7 @@
"instance19": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -220,6 +224,7 @@
"instance2": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -250,10 +255,12 @@
"instance3": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 256
},
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -283,6 +290,7 @@
"instance4": {
"disks": [
{
"spindles": 2,
"mode": "rw",
"size": 2048
}
......@@ -313,6 +321,7 @@
"instance8": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 256
}
......@@ -342,6 +351,7 @@
"instance9": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -374,6 +384,7 @@
"instance20": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 512
}
......@@ -503,6 +514,7 @@
"request": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 1024
}
......
......@@ -74,9 +74,11 @@
"disk_template": "file",
"disks": [
{
"spindles": 1,
"size": 768
},
{
"spindles": 1,
"size": 768
}
],
......
{
"cluster_tags": [
"htools:iextags:test",
"htools:iextags:service-group"
],
"nodegroups": {
"uuid-group-1": {
"ipolicy": {
"std": {
"nic-count": 1,
"disk-size": 1024,
"disk-count": 1,
"memory-size": 128,
"cpu-count": 1,
"spindle-use": 1
},
"minmax": [
{
"min": {
"nic-count": 1,
"disk-size": 128,
"disk-count": 1,
"memory-size": 128,
"cpu-count": 1,
"spindle-use": 1
},
"max": {
"nic-count": 8,
"disk-size": 1048576,
"disk-count": 16,
"memory-size": 32768,
"cpu-count": 8,
"spindle-use": 2
}
}
],
"vcpu-ratio": 4.0,
"disk-templates": [
"sharedfile",
"diskless",
"plain",
"blockdev",
"drbd",
"file",
"rbd"
],
"spindle-ratio": 32.0
},
"alloc_policy": "preferred",
"networks": [],
"tags": [],
"name": "group1"
},
"uuid-group-2": {
"ipolicy": {
"std": {
"nic-count": 1,
"disk-size": 1024,
"disk-count": 1,
"memory-size": 128,
"cpu-count": 1,
"spindle-use": 2
},
"minmax": [
{
"min": {
"nic-count": 1,
"disk-size": 128,
"disk-count": 1,
"memory-size": 128,
"cpu-count": 1,
"spindle-use": 2
},
"max": {
"nic-count": 8,
"disk-size": 1048576,
"disk-count": 16,
"memory-size": 32768,
"cpu-count": 8,
"spindle-use": 3
}
}
],
"vcpu-ratio": 4.0,
"disk-templates": [
"sharedfile",
"diskless",
"plain",
"blockdev",
"drbd",
"file",
"rbd"
],
"spindle-ratio": 32.0
},
"alloc_policy": "preferred",
"networks": [],
"tags": [],
"name": "group2"
}
},
"ipolicy": {
"std": {
"nic-count": 1,
"disk-size": 1024,
"memory-size": 128,
"cpu-count": 1,
"disk-count": 1,
"spindle-use": 1
},
"minmax": [
{
"min": {
"nic-count": 1,
"disk-size": 1024,
"memory-size": 128,
"cpu-count": 1,
"disk-count": 1,
"spindle-use": 1
},
"max": {
"nic-count": 8,
"disk-size": 1048576,
"memory-size": 32768,
"cpu-count": 8,
"disk-count": 16,
"spindle-use": 8
}
}
],
"vcpu-ratio": 4.0,
"disk-templates": [
"sharedfile",
"diskless",
"plain",
"blockdev",
"drbd",
"file",
"rbd"
],
"spindle-ratio": 32.0
},
"enabled_hypervisors": [
"xen-pvm",
"xen-hvm"
],
"cluster_name": "cluster",
"instances": {
"instance1": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 650000
}
],
"disk_space_total": 650000,
"hypervisor": "xen-pvm",
"tags": [],
"nics": [
{
"ip": null,
"mac": "aa:00:00:7f:8c:91",
"link": "xen-br1",
"mode": "bridged",
"bridge": "xen-br1"
}
],
"vcpus": 1,
"spindle_use": 1,
"admin_state": "up",
"disk_template": "plain",
"memory": 1024,
"nodes": [
"node1"
],
"os": "instance-debootstrap"
},
"instance2": {
"disks": [
{
"spindles": 2,
"mode": "rw",
"size": 256
}
],
"disk_space_total": 256,
"hypervisor": "xen-pvm",
"tags": [],
"nics": [
{
"ip": null,
"mac": "aa:00:00:7f:8c:92",
"link": "xen-br1",
"mode": "bridged",
"bridge": "xen-br1"
}
],
"vcpus": 1,
"spindle_use": 1,
"admin_state": "up",
"disk_template": "plain",
"memory": 1024,
"nodes": [
"node2"
],
"os": "instance-debootstrap"
},
"instance3": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 650000
}
],
"disk_space_total": 650000,
"hypervisor": "xen-pvm",
"tags": [],
"nics": [
{
"ip": null,
"mac": "aa:00:00:7f:8c:93",
"link": "xen-br1",
"mode": "bridged",
"bridge": "xen-br1"
}
],
"vcpus": 1,
"spindle_use": 1,
"admin_state": "up",
"disk_template": "plain",
"memory": 1024,
"nodes": [
"node3"
],
"os": "instance-debootstrap"
},
"instance4": {
"disks": [
{
"spindles": 2,
"mode": "rw",
"size": 256
}
],
"disk_space_total": 256,
"hypervisor": "xen-pvm",
"tags": [],
"nics": [
{
"ip": null,
"mac": "aa:00:00:7f:8c:94",
"link": "xen-br1",
"mode": "bridged",
"bridge": "xen-br1"
}
],
"vcpus": 1,
"spindle_use": 1,
"admin_state": "up",
"disk_template": "plain",
"memory": 1024,
"nodes": [
"node4"
],
"os": "instance-debootstrap"
}
},
"version": 2,
"nodes": {
"node1": {
"total_disk": 1377280,
"total_cpus": 4,
"group": "uuid-group-1",
"secondary_ip": "192.168.2.1",
"i_pri_up_memory": 1024,
"tags": [],
"master_candidate": true,
"free_memory": 30722,
"ndparams": {
"spindle_count": 2,
"oob_program": null,
"exclusive_storage": false
},
"reserved_memory": 1017,
"master_capable": true,
"free_disk": 687280,
"drained": false,
"total_memory": 32763,
"primary_ip": "192.168.1.1",
"i_pri_memory": 1024,
"vm_capable": true,
"offline": false
},
"node2": {
"total_disk": 1377280,
"total_cpus": 4,
"group": "uuid-group-1",
"secondary_ip": "192.168.2.2",
"i_pri_up_memory": 1024,
"tags": [],
"master_candidate": true,
"free_memory": 30722,
"ndparams": {
"spindle_count": 2,
"oob_program": null,
"exclusive_storage": false
},
"reserved_memory": 1017,
"master_capable": true,
"free_disk": 1377024,
"drained": false,
"total_memory": 32763,
"primary_ip": "192.168.1.2",
"i_pri_memory": 1024,
"vm_capable": true,
"offline": false
},
"node3": {
"total_disk": 1377280,
"total_cpus": 4,
"group": "uuid-group-2",
"secondary_ip": "192.168.2.3",
"i_pri_up_memory": 1024,
"tags": [],
"master_candidate": true,
"free_memory": 30722,
"ndparams": {
"spindle_count": 2,
"oob_program": null,
"exclusive_storage": false
},
"reserved_memory": 1017,
"master_capable": true,
"free_disk": 687280,
"drained": false,
"total_memory": 32763,
"primary_ip": "192.168.1.3",
"i_pri_memory": 1204,
"vm_capable": true,
"offline": false
},
"node4": {
"total_disk": 1377280,
"total_cpus": 4,
"group": "uuid-group-2",
"secondary_ip": "192.168.2.4",
"i_pri_up_memory": 1024,
"tags": [],
"master_candidate": true,
"free_memory": 30722,
"ndparams": {
"spindle_count": 2,
"oob_program": null,
"exclusive_storage": false
},
"reserved_memory": 1017,
"master_capable": true,
"free_disk": 1377024,
"drained": false,
"total_memory": 32763,
"primary_ip": "192.168.1.4",
"i_pri_memory": 1024,
"vm_capable": true,
"offline": false
}
},
"request": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 1024
}
],
"required_nodes": 1,
"name": "instance10",
"tags": [],
"hypervisor": "xen-pvm",
"disk_space_total": 1024,
"nics": [
{
"ip": null,
"mac": "00:11:22:33:44:55",
"bridge": null
}
],
"vcpus": 1,
"spindle_use": 3,
"os": "instance-debootstrap",
"disk_template": "plain",
"memory": 1024,
"type": "allocate"
}
}
......@@ -74,9 +74,11 @@
"disk_template": "file",
"disks": [
{
"spindles": 1,
"size": 1536
},
{
"spindles": 1,
"size": 1536
}
],
......
......@@ -149,6 +149,7 @@
"instance14": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -179,6 +180,7 @@
"instance13": {
"disks": [
{
"spindles": 2,
"mode": "rw",
"size": 512
}
......@@ -208,6 +210,7 @@
"instance18": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -237,6 +240,7 @@
"instance19": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -267,6 +271,7 @@
"instance2": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -297,6 +302,7 @@
"instance3": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 256
},
......@@ -330,6 +336,7 @@
"instance4": {
"disks": [
{
"spindles": 2,
"mode": "rw",
"size": 2048
}
......@@ -360,6 +367,7 @@
"instance8": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 256
}
......@@ -389,6 +397,7 @@
"instance9": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -421,6 +430,7 @@
"instance20": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 512
}
......
......@@ -98,6 +98,7 @@
"instance14": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 128
}
......@@ -128,6 +129,7 @@
"instance13": {
"disks": [
{
"spindles": 1,
"mode": "rw",
"size": 512
}
......@@ -157,6 +159,7 @@
"instance18": {
"disks": [
{