[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesos-user
Subject:    Re: DC/OS dynamic reservation dosen't work
From:       caogaojin <caogaojin () cmss ! chinamobile ! com>
Date:       2016-04-30 23:57:02
Message-ID: BB7ABEB4-C06E-49AA-9BB7-FFA573F172D8 () cmss ! chinamobile ! com
[Download RAW message or body]

dear Haosdent, 

> Why you send reserve request to http://10.132.46.81:5050/unreserve \
> <http://10.132.46.81:5050/unreserve>, is it should be \
> "http://10.132.46.81:5050/reserve <http://10.132.46.81:5050/reserve>"?

my bad; actually i use http://10.132.46.81:5050/reserve for reservation, and \
http://10.132.46.81:5050/unreserve for releasing resources  :)

> And why you add
> 
> ```
> "reservation": {}
> ```


if i do not add this, mesos will report error: 

```
HTTP/1.1 400 Bad Request
Date: Sun, 01 May 2016 01:11:50 GMT
Content-Length: 75

Invalid RESERVE operation: Resource cpus(dev):1 is not dynamically reserved
```

> in the resource define? Which role you used when start Marathon?

i'm using `dev` role in marathon. 



Best Regards.

GaoJin CAO 
ChinaMobile(Suzhou) R&D
Phone:18896723732 
Mail:caogaojin at cmss.chinamobile.com <http://cmss.chinamobile.com/>
> On May 1, 2016, at 02:40, haosdent <haosdent@gmail.com> wrote:
> 
> And why you add
> 
> ```
> "reservation": {}
> ```
> 
> in the resource define? Which role you used when start Marathon?
> 
> 
> On Sun, May 1, 2016 at 2:28 AM, haosdent <haosdent@gmail.com \
> <mailto:haosdent@gmail.com>> wrote: Why you send reserve request to \
> http://10.132.46.81:5050/unreserve <http://10.132.46.81:5050/unreserve>, is it \
> should be "http://10.132.46.81:5050/reserve <http://10.132.46.81:5050/reserve>"? 
> On Sun, May 1, 2016 at 1:59 AM, caogaojin <caogaojin@cmss.chinamobile.com \
> <mailto:caogaojin@cmss.chinamobile.com>> wrote: Anyone has such experiences? I \
> think it may be a dynamic reservation issue.  In my situation, i turn off mesos \
> authentication mechanism, will this be a problem? 
> GaoJin CAO 
> ChinaMobile(Suzhou) R&D
> Phone:18896723732 
> Mail:caogaojin at cmss.chinamobile.com <http://cmss.chinamobile.com/>
> 
> > On May 1, 2016, at 01:49, caogaojin <caogaojin@cmss.chinamobile.com \
> > <mailto:caogaojin@cmss.chinamobile.com>> wrote: 
> > Hi list,
> > 
> > I'm currently using dynamic reservation mechanism with mesosphere/DCOS 1.7, the \
> > opensourced version,  and something wired just happened. I tried to setup a new \
> > marathon service from the universe repo,  and i did a slight modification, \
> > setting mesos_role to `dev`. i also turned off mesos anthentication  mechenism. 
> > 
> > My steps are:
> > 
> > First i tried to reserve 2 cpu and 1743 ram to `dev` role using http endpoint, \
> > and it works: # curl -i -d slaveId=e6d590b1-5f2d-4be9-93fd-2fac364584cf-S11 \
> > -d resources='[
> > {
> > "name": "cpus",
> > "type": "SCALAR",
> > "scalar": {
> > "value": 2.0
> > },
> > "role": "dev",
> > "reservation": {
> > }
> > 
> > },
> > {
> > "name": "mem",
> > "type": "SCALAR",
> > "scalar": {
> > "value": 1024.0
> > 
> > },
> > "role": "dev",
> > "reservation": {
> > }
> > }
> > ]' -X POST http://10.132.46.81:5050/unreserve \
> > <http://10.132.46.81:5050/unreserve> 
> > Second, the slave shows following infomation:
> > # curl http://10.132.46.81/mesos/slaves <http://10.132.46.81/mesos/slaves>
> > reserved_resources_full: {
> > dev: [
> > {
> > name: "cpus",
> > type: "SCALAR",
> > scalar: {
> > value: 2
> > },
> > role: "dev",
> > reservation: { }
> > },
> > {
> > name: "mem",
> > type: "SCALAR",
> > scalar: {
> > value: 1743
> > },
> > role: "dev",
> > reservation: { }
> > }
> > ]
> > },
> > 
> > Third, i tried to run nginx using the new marathon service, which i also set the \
> > task only accept `dev` resources,  
> > ID: /nginx
> > ...
> > Resource Roles:  dev
> > 
> > 4.  on marathon ui i just see the waiting status, which means there's no suitable \
> > resource offer, marathon reports: 
> > Insufficient resources for [/nginx] (need cpus=1.0, mem=128.0, disk=0.0, ports=(1 \
> > dynamic), available in offer: [id { value: \
> > "e6d590b1-5f2d-4be9-93fd-2fac364584cf-O7476" } framework_id { value: \
> > "e6d590b1-5f2d-4be9-93fd-2fac364584cf-0006" } slave_id { value: \
> > "e6d590b1-5f2d-4be9-93fd-2fac364584cf-S11" } hostname: "10.132.46.84" resources { \
> > name: "ports" type: RANGES ranges { range { begin: 8182 end: 32000 } } role: \
> > "dev" reservation { } } resources { name: "cpus" type: SCALAR scalar { value: 2.0 \
> > } role: "dev" reservation { } } resources { name: "mem" type: SCALAR scalar { \
> > value: 1743.0 } role: "dev" reservation { } } resources { name: "ports" type: \
> > RANGES ranges { range { begin: 1025 end: 2180 } range { begin: 2182 end: 3887 } \
> > range { begin: 3889 end: 5049 } range { begin: 5052 end: 6326 } range { begin: \
> > 6328 end: 8079 } range { begin: 8082 end: 8180 } } role: "*" } resources { name: \
> > "disk" type: SCALAR scalar { value: 41497.0 } role: "*" } resources { name: \
> > "cpus" type: SCALAR scalar { value: 1.0 } role: "*" } resources { name: "mem" \
> > type: SCALAR scalar { value: 896.0 } role: "*" } url { scheme: "http" address { \
> > hostname: "10.132.46.84" ip: "10.132.46.84" port: 5051 } path: "/slave(1)" }] \
> > (mesosphere.mesos.TaskBuilder:marathon-akka.actor.default-dispatcher-19) 
> > can anyone help me with this?
> > 
> > thank you.
> > 
> > 
> > GaoJin CAO 
> > ChinaMobile(Suzhou) R&D
> > Phone:18896723732 
> > Mail:caogaojin at cmss.chinamobile.com <http://cmss.chinamobile.com/>
> 
> 
> 
> 
> -- 
> Best Regards,
> Haosdent Huang
> 
> 
> 
> -- 
> Best Regards,
> Haosdent Huang


[Attachment #3 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space;" class=""><div class="">dear \
Haosdent,&nbsp;</div><div class=""><br class=""><blockquote type="cite" class=""><div \
class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" \
style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, \
204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class="">Why \
you send reserve request to&nbsp;<a href="http://10.132.46.81:5050/unreserve" \
target="_blank" class="">http://10.132.46.81:5050/unreserve</a>, is it should be "<a \
href="http://10.132.46.81:5050/reserve" target="_blank" \
class="">http://10.132.46.81:5050/reserve</a>"?</div></blockquote></div></div></blockquote><br \
class=""></div><div class="">my bad; actually i use <a \
href="http://10.132.46.81:5050/reserve" class="">http://10.132.46.81:5050/reserve</a> \
for reservation, and <a href="http://10.132.46.81:5050/unreserve" \
class="">http://10.132.46.81:5050/unreserve</a></div><div class="">for releasing \
resources &nbsp;:)</div><div class=""><br class=""></div><div class=""><blockquote \
type="cite" class=""><div dir="ltr" class="">And why you add<div class=""><br \
class=""></div><div class="">```</div><div class=""><div \
class="">&nbsp;"reservation": {}</div></div><div \
class="">```</div></div></blockquote></div><div class=""><br class=""></div><div \
class="">if i do not add this, mesos will report error:&nbsp;</div><div class=""><div \
class=""><br class=""></div><div class="">```</div><div class="">HTTP/1.1 400 Bad \
Request</div><div class="">Date: Sun, 01 May 2016 01:11:50 GMT</div><div \
class="">Content-Length: 75</div><div class=""><br class=""></div><div \
class="">Invalid RESERVE operation: Resource cpus(dev):1 is not dynamically \
reserved</div></div>```<div class=""><br class=""></div><div class=""><blockquote \
type="cite" class=""><div dir="ltr" class=""><div class="">in the resource define? \
Which role you used when start Marathon?</div></div></blockquote><div class=""><div \
dir="ltr" class=""><div class=""><br class=""></div><div class="">i'm using `dev` \
role in marathon.&nbsp;</div><div class=""><br class=""></div><div class=""><br \
class=""></div><div class=""><br class=""></div><div class="">Best Regards.</div><div \
class=""><br class=""></div></div></div><div class=""> <div class=""><div \
class=""><span class="" style="font-family: '} '; font-size: 14px;">GaoJin \
CAO&nbsp;</span><br class="" style="font-family: '} '; font-size: 14px;"><span \
class="" style="font-family: '} '; font-size: 14px;">ChinaMobile(Suzhou) \
R&amp;D</span></div><div class=""><span class="" style="font-family: '} '; font-size: \
14px;">Phone:18896723732&nbsp;</span><br class="" style="font-family: '} '; \
font-size: 14px;"><span class="" style="font-family: '} '; font-size: \
14px;">Mail:caogaojin at&nbsp;<a href="http://cmss.chinamobile.com" \
class="">cmss.chinamobile.com</a></span></div></div> </div>
<br class=""><div><blockquote type="cite" class=""><div class="">On May 1, 2016, at \
02:40, haosdent &lt;<a href="mailto:haosdent@gmail.com" \
class="">haosdent@gmail.com</a>&gt; wrote:</div><br \
class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">And why you \
add<div class=""><br class=""></div><div class="">```</div><div class=""><div \
class="">&nbsp;"reservation": {}</div></div><div class="">```</div><div class=""><br \
class=""></div><div class="">in the resource define? Which role you used when start \
Marathon?</div><div class=""><br class=""></div></div><div class="gmail_extra"><br \
class=""><div class="gmail_quote">On Sun, May 1, 2016 at 2:28 AM, haosdent <span \
dir="ltr" class="">&lt;<a href="mailto:haosdent@gmail.com" target="_blank" \
class="">haosdent@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr" class="">Why you send reserve request \
to&nbsp;<a href="http://10.132.46.81:5050/unreserve" target="_blank" \
class="">http://10.132.46.81:5050/unreserve</a>, is it should be "<a \
href="http://10.132.46.81:5050/reserve" target="_blank" \
class="">http://10.132.46.81:5050/reserve</a>"?</div><div class="gmail_extra"><div \
class=""><div class="h5"><br class=""><div class="gmail_quote">On Sun, May 1, 2016 at \
1:59 AM, caogaojin <span dir="ltr" class="">&lt;<a \
href="mailto:caogaojin@cmss.chinamobile.com" target="_blank" \
class="">caogaojin@cmss.chinamobile.com</a>&gt;</span> wrote:<br class=""><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div \
class="">Anyone has such experiences? I think it may be a dynamic reservation \
issue.&nbsp;</div><div class="">In my situation, i turn off mesos authentication \
mechanism, will this be a problem?</div><span class=""><br class=""><div class=""> \
<div class=""><div class=""><span style="font-family:'} ';font-size:14px" \
class="">GaoJin CAO&nbsp;</span><br style="font-family:'} ';font-size:14px" \
class=""><span style="font-family:'} ';font-size:14px" class="">ChinaMobile(Suzhou) \
R&amp;D</span></div><div class=""><span style="font-family:'} ';font-size:14px" \
class="">Phone:18896723732&nbsp;</span><br style="font-family:'} ';font-size:14px" \
class=""><span style="font-family:'} ';font-size:14px" class="">Mail:caogaojin \
at&nbsp;<a href="http://cmss.chinamobile.com/" target="_blank" \
class="">cmss.chinamobile.com</a></span></div></div><div class=""><br \
class=""></div></div></span><div class=""><div class=""><div class=""><blockquote \
type="cite" class=""><div class="">On May 1, 2016, at 01:49, caogaojin &lt;<a \
href="mailto:caogaojin@cmss.chinamobile.com" target="_blank" \
class="">caogaojin@cmss.chinamobile.com</a>&gt; wrote:</div><br class=""><div \
class=""><div style="word-wrap:break-word" class=""><div class=""><div class=""><span \
style="font-size:14px" class="">Hi list,</span></div><div class=""><span \
style="font-size:14px" class=""><br class=""></span></div><div class=""><span \
style="font-size:14px" class="">I'm currently using dynamic reservation mechanism \
with mesosphere/DCOS 1.7, the opensourced version,&nbsp;</span></div><div \
class=""><span style="font-size:14px" class="">and something wired just happened. I \
tried to setup a new marathon service from the universe repo,&nbsp;</span></div><div \
class=""><span style="font-size:14px" class="">and i did a slight modification, \
setting mesos_role to `dev`. i also turned off mesos \
anthentication&nbsp;</span></div><div class=""><span style="font-size:14px" \
class="">mechenism.&nbsp;</span></div><div class=""><span style="font-size:14px" \
class=""><br class=""></span></div><div class=""><span style="font-size:14px" \
class="">My steps are:</span></div><div class=""><span style="font-size:14px" \
class=""><br class=""></span></div><div class=""><span style="font-size:14px" \
class="">First i tried to reserve 2 cpu and 1743 ram to `dev` role using http \
endpoint, and it works:</span></div><div class=""><span style="font-size:14px" \
class=""># curl -i -d slaveId=e6d590b1-5f2d-4be9-93fd-2fac364584cf-S11 \
\</span></div><div class=""><span style="font-size:14px" class="">-d \
resources='[</span></div><div class=""><span style="font-size:14px" \
class="">{</span></div><div class=""><span style="font-size:14px" class="">&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "name": "cpus",</span></div><div class=""><span \
style="font-size:14px" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "type": \
"SCALAR",</span></div><div class=""><span style="font-size:14px" class="">&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "scalar": {</span></div><div class=""><span \
style="font-size:14px" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
"value": 2.0</span></div><div class=""><span style="font-size:14px" class="">&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },</span></div><div class=""><span \
style="font-size:14px" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "role": \
"dev",</span></div><div class=""><span style="font-size:14px" class="">&nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "reservation": {</span></div><div class=""><span \
style="font-size:14px" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
}</span></div><div class=""><span style="font-size:14px" class=""><br \
class=""></span></div><div class=""><span style="font-size:14px" \
class="">},</span></div><div class=""><span style="font-size:14px" \
class="">{</span></div><div class=""><span style="font-size:14px" class="">&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "name": "mem",</span></div><div class=""><span \
style="font-size:14px" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "type": \
"SCALAR",</span></div><div class=""><span style="font-size:14px" class="">&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "scalar": {</span></div><div class=""><span \
style="font-size:14px" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
"value": 1024.0</span></div><div class=""><span style="font-size:14px" class=""><br \
class=""></span></div><div class=""><span style="font-size:14px" class="">&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },</span></div><div class=""><span \
style="font-size:14px" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "role": \
"dev",</span></div><div class=""><span style="font-size:14px" class="">&nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "reservation": {</span></div><div class=""><span \
style="font-size:14px" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
}</span></div><div class=""><span style="font-size:14px" class="">}</span></div><div \
class=""><span style="font-size:14px" class="">]' -X POST <a \
href="http://10.132.46.81:5050/unreserve" target="_blank" \
class="">http://10.132.46.81:5050/unreserve</a></span></div><div class=""><span \
style="font-size:14px" class=""><br class=""></span></div><div class=""><span \
style="font-size:14px" class="">Second, the slave shows following \
infomation:</span></div><div class=""><span style="font-size:14px" class=""># curl <a \
href="http://10.132.46.81/mesos/slaves" target="_blank" \
class="">http://10.132.46.81/mesos/slaves</a></span></div><div class=""><span \
style="font-size:14px" class="">reserved_resources_full: {</span></div><div \
class=""><span style="font-size:14px" class="">dev: [</span></div><div class=""><span \
style="font-size:14px" class="">{</span></div><div class=""><span \
style="font-size:14px" class="">name: "cpus",</span></div><div class=""><span \
style="font-size:14px" class="">type: "SCALAR",</span></div><div class=""><span \
style="font-size:14px" class="">scalar: {</span></div><div class=""><span \
style="font-size:14px" class="">value: 2</span></div><div class=""><span \
style="font-size:14px" class="">},</span></div><div class=""><span \
style="font-size:14px" class="">role: "dev",</span></div><div class=""><span \
style="font-size:14px" class="">reservation: { }</span></div><div class=""><span \
style="font-size:14px" class="">},</span></div><div class=""><span \
style="font-size:14px" class="">{</span></div><div class=""><span \
style="font-size:14px" class="">name: "mem",</span></div><div class=""><span \
style="font-size:14px" class="">type: "SCALAR",</span></div><div class=""><span \
style="font-size:14px" class="">scalar: {</span></div><div class=""><span \
style="font-size:14px" class="">value: 1743</span></div><div class=""><span \
style="font-size:14px" class="">},</span></div><div class=""><span \
style="font-size:14px" class="">role: "dev",</span></div><div class=""><span \
style="font-size:14px" class="">reservation: { }</span></div><div class=""><span \
style="font-size:14px" class="">}</span></div><div class=""><span \
style="font-size:14px" class="">]</span></div><div class=""><span \
style="font-size:14px" class="">},</span></div><div class=""><span \
style="font-size:14px" class=""><br class=""></span></div><div class=""><span \
style="font-size:14px" class="">Third, i tried to run nginx using the new marathon \
service, which i also set the task only accept `dev` \
resources,&nbsp;</span></div><div class=""><span style="font-size:14px" class=""><br \
class=""></span></div><div class=""><span style="font-size:14px" class="">ID: \
/nginx</span></div><div class=""><span style="font-size:14px" \
class="">...</span></div><div class=""><span style="font-size:14px" class="">Resource \
Roles: &nbsp;dev</span></div><div class=""><span style="font-size:14px" class=""><br \
class=""></span></div><div class=""><span style="font-size:14px" class="">4. &nbsp;on \
marathon ui i just see the waiting status, which means there's no suitable resource \
offer, marathon reports:</span></div><div class=""><span style="font-size:14px" \
class=""><br class=""></span></div><div class=""><span style="font-size:14px" \
class="">Insufficient resources for [/nginx] (need cpus=1.0, mem=128.0, disk=0.0, \
ports=(1 dynamic), available in offer: [id { value: \
"e6d590b1-5f2d-4be9-93fd-2fac364584cf-O7476" } framework_id { value: \
"e6d590b1-5f2d-4be9-93fd-2fac364584cf-0006" } slave_id { value: \
"e6d590b1-5f2d-4be9-93fd-2fac364584cf-S11" } hostname: "10.132.46.84" resources { \
name: "ports" type: RANGES ranges { range { begin: 8182 end: 32000 } } role: "dev" \
reservation { } } resources { name: "cpus" type: SCALAR scalar { value: 2.0 } role: \
"dev" reservation { } } resources { name: "mem" type: SCALAR scalar { value: 1743.0 } \
role: "dev" reservation { } } resources { name: "ports" type: RANGES ranges { range { \
begin: 1025 end: 2180 } range { begin: 2182 end: 3887 } range { begin: 3889 end: 5049 \
} range { begin: 5052 end: 6326 } range { begin: 6328 end: 8079 } range { begin: 8082 \
end: 8180 } } role: "*" } resources { name: "disk" type: SCALAR scalar { value: \
41497.0 } role: "*" } resources { name: "cpus" type: SCALAR scalar { value: 1.0 } \
role: "*" } resources { name: "mem" type: SCALAR scalar { value: 896.0 } role: "*" } \
url { scheme: "http" address { hostname: "10.132.46.84" ip: "10.132.46.84" port: 5051 \
} path: "/slave(1)" }] \
(mesosphere.mesos.TaskBuilder:marathon-akka.actor.default-dispatcher-19)</span></div><div \
class=""><span style="font-size:14px" class=""><br class=""></span></div><div \
class=""><span style="font-size:14px" class="">can anyone help me with \
this?</span></div><div class=""><span style="font-size:14px" class=""><br \
class=""></span></div><div class=""><span style="font-size:14px" class="">thank \
you.</span></div></div><div class=""><br class=""></div><div class=""><br \
class=""></div><div class=""> <div class=""><span style="font-family:'} \
';font-size:14px" class="">GaoJin CAO&nbsp;</span><br style="font-family:'} \
';font-size:14px" class=""><span style="font-family:'} ';font-size:14px" \
class="">ChinaMobile(Suzhou) R&amp;D</span></div><div class=""><span \
style="font-family:'} ';font-size:14px" class="">Phone:18896723732&nbsp;</span><br \
style="font-family:'} ';font-size:14px" class=""><span style="font-family:'} \
';font-size:14px" class="">Mail:caogaojin at <a href="http://cmss.chinamobile.com/" \
target="_blank" class="">cmss.chinamobile.com</a></span></div> </div>
<br class=""></div></div></blockquote></div><br \
class=""></div></div></div></blockquote></div><br class=""><br clear="all" \
class=""><div class=""><br class=""></div></div></div><span class="HOEnZb"><font \
color="#888888" class="">-- <br class=""><div class="">Best Regards,<br class=""><div \
class="">Haosdent Huang</div></div> </font></span></div>
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br \
class=""></div>-- <br class=""><div class="gmail_signature">Best Regards,<br \
class=""><div class="">Haosdent Huang</div></div> </div>
</div></blockquote></div><br class=""></div></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic