Tuesday, 21 July 2015

Research on Openstack Scheduler

Openstack Scheduling

Question:  What is nova- scheduler ?
Answer  :  The compute use this nova-scheduler service to determine how to dispatch compute requests.  So, this will determine on which host a VM(virtual machine) should be launched. The host term here refers to the physical node that has a nova-compute service running on it. Scheduler can be configured through variety of options. For example: compute node is configured with the default scheduler options in the /etc/nova/nova.conf  file.

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

In default configurations, scheduler_driver is configured as filter scheduler with default filters which considers only those hosts that meet all the following parameters:

Default filters:
  • Are in the requested availability zone (AvailabilityZoneFilter).
  • Have sufficient RAM available (RamFilter).
  • Can service the request (ComputeFilter).
  • Satisfy the extra specs associated with the instance type (ComputeCapabilitiesFilter).
  • Satisfy any architecture, hypervisor type, or virtual machine mode properties specified on the instance's image properties (ImagePropertiesFilter).
  • Are on a different host than other instances of a group (if requested) (ServerGroupAntiAffinityFilter).
  • Are in a set of group hosts (if requested) (ServerGroupAffinityFilter).
    Have not been attempted for scheduling purposes (RetryFilter).

    { This is how scheduler caches its list of available hosts}

    Important note :  Do not configure service_down_time to be much smaller than scheduler_driver_task_period; otherwise, hosts appear to be dead while the host list is being cached.

    Other role of scheduler:
    The scheduler is responsible for selecting a new host when an instance is migrated. 
    while evacuating the instance from a host, the scheduler service consider the target host which is defined by administrator on evacuate command. But, if the target host is not defined , then the scheduler determines the target host.

    Default scheduler -Filter scheduler :

    It is a default scheduler in openstack for scheduling virtual machines instances. It supports filtering and weighting to make important decision on where a new instance should be created. Following are the few steps explaining how filters actually works:
    1.  Filter receives a request for a resource
    2.  Filters determine which hosts are eligible for consideration while dispatching a resource.
    3.  Filters are binary so either host is accepted by filter or rejected.
    4.  Host which are selected are further processed by different weighting algorithm to decide the best host for launching the VM.
    figure: Filtering 

    The scheduler_available_filters provide the list of filters to the compute service which are used by scheduler to find hosts.

    List of all available filters:

    Make your own filters:

    We can implement our own filter in python called myfilter.MyFilter  in nova.conf file.

    The scheduler_available_filters configuration option in nova.conf provides the Compute service with the list of the filters that are used by the scheduler.

    scheduler_available_filters = nova.scheduler.filters.all_filters
     
    But if I want to use both the in-built as well as my own filter then my nova.conf would look like this : 
    scheduler_available_filters = nova.scheduler.filters.all_filters
    scheduler_available_filters = myfilter.MyFilter


    and The scheduler_default_filters configuration option in nova.conf defines the list of filters that are applied by the nova-scheduler service











No comments:

Post a Comment