Revision 7d26425f

b/doc/examples/dumb-allocator
75 75
  request = data["request"]
76 76
  req_type = request["type"]
77 77
  offline_nodes = [name for name in nodes if nodes[name]["offline"]]
78
  drained_nodes = [name for name in nodes if nodes[name]["offline"]]
78 79
  if req_type == "allocate":
79 80
    forbidden_nodes = offline_nodes
80 81
    inst_data = request
81 82
  elif req_type == "relocate":
82 83
    idict = data["instances"][request["name"]]
83
    forbidden_nodes = idict["nodes"] + offline_nodes
84
    forbidden_nodes = idict["nodes"] + offline_nodes + drained_nodes
84 85
    inst_data = idict
85 86
    inst_data["disk_space_total"] = request["disk_space_total"]
86 87
  else:

Also available in: Unified diff