gtw03 节点挂掉,导致该 L3 agent 上的 router router3 失联,导致连接该 router 的 vm 失联
目的:将 router3 迁移到 gtw02
1、查看 router
[root@k8s01 ~]# neutron router-list
2、查看 router 对应的 L3 agent host
[root@k8s01 ~]# neutron l3-agent-list-hosting-router router3
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+--------------------------------------+-----------+----------------+-------+----------+
| id | host | admin_state_up | alive | ha_state |
+--------------------------------------+-----------+----------------+-------+----------+
| 73bf0dbf-0365-490a-a852-252b11681bdb | uat-gtw03 | True | xxx | |
+--------------------------------------+-----------+----------------+-------+----------+
xxx 表示 host down,这个不怎么准确,最好多刷新几次
3、查看所有的 L3 agent
[root@k8s01 ~]# neutron agent-list | grep L3
..
4、删除 router3
[root@k8s01 ~]# neutron l3-agent-router-remove 73bf0dbf-0365-490a-a852-252b11681bdb router3
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Removed router router3 from L3 agent
openstack 自动将 router3 迁移到 uat-gtw01 节点
[root@k8s01 ~]# neutron l3-agent-list-hosting-router router3
5、删除网络节点(** 慎重 **)
停止节点
[root@k8s01 ~]# neutron agent-list | grep uat-gtw03
[root@k8s01 ~]# neutron agent-update 73bf0dbf-0365-490a-a852-252b11681bdb --admin-state-down
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Updated agent: 73bf0dbf-0365-490a-a852-252b11681bdb
[root@k8s01 ~]# neutron agent-list | grep uat-gtw03
...
删除节点
[root@k8s01 ~]# neutron agent-delete 73bf0dbf-0365-490a-a852-252b11681bdb
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Deleted agent(s): 73bf0dbf-0365-490a-a852-252b11681bdb
[root@k8s01 ~]# neutron agent-list | grep uat-gtw03
...
下面依次删除 uat-gtw03 节点上的 neutron-lbaasv2-agent、neutron-openvswitch-agent、 neutron-metadata-agent、neutron-dhcp-agent
[root@k8s01 ~]# neutron agent-delete 8eae073a-232a-45fc-a25d-a49846faebca
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Deleted agent(s): 8eae073a-232a-45fc-a25d-a49846faebca
[root@k8s01 ~]# neutron agent-delete 96743b09-588f-462c-8a64-5368aba7382a
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Deleted agent(s): 96743b09-588f-462c-8a64-5368aba7382a
[root@k8s01 ~]# neutron agent-delete a1b6906d-ac09-41f1-88a4-a1137bcf6d8b
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Deleted agent(s): a1b6906d-ac09-41f1-88a4-a1137bcf6d8b
[root@k8s01 ~]# neutron agent-delete cdc2ad81-0bc2-4569-84ea-28476823db6f
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
Deleted agent(s): cdc2ad81-0bc2-4569-84ea-28476823db6f
参考文章:
https://cloud.garr.it/support/kb/openstack/migrate_virtual_router/;