Re: [Openstack] How to set vcpupin in guest XML?
Hi Daniel, Thanks for your suggestion. I made some changes in config and it works fine. One more thing I wanted to ask is I want to add an attribute to xml. But I am not able to figure out how exactly libvirt is defining xml. I understand that config can only add the attributes that are defined in the xml. But how do I add a new attribute? Thanks. ~Peeyush Gupta From: Daniel P. Berrange berra...@redhat.com To: Peeyush Gupta gpeey...@ymail.com Cc: openstack@lists.launchpad.net openstack@lists.launchpad.net Sent: Tuesday, 23 July 2013 4:34 PM Subject: Re: [Openstack] How to set vcpupin in guest XML? On Tue, Jul 23, 2013 at 05:31:25PM +0800, Peeyush Gupta wrote: Hi all, I am working with openstack and I want to pin vcpus to pcpus in guest xml. Now, the pinning operation can be done using virsh vcpupin guestname vcpu pcpu But I want to do it using python API. I investigated the openstack code and found out that get_guest_config function in libvirt/driver.py is responsible for generation of guest XML file. Now, I tried to put vcpupin attribute here by guest.vcpupin or guest.cputune_vcpupin but none of them is working. Any idea what am I doing wrong? Or is this functionality not available with openstack? The get_guest_config() function returns an instance of the nova.virt.libvirt.config.LibvirtConfigGuest object. That class has defined attributes for setting various parts of the XML config. You can't simply set arbitrary attributes and expect it to work - you'll need to define how it is exposed in the LibvirtConfigGuest object (or one of the related classes that it uses) and then impl the code to generate the XML dom from that attribute. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] How to set vcpupin in guest XML?
On Wed, Jul 24, 2013 at 04:57:07PM +0800, Peeyush Gupta wrote: Hi Daniel, Thanks for your suggestion. I made some changes in config and it works fine. One more thing I wanted to ask is I want to add an attribute to xml. But I am not able to figure out how exactly libvirt is defining xml. I understand that config can only add the attributes that are defined in the xml. But how do I add a new attribute? Presumably when you say libvirt here, you mean the libvirt library itself, rather than the Nova libvirt driver. If you want libvirt to understand new attributes, then you need to write a patch for libvirt that updates its XML parsers / generator, updates its RNG schema, the schema docs, and finally the code to convert from XML to QEMU command line arguments (or equivalent for non-QEMU based virt drivers in libvirt). If you need help in adding features to core libvirt it is best to ask on the main libvirt mailing lists Regards, Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] How to set vcpupin in guest XML?
Yeah, I actually meant libvirt library only. Looks like I have got a lot of work to do! Thanks again, for your time. ~Peeyush Gupta From: Daniel P. Berrange berra...@redhat.com To: Peeyush Gupta gpeey...@ymail.com Cc: openstack@lists.launchpad.net openstack@lists.launchpad.net Sent: Wednesday, 24 July 2013 2:43 PM Subject: Re: [Openstack] How to set vcpupin in guest XML? On Wed, Jul 24, 2013 at 04:57:07PM +0800, Peeyush Gupta wrote: Hi Daniel, Thanks for your suggestion. I made some changes in config and it works fine. One more thing I wanted to ask is I want to add an attribute to xml. But I am not able to figure out how exactly libvirt is defining xml. I understand that config can only add the attributes that are defined in the xml. But how do I add a new attribute? Presumably when you say libvirt here, you mean the libvirt library itself, rather than the Nova libvirt driver. If you want libvirt to understand new attributes, then you need to write a patch for libvirt that updates its XML parsers / generator, updates its RNG schema, the schema docs, and finally the code to convert from XML to QEMU command line arguments (or equivalent for non-QEMU based virt drivers in libvirt). If you need help in adding features to core libvirt it is best to ask on the main libvirt mailing lists Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] How to set vcpupin in guest XML?
On Tue, Jul 23, 2013 at 05:31:25PM +0800, Peeyush Gupta wrote: Hi all, I am working with openstack and I want to pin vcpus to pcpus in guest xml. Now, the pinning operation can be done using virsh vcpupin guestname vcpu pcpu But I want to do it using python API. I investigated the openstack code and found out that get_guest_config function in libvirt/driver.py is responsible for generation of guest XML file. Now, I tried to put vcpupin attribute here by guest.vcpupin or guest.cputune_vcpupin but none of them is working. Any idea what am I doing wrong? Or is this functionality not available with openstack? The get_guest_config() function returns an instance of the nova.virt.libvirt.config.LibvirtConfigGuest object. That class has defined attributes for setting various parts of the XML config. You can't simply set arbitrary attributes and expect it to work - you'll need to define how it is exposed in the LibvirtConfigGuest object (or one of the related classes that it uses) and then impl the code to generate the XML dom from that attribute. Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp