Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1686648 - Creating domain fails when cpuset is limited by systemd slice
Summary: Creating domain fails when cpuset is limited by systemd slice
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2019-03-07 23:16 UTC by Charlie Smurthwaite
Modified: 2019-03-08 09:03 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:

Attachments (Terms of Use)

Description Charlie Smurthwaite 2019-03-07 23:16:13 UTC
When using a systemd "machine" slice to restrict the CPU cores used for virtualization, libvirt fails to create a kvm domain.

Domain XML:

<domain type="kvm">
  <memory unit="MiB">2048</memory>
  <vcpu cpuset="0,3-20,23-39">2</vcpu>
    <type arch="x86_64">hvm</type>

Creation error:

Call to virDomainCreateXML failed: Invalid value '0-39' for 'cpuset.cpus': Invalid argument

Systemd slice configuration:

group machine.slice {
    cpuset {
    memory {

OS: Ubuntu 18.04
libvirt version: 4.0.0

It appears at a glance that libvirt always attempts to set CPU affinity to all CPUs, even those not accessible to it, however I do not fully understand the mechanisms here.

Comment 1 Charlie Smurthwaite 2019-03-08 09:03:43 UTC
It was recommended that I install the Ubuntu package "systemd-container". I have done so and this resolves the problem. Not sure if this is the correct solution or if there is still an underlying bug here.

Note You need to log in before you can comment on or make changes to this bug.