Jump to: navigation, search

Difference between revisions of "DomainQuotaDriver"

(Created page with "= Domain Quota Driver = == Introduction == Keystone BP Domain Quota Management and Enforcement will enable O~S projects to enforce domain quotas, for this a new driver capab...")
 
(Desing)
 
(25 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Domain Quota Driver =
 
  
 
== Introduction ==
 
== Introduction ==
  
Keystone BP Domain Quota Management and Enforcement will enable O~S projects to enforce domain quotas, for this a new driver capable to enforce domain quota is necessary. This BP addresses the need of a new quota driver capable to enforce domain quotas in Nova.
+
Nova BP Domain Quota Driver will enable O~S projects to enforce domain quotas in Nova, for this a new driver capable to enforce domain quota is necessary. This BP addresses the need of a new quota driver capable to enforce domain quotas in Nova.
 +
 
 +
== Quotas in Nova==
 +
Currently, OpenStack services make usage of quotas to limit the project resources.
 +
For example,  the “Instances” quota represents the number of instances that can be created in a project. The table below summarizes the existing project quotas.
 +
From now on there will be the same options as Quotas in the context of domain.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! quotas !! type !! default values !! description
 +
|-
 +
| instances || reservable|| 10|| number of instances allowed per project
 +
|-
 +
| cores|| reservable|| 20|| number of instance cores allowed per project
 +
|-
 +
| ram || reservable || 50*1024|| megabytes of instance ram allowed per project
 +
|-
 +
| floating_ips || reservable || 10 || number of floating ips allowed per project
 +
|-
 +
| fixed_ips|| reservable|| -1 || number of fixed ips allowed per project
 +
|-
 +
| metadata_items|| absolute || 128|| number of metadata items allowed per instance
 +
|-
 +
| injected_files || absolute|| 5 || number of injected files allowed
 +
|-
 +
| injected_files_content_bytes|| absolute || 10*1024 || number of bytes allowed per injected file
 +
|-
 +
| nova.injected_file_path_bytes || absolute|| 255 || number of bytes allowed per injected file path
 +
|-
 +
| nova.security_groups || reservable || 10 || number of security groups per project
 +
|-
 +
| nova.security_groups_rules || countable || 20 || number of security rules per security group
 +
|-
 +
| nova.key_pairs|| countable || 100 || number of key pairs per user
 +
|}
 +
 
 +
= Desing =
 +
 
 +
So the Nova can use two drivers in parallel, they will be called by the Quota Engine. Therefore, when the two driver are running, to reserve a resource, for example, the quota engine will make the reservation in the current quota, ie the quota the project and also quota domain.
 +
 
 +
[[File:QuotaEngine.png|600x269px]]
 +
 
 +
= Implementation =
 +
 
 +
To implement the domain controller Quota was necessary to create three models, following the existing quotas for project templates. Furthermore it has created three tables corresponding to these models: DomainQuota, DomainQuotaUsages and DomainReservation, so we can store information about the limits of quotas, than is already in used and also the reserves of resources.
 +
 
 +
 
 +
''' Domain Quota Table'''
 +
{| class="wikitable"
 +
|-
 +
! Column || Description
 +
|-
 +
| id || primary key.
 +
|-
 +
| resource|| resource name.
 +
|-
 +
| domain_id || id that reference the domain.
 +
|-
 +
| hard_limit|| limit to quota.
 +
|-
 +
|  created_at|| time at which the record is created.
 +
|-
 +
|  updated_at|| time at which the record is updated.
 +
|-
 +
|  deleted_at|| time at which the record is deleted.
 +
|-
 +
|  deleted|| if the record was deleted
 +
|}
 +
 
 +
''' Domain Quota Usages Table'''
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Column || Description
 +
|-
 +
| id || primary key.
 +
|-
 +
| resource|| resource name.
 +
|-
 +
| domain_id || id that reference the domain.
 +
|-
 +
| in use|| amount of the resource that is already in use.
 +
|-
 +
|  reserved|| is this resource is reserved.
 +
|-
 +
|  created_at|| time at which the record is created.
 +
|-
 +
|  updated_at|| time at which the record is updated.
 +
|-
 +
|  deleted_at|| time at which the record is deleted.
 +
|-
 +
|  until_refresh|| count of reservations until usage is refreshed
 +
|-
 +
|  deleted|| if the record was deleted
 +
|}
 +
 
 +
''' Domain Reservation Table'''
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Column || Description
 +
|-
 +
| id || primary key.
 +
|-
 +
| resource|| resource name.
 +
|-
 +
| domain_id || id that reference the domain.
 +
|-
 +
| usage_id || id that reference the usage quota.
 +
|-
 +
| in use|| amount of the resource that is already in use.
 +
|-
 +
| reserved|| is this resource is reserved.
 +
|-
 +
| created_at|| time at which the record is created.
 +
|-
 +
| updated_at|| time at which the record is updated.
 +
|-
 +
| deleted_at|| time at which the record is deleted.
 +
|-
 +
| uuid|| Universally unique identifier.
 +
|-
 +
| delta|| variation of the resource to be added.
 +
|-
 +
| expire|| If the reservation is already expired.
 +
|-
 +
|  deleted|| if the record was deleted
 +
|}

Latest revision as of 14:04, 13 December 2013

Introduction

Nova BP Domain Quota Driver will enable O~S projects to enforce domain quotas in Nova, for this a new driver capable to enforce domain quota is necessary. This BP addresses the need of a new quota driver capable to enforce domain quotas in Nova.

Quotas in Nova

Currently, OpenStack services make usage of quotas to limit the project resources. For example, the “Instances” quota represents the number of instances that can be created in a project. The table below summarizes the existing project quotas. From now on there will be the same options as Quotas in the context of domain.

quotas type default values description
instances reservable 10 number of instances allowed per project
cores reservable 20 number of instance cores allowed per project
ram reservable 50*1024 megabytes of instance ram allowed per project
floating_ips reservable 10 number of floating ips allowed per project
fixed_ips reservable -1 number of fixed ips allowed per project
metadata_items absolute 128 number of metadata items allowed per instance
injected_files absolute 5 number of injected files allowed
injected_files_content_bytes absolute 10*1024 number of bytes allowed per injected file
nova.injected_file_path_bytes absolute 255 number of bytes allowed per injected file path
nova.security_groups reservable 10 number of security groups per project
nova.security_groups_rules countable 20 number of security rules per security group
nova.key_pairs countable 100 number of key pairs per user

Desing

So the Nova can use two drivers in parallel, they will be called by the Quota Engine. Therefore, when the two driver are running, to reserve a resource, for example, the quota engine will make the reservation in the current quota, ie the quota the project and also quota domain.

QuotaEngine.png

Implementation

To implement the domain controller Quota was necessary to create three models, following the existing quotas for project templates. Furthermore it has created three tables corresponding to these models: DomainQuota, DomainQuotaUsages and DomainReservation, so we can store information about the limits of quotas, than is already in used and also the reserves of resources.


Domain Quota Table

Column Description
id primary key.
resource resource name.
domain_id id that reference the domain.
hard_limit limit to quota.
created_at time at which the record is created.
updated_at time at which the record is updated.
deleted_at time at which the record is deleted.
deleted if the record was deleted

Domain Quota Usages Table

Column Description
id primary key.
resource resource name.
domain_id id that reference the domain.
in use amount of the resource that is already in use.
reserved is this resource is reserved.
created_at time at which the record is created.
updated_at time at which the record is updated.
deleted_at time at which the record is deleted.
until_refresh count of reservations until usage is refreshed
deleted if the record was deleted

Domain Reservation Table

Column Description
id primary key.
resource resource name.
domain_id id that reference the domain.
usage_id id that reference the usage quota.
in use amount of the resource that is already in use.
reserved is this resource is reserved.
created_at time at which the record is created.
updated_at time at which the record is updated.
deleted_at time at which the record is deleted.
uuid Universally unique identifier.
delta variation of the resource to be added.
expire If the reservation is already expired.
deleted if the record was deleted