openstack-manuals/doc/common/section_cli_nova_quotas.xml
Christian Berendt 70facbaac6 Document how to display per-tenant quota usage for Nova
Change-Id: Ic3c59ea9e934974e1893befe36d7ea91762a2ace
Partial-Bug: #1353017
2014-09-10 06:58:59 +02:00

382 lines
14 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0"
xml:id="cli_set_compute_quotas">
<title>Manage Compute service quotas</title>
<para>As an administrative user, you can use the <command>nova quota-*</command>
commands, which are provided by the <literal>python-novaclient</literal>
package, to update the Compute service quotas for a specific tenant or
tenant user, as well as update the quota defaults for a new tenant.</para>
<table rules="all">
<caption>Compute quota descriptions</caption>
<col width="40%"/>
<col width="60%"/>
<thead>
<tr>
<th>
Quota name
</th>
<th>
Description
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<para>
<systemitem>cores</systemitem>
</para>
</td>
<td>
<para>
Number of instance cores (VCPUs) allowed per tenant.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>fixed-ips</systemitem>
</para>
</td>
<td>
<para>
Number of fixed IP addresses allowed per tenant. This number
must be equal to or greater than the number of allowed
instances.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>floating-ips</systemitem>
</para>
</td>
<td>
<para>
Number of floating IP addresses allowed per tenant.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>injected-file-content-bytes</systemitem>
</para>
</td>
<td>
<para>
Number of content bytes allowed per injected file.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>injected-file-path-bytes</systemitem>
</para>
</td>
<td>
<para>
Length of injected file path.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>injected-files</systemitem>
</para>
</td>
<td>
<para>
Number of injected files allowed per tenant.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>instances</systemitem>
</para>
</td>
<td>
<para>
Number of instances allowed per tenant.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>key-pairs</systemitem>
</para>
</td>
<td>
<para>
Number of key pairs allowed per user.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>metadata-items</systemitem>
</para>
</td>
<td>
<para>
Number of metadata items allowed per instance.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>ram</systemitem>
</para>
</td>
<td>
<para>
Megabytes of instance ram allowed per tenant.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>security-groups</systemitem>
</para>
</td>
<td>
<para>
Number of security groups per tenant.
</para>
</td>
</tr>
<tr>
<td>
<para>
<systemitem>security-group-rules</systemitem>
</para>
</td>
<td>
<para>
Number of rules per security group.
</para>
</td>
</tr>
</tbody>
</table>
<section xml:id="cli_set_compute_tenant_quotas_procedure">
<title>View and update Compute quotas for a tenant (project)</title>
<procedure>
<title>To view and update default quota values</title>
<step>
<para>List all default quotas for all tenants, as follows:</para>
<screen><prompt>$</prompt> <userinput>nova quota-defaults</userinput></screen>
<para>For example:
</para>
<screen><prompt>$</prompt> <userinput>nova quota-defaults</userinput>
<computeroutput>+-----------------------------+-------+
| 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 |
+-----------------------------+-------+</computeroutput></screen>
</step>
<step>
<para>Update a default value for a new tenant, as follows:
</para>
<screen><prompt>$</prompt> <userinput>nova quota-class-update --<replaceable>key</replaceable> <replaceable>value</replaceable> default</userinput></screen>
<para>For example:
</para>
<screen><prompt>$</prompt> <userinput>nova quota-class-update --instances 15 default</userinput></screen>
</step>
</procedure>
<procedure>
<title>To view quota values for an existing tenant (project)</title>
<step><para>Place the tenant ID in a usable variable, as follows:</para>
<screen><prompt>$</prompt> <userinput>tenant=$(keystone tenant-list | awk '/<replaceable>tenantName</replaceable>/ {print $2}')</userinput></screen>
</step>
<step>
<para>List the currently set quota values for a
tenant, as follows:</para>
<screen><prompt>$</prompt> <userinput>nova quota-show --tenant $tenant</userinput></screen>
<para>For example:</para>
<screen><prompt>$</prompt> <userinput>nova quota-show --tenant $tenant</userinput>
<computeroutput>+-----------------------------+-------+
| 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 |
+-----------------------------+-------+</computeroutput></screen>
</step>
</procedure>
<procedure>
<title>To update quota values for an existing tenant (project)</title>
<step><para>Obtain the tenant ID, as follows:</para>
<screen><prompt>$</prompt> <userinput>tenant=$(keystone tenant-list | awk '/<replaceable>tenantName</replaceable>/ {print $2}')</userinput></screen>
</step>
<step>
<para>Update a particular quota value, as follows:</para>
<screen><prompt>$</prompt> <userinput>nova quota-update --<replaceable>quotaName</replaceable> <replaceable>quotaValue</replaceable> <replaceable>tenantID</replaceable></userinput></screen>
<para>For example:</para>
<screen><prompt>$</prompt> <userinput>nova quota-update --floating-ips 20 $tenant</userinput>
<prompt>$</prompt> <userinput>nova quota-show --tenant $tenant</userinput>
<computeroutput>+-----------------------------+-------+
| 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 |
+-----------------------------+-------+
</computeroutput></screen>
<note>
<para>To view a list of options for the
<command>quota-update</command> command, run:
</para>
<screen><prompt>$</prompt> <userinput>nova help quota-update</userinput></screen></note>
</step>
</procedure>
</section>
<section xml:id="cli_set_compute_user_quotas_procedure">
<title>View and update Compute quotas for a tenant user</title>
<procedure>
<title>To view quota values for a tenant user</title>
<step><para>Place the user ID in a usable variable, as follows:</para>
<screen><prompt>$</prompt> <userinput>tenantUser=$(keystone user-list | awk '/<replaceable>userName</replaceable>/ {print $2}')</userinput></screen>
</step>
<step>
<para>Place the user's tenant ID in a usable variable, as follows:</para>
<screen><prompt>$</prompt> <userinput>tenant=$(keystone tenant-list | awk '/<replaceable>tenantName</replaceable>/ {print $2}')</userinput></screen>
</step>
<step>
<para>List the currently set quota values for a
tenant user, as follows:</para>
<screen><prompt>$</prompt> <userinput>nova quota-show --user $tenantUser --tenant $tenant</userinput> </screen>
<para>For example:</para>
<screen><prompt>$</prompt> <userinput>nova quota-show --user $tenantUser --tenant $tenant</userinput>
<computeroutput>+-----------------------------+-------+
| 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 |
+-----------------------------+-------+
</computeroutput></screen>
</step>
</procedure>
<procedure>
<title>To update quota values for a tenant user</title>
<step><para>Place the user ID in a usable variable, as follows:</para>
<screen><prompt>$</prompt> <userinput>tenantUser=$(keystone user-list | awk '/<replaceable>userName</replaceable>/ {print $2}')</userinput></screen>
</step>
<step><para>Place the user's tenant ID in a usable variable, as follows:</para>
<screen><prompt>$</prompt> <userinput>tenant=$(keystone tenant-list | awk '/<replaceable>userName</replaceable>/ {print $2}')</userinput></screen>
</step>
<step>
<para>Update a particular quota value, as follows:</para>
<screen><prompt>$</prompt> <userinput>nova quota-update --user $tenantUser --<replaceable>quotaName</replaceable> <replaceable>quotaValue</replaceable> $tenant</userinput></screen>
<para>For example:</para>
<screen><prompt>$</prompt> <userinput>nova quota-update --user $tenantUser --floating-ips 12 $tenant</userinput>
<prompt>$</prompt> <userinput>nova quota-show --user $tenantUser --tenant $tenant</userinput>
<computeroutput>+-----------------------------+-------+
| 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 |
+-----------------------------+-------+
</computeroutput></screen>
<note>
<para>To view a list of options for the
<command>quota-update</command> command, run:
</para>
<screen><prompt>$</prompt> <userinput>nova help quota-update</userinput></screen></note>
</step>
</procedure>
<procedure>
<title>To display the current quota usage for a tenant user</title>
<step>
<para>Use <command>nova absolute-limits</command> to get a list of the
current quota values and the current quota usage.</para>
<screen><prompt>$</prompt> <userinput>nova absolute-limits --tenant <replaceable>tenantName</replaceable></userinput>
<computeroutput>+-------------------------+-------+
| Name | Value |
+-------------------------+-------+
| maxServerMeta | 128 |
| maxPersonality | 5 |
| maxImageMeta | 128 |
| maxPersonalitySize | 10240 |
| maxTotalRAMSize | 51200 |
| maxSecurityGroupRules | 20 |
| maxTotalKeypairs | 100 |
| totalRAMUsed | 0 |
| maxSecurityGroups | 10 |
| totalFloatingIpsUsed | 0 |
| totalInstancesUsed | 0 |
| totalSecurityGroupsUsed | 0 |
| maxTotalFloatingIps | 10 |
| maxTotalInstances | 10 |
| totalCoresUsed | 0 |
| maxTotalCores | 20 |
+-------------------------+-------+</computeroutput></screen>
</step>
</procedure>
</section>
</section>