Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
The current user interface for creating static reservations is described here:
http://mesos.apache.org/documentation/latest/reservation/
In summary, to create a static reservation, an operator needs to subdivide the available resources on an agent into reserved an unreserved resources, like this:
mesos-slave --resources="cpus:4;mem:2048;cpus(ads):8;mem(ads):4096" [...]
However, this can result in some awkward interactions when trying to change static reservations
1) Requirement of an explicit upper bound. By default, an agent will offer all CPU's and all Memory of its host machine. However, an agent with the above configuration running on a machine with e.g. 32 cpus will still only offer 12 of them, 8 for `ads` and 4 for general use.
For an operator planning to deploy configuration to a diverse set of machines, it seems to be required to write a script to get the total amount of available resources, and ensure that it is re-run periodically to capture hardware changes - duplicating functionality that Mesos already offers out-of-the-box.
2) Interaction with ranges. A configuration like
mesos-slave --resources="ports:[0-32655];ports(__internal):[22-22]" [...]
will lead to the master still offering port 22 to all frameworks, because the master thinks that the reserved port is an additional item of the "ports" resource.
On the other hand, a configuration like
mesos-slave --resources="ports(__internal):[22-22]" [...]
leaves the master knowing only about the existence of the single, reserved port 22.
Again, for an operator planning to reserve this port across a range of diverse agents, the only way seems to write a script parsing and processing the existing configuration and then slicing up the ranges like this:
mesos-slave --resources="ports:[0-21],[23-32655];ports(__internal):[22-22]" [...]
Ideally, it would be possible to specify static reservations as a subtraction from the total, i.e. being able to say "Reserve 4 GiB of memory for role X" instead of saying "Reserve 4GiB for role X and 4GiB for general use".
Doing so would probably require introducing some additional syntax to the resource specification strings.