[one-users] Centos7/RHEL7 cgroups questions?

Jhon Masschelein jhon.masschelein at surfsara.nl
Mon Oct 13 06:49:56 PDT 2014


Hi,

I did some testing with it and I am still not sure if it is actually working.

What does work is that:
- OpenNebula creates a good libvirt template containing the cputune-shares option
- The VM is put in a machine.slice unit so it is handled by the cgroup system.
- a virsh schedinfo VMID shows the correct value for cpu shares

What does not work, or at least what I find to be strange is finding out if the shares setting is actually enforced.
When I use the systemd show command on a VM scope, CPUShares is always 1024, no matter what I put for CPU (or VCPU)

Does anybody have an idea if this is ok or if something is going wrong?

Wkr,

Jhon


An example:

A running VM's cgroup output using the systemctl command gives:

#  systemctl show machine-qemu\x2done\x2d61 | grep CPU
LimitCPU=18446744073709551615
CPUSchedulingPolicy=0
CPUSchedulingPriority=0
CPUSchedulingResetOnFork=no
CPUAccounting=no
CPUShares=1024


-> Only 1024 CPUShares while it was started with 8 cpu's (and 16 VPCU's)

Here is how it is defined and interpreted :

The VM Template:
-------------------------
CPU="8"
VCPU="16"
MEMORY="512"
FEATURES=[ACPI="yes",APIC="yes",LOCALTIME="yes",PAE="yes"]
OS=[ARCH="x86_64",BOOT="hd",ROOT="vda1"]
DISK=[IMAGE="ttylinux - kvm_file0",IMAGE_UNAME="oneadmin"]

Gives a libvirt template:
--------------------------------
<domain type='kvm'>
  <name>one-61</name>
  <uuid>1d8d3e34-a1e1-40d9-9493-2724578dcdd2</uuid>
  <memory unit='KiB'>524288</memory>
  <currentMemory unit='KiB'>524288</currentMemory>
  <vcpu placement='static'>16</vcpu>
  <cputune>
    <shares>8192</shares>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
….

A virsh schedinfo gives:
--------------------------------
Scheduler      : posix
cpu_shares     : 8192
vcpu_period    : 100000
vcpu_quota     : -1
emulator_period: 100000
emulator_quota : -1

And systemd-cgls gives:
---------------------------------
...
└─machine.slice
  └─machine-qemu\x2done\x2d61.scope
    ├─emulator
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu15
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu14
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu13
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu12
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu11
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu10
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu9
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu8
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu7
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu6
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu5
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu4
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu3
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu2
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    ├─vcpu1
    │ └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets
    └─vcpu0
      └─63798 /usr/libexec/qemu-kvm -name one-61 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -m 512 -realtime mlock=off -smp 16,sockets



More information about the Users mailing list