Table of Contents
Quotas are operational limits set by the OpenStack administrator. Quotas are assigned to the projects (tenants) or services. The main idea behind setting up quotas is that single-tenant cannot consume all of the resources like disk space, RAM, number of CPU’s etc.
For more information, check out the OpenStack quota reference.
openstack command to checkout the default quota
There is a default quota set by the administrator to the project. In the following picture, we will see the default quotas.
Command :
(wallaby) ubuntu@ubuntu-exp:~$ openstack quota show --default
nova commands for default quotas
list nova resources quota
To list nova resources default quota use the following command
(wallaby) ubuntu@ubuntu-exp:~$ nova quota-defaults +----------------------+-------+ | Quota | Limit | +----------------------+-------+ | instances | 10 | | cores | 20 | | ram | 51200 | | metadata_items | 128 | | key_pairs | 100 | | server_groups | 10 | | server_group_members | 10 | +----------------------+-------+ (wallaby) ubuntu@ubuntu-exp:~$
change nova resources quota
Use the following command to change the nova default quota
(wallaby) ubuntu@ubuntu-exp:~$ nova quota-class-update default --instances 13 (wallaby) ubuntu@ubuntu-exp:~$
We have successfully updated Nova default number of instance quota form 10 to 13
(wallaby) ubuntu@ubuntu-exp:~$ nova quota-defaults +----------------------+-------+ | Quota | Limit | +----------------------+-------+ | instances | 13 | | cores | 20 | | ram | 51200 | | metadata_items | 128 | | key_pairs | 100 | | server_groups | 10 | | server_group_members | 10 | +----------------------+-------+ (wallaby) ubuntu@ubuntu-exp:~$
Simillarly we can change other parameters also. In the below example, we will change ram from 51200 MB to 25600 MB
(wallaby) ubuntu@ubuntu-exp:~$ nova quota-class-update default --ram 25600 (wallaby) ubuntu@ubuntu-exp:~$ (wallaby) ubuntu@ubuntu-exp:~$ nova quota-defaults +----------------------+-------+ | Quota | Limit | +----------------------+-------+ | instances | 13 | | cores | 20 | | ram | 25600 | | metadata_items | 128 | | key_pairs | 100 | | server_groups | 10 | | server_group_members | 10 | +----------------------+-------+ (wallaby) ubuntu@ubuntu-exp:~$
changing quota for tenants with nova command
Till now we have seen how to change default quotas. Which are applicable to all the projects in our deployment. In this section, we will look at how we can change the nova quota for a particular tenant.
In the following, we are listing all the tenants.
(wallaby) ubuntu@ubuntu-exp:~$ openstack project list +----------------------------------+---------+ | ID | Name | +----------------------------------+---------+ | 637d4156bede4e6db03fc0f556ee0250 | admin | | 85b4bb35c9974f95904c46030ce06e62 | service | +----------------------------------+---------+ (wallaby) ubuntu@ubuntu-exp:~$
For now, we are using two projects and in the below example we will change the number of max instances to 16 from 13 for the admin project.
(wallaby) ubuntu@ubuntu-exp:~$ nova quota-update --instances 16 637d4156bede4e6db03fc0f556ee0250 (wallaby) ubuntu@ubuntu-exp:~$ (wallaby) ubuntu@ubuntu-exp:~$ (wallaby) ubuntu@ubuntu-exp:~$ (wallaby) ubuntu@ubuntu-exp:~$ nova quota-show --tenant 637d4156bede4e6db03fc0f556ee0250 +----------------------+-------+ | Quota | Limit | +----------------------+-------+ | instances | 16 | | cores | 40 | | ram | 96000 | | metadata_items | 128 | | key_pairs | 100 | | server_groups | 10 | | server_group_members | 10 | +----------------------+-------+ (wallaby) ubuntu@ubuntu-exp:~$
changing quota for tenants with openstack command
Using OpenStack command for the same example which is shown previously. See the output in the following snapshot.
Command syntax:
openstack quota set <quota-name> <value> <projectname/servicename>
example:
(wallaby) ubuntu@ubuntu-exp:~$ openstack quota set --instance 10 admin