-- linux爱好者,业余时间热衷于分析linux内核源码 -- 目前主要研究云计算和虚拟化相关的技术,主要包括libvirt/qemu,openstack,opennebula架构和源码分析。 -- 第五届云计算大会演讲嘉宾 微博:@Marshal-Liu
分类: 云计算
2013-08-30 11:14:15
catalog其实是分级的
az在openstack中其实是nova-scheduler来实现的,当新建虚拟机,调度器将会根据nova-compute设置的az来调度,例如在新建虚拟机的时候,用户设置了希望将虚拟机放在az-1中,那么调度器将会选择属于这个az的nova-compute来调度,如下图所示。
#nova boot --image 1fe4b52c-bda5-11e2-a40b-f23c91aec05e --flavor large --availability-zone chicago:clocktower
指定instance clocktower将在availability
zone-chicago被创建,至于那些compute node属于哪一个az,是在nova.conf中通过参数node_availability_zone=xxx来配置的。
2. Aggregate Hosts
Availability zones are a customer-facing
capability, host aggregates are meant to be used by administrators to separate
hardware by particular properties, and are not seen by customers.
az是一个面向终端客户的概念和能力,而host aggregate是管理员用来根据硬件资源的某一属性来对硬件进行划分的功能,只对管理员可见。
其主要功能就是实现根据某一属性来划分物理机,比如按照地理位置,使用固态硬盘的机器,内存超过32G的机器,根据这些指标来构成一个host group。
nova aggregate-create joesservers chicago
Host aggregate可以用来进一步细分availability zone。
通过以上分析,问题就来了:availability zone和host aggregate都能对host machine进行划分,那么二者的区别是啥?
Availability zones are handy for allowing users to specify a particular group of servers on which they want their host to run, but beyond that they don’t do much more than serve as a bucket. In this example, using an availability zone, our users can specify that a VM should be started up in the Chicago data center.
Host aggregates, on the other hand, serve as an intelligent way for schedulers to know where to place VM’s based on some sort of characteristic. In this example, we might want to enable users to easily boot their most mission-critical VMs on servers that are administered by Joe, rather than leaving them to fate.
综上所述:az是用户可见的,用户手动的来指定vm运行在哪些host上;Host aggregate是一种更智能的方式,是调度器可见的,影响调度策略的一个表达式。