Openstack API,用于查询是否有足够的资源可用于实例化图像

时间:2017-03-03 05:59:28

标签: openstack openstack-nova

我正在查看openstack的API文档以获取API,我可以使用该文档检查openstack是否有足够的资源来实例化图像。 坦率地说,API指南非常强大。 只是想知道是否有人遇到任何这样的文件,可以帮助我摆脱这种泡沫。 备选指针也很受欢迎。

谢谢

编辑: 根据Albert V的回应,我尝试了以下内容:

curl -s -H "X-Auth-Token: $OS_AUTH_TOKEN" http://localhost:8774/v2/a6bc799ca8544b3f9a6698397fac92f7/os-quota-sets/c32f25d98f974c5a89e7c19cb7292da5/detail

但我得到的输出似乎是错误的,因为目前的使用是错误的,限制也是错误的:

{"quota_set": {"injected_file_content_bytes": {"reserved": 0, "limit": 10240, "in_use": 0}, "metadata_items": {"reserved": 0, "limit": 128, "in_use": 0}, "server_group_members": {"reserved": 0, "limit": 10, "in_use": 0}, "server_groups": {"reserved": 0, "limit": 10, "in_use": 0}, "ram": {"reserved": 0, "limit": 51200, "in_use": 0}, "floating_ips": {"reserved": 0, "limit": 23, "in_use": 0}, "key_pairs": {"reserved": 0, "limit": 100, "in_use": 0}, "id": "db3cceb48ecb4f028cbd7ec48e1e7fb0", "instances": {"reserved": 0, "limit": 10, "in_use": 0}, "security_group_rules": {"reserved": 0, "limit": 20, "in_use": 0}, "injected_files": {"reserved": 0, "limit": 5, "in_use": 0}, "cores": {"reserved": 0, "limit": 20, "in_use": 0}, "fixed_ips": {"reserved": 0, "limit": -1, "in_use": 0}, "injected_file_path_bytes": {"reserved": 0, "limit": 255, "in_use": 0}, "security_groups": {"reserved": 0, "limit": 10, "in_use": 0}}}

以下是openstack仪表板中关于机器限制和使用情况摘要的屏幕截图:  Openstack Limit Summary from Dashboard

1 个答案:

答案 0 :(得分:0)

直到最近,OpenStack必须手动计算使用量。现在它提供了绝对限制"轻松检索用法。

请在以下链接中找到CLI和API方法:

https://docs.openstack.org/admin-guide/cli-set-compute-quotas.html

https://developer.openstack.org/api-ref/compute/?expanded=show-rate-and-absolute-limits-detail