DomainQuotaDriver
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
To use the two driver design and parallel domain, the drivers will be called via the Quota Engine, so if both drivers are enabled for each function as committed or reserved, for example, will be made for the two drivers.
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 |