How to add flavors to openstack using cli

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. Type the following commands to define the six flavors:

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

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

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