@Haosdent, sorry for delay; i’m not familiar with scala, the compilation takes me some time. you are right, after changing the file you told me, it works. But that’s not what i want, it my situation, marathon should takes both reserved resource and unreserved resource; when using official marathon version, marathon will use static reserved resources (mesos agent started with `--default_role dev` flag, and marathon with `--mesos_role dev`), but it seems marathon did not take static reserved resource as *reserved resource*,
``` Considering unreserved resources with roles {dev}. Not all basic resources satisfied: cpus NOT SATISFIED (1.0 > 0.0), mem NOT SATISFIED (128.0 > 0.0) (mesosphere.mesos.ResourceMatcher$:marathon-akka.actor.default-dispatcher-6) ``` the above shows that marathon only considers *unreserved* resources with role `dev`. However IMO, all resources with role `dev` should be reserved resources, right? i’m quite confused, @haosdent, are resources provided by mesos agent that started with `--default_role dev` flag unreseved resources? i will advise mesosphere/marathon community for more help. Thanks, -- Best Regards, GaoJin CAO ChinaMobile(Suzhou) R&D Mail:caogaojin at cmss.chinamobile.com <http://cmss.chinamobile.com/> > On May 1, 2016, at 18:04, haosdent <haosd...@gmail.com> wrote: > > 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 > <https://groups.google.com/forum/?hl=en#!forum/marathon-framework> . Thanks a > lot! > > On Sun, May 1, 2016 at 5:07 PM, haosdent <haosd...@gmail.com > <mailto:haosd...@gmail.com>> 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 <caogao...@cmss.chinamobile.com > <mailto:caogao...@cmss.chinamobile.com>> wrote: > @Haosdent, what does http://10.132.46.71:5050/roles > <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 <http://cmss.chinamobile.com/> >> On May 1, 2016, at 16:02, caogaojin <caogao...@cmss.chinamobile.com >> <mailto:caogao...@cmss.chinamobile.com>> wrote: >> >> >> ``` >> [root@localhost ~]# curl http://10.132.46.71:5050/roles >> <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