Peeyush Gupta
2013-Jul-19 08:51 UTC
[libvirt-users] How to insert vcpupin in guest xml file
Hi all, I am trying to add vcpupin in the guest xml file. I am working with openstack and the code I have is python bound. I investigated through the code and found that the elemets in xml file are set in get_guest_config function. Now the thing is I am not able to set vcpupin element. I mean I tried guest.cputune_vcpupin but it's not working. Help me out, please! Thanks. ~Peeyush Gupta
hongming
2013-Sep-09 03:39 UTC
Re: [libvirt-users] How to insert vcpupin in guest xml file
On 07/19/2013 04:51 PM, Peeyush Gupta wrote:> Hi all, > > I am trying to add vcpupin in the guest xml file. I am working with > openstack and the code I have is python bound. I investigated through > the code and found that the elemets in xml file are set in > get_guest_config function. Now the thing is I am not able to set > vcpupin element. I mean I tried guest.cputune_vcpupin but it's not > working.Hi Peeyush In libvirt python -binding . You can find the following functions for pining vcpus. class virDomain: ..... def pinVcpu(self, vcpu, cpumap): """Dynamically change the real CPUs which can be allocated to a virtual CPU. This function requires privileged access to the hypervisor. """ ret = libvirtmod.virDomainPinVcpu(self._o, vcpu, cpumap) if ret == -1: raise libvirtError ('virDomainPinVcpu() failed', dom=self) return ret def pinVcpuFlags(self, vcpu, cpumap, flags): """Dynamically change the real CPUs which can be allocated to a virtual CPU. This function requires privileged access to the hypervisor. """ ret = libvirtmod.virDomainPinVcpuFlags(self._o, vcpu, cpumap, flags) if ret == -1: raise libvirtError ('virDomainPinVcpuFlags() failed', dom=self) return ret .......> > Help me out, please! > Thanks. > ~Peeyush Gupta > > > _______________________________________________ > libvirt-users mailing list > libvirt-users@redhat.com > https://www.redhat.com/mailman/listinfo/libvirt-users
hzguanqiang@corp.netease.com
2013-Sep-09 08:54 UTC
Re: [libvirt-users] How to insert vcpupin in guest xml file
Hi Peeyush, I also added vcpupin setting for my vm started by openstack. You can add the configure into xml just like one of the following two formats: <vcpu placement='static' cpuset='4-5'>3</vcpu> OR <cputune> <vcpupin vcpu='0' cpuset='4'/> <vcpupin vcpu='1' cpuset='5'/> </cputune> Wish this can help you. On 2013-09-09 11:39 , hongming wrote: On 07/19/2013 04:51 PM, Peeyush Gupta wrote: Hi all, I am trying to add vcpupin in the guest xml file. I am working with openstack and the code I have is python bound. I investigated through the code and found that the elemets in xml file are set in get_guest_config function. Now the thing is I am not able to set vcpupin element. I mean I tried guest.cputune_vcpupin but it's not working. Hi Peeyush In libvirt python -binding . You can find the following functions for pining vcpus. class virDomain: ..... def pinVcpu(self, vcpu, cpumap): """Dynamically change the real CPUs which can be allocated to a virtual CPU. This function requires privileged access to the hypervisor. """ ret = libvirtmod.virDomainPinVcpu(self._o, vcpu, cpumap) if ret == -1: raise libvirtError ('virDomainPinVcpu() failed', dom=self) return ret def pinVcpuFlags(self, vcpu, cpumap, flags): """Dynamically change the real CPUs which can be allocated to a virtual CPU. This function requires privileged access to the hypervisor. """ ret = libvirtmod.virDomainPinVcpuFlags(self._o, vcpu, cpumap, flags) if ret == -1: raise libvirtError ('virDomainPinVcpuFlags() failed', dom=self) return ret ....... Help me out, please! Thanks. ~Peeyush Gupta _______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users ------------------ Best regards! GuanQiang 16:41:56