You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

How to add flavors to openstack using cli: This is a continuation of getting started with Openstack compute platform series. Earlier in the series we looked at  Adding images to Openstack Glance.

What are Openstack flavors?

In OpenStack, a flavor defines the compute, memory, and storage capacity of a virtual server, also known as an instance. As an administrative user, you can create, edit, and delete flavors. This can be done either from the cli or using the Horizon dashboard,

As of Newton openstack release, there are no default flavors. You’ll have to create them manually, this is why I’m writing this tutorial.

Adding Flavors.

We’re going to define 6 flavors, each with unique flavor ID and starting from small to the largest. Please note that this is just an example, you can define custom flavors to suit your use.

You need OpenStack Client configured for this operation: How To Install and Configure OpenStack Client on Linux

Type the following commands to define the six flavors:

openstack flavor create --id 0 --ram 512   --vcpus 1 --disk 10  m1.tiny
openstack flavor create --id 1 --ram 1024  --vcpus 1 --disk 20  m1.small
openstack flavor create --id 2 --ram 2048  --vcpus 2 --disk 40  m1.medium
openstack flavor create --id 3 --ram 4096  --vcpus 2 --disk 80  m1.large
openstack flavor create --id 4 --ram 8192  --vcpus 4 --disk 160 m1.xlarge
openstack flavor create --id 5 --ram 16384 --vcpus 6 --disk 320 m1.jumbo

Let me first explain the meaning of the values used in each definition. If you take example of the first line, 0 is the id of the image, 512 means flavor will have 512 mb ram with 1 vcpu and 10 GB  root disk. The name given to the flavor is m1.tiny.

Confirm flavor list.

You can check if the flavors were created successfully from the cli using the command:

$ openstack flavor list
How to add flavors to openstack using cli

On the UI. this can be confirmed by going to Admin > System > Flavors

How to add flavors to openstack using cli

Now with the flavors added, you can create a test instance on your Openstack to test:

As an appreciation for the content we put out,
we would be thrilled if you support us!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here