1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

nproc shows all hosts cores in lxc despite limitiation

Discussion in 'Proxmox VE: Installation and configuration' started by avekrivoy, May 19, 2017.

  1. avekrivoy

    avekrivoy New Member

    Joined:
    May 19, 2017
    Messages:
    10
    Likes Received:
    0
    Hi!
    I'm having problem with resource limiting on Proxmox
    All CPUs of Proxmox host are available inside LXC-container, despite limit is set.
    Code:
    pct config 100
    
    arch: amd64
    cpulimit: 1
    cpuunits: 1024
    hostname: test
    memory: 1024
    net0: name=eth0,bridge=vmbr0,hwaddr=BE:C9:EB:5E:0E:15,type=veth
    ostype: debian
    rootfs: local:100/vm-100-disk-1.raw,size=8G
    swap: 512
    
    pct enter 100
    
    root@test:~# nproc
    8
    
    root@test:~# cat /proc/cpuinfo | grep cores | wc -l
    8
    
    Proxmox host is running on Debian Jessie.
    Code:
    pveversion
    pve-manager/4.2-23/d94f9458 (running kernel: 4.4.19-1-pve)
    
    I have another host with 4.4.59-1-pve kernel and there is no such problem.
    Is there a way to fix this without updating whole host? Maybe LXC part only?
     
  2. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    15,346
    Likes Received:
    171
    You need to set the 'cores' configuration (cpulimit only limits performance, but does not reduce the number of assigned cores)
     
  3. avekrivoy

    avekrivoy New Member

    Joined:
    May 19, 2017
    Messages:
    10
    Likes Received:
    0
    oh, right, newer version of Proxmox has field Cores at container creation menu.
    So I tried to edit my container config and add
    Code:
    cores: 2
    but operation failed:
    Code:
    pct stop 100
    vm 100 - unable to parse value of 'cores' - unknown setting 'cores'
    
     
  4. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    15,346
    Likes Received:
    171
    What version do you run exactly? Maybe you still run an old version?
     
  5. avekrivoy

    avekrivoy New Member

    Joined:
    May 19, 2017
    Messages:
    10
    Likes Received:
    0
    Code:
    pveversion -v
    proxmox-ve: 4.2-66 (running kernel: 4.4.19-1-pve)
    pve-manager: 4.2-23 (running version: 4.2-23/d94f9458)
    pve-kernel-4.4.19-1-pve: 4.4.19-66
    lvm2: 2.02.111-2.2+deb8u1
    corosync-pve: 2.4.0-1
    libqb0: 1.0-1
    pve-cluster: 4.0-46
    qemu-server: 4.0-88
    pve-firmware: 1.1-9
    libpve-common-perl: 4.0-73
    libpve-access-control: 4.0-19
    libpve-storage-perl: 4.0-61
    pve-libspice-server1: 0.12.8-1
    vncterm: 1.2-1
    pve-qemu-kvm: 2.6.1-6
    pve-container: 1.0-75
    pve-firewall: 2.0-29
    pve-ha-manager: 1.0-35
    ksm-control-daemon: 1.2-1
    glusterfs-client: 3.5.2-2+deb8u2
    lxc-pve: 2.0.7-4
    lxcfs: 2.0.6-pve1
    criu: 1.6.0-1
    novnc-pve: 0.5-8
    
    And I've updated lxc-pve and lxcfs manually by apt install.
     
  6. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    15,346
    Likes Received:
    171
    You need a newer version (Proxmox VE 4.4)
     
  7. avekrivoy

    avekrivoy New Member

    Joined:
    May 19, 2017
    Messages:
    10
    Likes Received:
    0
    is it possible to make partial upgrade without reboot?
     
  8. LnxBil

    LnxBil Well-Known Member

    Joined:
    Feb 21, 2015
    Messages:
    1,982
    Likes Received:
    120
    Normally, you can to a full-upgrade without a reboot. Kernel changes are normally only security fixes, not feature improvements. You need to restart your containers to get the new configuration stuff. Normally one would restart every service that is affected by an update, so most people just reboot their servers to be on the safe side. I'd recommend that too for most people :-D
     
  9. avekrivoy

    avekrivoy New Member

    Joined:
    May 19, 2017
    Messages:
    10
    Likes Received:
    0
    Eh, those are risky things for production environment) But, I guess, I have no other options. Thank you for response!
     

Share This Page