+++ This bug was initially created as a clone of Bug #453042 +++ Bug #453042 introduced max-vcpus/vcpus resolution to xen userspace tools to be able to run boot machine without all vcpus allocated at the boot time. What we need now it to add support for this to libvirt itself to provide interface to set initial number of vcpus and maximum number of vcpus since they don't have to be the same at the boot time like it was before my patch for BZ #453042 applied.
Patches for RHEL 5.6 posted: http://post-office.corp.redhat.com/archives/rhvirt-patches/2010-October/msg00178.html Note that this is a bare minimum subset of what is going upstream in 0.8.5 - rather than backport the new convenience APIs of virDomainSetVcpusFlags, you have to do raw XML editing. But it is sufficient to provide the desired feature.
*** Bug 644159 has been marked as a duplicate of this bug. ***
Verified PASSED on 4 arches(RHEL5u6-Server-ia64-Xen,RHEL5u6-Server-x86_64-Xen,RHEL5u6-Server-x86_64-Kvm,RHEL5u6-Client-i386-Xen) with build: libvirt-0.8.2-7.el5 kernel-2.6.18-228.el5 kernel-xen-2.6.18-228.el5 xen-3.0.3-117.el5. Steps: 1.#virsh dumpxml xen-pv <domain type='xen' id='2'> <name>xen-pv</name> <uuid>b6a3427e-12ae-c04b-090c-f96c1d344533</uuid> <memory>524288</memory> <currentMemory>524288</currentMemory> <vcpu>3</vcpu> <bootloader>/usr/bin/pygrub</bootloader> <os> <type>linux</type> <kernel>/var/lib/xen/boot_kernel.29GseO</kernel> <initrd>/var/lib/xen/boot_ramdisk.7YgE0w</initrd> <cmdline>ro root=/dev/VolGroup00/LogVol00 rhgb quiet</cmdline> </os> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <disk type='file' device='disk'> <driver name='tap' type='aio'/> <source file='/var/lib/xen/images/xen-pv.img'/> <target dev='xvda' bus='xen'/> </disk> <interface type='bridge'> <mac address='00:16:36:4b:91:03'/> <source bridge='virbr0'/> <script path='vif-bridge'/> <target dev='vif2.0'/> </interface> <console type='pty' tty='/dev/pts/3'> <source path='/dev/pts/3'/> <target port='0'/> </console> <input type='mouse' bus='xen'/> <graphics type='vnc' port='5900' autoport='yes' keymap='en-us'/> </devices> </domain> 2.virsh setvcpus xen-pv 4 error: Too many virtual CPUs. 3.#virsh setvcpus xen-pv 2 4.#virsh dumpxml xen-pv|grep vcpu <vcpu current='2'>3</vcpu> on guest 5.#grep processor /proc/cpuinfo processor : 0 processor : 1 6.#virsh setvcpus xen-pv 3 on guest a). grep processor /proc/cpuinfo processor : 0 processor : 1 processor : 2
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2011-0060.html
*** Bug 615999 has been marked as a duplicate of this bug. ***