[SOLVED] python : get lxc allocated ram\cores

ilia987

Well-Known Member
Sep 9, 2019
281
14
58
37
when running python script inside the lxc all the python functions i found return the original core count of the host, and it should return the amount of recesses allocated to the lxc.
anyone got an idea ?
 
It depends if you want to read physical or logical cores (this is the same difference between running nproc and nproc --all).

See this SO answer on how to get logical cores in python for example: https://stackoverflow.com/a/55423170
 
  • Like
Reactions: ilia987