[libvirt-users] setvcpus libvirt 1.2.9

Hello. I'm struggeling a little bit with the setvcpus command. I'm trying now to get this running for a linux VM. Here is what i have: <vcpu placement='auto' current='2'>4</vcpu> Now the VM is starting with 2 CPUs. When i try to increase the number of CPUs i get: setvcpus dev --guest 4 error: invalid argument: requested vcpu count is greater than the count of enabled vcpus in the domain: 4 > 2 Strange thing is when i set in the xml file: <vcpu placement='auto' current='4'>4</vcpu> the VM starts with 4CPUs and setting the CPUs works. I can do: setvcpus dev --guest 2 and: setvcpus dev --guest 4 Is this a bug? Should i try to upgrade to 1.2.10? There seem to be a lot of changes in it regarding setvcpus. thanks and cheers t.

On Wed, Nov 05, 2014 at 11:35:37AM +0100, Thomas Stein wrote:
Hello.
I'm struggeling a little bit with the setvcpus command. I'm trying now to get this running for a linux VM. Here is what i have:
<vcpu placement='auto' current='2'>4</vcpu>
Now the VM is starting with 2 CPUs. When i try to increase the number of CPUs i get:
setvcpus dev --guest 4 error: invalid argument: requested vcpu count is greater than the count of enabled vcpus in the domain: 4 > 2
This sets the current number of cpus and that cannot be changed live (unless you have cpu hot(un)plug).
Strange thing is when i set in the xml file:
<vcpu placement='auto' current='4'>4</vcpu>
the VM starts with 4CPUs and setting the CPUs works.
Because the max is 4 and you're setting the "current" number.
I can do:
setvcpus dev --guest 2
and:
setvcpus dev --guest 4
Is this a bug? Should i try to upgrade to 1.2.10? There seem to be a lot of changes in it regarding setvcpus.
thanks and cheers t.
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

Am 05.11.14 11:48, schrieb Martin Kletzander:
On Wed, Nov 05, 2014 at 11:35:37AM +0100, Thomas Stein wrote:
Hello.
I'm struggeling a little bit with the setvcpus command. I'm trying now to get this running for a linux VM. Here is what i have:
<vcpu placement='auto' current='2'>4</vcpu>
Now the VM is starting with 2 CPUs. When i try to increase the number of CPUs i get:
setvcpus dev --guest 4 error: invalid argument: requested vcpu count is greater than the count of enabled vcpus in the domain: 4 > 2
This sets the current number of cpus and that cannot be changed live
I'm not quite sure i understand what you mean. What would be a common use case for this setting? <vcpu placement='auto' current='2'>4</vcpu>
(unless you have cpu hot(un)plug).
What is neccessary to have that? thanks and cheers t.
Strange thing is when i set in the xml file:
<vcpu placement='auto' current='4'>4</vcpu>
the VM starts with 4CPUs and setting the CPUs works.
Because the max is 4 and you're setting the "current" number.
I can do:
setvcpus dev --guest 2
and:
setvcpus dev --guest 4
Is this a bug? Should i try to upgrade to 1.2.10? There seem to be a lot of changes in it regarding setvcpus.
thanks and cheers t.
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

On 11/05/2014 01:20 PM, Thomas Stein wrote:
Am 05.11.14 11:48, schrieb Martin Kletzander:
On Wed, Nov 05, 2014 at 11:35:37AM +0100, Thomas Stein wrote:
Hello.
I'm struggeling a little bit with the setvcpus command. I'm trying now to get this running for a linux VM. Here is what i have:
<vcpu placement='auto' current='2'>4</vcpu>
This is one case where xen may be a bit more powerful than current qemu support. Xen supports booting a guest with a promise of a maximum cpu larger than what it boots with; but I don't know that qemu does that well yet. For now, with qemu, you pretty much have to boot with all cpus enabled, then after the guest is up and running, disable the cpus you don't plan to use right away. CPU hotplug/hot-unplug is still a work in progress in qemu (for example, some versions of qemu support hotplug but not hot-unplug). I haven't played much with it myself to know what minimum version of libvirt and qemu will do what you want, so you may have to do some experimentation. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Am 05.11.14 14:48, schrieb Eric Blake:
On 11/05/2014 01:20 PM, Thomas Stein wrote:
Am 05.11.14 11:48, schrieb Martin Kletzander:
On Wed, Nov 05, 2014 at 11:35:37AM +0100, Thomas Stein wrote:
Hello.
I'm struggeling a little bit with the setvcpus command. I'm trying now to get this running for a linux VM. Here is what i have:
<vcpu placement='auto' current='2'>4</vcpu>
This is one case where xen may be a bit more powerful than current qemu support. Xen supports booting a guest with a promise of a maximum cpu larger than what it boots with; but I don't know that qemu does that well yet. For now, with qemu, you pretty much have to boot with all cpus enabled, then after the guest is up and running, disable the cpus you don't plan to use right away. CPU hotplug/hot-unplug is still a work in progress in qemu (for example, some versions of qemu support hotplug but not hot-unplug). I haven't played much with it myself to know what minimum version of libvirt and qemu will do what you want, so you may have to do some experimentation.
Thanks. I let you know if my experiments lead to some discoveries. cheers t.

On 11/05/2014 02:56 PM, Thomas Stein wrote:
Am 05.11.14 14:48, schrieb Eric Blake:
On 11/05/2014 01:20 PM, Thomas Stein wrote:
Am 05.11.14 11:48, schrieb Martin Kletzander:
On Wed, Nov 05, 2014 at 11:35:37AM +0100, Thomas Stein wrote:
Hello.
I'm struggeling a little bit with the setvcpus command. I'm trying now to get this running for a linux VM. Here is what i have:
<vcpu placement='auto' current='2'>4</vcpu>
This is one case where xen may be a bit more powerful than current qemu support. Xen supports booting a guest with a promise of a maximum cpu larger than what it boots with; but I don't know that qemu does that well yet. For now, with qemu, you pretty much have to boot with all cpus enabled, then after the guest is up and running, disable the cpus you don't plan to use right away. CPU hotplug/hot-unplug is still a work in progress in qemu (for example, some versions of qemu support hotplug but not hot-unplug). I haven't played much with it myself to know what minimum version of libvirt and qemu will do what you want, so you may have to do some experimentation.
Thanks. I let you know if my experiments lead to some discoveries.
In fact, one of the reasons that 'setvcpus --guest' was added in the guest agent was precisely because direct qemu support for cpu hot-unplug was not ready yet, and faking things by requiring the guest to do the work instead of qemu was an attempt to paper around the lack of qemu support. However, guest unplug is different than qemu unplug on several fronts; for instance, rebooting the guest will forget what settings the previous run had been using (that is, libvirt will NOT update XML to reflect guest settings, because guest interaction is assumed to be untrusted; while if qemu hot-unplug works, libvirt would update the XML to match). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Eric Blake
-
Martin Kletzander
-
Thomas Stein