<div dir="ltr">+1</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 16, 2017 at 9:28 AM, Aaron Bentley <span dir="ltr"><<a href="mailto:aaron.bentley@canonical.com" target="_blank">aaron.bentley@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ISTM that<br>
- constraints are used to ensure that a workload runs well. Minimum<br>
constraints serve this, and maximum constraints do not. (Maximum<br>
constraints may be useful to ensure that a workload does not swamp<br>
processes outside its container.)<br>
<br>
- Juju cannot enforce a minimum constraint. LXD could potentially add<br>
support for this, and then Juju would be able to leverage it.<br>
<br>
- Given that Juju cannot enforce a minimum constraint on LXD at this<br>
time, it would make sense to emit a warning that it is ignoring the<br>
constraint. This would retain the portability of bundles that use<br>
constraints while keeping the user informed.<br>
<div><div class="h5"><br>
On 2017-01-13 01:14 PM, Nate Finch wrote:<br>
> I just feel like we're entering a minefield that our application and CLI<br>
> aren't really built to handle. I think we *should* handle it, but it<br>
> needs to be well planned out, instead of just doing a tiny piece at a<br>
> time and only figuring out later if we did the right thing.<br>
><br>
> There's a few problems I can see:<br>
><br>
> 1.) you can have 10 lxd containers with memory limit of 2GB on a machine<br>
> with 4GB of RAM. Deploying 10 applications to those containers that<br>
> each have a constraint of mem=2GB will not work as you expect. We could<br>
> add extra bookkeeping for this, and warn you that you appear to be<br>
> oversubscribing the host, but that's more work.<br>
><br>
> 2.) What happens if you try to deploy a container without a memory limit<br>
> on a host that already has a container on it?<br>
><br>
> For example:<br>
> 4GB host<br>
> 2GB lxd container<br>
> try to deploy a new service in a container on this machine.<br>
> Do we warn? We have no clue how much RAM the service will use. Maybe<br>
> it'll be fine, maybe it won't.<br>
><br>
> 3.) Our CLI doesn't really work well with constraints on containers:<br>
><br>
> juju deploy mysql --constraints mem=2G --to lxd<br>
><br>
> Does this deploy a machine with 2GB of ram and a container with a 2GB<br>
> ram limit on it? Or does it deploy a machine with 2GB of ram and a<br>
> container with no limit on it? It has to be one or the other, and<br>
> currently we have no way of indicating which we want to do, and no way<br>
> to do the other one without using multiple commands.<br>
><br>
> This is a more likely use case, creating a bigger machine that can hold<br>
> multiple containers:<br>
> juju add-machine --constraints mem=4GB<br>
> // adds machine, let's say 5<br>
> // create a container on machine 5 with 2GB memory limit<br>
> juju deploy mysql --constraints mem=2GB --to lxd:5<br>
><br>
> At least in this case, the deploy command is clear, there's only one<br>
> thing they can possibly mean. Usually, the placement directive would<br>
> override the constraint, but in this case, it does what you would<br>
> want... but it is a littler weird that --to lxd:5 uses the constraint,<br>
> but --to 5 ignores it.<br>
><br>
> Note that you can't just write a simple script to do the above, because<br>
> the machine number is variable, so you have to parse our output and then<br>
> use that for the next command. It's still scriptable, obviously, but<br>
> it's more complicated script than just two lines of bash.<br>
><br>
> Also note that using this second method, you can't deploy more than one<br>
> unit at a time, unless you want multiple units on containers on the same<br>
> machine (which I think would be pretty odd).<br>
><br>
><br>
><br>
> On Fri, Jan 13, 2017 at 3:48 AM Rick Harding <<a href="mailto:rick.harding@canonical.com">rick.harding@canonical.com</a><br>
</div></div><span class="">> <mailto:<a href="mailto:rick.harding@canonical.com">rick.harding@<wbr>canonical.com</a>>> wrote:<br>
><br>
> In the end, you say you want an instance with 2gb of ram and if the<br>
> cloud has an instance with that exact limit it is in fact an exact<br>
> limit. The key things here is the clouds don't have infinite<br>
> malleable instance types like containers (this works for kvm and for<br>
> lxd). So I'm not sure the mis-match is as far apart as it seems.<br>
> root disk means give me a disk this big, if you ask for 2 core as<br>
> long as you can match an instance type with 2 cores it's exactly the<br>
> max you get.<br>
><br>
> It seems part of this can be more adjusting the language from<br>
> "minimum" to something closer to "requested X" where request gives<br>
> it more of a "I want X" without the min/max boundaries.<br>
><br>
><br>
><br>
> On Fri, Jan 13, 2017 at 3:14 AM John Meinel <<a href="mailto:john@arbash-meinel.com">john@arbash-meinel.com</a><br>
</span><span class="">> <mailto:<a href="mailto:john@arbash-meinel.com">john@arbash-meinel.com</a><wbr>>> wrote:<br>
><br>
> So we could make it so that constraints are actually 'exactly'<br>
> for LXD, which would then conform to both minimum and maximum,<br>
> and would still be actually useful for people deploying to<br>
> containers. We could certainly probe the host machine and say<br>
> "you asked for 48 cores, and the host machine doesn't have it".<br>
><br>
> However, note that explicit placement also takes precedence over<br>
> constraints anyway. If you do:<br>
> juju deploy mysql --constraints mem=4G<br>
> today, and then do:<br>
> juju add-unit --to 2<br>
> We don't apply the constraint limitations to that specific unit.<br>
> Arguably we should at *least* be warning that the constraints<br>
> for the overall application don't appear to be valid for this<br>
> instance.<br>
><br>
> I guess I'd rather see constraints still set limits for<br>
> containers, because people really want that functionality, and<br>
> that we warn any time you do a direct placement and the<br>
> constraints aren't satisfied. (but warn isn't failing the attempt)<br>
><br>
> John<br>
> =:-><br>
><br>
> On Fri, Jan 13, 2017 at 10:09 AM, Stuart Bishop<br>
> <<a href="mailto:stuart.bishop@canonical.com">stuart.bishop@canonical.com</a><br>
</span><span class="">> <mailto:<a href="mailto:stuart.bishop@canonical.com">stuart.bishop@<wbr>canonical.com</a>>> wrote:<br>
><br>
> On 13 January 2017 at 02:20, Nate Finch<br>
</span>> <<a href="mailto:nate.finch@canonical.com">nate.finch@canonical.com</a> <mailto:<a href="mailto:nate.finch@canonical.com">nate.finch@canonical.<wbr>com</a>>><br>
<span class="">> wrote:<br>
><br>
> I'm implementing constraints for lxd containers and<br>
> provider... and stumbled on an impedance mismatch that I<br>
> don't know how to handle.<br>
><br>
><br>
><br>
> I'm not really sure how to resolve this problem. Maybe<br>
> it's not a problem. Maybe constraints just have a<br>
> different meaning for containers? You have to specify<br>
> the machine number you're deploying to for any<br>
> deployment past the first anyway, so you're already<br>
> manually choosing the machine, at which point,<br>
> constraints don't really make sense anyway.<br>
><br>
><br>
> I don't think Juju can handle this. Either constraints have<br>
> different meanings with different cloud providers, or lxd<br>
> needs to accept minimum constraints (along with any other<br>
> cloud providers with this behavior).<br>
><br>
> If you decide constraints need to consistently mean minimum,<br>
> then I'd argue it is best to not pass them to current-gen<br>
> lxd at all. Enforcing that containers are restricted to the<br>
> minimum viable resources declared in a bundle does not seem<br>
> helpful, and Juju does not have enough information to choose<br>
> suitable maximums (and if it did, would not know if they<br>
> would remain suitable tomorrow).<br>
><br>
> --<br>
> Stuart Bishop <<a href="mailto:stuart.bishop@canonical.com">stuart.bishop@canonical.com</a><br>
</span>> <mailto:<a href="mailto:stuart.bishop@canonical.com">stuart.bishop@<wbr>canonical.com</a>>><br>
><br>
> --<br>
> Juju-dev mailing list<br>
> <a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a> <mailto:<a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.<wbr>com</a>><br>
<span class="">> Modify settings or unsubscribe at:<br>
> <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/juju-dev</a><br>
><br>
><br>
> --<br>
> Juju-dev mailing list<br>
</span>> <a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a> <mailto:<a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.<wbr>com</a>><br>
<span class="">> Modify settings or unsubscribe at:<br>
> <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/juju-dev</a><br>
><br>
> --<br>
> Juju-dev mailing list<br>
</span>> <a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a> <mailto:<a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.<wbr>com</a>><br>
<div class="HOEnZb"><div class="h5">> Modify settings or unsubscribe at:<br>
> <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/juju-dev</a><br>
><br>
><br>
><br>
<br>
</div></div><br>--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/juju-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Reed O'Brien <div><div><span style="font-size:12.8px">✉ </span><a href="mailto:reed.obrien@canonical.com" target="_blank">reed.obrien@canonical.com</a></div><div style="font-size:12.8px">✆ <span title="Call with Google Voice">415-562-6797</span></div></div><div style="font-size:12.8px"><span title="Call with Google Voice">💻 redir</span></div></div></div></div></div></div>
</div>