Ask Your Question

Why does Openstack use flavor in APIs?

asked 2013-11-18 06:38:35 -0500

Romain gravatar image

updated 2013-11-19 18:48:30 -0500

smaffulli gravatar image

Hello, this question is more about a problem of understanding. I would like to know why an instance is created with a flavor as parameter and not directly with the parameters of the flavor.


why this:

server_create(imageRef, flavorRef...)

and not this:

server_create(imageRef, ram, disk, vcpus...) ?

Thanks beforehand.

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2013-11-19 14:27:52 -0500

John MacMaster gravatar image

I suspect the reason for lumping ram, disk, vcpus together as a flavor is that many service providers have defined machine sizes that cost a given amount per month. (e.g. a 1 cpu machine with 1 GB of RAM and 10 GB of storage will cost x dollars per month but the next size up in machine would cost y dollars and provide 2 cpu with 4 GB of RAM and 20 GB storage. They often don't offer an option in between)

edit flag offensive delete link more

answered 2013-11-18 17:30:01 -0500

updated 2013-11-18 17:30:09 -0500

The Flavor or Platform Flavor as I like to call it is the virtual platform definition, and like most thing in OpenStack the the number represents the UUID of the platform. When you combine a Platform Flavor with an OS image, launch it, you now have a running Instance or VM. You can find an ID by the nova list-flavor command. $ nova flavor-list

edit flag offensive delete link more

answered 2013-11-18 10:48:09 -0500

AlanObject gravatar image

The intent of the API is that it reflects what is presented to the user.

A flavor is just a set of options that are generally appear often together. (ram, disk, vcpus as you put it). The reason this happens is that the truly optimal settings can be very hard to derive. Instead, a user uses flavor '2' for his VM and that runs like crap so then he tries flavor '3' and that works and we are good.

I haven't been around for OS development but I think this scheme evolved out of long experience of typing in the same options over and over again.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-11-18 06:38:35 -0500

Seen: 160 times

Last updated: Nov 19 '13