mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-9929: Do not gather statistics for CDROM or FLOPPY devices
Libvirt / Qemu (KVM) does not collect statistics about these either. On some systems it might even yield a 'internal error' from libvirt when attempting to gather block statistics from such devices. For example Ubuntu 16.04 (Xenial) has a issue with this. Skip them when looping through all devices. Signed-off-by: Wido den Hollander <wido@widodh.nl>
This commit is contained in:
parent
a97d2505c8
commit
ca415e7436
|
|
@ -3095,6 +3095,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
|||
long bytes_rd = 0;
|
||||
long bytes_wr = 0;
|
||||
for (final DiskDef disk : disks) {
|
||||
if (disk.getDeviceType() == DeviceType.CDROM || disk.getDeviceType() == DeviceType.FLOPPY) {
|
||||
continue;
|
||||
}
|
||||
final DomainBlockStats blockStats = dm.blockStats(disk.getDiskLabel());
|
||||
io_rd += blockStats.rd_req;
|
||||
io_wr += blockStats.wr_req;
|
||||
|
|
|
|||
Loading…
Reference in New Issue