RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 509779 - RFE: Support schedular parameters for QEMU guests
Summary: RFE: Support schedular parameters for QEMU guests
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 530984 (view as bug list)
Depends On:
Blocks: 519868 554544 575275
TreeView+ depends on / blocked
 
Reported: 2009-07-06 07:24 UTC by zhanghaiyan
Modified: 2010-07-02 19:24 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.7.1-2.el6
Doc Type: Enhancement
Doc Text:
Clone Of:
: 524766 548485 (view as bug list)
Environment:
Last Closed: 2010-07-02 19:24:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhanghaiyan 2009-07-06 07:24:10 UTC
Description of problem:
Command 'virsh schedinfo' works not correctly, function 'virDomainGetSchedulerType' is not supported by hypervisor

Version-Release number of selected component (if applicable):
- libvirt: 0.6.3-13.el5
- RHEL5.4-Server-x86_64 
- KVM


How reproducible:
100%

Steps to Reproduce:
1, virsh define rhel5u4.xml 
2, virsh start rhel5u4
3, virsh schedinfo rhel5u4
4, virsh schedinfo rhel5u4 --cap 65534
  
Actual results:
After step3, output:
Scheduler      : Unknown
error: this function is not supported by the hypervisor: virDomainGetSchedulerType

After step4, output:
error: this function is not supported by the hypervisor: virDomainSetSchedulerParameters


Expected results:
After step3,4 Output rhel5u4 schedinfo

Comment 1 Chris Lalancette 2009-07-06 08:02:52 UTC
Right, this just isn't currently implemented in 5.4 libvirt (not in upstream libvirt, either).  So the error message is correct.  It looks like an area for future enhancement.

Chris Lalancette

Comment 2 Daniel Berrangé 2009-07-06 10:14:16 UTC
We've no intention of addressing this for RHEL-5, since our desired solution requires kernel CGroups.

Comment 3 RHEL Program Management 2009-07-06 10:37:44 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 4 Daniel Berrangé 2009-07-27 11:38:58 UTC
This is now implemented in usptream libvirt, so on target for inclusion in RHEL-6.0

http://libvirt.org/git/?p=libvirt.git;a=commit;h=55bc5090b94e56d9e2f7420e6e5aa97810d5d15f

Comment 5 Daniel Berrangé 2009-09-17 12:03:34 UTC
This was included in libvirt 0.7.0, so should be in the current RHEL6 build.

Comment 6 Daniel Berrangé 2009-09-22 09:36:08 UTC
FYI, to make this work you need to have cgroups mounted.

eg, 

   mkdir /dev/cgroup
   mount -t cgroup none -o cpu,devices /dev/cgroup


And then restart libvirtd, and restart any guests and it should work.

Comment 7 releng-rhel@redhat.com 2009-10-30 22:11:55 UTC
Fixed in 'libvirt-0.7.1-2.el6'. 'libvirt-0.7.1-2.el6.2' included in compose 'RHEL6.0-20091029.0'.
Moving to ON_QA.

Comment 8 Johnny Liu 2009-11-05 08:10:04 UTC
Verified the bug with libvirt-0.7.1-2.el6.2 on rhel6.0 X86_64.


[root@dhcp-66-70-119 ~]# uname -a
Linux dhcp-66-70-119.nay.redhat.com 2.6.31-33.el6.x86_64 #1 SMP Thu Oct 29 12:00:41 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-119 ~]# rpm -qa|grep libvirt
libvirt-0.7.1-2.el6.2.x86_64
libvirt-client-0.7.1-2.el6.2.x86_64
libvirt-python-0.7.1-2.el6.2.x86_64
libvirt-devel-0.7.1-2.el6.2.x86_64
libvirt-cim-0.5.6-2.el6.x86_64
[root@dhcp-66-70-119 ~]# mkdir /dev/cgroup
[root@dhcp-66-70-119 ~]# mount -t cgroup none -o cpu,devices /dev/cgroup
[root@dhcp-66-70-119 ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
[root@dhcp-66-70-119 ~]# virsh start rhel5.4_i386
Domain rhel5.4_i386 started
[root@dhcp-66-70-119 ~]# virsh schedinfo rhel5.4_i386
Scheduler      : posix
cpu_shares     : 1024

Comment 9 Alex Jia 2009-11-05 08:26:05 UTC
Description of problem:
1.virsh help document need to be updated about schedinfo part.
2.cpu_shares data type is unsigned long long, but maximum value only 
reach 262144 rather than 18446744073709551615,the value is limited to REMOTE_MESSAGE_MAX? and if given a negative value, such as -1, it also 
display 262144. cpu_shares assigns value 0 or 1 or 2,the result display value is 2.

Version-Release number of selected component (if applicable):
[root@dhcp-66-70-97 libvirt-0.7.2]# uname -a
Linux dhcp-66-70-97.nay.redhat.com 2.6.31-31.el6.x86_64 #1 SMP Fri Oct 16 16:34:16 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-97 libvirt-0.7.2]# lsmod|grep kvm
kvm_intel              57344  3 
kvm                   192512  1 kvm_intel
[root@dhcp-66-70-97 libvirt-0.7.2]# rpm -qa|grep virt
virt-manager-0.8.0-2.el6.1.noarch
libvirt-client-0.7.1-2.el6.2.x86_64
libvirt-0.7.1-2.el6.2.x86_64
virt-viewer-0.2.0-1.el6.2.x86_64
libvirt-devel-0.7.1-2.el6.2.x86_64
libvirt-python-0.7.1-2.el6.2.x86_64
python-virtinst-0.500.0-1.el6.2.noarch

1.
[root@dhcp-66-70-97 ajia]# virsh help schedinfo 
  NAME
    schedinfo - show/set scheduler parameters

  SYNOPSIS
    schedinfo <domain> [--set <string>] [--weight <number>] [--cap <number>]

  DESCRIPTION
    Show/Set scheduler parameters.

  OPTIONS
    <domain>         domain name, id or uuid
    --set <string>   parameter=value
    --weight <number>  weight for XEN_CREDIT
    --cap <number>   cap for XEN_CREDIT

NOTE: only have 'cpu_shares' key

2.
[root@dhcp-66-70-97 ajia]# virsh schedinfo rhel6-alpha
Scheduler      : posix
cpu_shares     : 1024

NOTE: get scheduler parameter is correct.

[root@dhcp-66-70-97 ajia]# virsh schedinfo rhel6-alpha --weight 2048
Scheduler      : posix
cpu_shares     : 1024

NOTE: in fact, 'weight' key don't exist, but without error information.
it seems should display "Invalid parameter weight", looks the following
source code from qemu_drivier.c:
            qemudReportError(dom->conn, domain, NULL, VIR_ERR_INVALID_ARG,
                             _("Invalid parameter `%s'"), param->field);
 
[root@dhcp-66-70-97 ajia]# virsh schedinfo rhel6-alpha --set cpu_shares=2048
Scheduler      : posix
cpu_shares     : 2048

NOTE: set scheduler parameter is correct.

[root@dhcp-66-70-97 ajia]# virsh schedinfo rhel6-alpha --set cpu_shares=0
Scheduler      : posix
cpu_shares     : 2

[root@dhcp-66-70-97 ajia]# virsh schedinfo rhel6-alpha --set cpu_shares=1
Scheduler      : posix
cpu_shares     : 2

[root@dhcp-66-70-97 ajia]# virsh schedinfo rhel6-alpha --set cpu_shares=2
Scheduler      : posix
cpu_shares     : 2

NOTE: assign value 0 or 1 or 2, cpu_shares value is 2

[root@dhcp-66-70-97 ajia]# virsh schedinfo rhel6-alpha --set cpu_shares=18446744073709551615
Scheduler      : posix
cpu_shares     : 262144

[root@dhcp-66-70-97 ajia]# virsh schedinfo rhel6-alpha --set cpu_shares=-1
Scheduler      : posix
cpu_shares     : 262144

NOTE: maximum value only reach 262144,and given illegal value, the result also
is 262144

Comment 10 Daniel Berrangé 2009-11-12 18:08:16 UTC
*** Bug 530984 has been marked as a duplicate of this bug. ***

Comment 11 Daniel Berrangé 2009-12-17 15:52:41 UTC
The fact that the tunable is limited to 2->262144 is a result of the kernel's policy. We're not attempting to enforce that at the libvirt layer since then we'd introduce the problem of trying to keep the libvirt logic in sync with the kernel.

The poor virsh documentation  is a separate issue, so I opened bug 548485 for that.

This bug is about the implementation of sched params in the QEMU driver, rather than virsh issues,

Comment 13 releng-rhel@redhat.com 2010-07-02 19:24:12 UTC
Red Hat Enterprise Linux Beta 2 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.


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