Working with nova-schedulers

When you launch an instance with OpenStack, the job of the nova-schedulers is to determine which Compute Host (hypervisor) the instance will be created on. The scheduler can be configured to make some basic decisions, such as whether or not RAM exists or not to run the instance and whether enough cores are available. It can also be configured to be more complex and make decisions based on environmental factors and metadata, so that instances can be grouped together on hosts or spread across different hosts to ensure a level of stability in the event of a compute host failure.

Getting ready

Ensure that you are logged in to the OpenStack controller node. If you used Vagrant to create this, we can access this with the following command:

vagrant ssh controller

How to do it...

Let’s modify the /etc/nova/nova.conf file to enable all the scheduler filters discussed:

  1. Add the following lines to the [Default] section of the /etc/nova/nova.conf file on the Controller:
    scheduler_driver=nova.scheduler.multi.MultiScheduler
    scheduler_driver_task_period = 60 
    scheduler_driver = nova.scheduler.filter_scheduler.FilterScheduler
    scheduler_available_filters = nova.scheduler.filters.all_filters
    scheduler_default_filters = RetryFilter, AvailabilityZoneFilter,
        RamFilter, ComputeFilter, ComputeCapabilitiesFilter,
        ImagePropertiesFilter, ServerGroupAntiAffinityFilter
        ServerGroupAffinityFilter
  2. Restart the nova-scheduler service to pick up the change:
    sudo service nova-scheduler restart
    

How it works...

You can modify the nova.conf file to expose additional features of the nova-scheduler to be used in our environment. In this example, the default scheduler enabled with OpenStack Juno will consider scheduling an instance to a host, if the host meets all of the following criteria:

  • RetryFilter: This will retry each host (in the first instance, implies the host hasn’t been requested before)
  • AvailabilityZoneFilter: This specifies that the host is in the request availability zone (the default is nova)
  • RamFilter: This specifies that the Compute host has enough RAM available
  • ComputeFilter: This specifies that the Compute host is available to service the request
  • ComputeCapabilitiesFilter: This specifies that the Compute host satisfies any extra specs associated with the instance type requested
  • ImagePropertiesFilter: This specifies that the image (and associated properties) requested can run on the particular host
  • ServerGroupAntiAffinityFilter: If requested, whether the instance should run on a different host to another instance in the same group
  • ServerGroupAffinityFilter: If requested, whether the instance should run on hosts belonging to the same instance group

There’s more...

There are a number of schedulers available for a wide variety of scenarios. For more information, visit http://docs.openstack.org/juno/config-reference/content/section_compute-scheduler.html.

..................Content has been hidden....................

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