Skip to content
Snippets Groups Projects
Commit 7d26425f authored by Iustin Pop's avatar Iustin Pop
Browse files

dumb allocator: do not use drained nodes

This patch changes the dumb allocator not to use drained nodes (similar
to offline nodes).

Reviewed-by: imsnah
parent 0b2454b9
No related branches found
No related tags found
No related merge requests found
...@@ -75,12 +75,13 @@ def main(): ...@@ -75,12 +75,13 @@ def main():
request = data["request"] request = data["request"]
req_type = request["type"] req_type = request["type"]
offline_nodes = [name for name in nodes if nodes[name]["offline"]] offline_nodes = [name for name in nodes if nodes[name]["offline"]]
drained_nodes = [name for name in nodes if nodes[name]["offline"]]
if req_type == "allocate": if req_type == "allocate":
forbidden_nodes = offline_nodes forbidden_nodes = offline_nodes
inst_data = request inst_data = request
elif req_type == "relocate": elif req_type == "relocate":
idict = data["instances"][request["name"]] idict = data["instances"][request["name"]]
forbidden_nodes = idict["nodes"] + offline_nodes forbidden_nodes = idict["nodes"] + offline_nodes + drained_nodes
inst_data = idict inst_data = idict
inst_data["disk_space_total"] = request["disk_space_total"] inst_data["disk_space_total"] = request["disk_space_total"]
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment