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的更多相关文章

  1. neutron 的 quota design

    发现, cinder, nova 制实现了, CountableResource. 只有nuetron实现了 TrackedResource 和 CountableResource. I read u ...

  2. 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 ...

  3. [转] Quality Of Service In OpenStack

    http://tropicaldevel.wordpress.com/2013/07/15/quality-of-service-in-openstack/ In this post I will b ...

  4. mmcrfs

    mmcrfs command Creates a GPFS™ file system. Synopsis mmcrfs Device {"DiskDesc[;DiskDesc...]&quo ...

  5. 什么是Istio

    本文主要是对Istio Prelim 1.0(https://preliminary.istio.io/docs/)的翻译 Istio:一种开放式平台,用于连接,管理和保护微服务. Istio提供了一 ...

  6. windows7命令帮助大全

    有关某个命令的详细信息,请键入 HELP 命令名ASSOC 显示或修改文件扩展名关联.ATTRIB 显示或更改文件属性.BREAK 设置或清除扩展式 CTRL+C 检查.BCDEDIT 设置启动数据库 ...

  7. HBase 数据模型(Data Model)

    HBase Data Model--HBase 数据模型(翻译) 在HBase中,数据是存储在有行有列的表格中.这是与关系型数据库重复的术语,并不是有用的类比.相反,HBase可以被认为是一个多维度的 ...

  8. Linux下Mongodb安装和启动配置

    1.下载安装包 wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgz 下载完成后解压缩压缩包 tar zxf mongod ...

  9. Hadoop 之Mong DB 之CentOS 6 使用 yum 安装MongoDB及服务器端配置

    安装MongoDB的方法有很多种,可以源代码安装,在Centos也可以用yum源安装的方法.由于MongoDB更新得比较快,我比较喜欢用yum源安装的方法.64位Centos下的安装步骤如下: 1.准 ...

随机推荐

  1. C++ Primer(第五版)读书笔记 & 习题解答 --- Chapter 1

    Chapter 1.1 1. 每个C++程序都必须有且只能有一个main函数,main函数的返回类型必须是int.操作系统通过调用main函数来运行C++程序. 2. 一个函数的定义包含四部分:返回类 ...

  2. web.xml中url-pattern匹配规则

    小知识 一般的URL组成 URL = 服务器地址 + RequestURI 例如URI:http://localhost:8080/practice/main [http://localhost:80 ...

  3. leetCode 50.Pow(x, n) (x的n次方) 解题思路和方法

    Pow(x, n) Implement pow(x, n). 思路:题目不算难.可是须要考虑的情况比較多. 详细代码例如以下: public class Solution { public doubl ...

  4. 2018年EI收录中文期刊目录【转】

    [转]2018年EI收录中文期刊目录 Elsevier官网于2018年1月1日更新了EI Compendex目录,共收录中文期刊158种,其中新增期刊5种. 序号 中文刊名 收录情况 1 声学学报 保 ...

  5. python 函数的进阶

    1. 动态参数 位置参数的动态参数: *args 动态接收参数的时候要注意: 动态参数必须在位置参数后面 顺序: 位置参数, 动态参数*, 默认值参数 例子: def chi(a, b, *food, ...

  6. linux集群管理

    本文以ubuntu-16.04.3-server-amd64为例,搭建服务器集群.同样是依托于虚拟机. 创建第一个节点 创建新的虚拟机参见:创建新的虚拟机,创建之后,编辑虚拟机,选择Ubuntu镜像, ...

  7. Nginx教程

    Nginx教程 1.背景 介绍 Nginx是一个高性能的HTTP服务器,以及反向代理服务器 组成 Ngnix有内核和模块组成.微结构的内核根据配置文件将一个请求映射到一个location块中,该loc ...

  8. AFN errorCode对应的状态码

    转 http://blog.csdn.NET/wangyanchang21/article/details/50932191 在很多时候都会遇到错误, 还会带有一些 Error Code , 比如在各 ...

  9. zabbix server 端安装

    1.系统环境 [root@crazy-acong ~]# cat /etc/redhat-release CentOS release 6.6 (Final) [root@crazy-acong ~] ...

  10. Webpack探索【7】--- sourceMap、自动构建刷新功能详解

    本文主要讲sourceMap.自动构建刷新功能.