[root@controller ~]# cinder list 8 L0 B! R; y6 R& {9 V: e" J
+--------------------------------------+-----------+------+------+-------------+----------+-------------+# b3 |! g2 }/ y5 i! Q1 b+ n$ T! N
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |/ a. ]/ k7 a3 s- s6 L2 S
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
+ c1 B( E9 Y. f* a% m) O| 409f3a86-2bd6-413c-86f0-f41f59b8d840 | available | test | 1 | __DEFAULT__ | true | |. ]4 |$ G& t7 O3 u, f/ N* v
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
% M2 H" _/ C) S4 \1 q
5 V# E" s1 j. M还是删除失败:; K$ y' t, n6 H* E+ g$ r5 D/ I7 n
只能清理数据库了:7 K) F) M8 z6 \/ H5 G2 z6 l8 x
这就需要在控制节点在数据库删除了,因为此时虽然在物理机上已经删除了,但是数据库中还有该记录 ,不能直接删除记录,数据库有外键依赖,要把 cinder 卷的 deleted 改成 “1”. S- E+ g) ?2 e& |% i$ D
" J8 u( W& |) t
7 ?5 D3 ~% Q8 b4 k8 O9 ?在控制节点操作删除卷1) 进入数据库 mysql -u cinder -pxxxxxx -hIP cinder [root@controller ~]# mysql -u cinder -pxxxx cinder
5 M& N" x; J1 l0 [3 t8 f" u2 k1 W& F! IReading table information for completion of table and column names
+ o1 Y& w+ F. S" k- e% iYou can turn off this feature to get a quicker startup with -A Welcome to the MariaDB monitor. Commands end with ; or \g.0 H* j6 n" Y0 s% @8 u$ E' O! H/ Z) ~
Your MariaDB connection id is 4298 `% }* C& L1 l- _# V6 y
Server version: 10.3.28-MariaDB MariaDB Server 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 [cinder]> 2) 进入 cinder 数据库表 或者使用 mysql -u cinder -pxxxx use cinder; 3) selete 找到出错的表 MariaDB [cinder]> select id,status,display_name from volumes where id='409f3a86-2bd6-413c-86f0-f41f59b8d840';
# ~7 Q/ f% c$ A9 f+--------------------------------------+-----------+--------------+7 h6 l1 @3 a9 n6 P9 ~" c
| id | status | display_name |
5 H+ w$ b0 O2 C% |+ Z3 q+--------------------------------------+-----------+--------------+
) \3 c4 @3 C7 s8 o) V3 h( t| 409f3a86-2bd6-413c-86f0-f41f59b8d840 | available | test |
# y+ t; j6 t- t) d. S+--------------------------------------+-----------+--------------+
0 D5 l* ~ }9 |' Q1 row in set (0.000 sec) 4) 修改数据库 cinder 相关卷记录 MariaDB [cinder]> update volumes set deleted='1' where id='409f3a86-2bd6-413c-86f0-f41f59b8d840';! b) @+ w+ f0 J7 }1 T
Query OK, 1 row affected (0.001 sec)5 Q2 W; q, c1 L0 n; f2 v$ }
Rows matched: 1 Changed: 1 Warnings: 0 到此问题解决 注意别忘了重新打开刚才 stop 的 cinder 相关服务
! l* |: @8 J6 W8 |% v Z
, e1 ]7 N: z/ X4 j" B- O) L( `
2 a! p& S# j: k; O3 c5 Y |