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

check_image_snaps: image has snapshots - not removing

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-6-29 15:30:06 | 显示全部楼层 |阅读模式
rbd删除卷时报错,反馈如下 4 \+ w+ `2 ?& [
# rbd rm pool_name/volume_name# s* ^4 f% n+ t# T- C
2021-10-25 10:32:42.192 7f789c502c80 -1 librbd::image::PreRemoveRequest: 0x5610334fcc40 check_image_snaps: image has snapshots - not removing
# W  L$ y2 m* \$ l3 l6 DRemoving image: 0% complete...failed.
. D1 \: v% j! [7 O% t5 h# y/ S* |rbd: image has snapshots - these must be deleted with 'rbd snap purge' before the image can be removed.
1 P: L0 i$ @1 e& k8 q' q" z( [0 j" x3 A3 ]) B

! x  \+ D: l7 l1 k$ A+ R& E[root@compute05 data]# rbd rm  images/39a2e9a9-2ce5-454a-bd66-47f15eeb11ea
) e; M: C! _( d( n) |7 L! b2 V2022-06-29 14:34:02.548 7fb15bf9db00 -1 librbd::image::PreRemoveRequest: 0x5607e27ae6f0 check_image_snaps: image has snapshots - not removing% s# Z0 |, c7 D4 _6 P
Removing image: 0% complete...failed.& Q1 ^7 [' V! b
rbd: image has snapshots - these must be deleted with 'rbd snap purge' before the image can be removed.
  E3 S$ r  c$ i- q- N7 g" S' b% B1 l* P' C' S3 V# C& y) w7 _3 z

5 G+ d2 P4 l0 N" |1 l& i( q% ]- Q; \此时是因为有快照存在,所以无法删除。 使用snap list命令可以查看卷下快照,后snap rm删除即可。 若提示快照保护状态还需执行rbd unprotect进行解保护 / Q! |; [  D% y  q: R! [
# rbd snap list pool_name/volume_name9 y7 [2 Q4 x. ]( ]( f! o# i% t
SNAPID NAME       SIZE  PROTECTED TIMESTAMP                % x/ |0 Q) d5 Y1 s7 Y+ }9 |
    10 tempkoswji 1 GiB yes       Tue Oct 19 11:16:07 2021! x' |2 H" D( h7 p
#  rbd snap rm pool_name/volume_name@tempkoswji: m3 e$ ?6 v1 g5 H- L+ b
Removing snap: 100% complete...done.
5 Z! D# ]1 L0 M8 ^. H7 I" E6 _0 t6 {# rbd rm pool_name/volume_name
% w0 Q2 ]) [4 r- WRemoving image: 100% complete...done.
- J3 O8 N1 ?4 k1234567
+ Z) [3 l; ^( H4 g9 c注:还存在一种情况,快照删除失败
" @: }# t' N& B3 n1 E( e此时可能是快照做过克隆,需找到克隆出的卷,进行还原
$ P/ A. y! U' |% S5 F8 w; x# rbd flatten pool_name/kelong; o9 Z: D) \7 u7 l. u& F' e

1 K! g* |$ b% v2 ~" H9 P6 T* U还原之后对快照进行解保护,快照即可删除
' ^- Z$ \5 c9 j! r4 L( Z# rbd unprotect pool_name/volume_name@snap_name/ }) L& U9 ]% ^3 T! [& M8 k4 _
; U- J# o- B6 I( X- F" L
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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