Bug 1842716
Summary: | Failure to spawn VMs with CPU pinning | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | David Hill <dhill> |
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
Status: | CLOSED WORKSFORME | QA Contact: | jiyan <jiyan> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.8 | CC: | berrange, jsuchane, lhuang, lmen, phrdina, xuzhang, yalzhang |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-06-10 17:55:55 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
David Hill
2020-06-01 22:46:31 UTC
I have the same version in my lab and I wasn't able to reproduce this issue ... As a first step it'd be desirable to see the cpuset.cpus content for /sys/fs/cgroup/cpuset/machine.slice/ and /sys/fs/cgroup/cpuset too for the machine which exhibits this behaviour In the sosreport $ cat /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus 0,14,28,42 $ cat /sys/fs/cgroup/cpuset/cpuset.cpus 0-55 And in the guest XML config we have <cputune> <shares>8192</shares> <vcpupin vcpu='0' cpuset='9'/> <vcpupin vcpu='1' cpuset='37'/> <vcpupin vcpu='2' cpuset='11'/> <vcpupin vcpu='3' cpuset='39'/> <vcpupin vcpu='4' cpuset='34'/> <vcpupin vcpu='5' cpuset='6'/> <vcpupin vcpu='6' cpuset='40'/> <vcpupin vcpu='7' cpuset='12'/> <emulatorpin cpuset='6,9,11-12,34,37,39-40'/> </cputune> So the problem here is that something has configured a very restrictive CPU mask on machine.slice cgroup. The guest is configued to use CPUs that are outside this mask, and this si likely why they get EPERM. The key question is who/what has configured machine.slice cpuset.cpus in this way, and why. One possible reason why machine.slice cpuset.cpus was modified and doesn't contain all host CPUs is by changing online CPUs on the host. This is the main issue with cpuset in cgroups v1 where disabling host CPU changes the cpuset.cpus but enabling it again will not set it back as it cannot know if the changes was done by disabling that CPU or by user changing cpuset.cpus. In cgroups v2 this is solved by having cpuset.cpus and cpuset.cpus.effective where user changes values in cpuset.cpus and cpuset.cpus.effective reflects the actual state so it is possible to set 0-20 for example but have 0-10 only as effective if it is disabled by parent cgroup or changes to online CPUs on the host. IIUC, while systemd has support for mounting "cpuset" controller, it doesn't ever do anything with it itself. libvirt creates the machine.slice subdirectory for cpuset controller, and populates cpuset.cpus by copying from the parent (root) cgroup. The root cgroup shows 0-55, so libvirt should have copied that value into machine.slicen. Supposedly this host has been rebooted multiple times and always shows the same behaviour, so any offlining of CPUs was not random historical baggage. That said, I wonder if anything in tuned temporarily takes CPUs offline & online when configuring the host ? I think it would be useful to get a libvirt debug log from the customer's machine In /etc/libvirt/libvirtd.conf set log_filters="1:systemd 1:cgroup 1:qemu" log_outputs="1:file:/var/log/libvirt/libvirtd.log" then reboot the host machine. When it first comes up, and all the services are running but *BEFORE* starting any VMs, report - Content of /sys/fs/cgroup/cpuset/cpuset.cpus - Whether /sys/fs/cgroup/cpuset/machine.slice exists or not, and if so - Content of /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus Now, try to start a VM when it fails, again report - Content of /sys/fs/cgroup/cpuset/cpuset.cpus - Whether /sys/fs/cgroup/cpuset/machine.slice exists or not, and if so - Content of /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus And also attach the libvirtd.log file at this time. It looks like the container nova_libvirt was created with "CpusetCpus" using the non-isolated cores ... I tried finding the value in the templates/kolla/etc to no avail! I'm wondering if it's not just because isolcpus is setted in the kernel cmdline and docker hardcoded the CpusetCpus values at creation time. I don't think running libvirtd with debugging is required here and it'll probably provide the same CpusetCpus values anyways. (In reply to David Hill from comment #8) > It looks like the container nova_libvirt was created with "CpusetCpus" using > the non-isolated cores ... I tried finding the value in the > templates/kolla/etc to no avail! I'm wondering if it's not just because > isolcpus is setted in the kernel cmdline and docker hardcoded the CpusetCpus > values at creation time. I don't think running libvirtd with debugging is > required here and it'll probably provide the same CpusetCpus values anyways. Please help me understand the situation. Is there anything libvirt should address here? Or in any other component? Thanks. |