Quota Management and Enforcement
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 |
Quota Management and Enforcement的更多相关文章
- neutron 的 quota design
发现, cinder, nova 制实现了, CountableResource. 只有nuetron实现了 TrackedResource 和 CountableResource. I read u ...
- Taking A Fresh Look At What Open Source API Management Architecture Is Available
http://apievangelist.com/2014/10/05/taking-a-fresh-look-at-what-open-source-api-management-architect ...
- [转] Quality Of Service In OpenStack
http://tropicaldevel.wordpress.com/2013/07/15/quality-of-service-in-openstack/ In this post I will b ...
- mmcrfs
mmcrfs command Creates a GPFS™ file system. Synopsis mmcrfs Device {"DiskDesc[;DiskDesc...]&quo ...
- 什么是Istio
本文主要是对Istio Prelim 1.0(https://preliminary.istio.io/docs/)的翻译 Istio:一种开放式平台,用于连接,管理和保护微服务. Istio提供了一 ...
- windows7命令帮助大全
有关某个命令的详细信息,请键入 HELP 命令名ASSOC 显示或修改文件扩展名关联.ATTRIB 显示或更改文件属性.BREAK 设置或清除扩展式 CTRL+C 检查.BCDEDIT 设置启动数据库 ...
- HBase 数据模型(Data Model)
HBase Data Model--HBase 数据模型(翻译) 在HBase中,数据是存储在有行有列的表格中.这是与关系型数据库重复的术语,并不是有用的类比.相反,HBase可以被认为是一个多维度的 ...
- Linux下Mongodb安装和启动配置
1.下载安装包 wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgz 下载完成后解压缩压缩包 tar zxf mongod ...
- Hadoop 之Mong DB 之CentOS 6 使用 yum 安装MongoDB及服务器端配置
安装MongoDB的方法有很多种,可以源代码安装,在Centos也可以用yum源安装的方法.由于MongoDB更新得比较快,我比较喜欢用yum源安装的方法.64位Centos下的安装步骤如下: 1.准 ...
随机推荐
- MySQL中in(常量列表)的执行计划
我们在写sql的时候,经常用到in,in后面跟一堆常量列表,如id.有人说in的效率很高,而有人说很低:有人说in能使用索引,还有人说in不能使用索引... 到底是一个怎样的情况呢?我们分析以下几种情 ...
- Sphinx初探之安装
在Centos or redhat 安装Sphinx .首先安装依赖包 $ yum install postgresql-libs unixODBC .安装软件 $ rpm -Uhv sphinx-- ...
- SpringBoot项目的云服务器部署
1.场景还原 springboot配置相当简单,人人皆知.怎么把springboot工程部署到云服务器上呢?可能有人会说,博主你前篇不是讲了java工程的云部署把:但是我想澄清一点的是,我前篇的工程都 ...
- Spring Boot - 配置信息后处理
最近在做项目的过程中,PSS提出配置文件中类似数据库连接需要的用户名.密码等敏感信息需要加密处理(之前一直是明文的). 为了快速完成任务,网上搜刮到jasypt包,也有相应的starter,使用方法可 ...
- Log4J 基本使用
Log4j由三个重要的组件 构 成:日志 信息 的优先级,日志信息的输出目的地,日志信息的输出格式. 日志信息的优先级 从高到低有ERROR . WARN . INFO . DEBUG ,分别用来指定 ...
- linux heads分析(转)
内核默认的运行地址为PHY_OFFSET+0x8000,即物理地址开始后的0x8000字节处,前面是留给参数用的.参数以atag方式存储,默认放在0x100偏移位置. http://blog.chin ...
- MIC中示例程序计算π
mic中编程十分简单,只需在普通程序中简单加几句就可以,使用 lspci|grep -i -co-processor 命令可以查看机器中是否插入MIC卡以及MIC卡的数目,MIC编程环境的配置这里就不 ...
- erlang 最大公约数
一般面试会遇到问一些算法,什么排序,树,图等等,冷不丁还会问几个蛋疼的问题,我估计生产情况十有八九都用不上,只是题目罢了. 题目:求两个大数的最大公约数. 什么是最大公约数呢? 百度百科的答案这样的: ...
- 利用socket.io实现消息实时推送
最近在写的项目中存在着社交模块,需要实现这样的一个功能:当发生了用户被点赞.评论.关注等操作时,需要由服务器向用户实时地推送一条消息.最终完成的项目地址为:socket-message-push,这里 ...
- ADC 分辨率和精度的区别(转载)
转自:http://hi.baidu.com/jnjypbpuhkbajmq/item/8a6b472ae86dcc69469962b7 分辨率和精度这两个,经常拿在一起说,才接触的时候经常混为一谈. ...