码迷,mamicode.com
首页 > 其他好文 > 详细

Specify compute hosts with SSDs

时间:2015-12-04 20:56:44      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:

在nova availability zone中创建 fast-io host aggregate

$ nova aggregate-create fast-io nova
+----+---------+-------------------+-------+----------+
| Id | Name    | Availability Zone | Hosts | Metadata |
+----+---------+-------------------+-------+----------+
| 1  | fast-io | nova              |       |          |
+----+---------+-------------------+-------+----------+

添加ssd=true key-value pair to the aggregate

$ nova aggregate-set-metadata 1 ssd=true
+----+---------+-------------------+-------+-------------------+
| Id | Name    | Availability Zone | Hosts | Metadata          |
+----+---------+-------------------+-------+-------------------+
| 1  | fast-io | nova              | []    | {ussd: utrue} |
+----+---------+-------------------+-------+-------------------+

把node1/2添加到aggregate

$ nova aggregate-add-host 1 node1
+----+---------+-------------------+-----------+-------------------+
| Id | Name    | Availability Zone | Hosts      | Metadata          |
+----+---------+-------------------+------------+-------------------+
| 1  | fast-io | nova              | [unode1] | {ussd: utrue} |
+----+---------+-------------------+------------+-------------------+

$ nova aggregate-add-host 1 node2
+----+---------+-------------------+---------------------+-------------------+
| Id | Name    | Availability Zone | Hosts                | Metadata          |
+----+---------+-------------------+----------------------+-------------------+
| 1  | fast-io | nova              | [unode1, unode2] | {ussd: utrue} |
+----+---------+-------------------+----------------------+-------------------+

创建ssd.large flavor, ID of 6, 8 GB of RAM, 80 GB root disk, and four vCPUs.

$ nova flavor-create ssd.large 6 8192 80 4
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 6  | ssd.large | 8192      | 80   | 0         |      | 4     | 1.0         | True      |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+

设置aggregate_instance_extra_specs filter的key-value pairs:

$ nova flavor-key ssd.large set  aggregate_instance_extra_specs:ssd=true

该filter的实现在:nova/scheduler/filters/aggregate_instance_extra_specs.py

$ nova flavor-show ssd.large
+----------------------------+--------------------------------------------------+
| Property                   | Value                                            |
+----------------------------+--------------------------------------------------+
| OS-FLV-DISABLED:disabled   | False                                            |
| OS-FLV-EXT-DATA:ephemeral  | 0                                                |
| disk                       | 80                                               |
| extra_specs                | {uaggregate_instance_extra_specs:ssd: utrue} |
| id                         | 6                                                |
| name                       | ssd.large                                        |
| os-flavor-access:is_public | True                                             |
| ram                        | 8192                                             |
| rxtx_factor                | 1.0                                              |
| swap                       |                                                  |
| vcpus                      | 4                                                |
+----------------------------+--------------------------------------------------+

现在使用ssd.large flavor来创建instance时,scheduler 只会考虑带有ssd=true key-value pair的host,也就是node1/2.

http://docs.openstack.org/liberty/config-reference/content/section_compute-scheduler.html

Specify compute hosts with SSDs

标签:

原文地址:http://www.cnblogs.com/allcloud/p/5020296.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!