2
Copyright 2011 Ken Pepple
4
Licensed under the Apache License, Version 2.0 (the "License"); you may
5
not use this file except in compliance with the License. You may obtain
6
a copy of the License at
8
http://www.apache.org/licenses/LICENSE-2.0
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
License for the specific language governing permissions and limitations
16
Managing Instance Types and Flavors
17
===================================
19
You can manage instance types and instance flavors using the nova-manage command-line interface coupled with the instance_type subcommand for nova-manage.
21
What are Instance Types or Flavors ?
22
------------------------------------
24
Instance types describe the compute, memory and storage capacity of nova computing instances. In layman terms, this is the size (in terms of vCPUs, RAM, etc.) of the virtual server that you will be launching. In the EC2 API, these are called by names such as "m1.large" or "m1.tiny", while the OpenStack API terms these "flavors" with names like "512 MB Server".
26
In Nova, "flavor" and "instance type" are equivalent terms. When you create an EC2 instance type, you are also creating a OpenStack API flavor. To reduce repetition, for the rest of this document I will refer to these as instance types.
28
Instance types can be in either the active or inactive state:
29
* Active instance types are available to be used for launching instances
30
* Inactive instance types are not available for launching instances
32
In the current (Cactus) version of nova, instance types can only be created by the nova administrator through the nova-manage command. Future versions of nova (in concert with the OpenStack API or EC2 API), may expose this functionality directly to users.
37
Instance types / flavor are managed through the nova-manage binary with
38
the "instance_type" command and an appropriate subcommand. Note that you can also use
39
the "flavor" command as a synonym for "instance_types".
41
To see all currently active instance types, use the list subcommand::
43
# nova-manage instance_type list
44
m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
45
m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
46
m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
47
m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
48
m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
50
By default, the list subcommand only shows active instance types. To see all instance types (inactive and active), use the list subcommand with the "--all" flag::
52
# nova-manage instance_type list --all
53
m1.medium: Memory: 4096MB, VCPUS: 2, Storage: 40GB, FlavorID: 3, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
54
m1.large: Memory: 8192MB, VCPUS: 4, Storage: 80GB, FlavorID: 4, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
55
m1.tiny: Memory: 512MB, VCPUS: 1, Storage: 0GB, FlavorID: 1, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
56
m1.xlarge: Memory: 16384MB, VCPUS: 8, Storage: 160GB, FlavorID: 5, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
57
m1.small: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB
58
m1.deleted: Memory: 2048MB, VCPUS: 1, Storage: 20GB, FlavorID: 2, Swap: 0GB, RXTX Quota: 0GB, RXTX Cap: 0MB, inactive
60
To create an instance type, use the "create" subcommand with the following positional arguments:
61
* memory (expressed in megabytes)
63
* local storage (expressed in gigabytes)
64
* flavorid (unique integer)
65
* swap space (expressed in megabytes, defaults to zero, optional)
66
* RXTX quotas (expressed in gigabytes, defaults to zero, optional)
67
* RXTX cap (expressed in gigabytes, defaults to zero, optional)
69
The following example creates an instance type named "m1.xxlarge"::
71
# nova-manage instance_type create m1.xxlarge 32768 16 320 0 0 0
74
To delete an instance type, use the "delete" subcommand and specify the name::
76
# nova-manage instance_type delete m1.xxlarge
79
Please note that the "delete" command only marks the instance type as
80
inactive in the database; it does not actually remove the instance type. This is done
81
to preserve the instance type definition for long running instances (which may not
82
terminate for months or years). If you are sure that you want to delete this instance
83
type from the database, pass the "--purge" flag after the name::
85
# nova-manage instance_type delete m1.xxlarge --purge