Creating flavors

Flavors describe the size of the instance specified. They describe the number of cores (virtual CPUs), amount of RAM, and size of allocated local or ephemeral disk resource available to an instance. The standard flavors are usually m1.tiny, m1.small, m1.large and m1.xlarge. A user specifies these either on the command line or through the Horizon interface.

Getting ready

Ensure you are logged in to an Ubuntu host that has access to our OpenStack environment on the 192.168.100.0/24 public network. This host will be used to run client tools against the OpenStack environment created. If you are using the accompanying Vagrant environment, as described in the Preface, you can use the controller node. This node has the python-novaclient package that provides the swift command-line client.

If you created this node with Vagrant, you can execute the following command:

vagrant ssh controller 

Ensure you have set the following credentials (adjust the path to your certificates and key file to match your environment if not using the Vagrant environment):

export OS_TENANT_NAME=cookbook
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=https://192.168.100.200:5000/v2.0/
export OS_NO_CACHE=1
export OS_KEY=/vagrant/cakey.pem
export OS_CACERT=/vagrant/ca.pem

How to do it...

To create a new flavor that specifies 2 vCPU, 16 GB RAM, and 30 GB disk, carry out the following steps:

  1. We run the following commands:
    nova flavor-create m1.javaserver 
        49 16384 30 2 
        --is-public=true
    

    The preceding commands produce an output like this:

    How to do it...
  2. We can now list the flavors available with the following command:
    nova flavor-list
    

    The preceding command produces an output like this:

    How to do it...

How it works...

Create new flavors using the following syntax:

nova flavor-create $FLAVOR_NAME
    $FLAVOR_ID $RAM $DISK $CPU
    --is-public={true|false}
    --ephemeral $EPHEMERAL_SIZE_GB
    --swap $SWAP_SIZE_GB
    --rxtx-factor $FACTOR

The nova flavor-create command doesn’t automatically update flavor IDs; therefore, you must specify this and ensure that this is unique. We then specify the amount of RAM, disk and CPU for that flavor. Here are a few extra options:

  • --is-public=true|false: This specifies whether the flavor exists only within the current tenant, or it is available to all tenants. Only an administrator can specify this. The default value is true.
  • --ephemeral $EPHEMERAL_SIZE_GB: This allows you to specify a secondary ephemeral disk.
  • --swap $SWAP_SIZE_GB: This specifies an additional swap partition associated with the instance.
  • --rxtx-factor: This specifies the bandwidth factor of the flavor compared to other flavors. This defaults to 1. A factor of 0.5 specifies the bandwidth capacity to be half available.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset