停止计算节点服务,此时该节点上的 vm 还能使用

[root@k8s01 ~]# nova service-list | grep  cmp38
| aeebc762-6bf8-49be-8809-e779658f0411 | nova-compute     | cmp38     | nova     | enabled | up    | 2020-09-18T11:26:24.000000 | -               | False       |
[root@k8s01 ~]# nova service-disable aeebc762-6bf8-49be-8809-e779658f0411
+--------------------------------------+-------+--------------+----------+
| ID                                   | Host  | Binary       | Status   |
+--------------------------------------+-------+--------------+----------+
| aeebc762-6bf8-49be-8809-e779658f0411 | cmp38 | nova-compute | disabled |
+--------------------------------------+-------+--------------+----------+
...

cmp38 down 掉,迁移该节点上的 vm

[root@k8s01 ~]# nova service-list
+--------------------------------------+------------------+-----------+----------+----------+-------+----------------------------+-----------------+-------------+
| Id                                   | Binary           | Host      | Zone     | Status   | State | Updated_at                 | Disabled Reason | Forced down |
+--------------------------------------+------------------+-----------+----------+-----

host-evacuate 迁移 cmp38 上面的 vm

[root@k8s01 ~]# nova hypervisor-servers cmp38
[root@k8s01 ~]# nova  host-evacuate cmp38
+--------------------------------------+-------------------+---------------+
| Server UUID                          | Evacuate Accepted | Error Message |
+--------------------------------------+-------------------+---------------+
| 184d5af2-f802-448d-81ff-299ee032ba59 | True              |               |
+--------------------------------------+-------------------+---------------+

删除计算节点服务

nova service-delete c cmp38
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐