使用 host aggregates 逻辑分离这两个 hypervisors

2021-09-24 14:28:01 浏览数 (1)

Host aggregates

现在我们需要使用 host aggregates 逻辑分离这两个 hypervisors,为了实现这个,我们创建了两个 aggregates:

代码语言:javascript复制
$ nova aggregate-create ceph-compute-storage1
 ---- ----------------------- ------------------- ------- ---------- 
| Id | Name                  | Availability Zone | Hosts | Metadata |
 ---- ----------------------- ------------------- ------- ---------- 
| 1  | ceph-compute-storage1 | -                 |       |          |
 ---- ----------------------- ------------------- ------- ---------- 
$ nova aggregate-create ceph-compute-storage2
 ---- ----------------------- ------------------- ------- ---------- 
| Id | Name                  | Availability Zone | Hosts | Metadata |
 ---- ----------------------- ------------------- ------- ---------- 
| 2  | ceph-compute-storage2 | -                 |       |          |
 ---- ----------------------- ------------------- ------- ---------- 

现在添加 hypervisor 到他们各自的 aggregates:

代码语言:javascript复制
$ nova aggregate-add-host ceph-compute-storage1 compute-ceph1
Host compute-ceph1 has been successfully added for aggregate 1
 ---- ----------------------- ------------------- ----------------- ---------- 
| Id | Name                  | Availability Zone | Hosts           | Metadata |
 ---- ----------------------- ------------------- ----------------- ---------- 
| 1  | ceph-compute-storage1 | -                 | 'compute-ceph1' |          |
 ---- ----------------------- ------------------- ----------------- ---------- 
$ nova aggregate-add-host ceph-compute-storage2 compute-ceph2
Host compute-ceph2 has been successfully added for aggregate 2
 ---- ----------------------- ------------------- ----------------- ---------- 
| Id | Name                  | Availability Zone | Hosts           | Metadata |
 ---- ----------------------- ------------------- ----------------- ---------- 
| 2  | ceph-compute-storage2 | -                 | 'compute-ceph2' |          |
 ---- ----------------------- ------------------- ----------------- ---------- 

最后设置一个特定的元数据,稍后会被 Nova flavor 记录:

代码语言:javascript复制
$ nova aggregate-set-metadata 1 cephcomputestorage1=true
Metadata has been successfully updated for aggregate 1.
 ---- ----------------------- ------------------- ----------------- ---------------------------- 
| Id | Name                  | Availability Zone | Hosts           | Metadata                   |
 ---- ----------------------- ------------------- ----------------- ---------------------------- 
| 1  | ceph-compute-storage1 | -                 | 'compute-ceph1' | 'cephcomputestorage1=true' |
 ---- ----------------------- ------------------- ----------------- ---------------------------- 
$ nova aggregate-set-metadata 2 cephcomputestorage2=true
Metadata has been successfully updated for aggregate 2.
 ---- ----------------------- ------------------- ----------------- ---------------------------- 
| Id | Name                  | Availability Zone | Hosts           | Metadata                   |
 ---- ----------------------- ------------------- ----------------- ---------------------------- 
| 2  | ceph-compute-storage2 | -                 | 'compute-ceph2' | 'cephcomputestorage2=true' |
 ---- ----------------------- ------------------- ----------------- ---------------------------- 

0 人点赞