openstack compute service delete $node_id 提示报错
(venv) root@cn02-kvm_hy:~# openstack compute service delete d2ad1e42-43fb-43f2-a4bf-62be92b8eadf
Failed to delete compute service with ID 'd2ad1e42-43fb-43f2-a4bf-62be92b8eadf': ConflictException: 409: Client Error for url: http://10.191.3.2:8774/v2.1/os-services/d2ad1e42-43fb-43f2-a4bf-62be92b8eadf, Unable to delete compute service that has in-progress migrations. Complete the migrations or delete the instances first.
1 of 1 compute services failed to delete.
#查看 migrations list 的状态
(venv) root@cn02-kvm_hy:~# openstack server migration list | grep 'cn08-kvm_hy' |grep 'confirmed'
| cn01-kvm_hy | cn08-kvm_hy | cn01-kvm_hy | cn08-kvm_hy | 10.191.3.18 | confirmed | 82e7732c-19f7-474a-b9b8-4f9a3031de41 | 3 | 6 | 2024-05-04T10:04:05.000000 | 2024-05-04T10:04:19.000000 |
#进入数据库 修改 状态,把 finished 和confirmed 都修改成 completed
MariaDB [nova]> select * from migrations limit 1 \G;
*************************** 1. row ***************************
created_at: 2023-05-12 09:25:37
updated_at: 2023-05-12 09:27:09
deleted_at: 2023-06-01 07:25:12
id: 3
source_compute: cn01-kvm_hy
dest_compute: cn01-kvm_hy
dest_host: 10.191.3.11
status: confirmed
instance_uuid: e83b63bf-6367-40da-98c7-918c9cecf860
old_instance_type_id: 30
new_instance_type_id: 24
source_node: cn01-kvm_hy
dest_node: cn01-kvm_hy
deleted: 3
migration_type: resize
hidden: 0
memory_total: NULL
memory_processed: NULL
memory_remaining: NULL
disk_total: NULL
disk_processed: NULL
disk_remaining: NULL
uuid: 603f834e-8968-4931-9431-3d51df5471aa
cross_cell_move: 0
user_id: 0bec5a85e7cc473b8d792b8601f8a321
project_id: 904417ef41cc402d8a2fcf6f85ab3613
ERROR: No query specified
MariaDB [nova]> select id,source_compute,dest_compute,source_node,dest_node,status from migrations where status='confirmed';
+------+----------------+----------------+----------------+----------------+-----------+
| id | source_compute | dest_compute | source_node | dest_node | status |
+------+----------------+----------------+----------------+----------------+-----------+
| 3 | cn01-kvm_hy | cn01-kvm_hy | cn01-kvm_hy | cn01-kvm_hy | confirmed |
| 180 | cn03-kvm_hy | cn03-kvm_hy | cn03-kvm_hy | cn03-kvm_hy | confirmed |
| 183 | cn03-kvm_hy | cn03-kvm_hy | cn03-kvm_hy | cn03-kvm_hy | confirmed |
| 273 | cn06-kvm_hy | cn04-kvm_hy | cn06-kvm_hy | cn04-kvm_hy | confirmed |
| 648 | cn01-kvm_hy | cn01-kvm_hy | cn01-kvm_hy | cn01-kvm_hy | confirmed |
| 651 | cn04-kvm_hy | cn05-kvm_hy | cn04-kvm_hy | cn05-kvm_hy | confirmed |
| 954 | cn07-kvm_hy | cn15-kvm_hy | cn07-kvm_hy | cn15-kvm_hy | confirmed |
| 972 | cn01-kvm_hy | cn09-kvm_hy | cn01-kvm_hy | cn09-kvm_hy | confirmed |
| 1065 | cn01-kvm_hy | cn08-kvm_hy | cn01-kvm_hy | cn08-kvm_hy | confirmed |
+------+----------------+----------------+----------------+----------------+-----------+
9 rows in set (0.001 sec)
MariaDB [nova]> update migrations set status='completed' where id IN (3,180,183,273,648,651,954,972)
-> ;
Query OK, 8 rows affected (0.001 sec)
Rows matched: 8 Changed: 8 Warnings: 0
MariaDB [nova]> select id,source_compute,dest_compute,source_node,dest_node,status from migrations where status='finished';
+------+----------------+----------------+----------------+----------------+----------+
| id | source_compute | dest_compute | source_node | dest_node | status |
+------+----------------+----------------+----------------+----------------+----------+
| 1491 | cn08-kvm_hy | cn04-kvm_hy | cn08-kvm_hy | cn04-kvm_hy | finished |
| 1506 | cn08-kvm_hy | cn04-kvm_hy | cn08-kvm_hy | cn04-kvm_hy | finished |
| 1509 | cn08-kvm_hy | cn04-kvm_hy | cn08-kvm_hy | cn04-kvm_hy | finished |
| 1512 | cn08-kvm_hy | cn04-kvm_hy | cn08-kvm_hy | cn04-kvm_hy | finished |
| 1560 | cn08-kvm_hy | cn04-kvm_hy | cn08-kvm_hy | cn04-kvm_hy | finished |
| 1563 | cn08-kvm_hy | cn04-kvm_hy | cn08-kvm_hy | cn04-kvm_hy | finished |
| 1566 | cn08-kvm_hy | cn04-kvm_hy | cn08-kvm_hy | cn04-kvm_hy | finished |
| 1569 | cn08-kvm_hy | cn04-kvm_hy | cn08-kvm_hy | cn04-kvm_hy | finished |
+------+----------------+----------------+----------------+----------------+----------+
8 rows in set (0.001 sec)
MariaDB [nova]> update migrations set status='completed' where id IN (1491,1506,1509,1512,1560,1563,1566,1569);
Query OK, 8 rows affected (0.002 sec)
Rows matched: 8 Changed: 8 Warnings: 0
#再次删除
(venv) root@cn01-kvm_hy:~# openstack compute service delete d2ad1e42-43fb-43f2-a4bf-62be92b8eadf
(venv) root@cn01-kvm_hy:~#
#删除网络agent 节点服务
(venv) root@cn01-kvm_hy:~# openstack network agent list | grep cn08-kvm_hy
| 9ddc2b66-90c2-4362-a97a-d4b4b62a35bc | Linux bridge agent | cn08-kvm_hy | None | XXX | UP | neutron-linuxbridge-agent |
(venv) root@cn01-kvm_hy:~# openstack network agent delete 9ddc2b66-90c2-4362-a97a-d4b4b62a35bc
(venv) root@cn01-kvm_hy:~#