15.7. 删除 overcloud 堆栈
您可以删除 overcloud 堆栈,并取消置备所有堆栈节点。
注意
删除 overcloud 堆栈不会清除所有 overcloud 数据。如果您需要删除所有 overcloud 数据,请联系红帽支持。
流程
-
以
stack
用户身份登录 undercloud 主机。 查找
stackrc
undercloud 凭证文件:$ source ~/stackrc
检索堆栈中所有节点的列表及其当前状态:
(undercloud)$ openstack baremetal node list +--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+ | UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance | +--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+ | 92ae71b0-3c31-4ebb-b467-6b5f6b0caac7 | compute-0 | 059fb1a1-53ea-4060-9a47-09813de28ea1 | power on | active | False | | 9d6f955e-3d98-4d1a-9611-468761cebabf | compute-1 | e73a4b50-9579-4fe1-bd1a-556a2c8b504f | power on | active | False | | 8a686fc1-1381-4238-9bf3-3fb16eaec6ab | controller-0 | 6d69e48d-10b4-45dd-9776-155a9b8ad575 | power on | active | False | | eb8083cc-5f8f-405f-9b0c-14b772ce4534 | controller-1 | 1f836ac0-a70d-4025-88a3-bbe0583b4b8e | power on | active | False | | a6750f1f-8901-41d6-b9f1-f5d6a10a76c7 | controller-2 | e2edd028-cea6-4a98-955e-5c392d91ed46 | power on | active | False | +--------------------------------------+--------------+--------------------------------------+-------------+--------------------+-------------+
删除 overcloud 堆栈并取消置备节点和网络:
(undercloud)$ openstack overcloud delete -b <node_definition_file> \ --networks-file <networks_definition_file> --network-ports <stack>
-
将
<node_definition_file
> 替换为节点定义文件的名称,如overcloud-baremetal-deploy.yaml
。 -
将
<networks_definition_file
> 替换为网络定义文件的名称,如network_data_v2.yaml
。 -
将 <
;stack> 替换为您要删除的堆栈的名称。如果未指定,则默认堆栈为overcloud
。
-
将
确认您要删除 overcloud:
Are you sure you want to delete this overcloud [y/N]?
- 等待 overcloud 删除,以及节点和网络取消置备。
确认裸机节点已被取消置备:
(undercloud) [stack@undercloud-0 ~]$ openstack baremetal node list +--------------------------------------+--------------+---------------+-------------+--------------------+-------------+ | UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance | +--------------------------------------+--------------+---------------+-------------+--------------------+-------------+ | 92ae71b0-3c31-4ebb-b467-6b5f6b0caac7 | compute-0 | None | power off | available | False | | 9d6f955e-3d98-4d1a-9611-468761cebabf | compute-1 | None | power off | available | False | | 8a686fc1-1381-4238-9bf3-3fb16eaec6ab | controller-0 | None | power off | available | False | | eb8083cc-5f8f-405f-9b0c-14b772ce4534 | controller-1 | None | power off | available | False | | a6750f1f-8901-41d6-b9f1-f5d6a10a76c7 | controller-2 | None | power off | available | False | +--------------------------------------+--------------+---------------+-------------+--------------------+-------------+
删除堆栈目录:
$ rm -rf ~/overcloud-deploy/<stack> $ rm -rf ~/config-download/<stack>
注意如果使用
openstack overcloud deploy
命令部署 overcloud 时使用了--output-dir
和--working-dir
选项,则堆栈的目录路径可能与默认值不同。