Bug 846265 - virsh blkdeviotune fail
virsh blkdeviotune fail
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
Unspecified Unspecified
medium Severity high
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-07 05:46 EDT by yanbing du
Modified: 2013-02-21 02:21 EST (History)
8 users (show)

See Also:
Fixed In Version: libvirt-0.10.0-0rc1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:21:18 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
libvirtd log (37.26 KB, text/x-log)
2012-08-07 05:52 EDT, yanbing du
no flags Details

  None (edit)
Description yanbing du 2012-08-07 05:46:50 EDT
Description of problem:
Virsh command blkdeviotune fail with error: internal error cannot read total_bytes_sec

Version-Release number of selected component (if applicable):
libvirt-0.10.0-0rc0.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.298.el6_3.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start a guest("ga")
# virsh domblklist ga
Target     Source
------------------------------------------------
hda        /var/lib/libvirt/images/ga.s3

2. 
# virsh blkdeviotune ga hda
error: Unable to get block I/O throttle parameters
error: internal error cannot read total_bytes_sec

3.Destroy the guest and check the blkdeviotune again
# virsh blkdeviotune ga hda
total_bytes_sec: 0
read_bytes_sec : 0
write_bytes_sec: 0
total_iops_sec : 0
read_iops_sec  : 0
write_iops_sec : 0

  
Actual results:
virsh blkdeviotune fail.

Expected results:
virsh blkdeviotune can query disk I/O parameters.

Additional info:
libvirtd.log can get these qemuMonitor log
012-08-07 09:30:40.528+0000: 1245: debug : qemuMonitorIOProcess:369 : QEMU_MONITOR_IO_PROCESS: mon=0x7f68e0000d60 buf={"id": "libvirt-3", "error": {"class": "CommandNotFound", "desc": "The command query-events has not been found", "data": {"name": "query-events"}}}
2012-08-07 09:30:40.528+0000: 1245: debug : qemuMonitorJSONIOProcessLine:146 : Line [{"id": "libvirt-3", "error": {"class": "CommandNotFound", "desc": "The command query-events has not been found", "data": {"name": "query-events"}}}]
2012-08-07 09:30:40.528+0000: 1245: debug : qemuMonitorJSONIOProcessLine:166 : QEMU_MONITOR_RECV_REPLY: mon=0x7f68e0000d60 reply={"id": "libvirt-3", "error": {"class": "CommandNotFound", "desc": "The command query-events has not been found", "data": {"name": "query-events"}}}
Comment 1 yanbing du 2012-08-07 05:52:01 EDT
Created attachment 602706 [details]
libvirtd log
Comment 3 Peter Krempa 2012-08-08 08:47:42 EDT
Virsh blkdeviotune fails as the qemu hypervisor in rhel doesn't return all the statistic information required for blkdeviotune to work in the response of a "query-block" command.

The RHEL version of qemu-kvm returns:
{ "return":
    [
        {
            "io-status": "ok",
            "device": "drive-ide0-0-0",
            "locked": false,
            "removable": false,
            "inserted": {
                          "ro": false,
                          "drv": "raw",
                          "encrypted": false,
                          "file": "/tmp/ipxe.hd"
                        },
            "type": "unknown"
        }
    ],
  "id": "libvirt-7"
}

when upstream version of qemu returns:
{ "return":
    [
        {
            "io-status": "ok",
            "device": "drive-ide0-0-0",
            "locked": false, "removable": false,
            "inserted": {
                          "iops_rd": 0,
                          "iops_wr": 0,
                          "ro": false,
                          "drv": "raw",
                          "iops": 0,
                          "bps_wr": 0,
                          "encrypted": false,
                          "bps": 0,
                          "bps_rd": 0,
                          "file": "/tmp/ipxe.hd"
                        },
            "type": "unknown"
        }
    ],
  "id": "libvirt-9"
}
and the command works as expected.
Comment 5 Peter Krempa 2012-08-11 04:17:32 EDT
qemu supports tuning and reporting the IO related variables in version 1.1 (not present in RHEL6) and newer. I changed the error message to be more specific about this issue with upstream commits:

commit e9a24e3e3d480ea155fb93f62b5ed9d1590fcd08
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Aug 9 15:12:12 2012 +0200

    virterror: Add error message for unsupported operations.
    
    This patch introduces a new error code VIR_ERR_OPERATION_UNSUPPORTED to
    mark error messages regarding operations that failed due to lack of
    support on the hypervisor or other than libvirt issues.
    
    The code is first used in reporting error if qemu does not support block
    IO tuning variables yielding error message:
    error: Unable to get block I/O throttle parameters
    error: Operation not supported: block_io_throttle field
    'total_bytes_sec' missing in qemu's output
    
    instead of:
    error: Unable to get block I/O throttle parameters
    error: internal error cannot read total_bytes_sec

and:

commit aba9abc5b75c2558d8ec6d787c8a1b2148cd14ca
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Aug 9 09:58:05 2012 +0200

    qemu: Refactor parsing of block device IO tuning parameters.
    
    This patch refactors the JSON parsing function that extracts the block
    IO tuning parameters from qemu's output. The most impacting change
    concerns the error message that is returned if the reply from qemu does
    not contain the needed data. The data for IO parameter tuning were added
    in qemu 1.1 and the previous error message was confusing.
    
    This patch also breaks long lines and extracts a multiple time used code
    pattern to a macro.

The new error message now should read:
error: Unable to get block I/O throttle parameters
error: Operation not supported: block_io_throttle field 'total_bytes_sec' missing in qemu's output

I'm moving this bug to POST as this change will be backported in a rebase.
Comment 8 yuping zhang 2012-08-24 03:03:10 EDT
Verified this issue with libvirt-0.10.0-0rc1.el6.x86_64.
# virsh blkdeviotune fedora hda
error: Unable to get block I/O throttle parameters
error: Operation not supported: block_io_throttle field 'total_bytes_sec' missing in qemu's output

So change the bug status to VERIFIED.
Comment 9 errata-xmlrpc 2013-02-21 02:21:18 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0276.html

Note You need to log in before you can comment on or make changes to this bug.