我想监控openstack项目的配额级别使用情况,我需要能够监控网络,端口和路由器的当前和最高级别(来自Python代码)。
请注意,我正在谈论项目级访问,因此执行监控的用户不是开放式堆栈管理员。
我能够成功读取nova指标(计算)的当前水平和最高水平,但对于与中子(网络)相关的水平,似乎API和命令行仅返回最大限制而不是当前水平。
很容易自己测试一下:
>openstack limits show --absolute
| totalFloatingIpsUsed | 0 | # broken, real value not 0
| maxTotalFloatingIps | 300 | # correct
...
# no network related limits reported at all
>openstack quota show
| floating-ips | 300 |
| networks | 200 |
| ports | 425 |
| routers | 200 |
| subnets | 200 |
...
# These are the MAX limits, not the current usage levels.
>nova limits
| Name | Used | Max |
+--------------------+-------+--------+
| Cores | 14 | 150 | # correct
| FloatingIps | 0 | 300 | # broken, real value is not 0
| Instances | 3 | 200 | # correct
| Keypairs | - | 100 | # broken, real value is not 0
| RAM | 28672 | 307200 | # correct
# As you c
>neutron quota-list
User does not have admin privileges: Only admin can view or configure quota
我应该提到Web界面(地平线)已经正确报告了浮动IP。它似乎没有显示网络的任何仪表。
解决方案应该适用于openstack kilo
(7)版本或更新版本。