Bug 509779
Summary: | RFE: Support schedular parameters for QEMU guests | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | zhanghaiyan <yoyzhang> | |
Component: | libvirt | Assignee: | Daniel Berrangé <berrange> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | medium | Docs Contact: | ||
Priority: | low | |||
Version: | 6.0 | CC: | berrange, clalance, danken, gozen, jialiu, llim, syeghiay, virt-maint, xen-maint | |
Target Milestone: | rc | Keywords: | FutureFeature | |
Target Release: | --- | |||
Hardware: | All | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-0.7.1-2.el6 | Doc Type: | Enhancement | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 524766 548485 (view as bug list) | Environment: | ||
Last Closed: | 2010-07-02 19:24:12 UTC | Type: | --- | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 519868, 554544, 575275 |
Description
zhanghaiyan
2009-07-06 07:24:10 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 We've no intention of addressing this for RHEL-5, since our desired solution requires kernel CGroups. 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. 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 This was included in libvirt 0.7.0, so should be in the current RHEL6 build. 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. 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. 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 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 *** Bug 530984 has been marked as a duplicate of this bug. *** 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, 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. |