为什么nova不像cinder一样是工作流的形式???
描述 | 详细 |
- 日志显示初始有两个 host(在我们的实验环境中就是controller和compute),依次经过若干filter 的过滤,两个计算节点都通过了。
- 过滤器补充:
- DifferentHostFilter:allows the instance on a different host from a set of instances.选择与一组虚拟机不同位置的主机
- SameHostFilter:puts the instance on the same host as another instance in a set of instances选择与一组虚拟机相同位置的主机
- 过滤器位置\opt\stack\nova\nova\scheduler\filters\
| | Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.filters [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Starting with 2 host(s)
{{(pid=25303) get_filtered_objects /opt/stack/nova/nova/filters.py:70
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.scheduler.filters.retry_filter
[None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Re-scheduling is disabled
{{(pid=25303) host_passes /opt/stack/nova/nova/scheduler/filters/retry_filter.py:38
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.scheduler.filters.retry_filter
[None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Re-scheduling is disabled
{{(pid=25303) host_passes /opt/stack/nova/nova/scheduler/filters/retry_filter.py:38
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.filters [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Filter RetryFilter returned 2 host(s)
{{(pid=25303) get_filtered_objects /opt/stack/nova/nova/filters.py:104
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.filters [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Filter AvailabilityZoneFilter returned 2 host(s)
{{(pid=25303) get_filtered_objects /opt/stack/nova/nova/filters.py:104
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.filters [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Filter ComputeFilter returned 2 host(s)
{{(pid=25303) get_filtered_objects /opt/stack/nova/nova/filters.py:104
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.filters [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Filter ComputeCapabilitiesFilter returned 2 host(s)
{{(pid=25303) get_filtered_objects /opt/stack/nova/nova/filters.py:104
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.filters [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Filter ImagePropertiesFilter returned 2 host(s)
{{(pid=25303) get_filtered_objects /opt/stack/nova/nova/filters.py:104}}
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.filters [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Filter ServerGroupAntiAffinityFilter returned 2 host(s)
{{(pid=25303) get_filtered_objects /opt/stack/nova/nova/filters.py:104}}
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.filters [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Filter ServerGroupAffinityFilter returned 2 host(s)
{{(pid=25303) get_filtered_objects /opt/stack/nova/nova/filters.py:104}}
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.filters [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Filter SameHostFilter returned 2 host(s)
{{(pid=25303) get_filtered_objects /opt/stack/nova/nova/filters.py:104}}
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.filters [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Filter DifferentHostFilter returned 2 host(s)
{{(pid=25303) get_filtered_objects /opt/stack/nova/nova/filters.py:104}}
|
|
- 接下来就该 weight 了,可以看到controller和compute内存一致,因此比较磁盘得到结果:controller(1.95...)的权重小于compute(2),最终选择compute
- 要显示 DEBUG 日志,需要在 /etc/nova/nova.conf 中打开 debug 选项
| | Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.scheduler.filter_scheduler [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Filtered [
(compute, compute) ram: 7471MB disk: 41984MB io_ops: 0 instances: 0,
(controller, controller) ram: 7471MB disk: 39936MB io_ops: 0 instances: 0]
{{(pid=25303) _get_sorted_hosts /opt/stack/nova/nova/scheduler/filter_scheduler.py:404}}
|
| Jun 16 13:12:50 controller nova-scheduler[25303]:
DEBUG nova.scheduler.filter_scheduler [None req-d9a23179-e16d-4016-9586-e68c3dfdf6a9 admin admin]
Weighed [WeighedHost
[host: (compute, compute) ram: 7471MB disk: 41984MB io_ops: 0 instances: 0, weight: 2.0],
WeighedHost
[host: (controller, controller) ram: 7471MB disk: 39936MB io_ops: 0 instances: 0, weight: 1.9512195122]]
{{(pid=25303) _get_sorted_hosts /opt/stack/nova/nova/scheduler/filter_scheduler.py:423}} |
|