command syntax: openstack flavor <action/operation> <--flags values> <flavor-name>

Flavors define the available hardware configuration of instances(servers).

#to view the list of flavors configured

cumulus@server01:~$ openstack flavor list
+----+---------+-----+------+-----------+-------+-----------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+---------+-----+------+-----------+-------+-----------+
| 0 | m1.nano | 64 | 1 | 0 | 1 | True |
+----+---------+-----+------+-----------+-------+-----------+
cumulus@server01:~$

#let's create a new flavor firstFlavor, with ID 1 this is a unique ID, since this ID is not used yet, we can use this, we can also set this to auto instead of 1, so that the system will assign a UUID, this flavor defines 128MB RAM, 1GB disk capacity and 1 virtual cpu.

cumulus@server01:~$ openstack flavor create --id 1 --ram 128 --disk 1 --vcpus 1 firstFlavor
+----------------------------+-------------+
| Field | Value |
+----------------------------+-------------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 1 |
| id | 1 |
| name | firstFlavor |
| os-flavor-access:is_public | True |
| properties | |
| ram | 128 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+----------------------------+-------------+

#to verify

cumulus@server01:~$ openstack flavor list
+----+-------------+-----+------+-----------+-------+-----------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+-------------+-----+------+-----------+-------+-----------+
| 0 | m1.nano | 64 | 1 | 0 | 1 | True |
| 1 | firstFlavor | 128 | 1 | 0 | 1 | True |
+----+-------------+-----+------+-----------+-------+-----------+

#to delete the flavor
cumulus@server01:~$ openstack flavor delete firstFlavor

cumulus@server01:~$

--end-of-post--