nova aggregate

概述

aggregate进一步切分了availability zone的概念。AZ对用户是可见的,aggregate仅仅对管理员可见,用户并不可用。

aggregate的概念来自Xen的resource pool,后来抽象成aggregate的概念。管理员可以给aggregate设置metadata,一个host可以属于多个aggregate,基于aggregate的metadata可以高级调度功能。

grizzly及之后版本基于aggregate可以了两个功能:availability zone和特殊调度。

Availability zone

在grizzly版本之后,AZ都是基于aggregate实现的。原本数据库中的表service的availability_zone字段已删除。并且配置项node_availability_zone也无效。新增一个配置项default_availability_zone=nova,表示如果host不属于任何aggregate,或者aggregate没有设置availability-zone,那么host的AZ为nova。

grizzly中的aggregate和AZ以及Host的关系如图所示。
此图意为:系统有3个aggregate,并且设置了3个AZ。特别地host5既属于aggregateB也属于aggregateC,所以host5既属于az2,也属于az3。

20140108113702796

特殊调度

此外每一个aggregate还可以配置不同的metadata(AZ也是一个metadata) 如上图中所示,aggregateA被标记了ssd:true,表示这些host支持SSD,如果在flavor的extra-specs中配置了ssd:true,那么调度时,仅有这个aggregate的宿主机会通过过滤器。换言之,此flavor创建的虚拟机只能落在此aggregate上。

命令行接口

nova aggregate-list  
# Print a list of all aggregates.  

nova aggregate-create <name> <availability-zone>  
# Create a new aggregate named <name> in availability zone <availability-zone>. Returns the ID of the newly created aggregate.  

nova aggregate-delete <id>  
# Delete an aggregate with id <id>.  

nova aggregate-details <id>  
# Show details of the aggregate with id <id>.  

nova aggregate-add-host <id> <host>  
# Add host with name <host> to aggregate with id <id>.  

nova aggregate-remove-host <id> <host>  
# Remove the host with name <host> from the aggregate with id <id>.  

nova aggregate-set-metadata <id> <key=value> [<key=value> ...]  
# Add or update metadata (key-value pairs) associated with the aggregate with id <id>.  

nova aggregate-update <id> <name> [<availability_zone>]  
# Update the aggregate's name and optionally availability zone.  

nova host-list  
# List all hosts by service.  

nova host-update --maintenance [enable | disable]  
#Put/resume host into/from maintenance.  

参考:http://docs.openstack.org/trunk/openstack-compute/admin/content/host-aggregates.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注