首页 > 其他 > 详细

nova Scheduling 配置

时间:2015-12-05 00:28:16      阅读:526      评论:0      收藏:0      [点我收藏+]

 

 

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, DiskFilter, ComputeFilter, ComputeCapabilitiesFilter,
ImagePropertiesFilter, ServerGroupAntiAffinityFilter, ServerGroupAffinityFilter

 

 

 

DiskFilter

调度的hosts需要足够的剩余disk给 root and ephemeral.

$ nova hypervisor-stats
+----------------------+-------+
| Property             | Value |
+----------------------+-------+
| count                |  1    |
| current_workload     |  0    |
| disk_available_least |  29   |
| free_disk_gb         |  35   |
| free_ram_mb          |  3441 |
| local_gb             |  35   |
| local_gb_used        |  0    |
| memory_mb            |  3953 |
| memory_mb_used       |  512  |
| running_vms          |  0    |
| vcpus                |  2    |
| vcpus_used           |  0    |
+----------------------+-------+

可以看到disk_available_least要小于free_disk_gb, disk_available_least是计算virtual size而不是image的实际大小。如果image是sparse or copy on write,那么它

实际大小要比virtual size小。

调度依据disk_available_least而不是free_disk_gb。

disk_allocation_ratio = 1.0 默认不disk over commitment,如果需要,设置 > 1 ,同时注意 free_disk_gb。它代表的是真实的磁盘空余。

GroupAffinityFilter

已经被ServerGroupAffinityFilter取代了。需要设置scheduler hint,其中,group 为key

$ nova boot --image IMAGE_ID --flavor 1 --hint group=foo server-1

不能和 GroupAntiAffinityFilter同时使用,否则2个都不生效。

ImagePropertiesFilter

根据instance‘s image上定义的属性来过滤,熟悉包括

architecture, hypervisor type, hypervisor version (for Xen hypervisor type only), and virtual machine mode。

比如,

$ glance image-update img-uuid --property architecture=arm --property hypervisor_type=qemu

IsolatedHostsFilter

定义特殊的image 集合只能运行在特殊的host集合上。设置flag restrict_isolated_hosts_to_isolated_images来enable。

需要事先在nova.conf里面设置isolated_images/isolated_hosts。

比如:

isolated_hosts = server1, server2
isolated_images = 342b492c-128f-4a42-8d3a-c5088cf27d13, ebd267a6-ca86-4d6c-9a0e-bd132d6b7d09

IoOpsFilter

host上的io并发超过max_io_ops_per_host 的会被过滤掉。

JsonFilter

自定义的json格式的scheduler hint。

支持的变量有:

  • $free_ram_mb

  • $free_disk_mb

  • $total_usable_ram_mb

  • $vcpus_total

  • $vcpus_used

比如

$ nova boot --image 827d564a-e636-4fc4-a376-d36f7ebe1747   --flavor 1 --hint query=[">=","$free_ram_mb",1024] server1

在API中使用os:scheduler_hints key:

{
    "server": {
        "name": "server-1",
        "imageRef": "cedef40a-ed67-4d10-800e-17455edce175",
        "flavorRef": "1"
    },
    "os:scheduler_hints": {
        "query": "[>=,$free_ram_mb,1024]"
    }
}

MetricsFilter

根据host上的meters weight_setting来过滤。

NumInstancesFilter

host上的instance数量大于max_instances_per_host则被过滤掉。

PciPassthroughFilter

Host上的设备满足flavor 里面定义的extra_specs 。

RamFilter

可以使用ram_allocation_ratio = 1.5来超用。

RetryFilter

如果调度的host,而host没能相应调度需求的次数超过scheduler_max_attempts,则过滤掉该host。

SameHostFilter

调度到和其他instance相同的host上。使用--hint flag。与DifferentHostFilter正好相反。

$ nova boot --image cedef40a-ed67-4d10-800e-17455edce175 --flavor 1   --hint same_host=a0cf03a5-d921-4877-bb5c-86d26cf818e1   --hint same_host=8c19174f-4220-44f0-824a-cd1eeef10287 server-1

With the API, use the os:scheduler_hints key:

{
    "server": {
        "name": "server-1",
        "imageRef": "cedef40a-ed67-4d10-800e-17455edce175",
        "flavorRef": "1"
    },
    "os:scheduler_hints": {
        "same_host": [
            "a0cf03a5-d921-4877-bb5c-86d26cf818e1",
            "8c19174f-4220-44f0-824a-cd1eeef10287"
        ]
    }
}

 

 

 

 

 

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

 

nova Scheduling 配置

原文:http://www.cnblogs.com/allcloud/p/5020744.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!