Limit number of cores in LXC container

ferdl9999

Renowned Member
Nov 7, 2015
52
0
73
Hello,

is there a way - like in Proxmox 3 with OpenVZ - to limit the number of cores of a LXC container in Proxmox 4?

Thanks for answers
 
Is it possible to make the limiting with the number of cores? Is there a way to only see a certain number of cores?
 
No, at the moment this is impossible with LXC afaik.

It's technically possible, but the problem is that you map a lxc core to a physical core.
So it's very difficult to loadbalance correctly multiple lxc containers.

According to the LXC 2.0 / LXD documentation, it looks possible to see and use only a limited number of load-balanced CPU cores inside a container.
https://www.stgraber.org/2016/03/26/lxd-2-0-resource-control-412/

Hopefully we get to see these features (already available in LXC 2.0 with LXD) in Proxmox... My thread on the same subject:
https://forum.proxmox.com/threads/revisiting-cpu-limit-for-lxc-2-0-lxd.28736/#post-145783
 
Awesome. Sticking with proxmox a bit more as this is a pain for customers on cpanel vps's. I'm sure they will sort it out soon.
 
saw some packages now for 4.3.9 and did full update. and reboot however I still see 12 cores on a server I gave 4 to. Funny enough loads seems much better.

Lookie here:

Untitled.png
 
the packages are not yet released (will take a few days).
 
Also, It will not auto-convert old container. Instead, you need to set the cores option for old container
with:

# pct set <CTID> --cores N
 
Seems this works great at limiting cores. But I does not shows VPS load like openvz did? It still shows hosts load? for example if host cpu load is 2.84 then all LXC containers show 2.84 irrespective how many cores they have? Just need to confirm this before I start tweaking other things :)
 
Just spoke to a developer for a plugin of proxmox and inform it is available in the API so they can add it to their proxmox module? I want to be able to add and manage the cores during upgrades and downgrades of VPS servers? Is this possible?
 
you can set almost everything over the API, except for stuff that you need to manually set by editing configuration files by hand. check the API documentation at http://pve.proxmox.com/pve-docs/api-viewer/index.html , in this case for "PUT /api2/json/nodes/{node}/lxc/{vmid}/config"