Nova: Change the compute quota for a specific tenant

You can look at how to change the default quota on Default compute quota post. In this post we are going to look how to change the compute quota for a specific tenant. First of all letś go to check the current quota for a tenant called tenant1 that if you have not changed it, it should be the same that the default one.

[root@os-controller-01 ~(keystone_admin)]# nova quota-show --tenant tenant1
+-----------------------------+-------+
| Quota                       | Limit |
+-----------------------------+-------+
| instances                   | 15    |
| 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    |
+-----------------------------+-------+

To change for example the number of instances allowed for our tenant you have to execute the following command:

[root@os-controller-01 ~(keystone_admin)]# nova quota-update --instances 5 tenant1
[root@os-controller-01 ~(keystone_admin)]# nova quota-show --tenant tenant1
+-----------------------------+-------+
| Quota                       | Limit |
+-----------------------------+-------+
| instances                   | 5     |
| 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    |
+-----------------------------+-------+

As you can see the quota has been updated only to allow 5 instances.

Leave a comment