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

Source: Internet
Author: User

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466033624591050732.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466034080769084039.jpg "style=" border:0px;float:none; "/>

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.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466033702311001361.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466034080900009627.jpg "alt=" Image154.png "style=" border:0px; "/>

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

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466033624600015729.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466034081255069892.jpg "style=" border:0px;white-space:normal;float:none; "/>

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.
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466033624578076693.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466034081358000194.jpg "style=" border:0px;font-family: ' Microsoft ya black '; white-space:normal; Float:none; "/>

Capabilitiesfilter


650) this.width=650; "title="/HTTP// 7xo6kd.com1.z0.glb.clouddn.com/upload-ueditor-image-20160616-1466033624693089219.png "src=" http// 7xo6kd.com1.z0.glb.clouddn.com/upload-ueditor-image-20160616-1466034081464094558.jpg "style=" border:0px; font-family: ' Microsoft Jacob Black '; white-space:normal;float:none;/>

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

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466033624731061010.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466034081530061629.jpg "style=" border:0px;font-family: ' Microsoft ya black '; white-space:normal; Float:none; "/>

Defined by the Extra Specs of the Volume Type capabilities

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466033624707004908.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466034081616052889.jpg "style=" border:0px;white-space:normal;float:none; "/>

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.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466033624799037241.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466034081690084757.jpg "style=" border:0px;white-space:normal;float:none; "/>

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.

650) this.width=650; "title=" "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160616-1466034081784021746.jpg "style=" Border:0px;vertical-align:middle;color:rgb ( 63,63,63); font-family: ' Microsoft Yahei '; Font-size:15px;line-height:21.75px;text-align:justify;background-color: RGB (246,246,246); "/>

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.