As an administrative user, you can use the nova quota-*
commands, which are provided by the python-novaclient
package, to update the Compute service quotas for a specific project or
project user, as well as update the quota defaults for a new project.
Compute quota descriptions
Quota name | Description |
---|---|
cores | Number of instance cores (VCPUs) allowed per project. |
fixed-ips | Number of fixed IP addresses allowed per project. This number must be equal to or greater than the number of allowed instances. |
floating-ips | Number of floating IP addresses allowed per project. |
injected-file-content-bytes | Number of content bytes allowed per injected file. |
injected-file-path-bytes | Length of injected file path. |
injected-files | Number of injected files allowed per project. |
instances | Number of instances allowed per project. |
key-pairs | Number of key pairs allowed per user. |
metadata-items | Number of metadata items allowed per instance. |
ram | Megabytes of instance ram allowed per project. |
security-groups | Number of security groups per project. |
security-group-rules | Number of rules per security group. |
server-groups | Number of server groups per project. |
server-group-members | Number of servers per server group. |
List all default quotas for all projects:
$ nova quota-defaults
For example:
$ nova quota-defaults
+-----------------------------+-------+
| Quota | Limit |
+-----------------------------+-------+
| instances | 10 |
| cores | 20 |
| ram | 51200 |
| floating_ips | 10 |
| fixed_ips | -1 |
| metadata_items | 128 |
| injected_files | 5 |
| injected_file_content_bytes | 10240 |
| injected_file_path_bytes | 255 |
| key_pairs | 100 |
| security_groups | 10 |
| security_group_rules | 20 |
| server_groups | 10 |
| server_group_members | 10 |
+-----------------------------+-------+
Update a default value for a new project.
$ nova quota-class-update --KEY VALUE default
For example:
$ nova quota-class-update --instances 15 default
Place the project ID in a usable variable.
$ tenant=$(openstack project show -f value -c id TENANT_NAME)
List the currently set quota values for a project.
$ nova quota-show --tenant $tenant
For example:
$ nova quota-show --tenant $tenant
+-----------------------------+-------+
| Quota | Limit |
+-----------------------------+-------+
| instances | 10 |
| cores | 20 |
| ram | 51200 |
| floating_ips | 10 |
| fixed_ips | -1 |
| metadata_items | 128 |
| injected_files | 5 |
| injected_file_content_bytes | 10240 |
| injected_file_path_bytes | 255 |
| key_pairs | 100 |
| security_groups | 10 |
| security_group_rules | 20 |
| server_groups | 10 |
| server_group_members | 10 |
+-----------------------------+-------+
Obtain the project ID.
$ tenant=$(openstack project show -f value -c id TENANT_NAME)
Update a particular quota value.
$ nova quota-update --QUOTA_NAME QUOTA_VALUE TENANT_ID
For example:
$ nova quota-update --floating-ips 20 $tenant
$ nova quota-show --tenant $tenant
+-----------------------------+-------+
| Quota | Limit |
+-----------------------------+-------+
| instances | 10 |
| cores | 20 |
| ram | 51200 |
| floating_ips | 20 |
| fixed_ips | -1 |
| metadata_items | 128 |
| injected_files | 5 |
| injected_file_content_bytes | 10240 |
| injected_file_path_bytes | 255 |
| key_pairs | 100 |
| security_groups | 10 |
| security_group_rules | 20 |
| server_groups | 10 |
| server_group_members | 10 |
+-----------------------------+-------+
Note
To view a list of options for the nova quota-update command, run:
$ nova help quota-update
Place the user ID in a usable variable.
$ tenantUser=$(openstack user show -f value -c id USER_NAME)
Place the user’s project ID in a usable variable, as follows:
$ tenant=$(openstack project show -f value -c id TENANT_NAME)
List the currently set quota values for a project user.
$ nova quota-show --user $tenantUser --tenant $tenant
For example:
$ nova quota-show --user $tenantUser --tenant $tenant
+-----------------------------+-------+
| Quota | Limit |
+-----------------------------+-------+
| instances | 10 |
| cores | 20 |
| ram | 51200 |
| floating_ips | 20 |
| fixed_ips | -1 |
| metadata_items | 128 |
| injected_files | 5 |
| injected_file_content_bytes | 10240 |
| injected_file_path_bytes | 255 |
| key_pairs | 100 |
| security_groups | 10 |
| security_group_rules | 20 |
| server_groups | 10 |
| server_group_members | 10 |
+-----------------------------+-------+
Place the user ID in a usable variable.
$ tenantUser=$(openstack user show -f value -c id USER_NAME)
Place the user’s project ID in a usable variable, as follows:
$ tenant=$(openstack project show -f value -c id TENANT_NAME)
Update a particular quota value, as follows:
$ nova quota-update --user $tenantUser --QUOTA_NAME QUOTA_VALUE $tenant
For example:
$ nova quota-update --user $tenantUser --floating-ips 12 $tenant
$ nova quota-show --user $tenantUser --tenant $tenant
+-----------------------------+-------+
| Quota | Limit |
+-----------------------------+-------+
| instances | 10 |
| cores | 20 |
| ram | 51200 |
| floating_ips | 12 |
| fixed_ips | -1 |
| metadata_items | 128 |
| injected_files | 5 |
| injected_file_content_bytes | 10240 |
| injected_file_path_bytes | 255 |
| key_pairs | 100 |
| security_groups | 10 |
| security_group_rules | 20 |
| server_groups | 10 |
| server_group_members | 10 |
+-----------------------------+-------+
Note
To view a list of options for the nova quota-update command, run:
$ nova help quota-update
Use nova absolute-limits to get a list of the current quota values and the current quota usage:
$ nova absolute-limits --tenant TENANT_NAME
+--------------------+------+-------+
| Name | Used | Max |
+--------------------+------+-------+
| Cores | 0 | 20 |
| FloatingIps | 0 | 10 |
| ImageMeta | - | 128 |
| Instances | 0 | 10 |
| Keypairs | - | 100 |
| Personality | - | 5 |
| Personality Size | - | 10240 |
| RAM | 0 | 51200 |
| SecurityGroupRules | - | 20 |
| SecurityGroups | 0 | 10 |
| Server Meta | - | 128 |
| ServerGroupMembers | - | 10 |
| ServerGroups | 0 | 10 |
+--------------------+------+-------+
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.