CPU Affinity configuration for LXD

Bug #1747457 reported by Alvaro Uria
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

Juju 2.3
LXD 2.0.11-0ubuntu1~16.04.4

Use case: pcpu separation between Host processes and nova-compute ones

Sample: 56 pcpus

1) On Host, /etc/systemd/system.conf
"""
[Manager]
CPUAffinity=0 1 26 27 28 29 54 55
"""

2) juju config nova-compute vcpu-pin-set=2-25,30-53

If we use Juju1+LXC (old deploys), nothing else needs to be set.

However, Juju2+LXD requires all containers to have the following setting:
lxc config set CONTAINER limits.cpu 0-1,26-29,54-55

What would be the best way to set this value via Juju? Would it be possible to add a "model-config" parameter that affects any LXD deployed within the model?

Revision history for this message
Anastasia (anastasia-macmood) wrote :

This is not something that we have plans to address immediately. It may be addressed at the time when we do more comprehensive work on inheriting container properties.

Changed in juju:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Alvaro Uria (aluria) wrote :

I discussed this with @thumper and model-config is not an option.

The use case is:
1) OpenStack cloud deployed in the "default" model
2) Some nodes run a vanilla nova-compute, without CPU affinity
3) Other nodes (nova-compute-vnf), do use CPU affinity configured on /etc/systemd/system.conf

Containers running on nodes from the 3rd case need to have "limits.cpu" set with the same info related to CPU affinity.

4) In case there are containers running on a node and nova-compute-vnf needs to be deployed, "old" containers need to setting applied from that moment and on.

Revision history for this message
Joseph Phillips (manadart) wrote :

The first support for LXD constraints has been committed to the develop and 2.4 branches.

In this scenario, the "cores" constraint ends up as the "limits.cpu" configuration setting when using it to provision a container machine.

This same LXD config item is used to set affinity by giving it range syntax; "1-1" for core 1, "1-2" for 1 and 2 etc.

The blocker for piggy-backing on the current functionality is that the cores constraint is validated as numeric, so supplying those strings will not work. However, I don't think it would take much to enable this feature.

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1747457] Re: CPU Affinity configuration for LXD

We could alternatively provide a different value for affinity, because it
wouldn't be available for things that aren't lxd containers. I don't really
like that LXD uses "cpu=X" to mean something very different (IMO) to
"cpu=X-Y" (a count, vs an explicit enumeration of cpu identities.)

Either way, we do have code now that can set the limits.cpu so it does put
us close to there.

On Sun, Jul 8, 2018 at 9:11 PM, Joseph Phillips <email address hidden>
wrote:

> The first support for LXD constraints has been committed to the develop
> and 2.4 branches.
>
> In this scenario, the "cores" constraint ends up as the "limits.cpu"
> configuration setting when using it to provision a container machine.
>
> This same LXD config item is used to set affinity by giving it range
> syntax; "1-1" for core 1, "1-2" for 1 and 2 etc.
>
> The blocker for piggy-backing on the current functionality is that the
> cores constraint is validated as numeric, so supplying those strings
> will not work. However, I don't think it would take much to enable this
> feature.
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1747457
>
> Title:
> CPU Affinity configuration for LXD
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1747457/+subscriptions
>

Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Medium → Low
tags: added: expirebugs-bot
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.