![使用oVirt收集磁盘使用情况的统计信息](https://linux22.com/image/127157/%E4%BD%BF%E7%94%A8oVirt%E6%94%B6%E9%9B%86%E7%A3%81%E7%9B%98%E4%BD%BF%E7%94%A8%E6%83%85%E5%86%B5%E7%9A%84%E7%BB%9F%E8%AE%A1%E4%BF%A1%E6%81%AF.png)
我使用 REST-API 通过 oVirt REST API 收集虚拟磁盘的统计信息,并得到以下响应,
https://1.1.1.1/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996/statistics/
对此的回应应用程序编程接口,
{
"statistic": [{
"kind": "gauge",
"type": "decimal",
"unit": "bytes_per_second",
"values": {
"value": [{
"datum": 0
}]
},
"disk": {
"href": "/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996",
"id": "b14da816-37e3-46d7-8617-2e42e52db996"
},
"name": "data.current.read",
"description": "Read data rate",
"href": "/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996/statistics/33b9212b-f9cb-3fd0-b364-248fb61e1272",
"id": "33b9212b-f9cb-3fd0-b364-248fb61e1272"
}, {
"kind": "gauge",
"type": "decimal",
"unit": "bytes_per_second",
"values": {
"value": [{
"datum": 0
}]
},
"disk": {
"href": "/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996",
"id": "b14da816-37e3-46d7-8617-2e42e52db996"
},
"name": "data.current.write",
"description": "Write data rate",
"href": "/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996/statistics/2f23addd-4ebd-3d82-a449-c28778bc33eb",
"id": "2f23addd-4ebd-3d82-a449-c28778bc33eb"
}, {
"kind": "gauge",
"type": "decimal",
"unit": "seconds",
"values": {
"value": [{
"datum": 0
}]
},
"disk": {
"href": "/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996",
"id": "b14da816-37e3-46d7-8617-2e42e52db996"
},
"name": "disk.read.latency",
"description": "Read latency",
"href": "/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996/statistics/3a7b3f72-d035-3bb9-b196-e86a4eb34993",
"id": "3a7b3f72-d035-3bb9-b196-e86a4eb34993"
}, {
"kind": "gauge",
"type": "decimal",
"unit": "seconds",
"values": {
"value": [{
"datum": 0
}]
},
"disk": {
"href": "/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996",
"id": "b14da816-37e3-46d7-8617-2e42e52db996"
},
"name": "disk.write.latency",
"description": "Write latency",
"href": "/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996/statistics/b1e75c7b-cea4-37d2-8459-f7d68efc69a3",
"id": "b1e75c7b-cea4-37d2-8459-f7d68efc69a3"
}, {
"kind": "gauge",
"type": "decimal",
"unit": "seconds",
"values": {
"value": [{
"datum": 0
}]
},
"disk": {
"href": "/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996",
"id": "b14da816-37e3-46d7-8617-2e42e52db996"
},
"name": "disk.flush.latency",
"description": "Flush latency",
"href": "/ovirt-engine/api/disks/b14da816-37e3-46d7-8617-2e42e52db996/statistics/9c17ad7b-9ef1-3e8d-ad0a-ff8bee3925f0",
"id": "9c17ad7b-9ef1-3e8d-ad0a-ff8bee3925f0"
}]
}
所以根据我的理解,它能够检索 5 个统计数据(IE) 读取和写入带宽、读取、写入和刷新延迟。
我的问题是,是否有可能获得读/写IOPS虚拟磁盘/VM?
谢谢,
哈利
答案1
https://bugzilla.redhat.com/show_bug.cgi?id=876697似乎回答了这个问题。它指出,对于 ovirt-engine-metrics 版本 3.0.7:
来自 virt 插件指标的每个虚拟机每个磁盘的collectd 指标对于此 RFE 来说已经足够了。
collectd.virt.disk_ops.readcollectd.virt.disk_ops.write
这些指标应允许用户快速/轻松地识别使用本 RFE 中要求的高 I/O 的虚拟机。
磁盘名称保存为collectd.type_instance。 VM 名称保存为collectd.plugin_instance。
至于能够聚合每个虚拟机的存储 IOPS,在这个阶段是不可能的,因为磁盘名称不是驱动器名称 - 这是 libvirt 猜测的,因此它不能跨虚拟机聚合。用户可以登录虚拟机以检查驱动器名称。
和
聚合部分将在单独的BZ中解决。在 ovirt-engine-metrics-1.1.3.3-1.el7ev.noarch 中验证