您的位置:首页 > 其它

nova-compute的虚拟机创建调度策略

2013-02-07 11:16 281 查看
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处!

文件 nova/scheduler/filter_scheduler.py

class FilterScheduler(driver.Scheduler)

->def schedule_run_instance

->self._schedule

->_schedule

->least_cost.weighted_sum

文件nova/schedul/least_cost.py

def weighted_sum

.........................

for host_state in host_states:

score = sum(weight * fn(host_state, weighing_properties)

for weight, fn in weighted_fns)


if min_score is None or score < min_score:

min_score, best_host = score, host_state

return WeightedHost(min_score, host_state=best_host)

每种调度策略给不同的权重,使用不同的调度策略根据物理主机的状态计算一个得分,得分与权重做乘运算,然后所有调度策略得分相加,计算出一个物理主机的和值,根据此值进行虚拟机实例的创建调度。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: