openstack-manuals/doc/user-guide-admin/section_cli_nova_manage_fla...

158 lines
7.2 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_manage_flavors">
<?dbhtml stop-chunking?>
<title>Manage flavors</title>
<para>In OpenStack, flavors define the compute, memory, and
storage capacity of nova computing instances. To put it
simply, a flavor is an available hardware configuration for a
server. It defines the <quote>size</quote> of a virtual server
that can be launched.</para>
<note>
<para>Flavors can also determine on which compute host a flavor
can be used to launch an instance. For information
about customizing flavors, refer to the <link
xlink:href="http://docs.openstack.org/admin-guide-cloud/content/"
><citetitle>OpenStack Cloud Administrator Guide</citetitle></link>.</para></note>
<para>A flavor consists of the following parameters:</para>
<variablelist>
<varlistentry>
<term>Flavor ID</term>
<listitem>
<para>Automatically generated by OpenStack. For
private flavors, a value from 1 to 255.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Name</term>
<listitem>
<para>Name for the new flavor.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>VCPUs</term>
<listitem>
<para>Number of virtual CPUs to use.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Memory MB</term>
<listitem>
<para>Amount of RAM to use (in megabytes).</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Root Disk GB</term>
<listitem>
<para>Amount of disk space (in gigabytes) to use for
the root (/) partition.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Ephemeral Disk GB</term>
<listitem>
<para>Amount of disk space (in gigabytes) to use for
the ephemeral partition. If unspecified, the value
is 0 by default.</para>
<para>Ephemeral disks offer machine local disk storage
linked to the life cycle of a VM instance. When a
VM is terminated, all data on the ephemeral disk
is lost. Ephemeral disks are not included in any
snapshots.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Swap</term>
<listitem>
<para>Amount of swap space (in megabytes) to use. If
unspecified, the value is 0 by default.</para>
</listitem>
</varlistentry>
</variablelist>
<para>The default flavors are:</para>
<itemizedlist>
<listitem>
<para>m1.tiny (1 VCPU/0 GB Disk/512 MB RAM)</para>
</listitem>
<listitem>
<para>m1.smaller (1 VCPU/0 GB Disk/1024 MB RAM)</para>
</listitem>
<listitem>
<para>m1.small (1 VCPU/10 GB Disk/2048 MB RAM)</para>
</listitem>
<listitem>
<para>m1.medium (2 VCPU/10 GB Disk/3072 MB RAM)</para>
</listitem>
<listitem>
<para>m1.large (4 VCPU/10 GB Disk/8192 MB RAM)</para>
</listitem>
<listitem>
<para>m1.xlarge (8 VCPU/10 GB Disk/8192 MB RAM)</para>
</listitem>
</itemizedlist>
<para>You can create and manage flavors with the nova
<command>flavor-*</command> commands provided by the
<filename>python-novaclient</filename> package.</para>
<section xml:id="cli_create_flavor">
<title>Create a flavor</title>
<procedure>
<step>
<para>List flavors to show the ID and name, the amount
of memory, the amount of disk space for the root
partition and for the ephemeral partition, the
swap, and the number of virtual CPUs for each
flavor.</para>
<screen><prompt>$</prompt> <userinput>nova flavor-list</userinput></screen>
</step>
<step>
<para>To create a flavor, specify a name, ID, RAM
size, disk size, and the number of VCPUs for the
flavor, as follows:</para>
<screen><prompt>$</prompt> <userinput>nova flavor-create <replaceable>FLAVOR_NAME</replaceable> <replaceable>FLAVOR_ID</replaceable> <replaceable>RAM_IN_MB ROOT_DISK_IN_GB</replaceable> <replaceable>NUMBER_OF_VCPUS</replaceable></userinput></screen>
<note>
<para>The flavor ID is a number from 1 to 255 and
cannot contain special characters or
spaces.</para>
</note>
<para>Here is an example with additional optional
parameters filled in that creates a public "extra
tiny" flavor that automatically gets an ID
assigned, with 256 MB memory, no disk space, and
one VCPU. The rxtx-factor indicates the slice of
bandwidth that the instances with this flavor can
use (through the Virtual Interface (vif) creation
in the hypervisor).</para>
<screen><prompt>$</prompt> <userinput>nova flavor-create --is-public true m1.extra_tiny auto 256 0 1 --rxtx-factor .1</userinput></screen>
<para>If an individual user or group of users needs a custom
flavor that you do not want other tenants to have access to,
you can change the flavor's access to make it a private flavor.
See <link
xlink:href="http://docs.openstack.org/trunk/openstack-ops/content/private-flavors.html">
Private Flavors in the OpenStack Operations Guide
</link>.</para>
<para>For a list of optional parameters, run this
command:</para>
<screen><prompt>$</prompt> <userinput>nova help flavor-create</userinput></screen>
</step>
<step>
<para>After you create a flavor, assign it to a
project by specifying the flavor name or ID and
the tenant ID:</para>
<screen><prompt>$</prompt> <userinput>nova flavor-access-add <replaceable>FLAVOR</replaceable> <replaceable>TENANT_ID</replaceable></userinput></screen>
</step>
</procedure>
</section>
<section xml:id="cli_delete_flavor">
<title>Delete a flavor</title>
<procedure>
<step>
<para>Delete a specified flavor, as follows:</para>
<screen><prompt>$</prompt> <userinput>nova flavor-delete <replaceable>FLAVOR_ID</replaceable></userinput></screen>
</step>
</procedure>
</section>
</section>