Reputation: 11
Is there any way to reset all slaves reserved resources in Mesos, without configuring one by one the /unreserve http endpoint?
In Mesos documentation :
/unreserve (since 0.25.0)
Suppose we want to unreserve the resources that we dynamically reserved above. We can send an HTTP POST request to the master’s /unreserve endpoint like so:
$ curl -i \
-u <operator_principal>:<password> \
-d slaveId=<slave_id> \
-d resources='[
{
"name": "cpus",
"type": "SCALAR",
"scalar": { "value": 8 },
"role": "ads",
"reservation": {
"principal": <reserver_principal>
}
},
{
"name": "mem",
"type": "SCALAR",
"scalar": { "value": 4096 },
"role": "ads",
"reservation": {
"principal": <reserver_principal>
}
}
]' \
-X POST http://<ip>:<port>/master/unreserve
Upvotes: 0
Views: 458
Reputation: 398
Mesos doesn't directly provide any support for unreserving resources at more than one slave using a single operation. However, you can write a script that uses the /unreserve
endpoint to unreserves the resources at all the slaves in the cluster, e.g., by fetching the list of slaves and reserved resources from the /slaves
endpoint on the master (see the reserved_resources_full
key).
Upvotes: 1