[libvirt-users] Getting libvirt Error when setting IO tune read_bytes_sec value using libvirt API virDomainSetBlockIotune

Hi All, I am setting the value for "read_bytes_sec" using the following API code virDomainSetBlockIoTune(dom, "/mnt/tmpsdb/FileVM1", parainfoPtr, nparams, 2); I am succesfully able to set this value and i can read it back using the API virDomainGetBlockIoTune(dom,"/mnt/tmpsdb/FileVM1",parainfoPtr,&nparams,2); But after setting this value when i shutdown my VM and start it again I am getting following error - ibvirtError: internal error Process exited while reading console log output: qemu-system-x86_64: -drive file=/mnt/tmpsdb/FileVM1,if=none,id=drive-ide0-1-1,format=raw,bps_rd=1048576: Invalid parameter 'bps_rd' Note - when i see dumpxml of the VM following lines are got added after setting the iotunes for read_bytes_sec <iotune> <read_bytes_sec>1048576</read_bytes_sec> </iotune> Please help me. Also i wanted to know whether we can set block IO tune for a VM using the above API. Is it same as the IO throttling provided by cgroup?

On 09.05.2013 14:02, vikrant verma wrote:
Hi All,
I am setting the value for "read_bytes_sec" using the following API code
virDomainSetBlockIoTune(dom, "/mnt/tmpsdb/FileVM1", parainfoPtr, nparams, 2);
I am succesfully able to set this value and i can read it back using the API
virDomainGetBlockIoTune(dom,"/mnt/tmpsdb/FileVM1",parainfoPtr,&nparams,2);
But after setting this value when i shutdown my VM and start it again I am getting following error -
ibvirtError: internal error Process exited while reading console log output: qemu-system-x86_64: -drive file=/mnt/tmpsdb/FileVM1,if=none,id=drive-ide0-1-1,format=raw,bps_rd=1048576: Invalid parameter 'bps_rd'
Interesting. What's the qemu version? bps_rs has been introduced in qemu-1.1 IIRC.
Note - when i see dumpxml of the VM following lines are got added after setting the iotunes for read_bytes_sec
<iotune> <read_bytes_sec>1048576</read_bytes_sec> </iotune>
Yep, that's correct. If you don't need this setting anymore, just delete it (e.g. by using virsh edit) and you should be able to start the domain up again.
Please help me. Also i wanted to know whether we can set block IO tune for a VM using the above API. Is it same as the IO throttling provided by cgroup?
Michal

Hi Michal, Thanks for the reply. But i want to keep this setting, my intention is to set IO throttling (IO tunning) over the block storage which is attached to the VM. As per my understanding there are 2 ways to do it. 1. Using Cgroup - we can put the IO throttling on the device using cgroup command (this i have tried and it is working) 2. Using Libvirt API virDomainSetBlockIoTune() - But i am not able to achieve the IO throttling using it, please suggest how to do it. Please let me know how to do it using Libvirt. Regards, Vikrant On Thu, May 9, 2013 at 5:42 PM, Michal Privoznik <mprivozn@redhat.com>wrote:
On 09.05.2013 14:02, vikrant verma wrote:
Hi All,
I am setting the value for "read_bytes_sec" using the following API code
virDomainSetBlockIoTune(dom, "/mnt/tmpsdb/FileVM1", parainfoPtr, nparams, 2);
I am succesfully able to set this value and i can read it back using the API
virDomainGetBlockIoTune(dom,"/mnt/tmpsdb/FileVM1",parainfoPtr,&nparams,2);
But after setting this value when i shutdown my VM and start it again I am getting following error -
ibvirtError: internal error Process exited while reading console log output: qemu-system-x86_64: -drive
file=/mnt/tmpsdb/FileVM1,if=none,id=drive-ide0-1-1,format=raw,bps_rd=1048576:
Invalid parameter 'bps_rd'
Interesting. What's the qemu version? bps_rs has been introduced in qemu-1.1 IIRC.
Note - when i see dumpxml of the VM following lines are got added after setting the iotunes for read_bytes_sec
<iotune> <read_bytes_sec>1048576</read_bytes_sec> </iotune>
Yep, that's correct. If you don't need this setting anymore, just delete it (e.g. by using virsh edit) and you should be able to start the domain up again.
Please help me. Also i wanted to know whether we can set block IO tune for a VM using the above API. Is it same as the IO throttling provided by cgroup?
Michal

Hi Michal, I am using qemu version 1.0 (qemu-kvm-1.0) i guess this is the problem, should i have to upgrade the qemu version inorder to get the things work? Regards, Vikrant On Thu, May 9, 2013 at 5:54 PM, vikrant verma <vikrantverma99@gmail.com>wrote:
Hi Michal,
Thanks for the reply.
But i want to keep this setting, my intention is to set IO throttling (IO tunning) over the block storage which is attached to the VM.
As per my understanding there are 2 ways to do it.
1. Using Cgroup - we can put the IO throttling on the device using cgroup command (this i have tried and it is working)
2. Using Libvirt API virDomainSetBlockIoTune() - But i am not able to achieve the IO throttling using it, please suggest how to do it.
Please let me know how to do it using Libvirt.
Regards, Vikrant
On Thu, May 9, 2013 at 5:42 PM, Michal Privoznik <mprivozn@redhat.com>wrote:
Hi All,
I am setting the value for "read_bytes_sec" using the following API code
virDomainSetBlockIoTune(dom, "/mnt/tmpsdb/FileVM1", parainfoPtr, nparams, 2);
I am succesfully able to set this value and i can read it back using
On 09.05.2013 14:02, vikrant verma wrote: the API
virDomainGetBlockIoTune(dom,"/mnt/tmpsdb/FileVM1",parainfoPtr,&nparams,2);
But after setting this value when i shutdown my VM and start it again I am getting following error -
ibvirtError: internal error Process exited while reading console log output: qemu-system-x86_64: -drive
file=/mnt/tmpsdb/FileVM1,if=none,id=drive-ide0-1-1,format=raw,bps_rd=1048576:
Invalid parameter 'bps_rd'
Interesting. What's the qemu version? bps_rs has been introduced in qemu-1.1 IIRC.
Note - when i see dumpxml of the VM following lines are got added after setting the iotunes for read_bytes_sec
<iotune> <read_bytes_sec>1048576</read_bytes_sec> </iotune>
Yep, that's correct. If you don't need this setting anymore, just delete it (e.g. by using virsh edit) and you should be able to start the domain up again.
Please help me. Also i wanted to know whether we can set block IO tune for a VM using the above API. Is it same as the IO throttling provided by cgroup?
Michal

On 09.05.2013 14:31, vikrant verma wrote:
Hi Michal,
I am using qemu version 1.0 (qemu-kvm-1.0) i guess this is the problem, should i have to upgrade the qemu version inorder to get the things work?
Regards, Vikrant
Yeah, you are trying to use functionality introduced in later releases. So either you will rue the feature or upgrade. Michal

Hi, When i am trying to upgrade qemu-kvm (using apt-get ) it says i already have the newest version. So i downloaded the source package of qemu (qemu-1.4.1.tar.bz2) and installed it. Now i am in a big mess - When i run VirtManager it says "no hypervisor options were found for this connection" Please help. Regards, Vikrant On Thu, May 9, 2013 at 6:12 PM, Michal Privoznik <mprivozn@redhat.com>wrote:
On 09.05.2013 14:31, vikrant verma wrote:
Hi Michal,
I am using qemu version 1.0 (qemu-kvm-1.0) i guess this is the problem, should i have to upgrade the qemu version inorder to get the things work?
Regards, Vikrant
Yeah, you are trying to use functionality introduced in later releases. So either you will rue the feature or upgrade.
Michal

On 05/10/2013 01:40 AM, vikrant verma wrote:
Hi,
[please don't top-post on technical lists]
When i am trying to upgrade qemu-kvm (using apt-get ) it says i already have the newest version.
So i downloaded the source package of qemu (qemu-1.4.1.tar.bz2) and installed it.
Now i am in a big mess - When i run VirtManager it says "no hypervisor options were found for this connection"
What does 'virsh --version=long' say on the pre-built binary vs. your self-built binary? I'm guessing that your self-built binary was lacking needed libraries, and thus didn't compile in support for the URI you are trying to connect to. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

virsh version command output - prebuilt binary - Compiled against library : libvir 0.9.8 Using library: libvir 0.9.8 Using API: QEMU 0.9.8 Running hypervisor :QEMU 1.0.0 Self built binary - i have reverted back to prebuilt binary as Self built was notworking so not able to take version. but my problem still remain intact. On Fri, May 10, 2013 at 8:16 PM, Eric Blake <eblake@redhat.com> wrote:
On 05/10/2013 01:40 AM, vikrant verma wrote:
Hi,
[please don't top-post on technical lists]
When i am trying to upgrade qemu-kvm (using apt-get ) it says i already have the newest version.
So i downloaded the source package of qemu (qemu-1.4.1.tar.bz2) and installed it.
Now i am in a big mess - When i run VirtManager it says "no hypervisor options were found for this connection"
What does 'virsh --version=long' say on the pre-built binary vs. your self-built binary? I'm guessing that your self-built binary was lacking needed libraries, and thus didn't compile in support for the URI you are trying to connect to.
-- Eric Blake eblake redhat com +1-919-301-3266<http://mail.google.com/_/mail-static/_/js/main/m_i,t/rt=h/ver=sdyxg0e7dVw.en./sv=1/am=!acwEPCeEADn1BMmS2-yDY5HyoNpqL1gqGCGYEYnCe4eo0LgLYS3U6qeJL7uNSoJKzCZ4WB4W/d=1#> Libvirt virtualization library http://libvirt.org

Hello All, Can anybody send me the dumpxml of a VM which is having IO tunes value set (for read_bytes_sec, or iops anything would be fine). I wanted to see the format how working <iotunes> parameter. Regards, Vikrant On Mon, May 13, 2013 at 11:37 AM, vikrant verma <vikrantverma99@gmail.com>wrote:
virsh version command output -
prebuilt binary - Compiled against library : libvir 0.9.8 Using library: libvir 0.9.8 Using API: QEMU 0.9.8 Running hypervisor :QEMU 1.0.0
Self built binary - i have reverted back to prebuilt binary as Self built was notworking so not able to take version.
but my problem still remain intact.
On Fri, May 10, 2013 at 8:16 PM, Eric Blake <eblake@redhat.com> wrote:
On 05/10/2013 01:40 AM, vikrant verma wrote:
Hi,
[please don't top-post on technical lists]
When i am trying to upgrade qemu-kvm (using apt-get ) it says i already have the newest version.
So i downloaded the source package of qemu (qemu-1.4.1.tar.bz2) and installed it.
Now i am in a big mess - When i run VirtManager it says "no hypervisor options were found for this connection"
What does 'virsh --version=long' say on the pre-built binary vs. your self-built binary? I'm guessing that your self-built binary was lacking needed libraries, and thus didn't compile in support for the URI you are trying to connect to.
-- Eric Blake eblake redhat com +1-919-301-3266<http://mail.google.com/_/mail-static/_/js/main/m_i,t/rt=h/ver=sdyxg0e7dVw.en./sv=1/am=!acwEPCeEADn1BMmS2-yDY5HyoNpqL1gqGCGYEYnCe4eo0LgLYS3U6qeJL7uNSoJKzCZ4WB4W/d=1#><http://mail.google.com/_/mail-static/_/js/main/m_i,t/rt=h/ver=sdyxg0e7dVw.en./sv=1/am=!acwEPCeEADn1BMmS2-yDY5HyoNpqL1gqGCGYEYnCe4eo0LgLYS3U6qeJL7uNSoJKzCZ4WB4W/d=1#>
Libvirt virtualization library http://libvirt.org

On 05/13/2013 12:07 AM, vikrant verma wrote: [Please don't top-post on technical lists; I'm reordering your message]
What does 'virsh --version=long' say on the pre-built binary vs. your self-built binary? I'm guessing that your self-built binary was lacking needed libraries, and thus didn't compile in support for the URI you are trying to connect to.
virsh version command output -
'virsh version' is not what I asked for. I want to see 'virsh --version=long'.
Self built binary - i have reverted back to prebuilt binary as Self built was notworking so not able to take version.
I suspect that your self-built version was missing some options compared to the pre-built version. For reference, this is what I see for the pre-built version shipped in Fedora: $ virsh --version=long Virsh command line tool of libvirt 1.0.5 See web site at http://libvirt.org/ Compiled with support for: Hypervisors: QEMU/KVM LXC UML Xen LibXL OpenVZ VMWare PHYP VirtualBox ESX Hyper-V Test Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Miscellaneous: Daemon Nodedev SELinux Secrets Debug DTrace Readline Modular Any entries listed here but not in your self-built version are evidence of a build pre-requisite that you missed (not necessarily fatal, if you weren't trying to use all the features, but certainly something to investigate). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Hello All, The problem got solved after adding the repo apt-add-repository ppa:dnjl/virtualization this provides newer version of qemu, with which i am able to get the desired result thanks to all regards, vikrant On Mon, May 13, 2013 at 9:24 PM, Eric Blake <eblake@redhat.com> wrote:
On 05/13/2013 12:07 AM, vikrant verma wrote: [Please don't top-post on technical lists; I'm reordering your message]
What does 'virsh --version=long' say on the pre-built binary vs. your self-built binary? I'm guessing that your self-built binary was lacking needed libraries, and thus didn't compile in support for the URI you are trying to connect to.
virsh version command output -
'virsh version' is not what I asked for. I want to see 'virsh --version=long'.
Self built binary - i have reverted back to prebuilt binary as Self built was notworking so not able to take version.
I suspect that your self-built version was missing some options compared to the pre-built version. For reference, this is what I see for the pre-built version shipped in Fedora:
$ virsh --version=long Virsh command line tool of libvirt 1.0.5 See web site at http://libvirt.org/
Compiled with support for: Hypervisors: QEMU/KVM LXC UML Xen LibXL OpenVZ VMWare PHYP VirtualBox ESX Hyper-V Test Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Miscellaneous: Daemon Nodedev SELinux Secrets Debug DTrace Readline Modular
Any entries listed here but not in your self-built version are evidence of a build pre-requisite that you missed (not necessarily fatal, if you weren't trying to use all the features, but certainly something to investigate).
-- Eric Blake eblake redhat com +1-919-301-3266<http://mail.google.com/_/mail-static/_/js/main/m_i,t/rt=h/ver=hFavn5G6bbw.en./sv=1/am=!DKoIPAxlBX31BMmS2-yDASlZSztmix9YTW0ZVSXvTE_6r7dCc9DHgC98JfpRBaSxkDZikN6-/d=1#> Libvirt virtualization library http://libvirt.org
participants (3)
-
Eric Blake
-
Michal Privoznik
-
vikrant verma