This may be a feature of Marathon. I saw it only filter resources from
those unreserved resources. After change
```
diff --git a/src/main/scala/mesosphere/mesos/TaskBuilder.scala
b/src/main/scala/mesosphere/mesos/TaskBuilder.scala
index efa3406..e750881 100644
--- a/src/main/scala/mesosphere/mesos/TaskBuilder.scala
+++ b/src/main/scala/mesosphere/mesos/TaskBuilder.scala
@@ -80,7 +80,7 @@ class TaskBuilder(app: AppDefinition,
val resourceMatch =
ResourceMatcher.matchResources(
- offer, app, runningTasks, ResourceSelector(acceptedResourceRoles,
reserved = false))
+ offer, app, runningTasks, ResourceSelector(acceptedResourceRoles,
reserved = true))
build(offer, resourceMatch)
}
```
It would use the dynamic resources we reserved before. I find Marathon
document have these words:
```
### Static Reservations
Dynamic reservations can only be created for unreserved resources. If you
specify an agent's resources to be reserved for a role via the Mesos
`--resources` or `--default_role` flag, these resources cannot be used for
dynamic reservations. In addition, if Marathon is started with the
`--default_accepted_resource_roles` flag specifying a value that does not
contain `*`, your application definition should explicitly specify
`"acceptedResourceRoles": ["*"]` in order to allow usage and reservation of
unreserved cluster resources.
```
You could double check this with Marathon mailing list
https://groups.google.com/forum/?hl=en#!forum/marathon-framework . Thanks a
lot!
On Sun, May 1, 2016 at 5:07 PM, haosdent <[email protected]> wrote:
> hmm, I am still digging more information in marathon. It may delay because
> I am not familiar with marathon's code and sick today, but I would inform
> you once have result. My quick conclusion is this may be the bug of
> marathon when match resource requirement in offers from Mesos Master. Still
> under finding the root cause of it.
>
> On Sun, May 1, 2016 at 4:24 PM, caogaojin <[email protected]>
> wrote:
>
>> @Haosdent, what does http://10.132.46.71:5050/roles mean? shouldn’t that
>> tell us all resources that framework with `dev` role takes, both from `dev`
>> and `*` role? It doesn’t mean resources are consumed from `dev` role, right?
>> --
>> Best Regards,
>>
>> GaoJin CAO
>> ChinaMobile(Suzhou) R&D
>> Mail:caogaojin at cmss.chinamobile.com
>>
>> On May 1, 2016, at 16:02, caogaojin <[email protected]>
>> wrote:
>>
>>
>> ```
>> [root@localhost ~]# curl http://10.132.46.71:5050/roles | python -m
>> json.tool
>> % Total % Received % Xferd Average Speed Time Time Time
>> Current
>> Dload Upload Total Spent Left
>> Speed
>> 100 250 100 250 0 0 46772 0 --:--:-- --:--:-- --:--:--
>> 50000
>> {
>> "roles": [
>> {
>> "frameworks": [],
>> "name": "*",
>> "resources": {
>> "cpus": 0,
>> "disk": 0,
>> "mem": 0
>> },
>> "weight": 1.0
>> },
>> {
>> "frameworks": [
>> "439a851d-aa09-47af-bc68-d5588dc9f5da-0002"
>> ],
>> * "name": "dev",*
>> * "resources": {*
>> * "cpus": 1.0,*
>> * "disk": 0,*
>> * "mem": 128.0,*
>> * "ports": "[31994-31994]"*
>> * },*
>> "weight": 1.0
>> }
>> ]
>> }
>> ```
>>
>>
>>
>
>
> --
> Best Regards,
> Haosdent Huang
>
--
Best Regards,
Haosdent Huang