[SOLVED] python : get lxc allocated ram\cores

ilia987

Active Member
Sep 9, 2019
275
13
38
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

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!