Host aggregates and its common usage


1.Host aggregates are a mechanism to further partition an availability zone, host aggregates are only visible to administrators

2. Each zone can have multiple aggregates, each compute node can only be in one zone, each compute node can have multiple aggregates, each aggregate can have multiple key-value pairs, and the same key-value pair can be assigned to multiple aggregates.

3. create aggregate and zone:
nova aggregate-create <name> <availability-zone>  # you can create new zone or use existed zone by run "nova-manage service list"

4. add compute node to aggregate:
nova aggregate-add-host <aggregate-name> <node-name>

5. related show commands:
nova host-list
nova service-list
nova-manage service  list
nova aggregate-list
nova aggregate-details <aggregate-name>

6. you can launch instance on particular nova compute host
nova boot ....  --availability-zone <zone-name>:<node-name>

Configure scheduler to support host aggregates

One common use case for host aggregates is when you want to support scheduling instances to a subset of compute hosts because they have a specific capability. For example, you may want to allow users to request compute hosts that have SSD drives if they need
access to faster disk I/O, or access to compute hosts that have GPU cards to take advantage of GPU-accelerated code.

1. on the host that runs the nova-scheduler service ( normally is controller)
vi /etc/nova/nova.conf
add AggregateInstanceExtraSpecsFilter to scheduler_default_filters=... line

service openstack-nova-api restart; service openstack-nova-scheduler restart; service openstack-nova-conductor restart

2. Example: Specify compute hosts with SSDs
nova aggregate-create fast-io nova
nova aggregate-set-metadata fast-io ssd=true

nova aggregate-add-host fast-io node1
nova aggregate-add-host fast-io node2

nova flavor-create ssd.large 6 4096 60 2
nova flavor-key ssd.large set ssd=true
nova flavor-show ssd.large

3. Now, when a user requests an instance with the ssd.largeflavor, the scheduler only considers hosts with the ssd=truekey-value pair. In this example, these are node1and node2.

你可能感兴趣的:(host,aggragate)