找回密码
 注册
查看: 1695|回复: 0

记一次rbd 删除snap 镜像失败问题SnapshotUnprotectReq rbd: listing children failed uest

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-12-29 17:00:01 | 显示全部楼层 |阅读模式
7 P( f! d2 p1 s. E- J' q
查看有多少镜像:
' F  K) X3 |- C* r0 e( \, U[root@ceph1 ~]# rbd ls -p images -l |grep d25d8b59-dfff-4f2b-b63e-aa22dc533778( ^* C8 _- f' T0 x
d25d8b59-dfff-4f2b-b63e-aa22dc533778       2 GiB          2           
; a$ X0 o& L- k* J: z( h, zd25d8b59-dfff-4f2b-b63e-aa22dc533778@snap  2 GiB          2 yes      
, S# ~+ x& L0 F; j0 _! v/ I6 a) @: T) V, C  N2 j
解除父进程关系:7 q/ D! W5 S) S: w
[root@ceph1 ~]# rbd children images/d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap3 R& P( [: m7 C6 s- \9 d9 a
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* E% e% M6 F0 O! b
, {1 z8 ]2 A# i# K) N' [
失败,再次尝试' [$ |6 Z4 u& i( s  i6 q
[root@ceph1 ~]# rbd children images/d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap+ H) ]9 K1 C" Q1 Y
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 directory
1 ^. O/ M# O) q) Y5 u7 K5 X$ N3 c4 u( Z0 I) [" C- R3 V1 @
[root@ceph1 ~]# rbd children images/d25d8b59-dfff-4f2b-b63e-aa22dc533778
4 ^% j$ H5 |- Q$ w2 k# h0 U7 jrbd: 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
/ a" H2 o& {) L3 o6 _! S( J2 M4 C& T: J2 j, K* S- M- ]
到报错的pool池中查找,也无相关的记录:3 S. z- J9 Y2 N1 r6 D+ k% Y
[root@ceph1 ~]# rbd ls -p volumes-hdd |grep 9753a327e2e1b4
3 X7 H2 c1 q+ K* k% z  W[root@ceph1 ~]# rbd ls -p volumes-hdd |grep 9753a327e2e1b4
. H: K# ], L2 J) I, Z! R3 `[root@ceph1 ~]# rbd ls -p volumes-hdd |grep 9753a32
2 V: C. F+ m. p! m& z; k4 \. j[root@ceph1 ~]# rbd ls -p volumes-hdd 1 E; h. O: I  y
[root@ceph1 ~]# rbd ls -p volumes-hdd 5 ?% e, [5 g% [
[root@ceph1 ~]# rbd ls -p volumes-hdd" d$ k: ~, J+ ]: x% r7 b
[root@ceph1 ~]#
6 F8 `- m1 P" ?+ M, P5 C[root@ceph1 ~]#
2 g. r) z; |6 G7 ]* e[root@ceph1 ~]# " z% Q6 f0 x" Z
[root@ceph1 ~]#) Y3 G- c* L" f. E
* a& t+ n5 E# f. H! ]0 I& _
查看所有的镜像:
# B0 B) |6 L, C8 ]( a7 m' u1 u[root@ceph1 ~]# rbd ls -l images
5 w! A2 i% ~+ `2 r' @( N/ hNAME                                      SIZE   PARENT FMT PROT LOCK
, D+ g6 A" @# L6 S33652a4d-3ff4-4b40-bada-6f7514f23345      12 GiB          2           + l/ b. C/ N& D
33652a4d-3ff4-4b40-bada-6f7514f23345@snap 12 GiB          2 yes       3 e' U2 n( A4 p  H9 M
46e08623-2616-429e-9b0c-008a1749d1a5      12 GiB          2           
2 V: b  T/ L) W: u+ p$ h/ B46e08623-2616-429e-9b0c-008a1749d1a5@snap 12 GiB          2 yes      
3 G1 b& Z& ^% m- Qbda91b25-d146-4084-923f-834019eae8db       3 GiB          2           
3 A: ]7 W4 r; i8 Ybda91b25-d146-4084-923f-834019eae8db@snap  3 GiB          2 yes      
& {* x& j7 g# B- U* s3 z1 dc47afb15-a38a-46b6-8aa7-9dfba4243f5d       2 GiB          2           . C8 L+ o2 I+ G3 u% y
c47afb15-a38a-46b6-8aa7-9dfba4243f5d@snap  2 GiB          2 yes       " I, s9 u! R2 k# J) R
d25d8b59-dfff-4f2b-b63e-aa22dc533778       2 GiB          2           
# r, r7 s9 M5 Md25d8b59-dfff-4f2b-b63e-aa22dc533778@snap  2 GiB          2 yes       5 ~% W) n; s2 g# Y6 D# x
d6d6c4cd-00ad-44ce-994e-8a5fa8022139       3 GiB          2           
5 h' y) r( @1 w1 o; v  f$ }d6d6c4cd-00ad-44ce-994e-8a5fa8022139@snap  3 GiB          2 yes       8 E  @7 d6 Z  r7 q  |2 l
e6ec5576-03e3-425c-86bc-871acd6d13eb      12 GiB          2           
6 _) o  k. `) t3 X& Le6ec5576-03e3-425c-86bc-871acd6d13eb@snap 12 GiB          2 yes      
- i0 }& {% x" R+ he828dc6f-b4ad-4ee0-b866-36b2df342553       3 GiB          2           # q- r. N- Z- r8 {
e828dc6f-b4ad-4ee0-b866-36b2df342553@snap  3 GiB          2 yes       6 Z) a( B1 Q6 R! g" L2 Q
8 N3 j1 a3 @9 k4 ~5 @- a7 d
删除下镜像:
. U9 h2 G. D2 u6 N# p[root@ceph1 ~]# rbd rm d25d8b59-dfff-4f2b-b63e-aa22dc533778 -p images( |2 h8 _' s* r" L* Y5 @$ d
2021-12-29 15:51:50.536 7faff2c6ab00 -1 librbd::image::PreRemoveRequest: 0x558372b2d180 check_image_snaps: image has snapshots - not removing
9 Y: w7 J0 J( O1 X1 v3 n4 fRemoving image: 0% complete...failed.
# w2 o: U+ Z# J! C7 urbd: image has snapshots - these must be deleted with 'rbd snap purge' before the image can be removed.+ d+ S& ]" g1 a7 c& r6 q
  |6 \% W/ E6 K0 [) k& e" G: I
删除失败,按提示执行rbd snap purge
9 O/ v. H3 _# R  X8 u6 Y
9 p# p/ E- N9 M- u2 ~1 H1 ]6 t& e[root@ceph1 ~]# rbd snap purge d25d8b59-dfff-4f2b-b63e-aa22dc533778 -p images  ?, b4 m' u9 c2 C6 j& n
rbd: error removing snapshot(s) 'snap', which is protected - these must be unprotected with `rbd snap unprotect`.
6 a& Z4 C/ I* Q) E6 Y# tRemoving all snapshots: 0% complete...failed.7 N# f& g$ }3 @& _" ^
% n0 ?& O8 X2 V
还是报错:
+ {: Q9 s9 @+ M, [) e) f5 s[root@ceph1 ~]# rbd snap unprotect d25d8b59-dfff-4f2b-b63e-aa22dc533778 -p images% g& e" h; z) D' F
rbd: snapshot name was not specified
" ]9 j& s* m0 w' t: G[root@ceph1 ~]# rbd snap unprotect d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap -p images
/ c; ~- v9 G: q. J* V; t2021-12-29 15:52:30.984 7f4bdb7fe700 -1 librbd::SnapshotUnprotectRequest: cannot unprotect: at least 1 child(ren) [9753a327e2e1b4] in pool 'volumes-hdd'
! G' z3 f3 V0 f( _7 S2021-12-29 15:52:30.985 7f4bdb7fe700 -1 librbd::SnapshotUnprotectRequest: encountered error: (16) Device or resource busy- @1 S# I! s8 R( T: R
2021-12-29 15:52:30.985 7f4bdb7fe700 -1 librbd::SnapshotUnprotectRequest: 0x55f981533360 should_complete_error: ret_val=-16
. X, h' ~& @) R( ?3 i2021-12-29 15:52:30.987 7f4bdb7fe700 -1 librbd::SnapshotUnprotectRequest: 0x55f981533360 should_complete_error: ret_val=-16+ j% U' p. h( r& H0 A# n
rbd: unprotecting snap failed: (16) Device or resource busy7 K6 i9 I) e+ f  Z& ?/ n
删除失败:
2 }  Y: t' [/ w8 O[root@ceph1 ~]# rbd snap rm d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap -p images5 Y! y' I/ y( P) t
Removing snap: 0% complete...failed.
4 k- M3 }+ c1 k8 E1 Hrbd: snapshot 'snap' is protected from removal.- u+ \0 ]6 w$ X6 Q# H. {) G
2021-12-29 15:52:42.995 7f2908879b00 -1 librbd::Operations: snapshot is protected" M* S& B2 S) \8 {$ T, E, A
[root@ceph1 ~]# rbd snap protect d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap -p images+ y) X( B" J2 V7 E) S6 l  T4 O
rbd: snap is already protected3 ]; [: h/ g; F, q( j: p4 R
[root@ceph1 ~]# rbd snap unprotect d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap -p images( f/ @5 X" s! y. |# q- n
2021-12-29 15:53:02.360 7ff8f6ffd700 -1 librbd::SnapshotUnprotectRequest: cannot unprotect: at least 1 child(ren) [9753a327e2e1b4] in pool 'volumes-hdd'
$ }8 y/ C% F6 p3 D$ p) I, q) |4 l2021-12-29 15:53:02.361 7ff8f6ffd700 -1 librbd::SnapshotUnprotectRequest: encountered error: (16) Device or resource busy+ a+ L$ o. i" J! J5 i9 q
2021-12-29 15:53:02.361 7ff8f6ffd700 -1 librbd::SnapshotUnprotectRequest: 0x5619a74f4230 should_complete_error: ret_val=-16$ e/ N, U3 M" m" D5 a
2021-12-29 15:53:02.363 7ff8f6ffd700 -1 librbd::SnapshotUnprotectRequest: 0x5619a74f4230 should_complete_error: ret_val=-16rbd: unprotecting snap failed: & d. K5 v. E+ u3 i4 l+ P0 z# b
(16) Device or resource busy: B, Z& z# P3 q9 U
[root@ceph1 ~]# rbd snap unprotect d25d8b59-dfff-4f2b-b63e-aa22dc533778@snap -p images1 B8 e2 a- P1 Y* i' t
2021-12-29 15:53:15.412 7fe7e3de8700 -1 librbd::SnapshotUnprotectRequest: cannot unprotect: at least 1 child(ren) [9753a327e2e1b4] in pool 'volumes-hdd'+ N% p5 ]+ g5 }* \: O* l% ]
2021-12-29 15:53:15.413 7fe7e3de8700 -1 librbd::SnapshotUnprotectRequest: encountered error: (16) Device or resource busy
$ h; m: X! }* d4 p1 i2021-12-29 15:53:15.413 7fe7e3de8700 -1 librbd::SnapshotUnprotectRequest: 0x557a25e9b330 should_complete_error: ret_val=-16" b  f: H! Z7 h: @: e/ W* A
2021-12-29 15:53:15.414 7fe7e3de8700 -1 librbd::SnapshotUnprotectRequest: 0x557a25e9b330 should_complete_error: ret_val=-163 z5 f- v0 C% Z( e2 a9 \# a
rbd: unprotecting snap failed: (16) Device or resource busy
% R8 F& k  m  A( s2 ^0 K- x, f& k9 ?
* C' G4 y. U: B7 N$ p1 I: t# g+ B% h& V0 `1 @

- L( }& @& [! d( u7 e  M, R7 H5 H# l7 e0 P

8 j7 U, j+ d! Y7 x7 K! X( K; U实在无法删除,只好通过更新数据库信息来完成删除的任务:1 |( w" u7 J  h
MariaDB [glance]> select id,name,deleted,protected,size  from images  ;6 ?( z0 _" \2 \2 R9 c2 h3 I8 }
+--------------------------------------+----------------------+---------+-----------+-------------+
4 G, a* o, _- H+ V| id                                   | name                 | deleted | protected | size        |9 w/ t1 H) {6 K' Y
+--------------------------------------+----------------------+---------+-----------+-------------+1 E$ Y% r1 L* A$ w4 [9 {0 E

9 g+ ~' |4 Q5 I$ {* C| c47afb15-a38a-46b6-8aa7-9dfba4243f5d | Centos7.9-origin-ssd |       0 |         0 |  2147483648 |
4 f9 R5 Z$ e/ b| d25d8b59-dfff-4f2b-b63e-aa22dc533778 | centos7.9-origin-hdd |       1 |         0 |  2147483648 |/ |; p$ [- F' p/ e, e
|; O0 S2 z4 P* E9 r, n0 ]$ V
+--------------------------------------+----------------------+---------+-----------+-------------+
; i7 }' d) |$ z5 s29 rows in set (0.00 sec)
% P4 n4 x! j; f- w) K: L0 J9 q5 C
MariaDB [glance]> update glance.images set deleted='1' where id='c47afb15-a38a-46b6-8aa7-9dfba4243f5d';
; `7 q5 I! d- ^( M& }0 Z* y- b2 ^Query OK, 1 row affected (0.00 sec)+ k0 n  w0 A& F% d* O5 `
Rows matched: 1  Changed: 1  Warnings: 0
* T7 i- X' r$ M. q$ D+ t0 P
9 g2 k3 f  g* `+ H. y. G$ J9 i7 a3 }* N$ j
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:09 , Processed in 0.014821 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表