在 Libvirt 中添加磁盘容量、分配和使用情况指标实现¶
https://blueprints.launchpad.net/ceilometer/+spec/disk-info-meters
问题描述¶
目前,Libvirt Inspector 并不收集磁盘容量、使用情况和分配指标。可以为 Libvirt 添加此功能以监控磁盘指标:容量、使用情况和分配。这将有助于管理磁盘资源,以便使用相同的物理磁盘添加虚拟机。
提议的变更¶
在 Libvirt 的 Inspector 中实现方法 ‘inspect_disk_info’。此方法将返回每个设备的磁盘容量、使用情况和分配情况。这些值对应于 Libvirt 的 domblkinfo 命令监控的值。
添加 CapacityPollster,用于创建样本
name=’disk.capacity’
type=sample.TYPE_GAUGE
unit=’B’
添加 PerDeviceCapacityPollster,用于创建样本
name=’disk.device.capacity’
type=sample.TYPE_GAUGE
unit=’B’
添加 AllocationPollster,用于创建样本
name=’disk.allocation’
type=sample.TYPE_GAUGE
unit=’B’
添加 PerDeviceAllocationPollster,用于创建样本
name=’disk.device.allocation’
type=sample.TYPE_GAUGE
unit=’B’
添加 PhysicalPollster,用于创建样本
name=’disk.usage’
type=sample.TYPE_GAUGE
unit=’B’
添加 PerDevicePhysicalPollster,用于创建样本
name=’disk.device.usage’
type=sample.TYPE_GAUGE
unit=’B’
替代方案¶
无
数据模型影响¶
无
REST API 影响¶
无
安全影响¶
无
Pipeline 影响¶
无
其他最终用户影响¶
无
性能/可扩展性影响¶
无
其他部署影响¶
在 pipeline.yaml 中,如果用户在 meters_sink 中没有 *,则需要添加新的指标 disk.capacity、disk.allocation、disk.usage、disk.device.capacity、disk.device.usage 和 disk.device.allocation
开发者影响¶
无
实现¶
负责人¶
- 主要负责人
ahmed-nooras-saba
工作项¶
添加 _DiskInfoPollsterBase 基类,用于读取值并对所有设备进行聚合
添加 CapacityPollster、AllocationPollster、PhysicalPollster,用于实例级别的磁盘指标
添加 PerDeviceCapacityPollster、PerDeviceAllocationPollster 和 PerDevicePhysicalPollster,用于实例的设备级别的磁盘指标
将 inspect_disk_info 添加到 Libvirt inspectors
在 measurements.rst 中添加新的指标定义
未来生命周期¶
此功能需要在接下来的两个版本中进行测试。
依赖项¶
libvirt 0.8.1 及以上版本。
测试¶
需要单元测试来测试 Libvirt 中的所有新的 pollsters。当列出 ceilometer 指标时,应该可以发现新的指标。例如:ceilometer meter-list
文档影响¶
已在 ceilometer/doc/source/measurements.rst 中添加以下指标,并且需要更新 https://docs.openstack.org/developer/ceilometer/measurements.html 的“measurement section”。
disk.capacity |
g |
B |
实例 ID |
n |
1 |
磁盘容量,单位为 B |
disk.allocation |
g |
B |
实例 ID |
n |
1 |
磁盘分配,单位为 B |
disk.usage |
g |
B |
实例 ID |
n |
1 |
磁盘使用情况,单位为 B |
disk.device.capacity |
g |
B |
磁盘 ID |
n |
1 |
每个磁盘设备的容量,单位为 B |
disk.device.allocation |
g |
B |
磁盘 ID |
n |
1 |
每个磁盘设备的分配,单位为 B |
disk.device.usage |
g |
B |
磁盘 ID |
n |
1 |
每个磁盘设备的使用情况,单位为 B |