Bug 1170484 - guest can not start when setting " vcpu placement='auto' "
Summary: guest can not start when setting " vcpu placement='auto' "
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: Virtualization Bugs
Depends On:
Blocks: 1170492 1170495 1175709
TreeView+ depends on / blocked
Reported: 2014-12-04 05:51 UTC by Song Wang
Modified: 2015-03-05 07:47 UTC (History)
8 users (show)

Fixed In Version: libvirt-1.2.8-11.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-03-05 07:47:55 UTC
Target Upstream Version:

Attachments (Terms of Use)
Libvirtd log (389.48 KB, text/plain)
2014-12-04 05:53 UTC, Song Wang
no flags Details

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description Song Wang 2014-12-04 05:51:49 UTC
Description of problem:
guest can not start when setting "  vcpu placement='auto'  "

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.[root@localhost songwang]# virsh edit aa
Domain aa XML configuration edited.

2.[root@localhost songwang]# virsh dumpxml aa |grep cpu -A4
  <vcpu placement='auto' current='2'>4</vcpu>
    <memory mode='strict' placement='auto'/>

3.[root@localhost songwang]# virsh start aa
error: Failed to start domain aa
error: Failed to create controller cpu for group: No such file or directory

[root@localhost songwang]# virsh dumpxml aa |grep cpu
  <vcpu placement='static' current='2'>4</vcpu>

5.[root@localhost songwang]# virsh start aa
Domain aa started

Actual results:
As steps

Expected results:
It should start guest successfully.

Additional info:
when I downgrade libvirt to libvirt-1.2.8-9.el7.x86_64 ,I can start guest successfully.
[root@localhost Downloads]# rpm -q libvirt
[root@localhost Downloads]# virsh edit aa
Domain aa XML configuration edited.

[root@localhost Downloads]# virsh dumpxml aa |grep cpu -A4
  <vcpu placement='auto' current='2'>4</vcpu>
    <memory mode='strict' placement='auto'/>

[root@localhost Downloads]# virsh start aa
Domain aa started

Comment 1 Song Wang 2014-12-04 05:53:04 UTC
Created attachment 964446 [details]
Libvirtd log

Comment 3 Luyao Huang 2014-12-04 07:07:47 UTC
I think this is Because bug 1168866 forget this patch

commit 411cea638f6ec8503b7142a31e58b1cd85dbeaba
Author: Zhou yimin <zhouyimin>
Date:   Thu Oct 16 22:18:48 2014 +0800

    qemu: move setting emulatorpin ahead of monitor showing up
    If VM is configured with many devices(including passthrough devices)
    and large memory, libvirtd will take seconds(in the worst case) to
    wait for monitor. In this period the qemu process may run on any
    PCPU though I intend to pin emulator to the specified PCPU in xml
    Actually qemu process takes high cpu usage during vm startup.
    So this is not the strict CPU isolation in this case.
    Signed-off-by: Zhou yimin <zhouyimin>

And because qemuSetupCgroupForEmulator haven't been called before
qemuSetupCpusetMems in qemuSetupCgroupPostInit, then call virCgroupNewEmulator(priv->cgroup, false, &cgroup_temp)
in qemuSetupCpusetMems. 
Because create is false in this place(virCgroupNewEmulator) and haven't call
qemuSetupCgroupForEmulator to create a dir before, so this will get
fail in virCgroupMakeGroup this line:

if (!virFileExists(path)) {
    if (!create ||
        mkdir(path, 0755) < 0) {

Comment 8 Jincheng Miao 2014-12-23 05:03:38 UTC
This problem is fixed in libvirt-1.2.8-11.el7.x86_64:
# rpm -q libvirt

1. configure a guest as automatic vcpu placement
# virsh edit a
  <vcpu placement='auto'>4</vcpu>
    <memory mode='strict' placement='auto'/>

2. succeed to start guest
# virsh start a
Domain a started

So I change the status to VERIFIED.

Comment 10 errata-xmlrpc 2015-03-05 07:47:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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