[root@controller ~]# cinder list 7 e! a1 E8 I% p
+--------------------------------------+-----------+------+------+-------------+----------+-------------+8 M$ |; h+ X/ L! w, c/ x" k9 v
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |- w* a: k% N! ~0 X O% A' v' `9 C3 S
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
; C2 t% m4 N* J, P; F; U| 409f3a86-2bd6-413c-86f0-f41f59b8d840 | available | test | 1 | __DEFAULT__ | true | |5 H1 R& Z' ?- _6 D/ Q
+--------------------------------------+-----------+------+------+-------------+----------+-------------+
^+ V# r9 T* u; }" y. ]' _! f+ \9 ?: v
还是删除失败:+ h5 |2 t, @4 c
只能清理数据库了:
; \- t) r4 F: ]& ~' F; f这就需要在控制节点在数据库删除了,因为此时虽然在物理机上已经删除了,但是数据库中还有该记录 ,不能直接删除记录,数据库有外键依赖,要把 cinder 卷的 deleted 改成 “1” e. ]2 b. [# _7 l
( B0 n$ y+ V. m: S1 i, M6 r" }+ h
$ h4 f5 W% u7 h在控制节点操作删除卷1) 进入数据库 mysql -u cinder -pxxxxxx -hIP cinder [root@controller ~]# mysql -u cinder -pxxxx cinder
- q3 _8 t% t* GReading table information for completion of table and column names
8 o6 J: k/ x8 q7 v. oYou can turn off this feature to get a quicker startup with -A Welcome to the MariaDB monitor. Commands end with ; or \g.
, e3 h' p6 ]% k- B oYour MariaDB connection id is 429
+ \# A6 J, f3 F/ c z" I& O' g! X% gServer 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 r: G z+ [4 v, W5 \+ |* Q+--------------------------------------+-----------+--------------+
6 `' J. t' |# i: D0 s% F$ v| id | status | display_name |
# m& g: O. Z; c+--------------------------------------+-----------+--------------+: J( b: y5 f7 I/ P7 ]8 ~
| 409f3a86-2bd6-413c-86f0-f41f59b8d840 | available | test |
5 J( X9 k6 _, w+--------------------------------------+-----------+--------------+
4 ^* t& r( H2 n U5 \1 row in set (0.000 sec) 4) 修改数据库 cinder 相关卷记录 MariaDB [cinder]> update volumes set deleted='1' where id='409f3a86-2bd6-413c-86f0-f41f59b8d840';- S- }* u, Z5 B& Q5 b" y
Query OK, 1 row affected (0.001 sec)! p' {2 P" E6 B9 \( H" h6 z
Rows matched: 1 Changed: 1 Warnings: 0 到此问题解决 注意别忘了重新打开刚才 stop 的 cinder 相关服务
0 Z' q# w- f% C* V
% v. i) h( w+ N: V" w% G
8 w1 R6 j& d/ K% B1 `- w |