Neutron API中大多的resource都需要quota limits。

Neutron API暴露出一个extension 来管理quota,Quota limits are enforced at the API layer,

Plugin and ML2 drivers唯一例外是subnet_allocation[1] extension。

不支持per user and 多租户嵌套。

High Level View

主要组件:

  • The Quota API extension;
  • The Quota Engine.

quota driver:

  • neutron.db.quota.driver.DbQuotaDriver
  • neutron.quota.ConfDriver

The latter driver is however deprecated.

Quota Management

和其他Neutron extensions不同,它 有自己的own controller class [3].

其中_update_attributes只被调用一次,它会动态的更新Neutron’s resource attribute map [4]

driver operations包括:

  • delete_tenant_quota, which simply removes all entries from the ‘quotas’ table for a given tenant identifier;
  • update_quota_limit, which adds or updates an entry in the ‘quotas’ tenant for a given tenant identifier and a given resource name;
  • _get_quotas, which fetches limits for a set of resource and a given tenant identifier
  • _get_all_quotas, which behaves like _get_quotas, but for all tenants.

Resource Usage Info

  • CountableResource
  • TrackedResource

Quota Enforcement

  • 通过count方法得到当前资源的usages.
  • 通过 _get_tenant_quotas 得到租户的quota.
  • usages减去expired reservations .
  • 计算可用资源,与请求资源对比.

Setting up Resource Tracking for a Plugin

@resource_registry.tracked_resources(network=models_v2.Network,
port=models_v2.Port, subnet=models_v2.Subnet, subnetpool=models_v2.SubnetPool)
[1] Subnet allocation extension:http://git.openstack.org/cgit/openstack/neutron/tree/neutron/extensions/subnetallocation.py
[2] DB Quota driver class:http://git.openstack.org/cgit/openstack/neutron/tree/neutron/db/quota_db.py#n33
[3] Quota API extension controller:http://git.openstack.org/cgit/openstack/neutron/tree/neutron/extensions/quotasv2.py#n40
[4] Neutron resource attribute map:http://git.openstack.org/cgit/openstack/neutron/tree/neutron/api/v2/attributes.py#n639
[5] Base controller class:http://git.openstack.org/cgit/openstack/neutron/tree/neutron/api/v2/base.py#n50
[6] http://lists.openstack.org/pipermail/openstack-dev/2015-February/057534.html

最新文章

  1. dos学习
  2. .保护Express应用程序
  3. [ASP.NET MVC 大牛之路]02 - C#高级知识点概要(1) - 委托和事件
  4. tableview左滑按钮 tableviewcell自定义左滑按钮
  5. 分布式缓存技术memcached学习(四)—— 一致性hash算法原理
  6. Tomcat安装配置
  7. 1214 - Large Division -- LightOj(大数取余)
  8. Ajax 文件上传
  9. 初识RPC协议
  10. Asp.Net请求管道中的19个事件
  11. codeforces 439D Devu and Partitioning of the Array(有深度的模拟)
  12. hadoop的ganglia数据监控
  13. PS字体工具字体显示不出来
  14. 纯css实现slide效果
  15. Staple: Complementary Learners For Real-time Tracking Tracking
  16. Jmeter GIS调用-->参数化+正则表达式提取器+后置处理器+逻辑控制器
  17. k8s访问服务时,解析不了域名
  18. django的model操作整理
  19. webService之helloword(java)rs
  20. Java NIO系列教程(六) Selector

热门文章

  1. 在Less中使用条件判断
  2. UFLDL深度学习笔记 (三)无监督特征学习
  3. 【转】Jenkins+Ant+Jmeter接口自动化集成测试实例
  4. 修改mysql数据库存储目录
  5. pdf文件编辑
  6. 批处理--执行sql(mysql数据库)
  7. python入门课程 第3章 Python变量和数据类型
  8. Android 与H5之间的js交互
  9. Mark指针的指针(**)和链表使用(*&)
  10. 【BZOJ5020】[THUWC 2017]在美妙的数学王国中畅游 泰勒展开+LCT