Description of problem: # virsh domblkstat rhel4.7_x86_64_pv_guest /dev/xvda /dev/xvda rd_req 2069 /dev/xvda rd_bytes 37224960 /dev/xvda wr_req 1079 /dev/xvda wr_bytes 9521152 /dev/xvda errs 0 # virsh domblkstat rhel4.7_x86_64_pv_guest /dev/xvdh libvir: Xen error : this function is not supported by the hypervisor: read_bd_stats: Failed to read any block statistics error: Failed to get block stats rhel4.7_x86_64_pv_guest /dev/xvdh It should probably rather say something like device "/dev/xvdh" doesn't exist, rather than saying that the hypervisor doesn't support the function. Version-Release number of selected component (if applicable): libvirt-0.3.3-14.el5 How reproducible: Very. Steps to Reproduce: 1. Try to get domblkstats for a device that doesn't exist in the guest. 2.
Seems to be addressed by this commit: http://git.et.redhat.com/?p=libvirt.git;a=commit;h=d752194d0735c50acf75e75f40cc259fdc0ffd6c
With the 0.6.1 rebase this now gives a slightly better message: # virsh domblkstat rhel5pv /dev/xvdr error: Failed to get block stats rhel5pv /dev/xvdr error: internal error read_bd_stats: Failed to read any block statistics
the problem is still exist on RHEL5.3 machine.and 'virsh domblkstat' works for xen PV block devices,but FV fail. (kernel:2.6.18-128.1.6.el5xen;libvirt-0.6.2-1.el5) for PV: [root@dhcp-66-70-18 /]# virsh domblkstat test xvda xvda rd_req 5539 xvda rd_bytes 153436160 xvda wr_req 1289 xvda wr_bytes 9679872 xvda errs 0 for FV: [root@dhcp-66-70-18 domain]# virsh domblkstat test hda error: Failed to get block stats test hda error: internal error read_bd_stats: Frontend block device not connected
for comment #3:the bug is still exist now,need to modify. the problem is still exist on RHEL5.3 machine.and 'virsh domblkstat' works for xen PV block devices,but FV fail. (kernel:2.6.18-128.1.6.el5xen;libvirt-0.6.2-1.el5) for PV: [root@dhcp-66-70-18 /]# virsh domblkstat test xvda xvda rd_req 5539 xvda rd_bytes 153436160 xvda wr_req 1289 xvda wr_bytes 9679872 xvda errs 0 for FV: [root@dhcp-66-70-18 domain]# virsh domblkstat test hda error: Failed to get block stats test hda error: internal error read_bd_stats: Frontend block device not connected
Does the fullyvirt guest have the paravirt drivers installed ? The blockstats only work for HVM guests with PV drivers. If you are using IDE in the HVM guest, then it is expected behaviour to get an error for stats.
IMHO this bug is fixed. The original bug report was that this error message is wrong: libvir: Xen error : this function is not supported by the hypervisor: that error message has now been replaced by the real error message. So the fact that you get an error for HVM guests it not a problem - it is expected behaviour, and the message error: internal error read_bd_stats: Frontend block device not connected accurately reflects what the problem is.
[root@dhcp-66-70-18 ~]# python Python 2.4.3 (#1, Sep 17 2008, 16:07:08) [GCC 4.1.2 20071124 (Red Hat 4.1.2-41)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import libvirt >>> conn=libvirt.open(None) >>> dir(conn) ['__del__', '__doc__', '__init__', '__module__', '_o', 'close', 'createLinux', 'createXML', 'defineXML', 'dispatchDomainEventCallbacks', 'domainEventDeregister', 'domainEventRegister', 'findStoragePoolSources', 'getCapabilities', 'getCellsFreeMemory', 'getFreeMemory', 'getHostname', 'getInfo', 'getMaxVcpus', 'getType', 'getURI', 'listDefinedDomains', 'listDefinedNetworks', 'listDefinedStoragePools', 'listDevices', 'listDomainsID', 'listNetworks', 'listStoragePools', 'lookupByID', 'lookupByName', 'lookupByUUID', 'lookupByUUIDString', 'migrate', 'networkCreateXML', 'networkDefineXML', 'networkLookupByName', 'networkLookupByUUIDString', 'nodeDeviceLookupByName', 'numOfDefinedDomains', 'numOfDefinedNetworks', 'numOfDefinedStoragePools', 'numOfDevices', 'numOfDomains', 'numOfNetworks', 'numOfStoragePools', 'ref', 'restore', 'storagePoolCreateXML', 'storagePoolDefineXML', 'storagePoolLookupByName', 'storagePoolLookupByUUID', 'storagePoolLookupByUUIDString', 'storageVolLookupByKey', 'storageVolLookupByPath', 'virConnGetLastError', 'virConnResetLastError'] >>> dom=conn.lookupByName("winxp") >>> dir(dom) ['ID', 'OSType', 'UUID', 'UUIDString', 'XMLDesc', '__del__', '__doc__', '__init__', '__module__', '_conn', '_o', 'attachDevice', 'autostart', 'blockPeek', 'blockStats', 'connect', 'coreDump', 'create', 'destroy', 'detachDevice', 'info', 'interfaceStats', 'maxMemory', 'maxVcpus', 'memoryPeek', 'migrate', 'name', 'pinVcpu', 'reboot', 'ref', 'resume', 'save', 'schedulerParameters', 'schedulerType', 'setAutostart', 'setMaxMemory', 'setMemory', 'setSchedulerParameters', 'setVcpus', 'shutdown', 'suspend', 'undefine', 'vcpus'] >>> xml=dom.XMLDesc(0) >>> import libxml2 >>> doc = libxml2.parseDoc(xml) >>> ctx = doc.xpathNewContext() >>> devs = ctx.xpathEval("/domain/devices/interface/target/@dev") >>> path = devs[0].content >>> ifstats = dom.interfaceStats(path) >>> print ifstats (0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L) >>> devs = ctx.xpathEval("/domain/devices/disk/target/@dev") >>> path = devs[0].content >>> blkstats = dom.blockStats(path) libvir: Linux Stats error : internal error read_bd_stats: Frontend block device not connected >>> print blkstats None [root@dhcp-66-70-18 ~]# uname -a Linux dhcp-66-70-18.nay.redhat.com 2.6.18-153.el5xen #1 SMP Wed Jun 10 18:12:08 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux [root@dhcp-66-70-18 ~]# rpm -qa|grep libvirt libvirt-cim-0.5.5-2.el5 libvirt-devel-0.6.3-10.el5 libvirt-0.6.3-10.el5 libvirt-debuginfo-0.6.3-10.el5 libvirt-python-0.6.3-10.el5
Please stop putting this bug back to ASSIGNED. Getting the error message: libvir: Linux Stats error : internal error read_bd_stats: Frontend block device not connected is the *CORRECT* expected behaviour for HVM guests where there are no PV drivers installed. This bug report is about a completely different problem, namely the error message given back, when the user requests a device name that does not exist for the guest. eg if the guest has /dev/xvda and the user asks for /dev/xvdz instead. Previously such a scenario would give back "libvir: Xen error : this function is not supported by the hypervisor:" now it gives the correct error message: # virsh domblkstat rhel5pv /dev/xvdz error: Failed to get block stats rhel5pv /dev/xvdz error: internal error read_bd_stats: Failed to read any block statistics
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHEA-2009-1269.html
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days