Mastering Cinder-scheduler Scheduling logic-5 minutes a day to play with OpenStack (48)

Source: Internet
Author: User

In the previous section we discussed in detail the Cinder-api and Cinder-volume, and today we discuss another important cinder component Cinder-scheduler.

When Volume is created, Cinder-scheduler chooses the most appropriate storage node based on conditions such as capacity, Volume Type, and then lets it create Volume.

Here's how Cinder-scheduler is implementing this scheduling task.

In/etc/cinder/cinder.conf, cinder through Scheduler_driver, Scheduler_default_filters and Scheduler_default_weighers These three parameters to configure the Cinder-scheduler.

Filter Scheduler

Filter Scheduler is the default scheduler for Cinder-scheduler.

Scheduler_driver=cinder.scheduler.filter_scheduler. Filterscheduler

Like Nova, Cinder also allows the use of third-party scheduler to configure Scheduler_driver.

The scheduler scheduling process is as follows:

    1. Select the storage node (running cinder-volume) that satisfies the condition through the filter

    2. Select the most optimal (weighted value) storage node by weight calculation (weighting).

It can be seen that the cinder-scheduler operation mechanism is exactly the same as the Nova-scheduler.

Filter

When the filter scheduler needs to perform a dispatch operation, the filter is asked to determine the compute node, and filter returns True or False.

The scheduler_default_filters option in cinder.conf specifies the filter used by the filter scheduler, the default value is as follows:

Scheduler_default_filters = Availabilityzonefilter, Capacityfilter, Capabilitiesfilter

Filter Scheduler is filtered in the order of the list:

Availabilityzonefilter

To improve disaster tolerance and provide isolation services, storage nodes and compute nodes can be partitioned into different availability zones. For example, a machine in a rack is divided into a availability Zone. OpenStack has a default name of "Nova" availability Zone, and all nodes are initially placed in "Nova". Users can create their own availability Zone as needed.

When creating Volume, you need to specify the availability Zone to which Volume belongs.

When Cinder-scheduler is doing filtering, it uses Availabilityzonefilter to filter out storage nodes that are not part of the specified availability Zone.

Capacityfilter

When Volume is created, the user specifies the size of the Volume. The role of Capacityfilter is to filter out storage nodes where storage space does not meet Volume creation requirements.

Capabilitiesfilter

Different Volume Provider have their own characteristics (capabilities), such as whether to support thin provision and so on. Cinder allows the user to create Volume by Volume Type to specify the required capabilities.

Volume Type can define several capabilities as needed, describing the properties of Volume in detail. Volumevolume Type is similar to Nova's flavor.

Volume Type is managed in the admin-, System-, Volume menu

Defined by the Extra Specs of the Volume Type capabilities

Extra Specs is defined in the form of Key-value. Different Volume Provider support different Extra Specs, you need to refer to the Volume Provider documentation.

The Volume Type shown is only one Extra Specs "Volume_backend_name", which is the most important and necessary Extra Specs.

Cinder-volume will set the "Volume_backend_name" parameter in its own configuration file/etc/cinder/cinder.conf, which is named for the volume Provider of the storage node.

This allows the Capabilitiesfilter to filter out the specified Volume Provider through the "Volume_backend_name" of the Volume Type.

Different storage nodes can be configured with the same volume_backend_name in their respective cinder.conf, which is allowed. Because although the storage nodes are different, they may be using a Volume Provider.

If multiple storage nodes are selected in the first step filtering, then the next weighting link will pick out the most appropriate node.

Weighter

Filter Scheduler Specifies the weigher for calculating weights by scheduler_default_weighers, which defaults to Capacityweigher.

Scheduler_default_weighers = Capacityweigher

As the name suggests, Capacityweigher calculates the weight value based on the storage node's idle capacity, and the maximum free capacity wins.

In the next section we will begin to learn Cinder through various scenarios.


Mastering Cinder-scheduler Scheduling logic-5 minutes a day to play with OpenStack (48)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.