|
|
- D6 l- p; i7 v% r* ]查看有多少镜像:
\; {' k( Z5 O! g5 Y$ L! U7 W[root@ceph1 ~]# rbd ls -p images -l |grep d25d8b59-dfff-4f2b-b63e-aa22dc533778
' A& x2 x, V- S. s0 S/ jd25d8b59-dfff-4f2b-b63e-aa22dc533778 2 GiB 2 7 b* U, p& o- b- z7 l/ S9 h) k( G
d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap 2 GiB 2 yes . t& _. _' I8 {" v0 B6 `
, Z4 s8 t g' t; P; C
解除父进程关系:
' [( F" N) z. V* Y& _/ L[root@ceph1 ~]# rbd children images/d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap2 L7 Q5 Z; B" u. _) \, R
rbd: listing children failed: 2021-12-29 15:45:01.087 7f6ad90a1b00 -1 librbd::api::Image: list_descendants: error looking up name for image id 9753a327e2e1b4 in pool volumes-hdd(2) No such file or directory" J9 ~1 J6 b6 z( M9 `1 `( O4 j
* v- z& `/ [% L z# T失败,再次尝试
. E) Q; o% d1 _ P, \( a[root@ceph1 ~]# rbd children images/d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap) {* T% ^) k( I
rbd: listing children failed: 2021-12-29 15:45:31.459 7fad7a5d1b00 -1 librbd::api::Image: list_descendants: error looking up name for image id 9753a327e2e1b4 in pool volumes-hdd(2) No such file or directory0 R; }- G' z6 w1 O# M3 h! p" @
0 g9 P; X5 e; O, V[root@ceph1 ~]# rbd children images/d25d8b59-dfff-4f2b-b63e-aa22dc533778
: l7 L' C$ a' \! u! G$ X- x6 arbd: listing children failed: 2021-12-29 15:45:59.067 7fbb3d475b00 -1 librbd::api::Image: list_descendants: error looking up name for image id 9753a327e2e1b4 in pool volumes-hdd(2) No such file or directory
# B: s% j+ U& J# S* x4 D7 x" ~. ?
到报错的pool池中查找,也无相关的记录:; Z* I3 B/ p" L+ d! x
[root@ceph1 ~]# rbd ls -p volumes-hdd |grep 9753a327e2e1b4) \4 y* E& b, m2 g; ?' F1 T# {
[root@ceph1 ~]# rbd ls -p volumes-hdd |grep 9753a327e2e1b4* [' v" Q6 \5 f! G2 c
[root@ceph1 ~]# rbd ls -p volumes-hdd |grep 9753a32
, q# W. R o) D4 B' q# B[root@ceph1 ~]# rbd ls -p volumes-hdd 0 J3 b; l }; o1 h% k+ n/ ~
[root@ceph1 ~]# rbd ls -p volumes-hdd
- k c% w7 `; z4 }2 `[root@ceph1 ~]# rbd ls -p volumes-hdd+ A8 e6 ]6 U6 Y0 |8 w9 m
[root@ceph1 ~]# 1 M1 g H+ A" I; T" i& d" L
[root@ceph1 ~]# x3 U v7 v f
[root@ceph1 ~]# " ^0 h0 H9 h B+ m- w5 k
[root@ceph1 ~]#3 `3 g* ]. q- P+ ^2 }$ }
- l% y! f! }) t, P& W! q$ R, V查看所有的镜像:, k6 M1 r" w- t8 o3 R: C% h
[root@ceph1 ~]# rbd ls -l images 7 c2 [$ t! I# J4 j4 J$ e7 B& f
NAME SIZE PARENT FMT PROT LOCK
+ g$ V6 [- y% E5 L33652a4d-3ff4-4b40-bada-6f7514f23345 12 GiB 2 8 D$ O6 t9 Z p4 Z# Q: k8 @' n
33652a4d-3ff4-4b40-bada-6f7514f23345@snap 12 GiB 2 yes 8 x2 ]2 F9 c( S
46e08623-2616-429e-9b0c-008a1749d1a5 12 GiB 2
' C; k# f: M- o5 Q) S, a- j46e08623-2616-429e-9b0c-008a1749d1a5@snap 12 GiB 2 yes 4 S7 Z, E& ^0 A; F$ C( O5 O. Z
bda91b25-d146-4084-923f-834019eae8db 3 GiB 2 # x" K0 h& p0 s% m
bda91b25-d146-4084-923f-834019eae8db@snap 3 GiB 2 yes + K. z# [ z, v) r9 ?
c47afb15-a38a-46b6-8aa7-9dfba4243f5d 2 GiB 2
8 e( ?0 D* d0 _" Wc47afb15-a38a-46b6-8aa7-9dfba4243f5d@snap 2 GiB 2 yes
7 I* ?/ y4 y- r3 \" Z/ \, M: pd25d8b59-dfff-4f2b-b63e-aa22dc533778 2 GiB 2 * J# @) W; n6 d: j& l
d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap 2 GiB 2 yes
7 L% O: [5 ~0 W1 ]4 sd6d6c4cd-00ad-44ce-994e-8a5fa8022139 3 GiB 2 4 L) f9 [& D% b# g, T1 ]6 C
d6d6c4cd-00ad-44ce-994e-8a5fa8022139@snap 3 GiB 2 yes
& G2 Z( M) y, c/ I ~; Pe6ec5576-03e3-425c-86bc-871acd6d13eb 12 GiB 2 ! B' C1 W! t( p, n- X1 V( D; f0 @
e6ec5576-03e3-425c-86bc-871acd6d13eb@snap 12 GiB 2 yes
7 k8 }* `. g0 se828dc6f-b4ad-4ee0-b866-36b2df342553 3 GiB 2 : V0 i, ?% A% ^
e828dc6f-b4ad-4ee0-b866-36b2df342553@snap 3 GiB 2 yes
+ \0 g5 T$ a' S) y, p& j8 w+ B, I! C8 v. s* G( A
删除下镜像:+ d; c3 [1 u* ~. q! ~3 t
[root@ceph1 ~]# rbd rm d25d8b59-dfff-4f2b-b63e-aa22dc533778 -p images
. m0 t# w, `% M: ^* l3 u6 A- I+ {2021-12-29 15:51:50.536 7faff2c6ab00 -1 librbd::image::PreRemoveRequest: 0x558372b2d180 check_image_snaps: image has snapshots - not removing: u' S* C! K" Q; B, s
Removing image: 0% complete...failed.
9 D5 i/ u6 o$ W7 t4 t Srbd: image has snapshots - these must be deleted with 'rbd snap purge' before the image can be removed.5 ]1 a, O3 w$ J. c8 c9 ~1 t
: s( W3 d; I! n) u
删除失败,按提示执行rbd snap purge
2 `7 Q; `/ e" R& w" [
: U1 F% f/ l/ o! n# x/ g[root@ceph1 ~]# rbd snap purge d25d8b59-dfff-4f2b-b63e-aa22dc533778 -p images
4 x% m" ?% {8 x$ |2 f! m4 j6 Xrbd: error removing snapshot(s) 'snap', which is protected - these must be unprotected with `rbd snap unprotect`.$ N' l- q h8 `
Removing all snapshots: 0% complete...failed.
' ~8 e; l) A% H, G. q! Y% G
6 `/ C1 p, h) h% S8 |还是报错:! \% p5 Z; S; e7 P) E8 ^# ]
[root@ceph1 ~]# rbd snap unprotect d25d8b59-dfff-4f2b-b63e-aa22dc533778 -p images. Y$ ?. H: x& i7 m# z
rbd: snapshot name was not specified
0 z" p5 B$ I6 h& h[root@ceph1 ~]# rbd snap unprotect d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap -p images
# _ A( A2 w! T: j4 z. G9 U2021-12-29 15:52:30.984 7f4bdb7fe700 -1 librbd::SnapshotUnprotectRequest: cannot unprotect: at least 1 child(ren) [9753a327e2e1b4] in pool 'volumes-hdd'
1 ~, u5 V( {2 W2021-12-29 15:52:30.985 7f4bdb7fe700 -1 librbd::SnapshotUnprotectRequest: encountered error: (16) Device or resource busy" @# G/ q/ h5 v; U! ]5 ~
2021-12-29 15:52:30.985 7f4bdb7fe700 -1 librbd::SnapshotUnprotectRequest: 0x55f981533360 should_complete_error: ret_val=-16. m$ T' u0 G8 L& d/ w' [" R1 `% b
2021-12-29 15:52:30.987 7f4bdb7fe700 -1 librbd::SnapshotUnprotectRequest: 0x55f981533360 should_complete_error: ret_val=-16
x- M8 }" K$ ]6 Z+ Erbd: unprotecting snap failed: (16) Device or resource busy
& V8 B. C! Y* ]& @% V删除失败:* ]* h! n7 [: b9 R" M' ?* k# _
[root@ceph1 ~]# rbd snap rm d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap -p images5 ~, G6 f0 u- d8 a, o% m5 U& _
Removing snap: 0% complete...failed.
+ G3 s. d6 ~: g' c/ I+ hrbd: snapshot 'snap' is protected from removal.7 P E6 n! d2 }/ ?9 `% j7 @/ b
2021-12-29 15:52:42.995 7f2908879b00 -1 librbd::Operations: snapshot is protected% V- X* l* Z( H) P
[root@ceph1 ~]# rbd snap protect d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap -p images2 E; Y6 r6 q" L8 b
rbd: snap is already protected) r2 n% o1 z, s8 k, l4 \
[root@ceph1 ~]# rbd snap unprotect d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap -p images
3 `# w5 d, W$ e0 k9 `8 G4 D2021-12-29 15:53:02.360 7ff8f6ffd700 -1 librbd::SnapshotUnprotectRequest: cannot unprotect: at least 1 child(ren) [9753a327e2e1b4] in pool 'volumes-hdd'% U6 Q! j6 F$ X' d8 b! |- R- u
2021-12-29 15:53:02.361 7ff8f6ffd700 -1 librbd::SnapshotUnprotectRequest: encountered error: (16) Device or resource busy+ @/ y0 X5 }: e9 @1 T
2021-12-29 15:53:02.361 7ff8f6ffd700 -1 librbd::SnapshotUnprotectRequest: 0x5619a74f4230 should_complete_error: ret_val=-16
- i# a. D) q1 |+ ^2021-12-29 15:53:02.363 7ff8f6ffd700 -1 librbd::SnapshotUnprotectRequest: 0x5619a74f4230 should_complete_error: ret_val=-16rbd: unprotecting snap failed: $ C; V" x+ n; U' g6 C
(16) Device or resource busy- f& B7 A& ]' k/ Q8 C
[root@ceph1 ~]# rbd snap unprotect d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap -p images( m' S& l4 X( N, `
2021-12-29 15:53:15.412 7fe7e3de8700 -1 librbd::SnapshotUnprotectRequest: cannot unprotect: at least 1 child(ren) [9753a327e2e1b4] in pool 'volumes-hdd'
3 j$ u2 ^$ P* W7 I V1 I9 k2021-12-29 15:53:15.413 7fe7e3de8700 -1 librbd::SnapshotUnprotectRequest: encountered error: (16) Device or resource busy# ~/ h2 q/ i: @! }) n2 ]: v. W
2021-12-29 15:53:15.413 7fe7e3de8700 -1 librbd::SnapshotUnprotectRequest: 0x557a25e9b330 should_complete_error: ret_val=-16
0 n- I* N0 V1 C3 t6 e2021-12-29 15:53:15.414 7fe7e3de8700 -1 librbd::SnapshotUnprotectRequest: 0x557a25e9b330 should_complete_error: ret_val=-16
4 o% Z1 u! t% ?6 N# E- brbd: unprotecting snap failed: (16) Device or resource busy( y- m$ Q; F$ M# N7 x9 u0 G
+ {( P! [! d/ ~% I9 d) s9 u ~! E) C+ t- G7 F
R% J% A |6 F1 n$ L1 }0 X* b% | q2 ?9 e
2 ?" l9 p- f. I3 k' g实在无法删除,只好通过更新数据库信息来完成删除的任务:
& S$ K, j% J; E& e9 gMariaDB [glance]> select id,name,deleted,protected,size from images ; T# E! G% g1 ]- N. Q
+--------------------------------------+----------------------+---------+-----------+-------------+
8 x! y4 ]4 R# U K5 v| id | name | deleted | protected | size |
) a6 D* o }9 y0 ~+--------------------------------------+----------------------+---------+-----------+-------------+! l x3 D, C2 a: m8 K( Y5 N
; Z7 c; H# W* r1 W6 L# O
| c47afb15-a38a-46b6-8aa7-9dfba4243f5d | Centos7.9-origin-ssd | 0 | 0 | 2147483648 |4 n0 t, ] K ?: M4 u6 E
| d25d8b59-dfff-4f2b-b63e-aa22dc533778 | centos7.9-origin-hdd | 1 | 0 | 2147483648 |3 {7 h( Z$ f. h9 v3 ^& d2 }
|
. s1 t x( `1 H$ o% e/ \+--------------------------------------+----------------------+---------+-----------+-------------+
2 ]4 {$ ` y3 G29 rows in set (0.00 sec)- B& e/ R+ F" `2 i* A
5 ^0 q3 p6 x" a( A. X
MariaDB [glance]> update glance.images set deleted='1' where id='c47afb15-a38a-46b6-8aa7-9dfba4243f5d';
2 v$ K9 x6 L8 MQuery OK, 1 row affected (0.00 sec)8 Q+ [* W$ |9 s& p' N, C! z' A0 o
Rows matched: 1 Changed: 1 Warnings: 0
5 z$ M. T W4 ^- }- a: A5 m( I6 C6 ~
6 s# @4 d" |" P, c ? |
|