实验环境;服务器,openstackY版
问题描述
openstack在删除实例时一直显示正在删除中
解决办法
进入数据库修改实例状态,修改为错误,然后重新删除
首先查看对应实例id
进入数据库修改
root@compute:~# mysql -uroot -p000000
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5843
Server version: 10.6.7-MariaDB-2ubuntu1.1 Ubuntu 22.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> use nova;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [nova]>
MariaDB [nova]> SELECT uuid, vm_state, task_state FROM instances WHERE uuid='4ef0c4ab-8b16-447e-b89b-009695320e07';
+--------------------------------------+----------+------------+
| uuid | vm_state | task_state |
+--------------------------------------+----------+------------+
| 4ef0c4ab-8b16-447e-b89b-009695320e07 | active | deleting |
+--------------------------------------+----------+------------+
1 row in set (0.000 sec)
MariaDB [nova]>
MariaDB [nova]> UPDATE instances SET vm_state='error', task_state=NULL WHERE uuid='4ef0c4ab-8b16-447e-b89b-009695320e07';
Query OK, 1 row affected (0.003 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [nova]>
验证查看
再次执行删除
快速执行该命令,替换id即可
mysql -uroot -p000000 -e "use nova; UPDATE instances SET vm_state='error', task_state=NULL WHERE uuid='2ab7c5cf-db9a-4615-ae42-bafb60