|
|
mariadb删除glance数据库中镜像文件,使用update set 修改运行状态一次操作记录:& _3 T% j3 v& x# s4 L- L7 ^
MariaDB [glance]> select * from images\G
# \* {) }7 l( Q9 t; Q0 G3 a, x*************************** 1. row ***************************
: e7 }' f I# G9 O5 q/ _7 e! v7 c8 v id: 0470245c-ee24-488f-89c9-622fd85e9ade9 ]; O: W, ^) ~
name: centOS7.9-x86-ssd
: h) ?6 p0 g+ r& T& F3 f" T size: 32212254728 Z6 g! S' Z8 W& ^1 d" ?
status: deleted
0 b$ V# {5 x) K3 M$ z0 V created_at: 2022-04-08 12:48:27) g& |1 p( m9 A
updated_at: 2022-04-15 01:04:252 e ]! t" H) x( P
deleted_at: 2022-04-15 01:04:25$ z$ c: V/ V! k; i ?: z
deleted: 1
) k5 Z( m8 c4 U" I) H! x disk_format: raw, _6 R, j* h6 {+ g0 @1 Y# Z5 z( T
container_format: bare, o! o$ x' d: T) x( @5 t
checksum: 6067ba67d340d6849fb08ad2dc1dc752" f+ ^! W( V( p+ E$ Q* ^! F3 d
owner: 6f0124196ea74eb79fbcf370add3ca7e) C( P) y |9 O
min_disk: 08 i0 c3 m. L3 V0 o) o
min_ram: 0 }, C" n( @2 ^3 Z9 i/ `$ y, O% J
protected: 0
: D% [& z2 J9 W# T2 |/ d% Z. E virtual_size: NULL' @) G3 j( ]9 |" s- ?
visibility: public
- E. C1 ^ L$ h$ @% a/ G5 t4 f7 T*************************** 2. row ***************************% X! |1 Q- O. }
id: 18804abd-9cba-4a94-8ceb-ba9b12f9fc47/ R, ?( t# c3 U% j0 E
name: RHEL-Server-7.9-hdd-2.4T
1 R' T% Q8 }: z' Y" J" J0 z size: 30064773129 q2 m3 k& @2 v/ I3 K0 C% X6 j
status: active, |. r/ S, v7 H( [- w4 L
created_at: 2022-04-12 02:44:15, |4 ]( b& V) B0 G
updated_at: 2022-04-15 01:04:39$ e2 {0 j: c" p0 D8 ]
deleted_at: NULL
/ R0 b) a: M @ H$ I8 _ deleted: 01 B, z& D/ e9 k8 _: h9 [" ^
disk_format: raw
' h# F' Q1 k4 l4 @; tcontainer_format: bare
, D1 Z) ~! b. f! }6 b) ~7 m! } checksum: 3ddbd59c32a4ec8141018ee9a433c78e5 R. m3 V2 x7 p! D. Y9 w8 a
owner: 6f0124196ea74eb79fbcf370add3ca7e
Y. X" s' }' h) g min_disk: 0
3 Z, N" P9 P+ m. p: n min_ram: 0
0 N/ o: _ ]5 a& Z3 e$ W protected: 0
3 M1 s6 r; }* I! [; T virtual_size: NULL
( y/ @" k* u8 P; X, Z! `9 @ visibility: private
. u# @ T' E _7 }+ ^6 q) ]/ j*************************** 3. row ***************************" K) ~7 h% w# r/ c* \1 J9 @
id: b9c335c4-34a8-498c-a735-82567f7ef186+ b8 A3 f) d: f4 s! Y$ y- I
name: rhel-server-7.9-ssd
+ u# G6 w4 f# Y& C4 n size: 2684354560/ B9 p1 ^' i' J- s( ~2 R1 z7 J
status: deleted
, o" }5 j' P% |, S3 P created_at: 2022-04-11 07:22:43# i3 A) z( x6 p5 n# O& F# B3 A( R
updated_at: 2022-04-11 08:02:40
$ D2 m* e* j' t$ \2 @6 L deleted_at: 2022-04-11 08:02:40, }* w4 d4 {' K! V4 u
deleted: 1' F/ O* `7 b5 I! S. X
disk_format: raw8 n9 y6 |5 l: a4 R
container_format: bare( G+ {. q9 \9 m3 i9 C* g* k' ^
checksum: 67e20fa3da128b17c3ec01d03e1e293d; k- W9 v: V- K& `
owner: 6f0124196ea74eb79fbcf370add3ca7e% t1 _& ]- y$ q- g, |
min_disk: 0$ }: H! m" M+ H; y* w$ T) K# ?: V6 c
min_ram: 00 I2 R+ a3 j5 r: J3 n# X( I
protected: 0
, r2 Z W2 h1 L6 l virtual_size: NULL
; k2 k% c; _; g k2 c9 A, A6 X visibility: public3 q) d4 y9 c7 m
*************************** 4. row ***************************
7 D4 z1 Q# W; W' M4 |9 K! p id: ea333f95-79c3-4ce4-856b-a397cc963d770 G) p* U+ E6 z
name: windows_2019_x64-hdd-2.4T
) g1 e" J5 G' R a. E" \ size: 12884901888# @* g& w: H. t' i% b7 ^
status: active2 w& w" B: }( S/ s6 k# J7 K
created_at: 2022-04-13 01:25:56( i$ c" P5 S7 W! k8 Z3 l$ c
updated_at: 2022-04-14 03:42:54
, I, t2 Q% p) H; l. h8 ? deleted_at: NULL
+ u. N' R1 I! O- y) M" [0 [5 q deleted: 02 K1 X; U% _7 e+ E" u" D. O; m
disk_format: raw7 Z# K: Y$ E* s" R0 D! J
container_format: bare) C3 r2 S E! L/ U; M
checksum: 2eabbd70218411fdb021c4cdb790b82f; X3 f* A/ Y% R8 e5 m
owner: 6f0124196ea74eb79fbcf370add3ca7e {! _* y+ c! i2 [! L
min_disk: 0
8 \% U: B2 x2 Q! N( l6 P2 h min_ram: 0
8 M: L7 j8 b9 h+ d! B* A protected: 0
9 w6 W7 ]* G. d$ k1 x virtual_size: NULL1 {- H/ Y( z# P; }8 a
visibility: public
0 T8 Q& g8 Z7 P2 P0 b' a8 x; }*************************** 5. row ***************************
8 x6 o& t, @2 C id: fb5fe7ed-ba56-4ae2-a483-af3cc0cce891# R. W, G% O9 r6 Z+ l
name: RHEL-Server-7.9-ssd0 G1 c7 y5 M3 y" q6 s6 Q/ ^
size: 3006477312
# C0 `2 F/ e# _' g2 I6 I status: active
# x$ O! |. i; _ R* `% y$ b/ _ created_at: 2022-04-12 02:16:14. m, i, h" n& r2 F2 ~" k0 V. F
updated_at: 2022-04-15 01:04:46; q$ \/ r' u; Q" W K& }
deleted_at: NULL6 m- r$ G# i' I$ M) e- x0 x- f, p
deleted: 0
' U6 b# q; i/ D _* E disk_format: raw
8 V+ Y9 l+ }2 M3 @1 C; x& Ucontainer_format: bare' ?# \0 m+ G( ?5 u& u
checksum: 3ddbd59c32a4ec8141018ee9a433c78e$ ~! Y1 p5 @2 A5 {5 y/ j5 _& _
owner: 6f0124196ea74eb79fbcf370add3ca7e1 o1 Q* z/ i4 p
min_disk: 0
& ?' `% k3 u5 ^- Y5 p min_ram: 0
' N0 E/ C: K$ G* r protected: 0* G( l1 Z g0 F, M+ M
virtual_size: NULL
& \) C# v) Y; C visibility: private, U6 o [$ K) G; G1 G- f j! Q
5 rows in set (0.00 sec)8 x# k' ]* e* ]' w4 q& f
( {# @2 L& ?( p- X, q
MariaDB [glance]> update glance.images set deleted='1' where id="fb5fe7ed-ba56-4ae2-a483-af3cc0cce891";) Z$ x7 G4 C% d, x6 i5 _% \' O. H
Query OK, 1 row affected (0.01 sec)1 K0 R' Z3 a6 H2 g1 x4 e
Rows matched: 1 Changed: 1 Warnings: 0* k+ ]3 S$ f% ^% h* V( n! y$ ~
MariaDB [glance]> select * from images\G
6 x. L+ Y! f. H. D$ C* F$ c*************************** 1. row ***************************: _/ Q6 s- @* Z0 h0 J+ J
id: 0470245c-ee24-488f-89c9-622fd85e9ade. l* Z7 e, s! k0 b. F
name: centOS7.9-x86-ssd) Z) z. U; B' V. |
size: 32212254722 A' t v# H0 m: N
status: deleted
; ?8 o7 W3 z( Y8 q B# p created_at: 2022-04-08 12:48:278 ?% [' K, S$ P/ Y& D
updated_at: 2022-04-15 01:04:25( N; x1 f, Q, [% m2 e
deleted_at: 2022-04-15 01:04:25
1 g7 a+ M6 S( t( ?7 @/ c deleted: 19 t( s+ x. F( H
disk_format: raw
; {% M! l+ o Scontainer_format: bare; i6 b2 L# D( |" |$ `
checksum: 6067ba67d340d6849fb08ad2dc1dc7522 E @& ~: Q0 W
owner: 6f0124196ea74eb79fbcf370add3ca7e: g, a; M9 @# b
min_disk: 0
# ]9 T" k* o& D# o min_ram: 0, {( U9 V5 O% o6 b8 i, D5 Y
protected: 0
' D5 Z$ B3 X. o, \. `) d5 z9 N7 R; Q virtual_size: NULL
5 i1 E& u/ \# e+ k) V8 v visibility: public3 W' l" J$ S1 b5 U" z) K
*************************** 2. row ***************************% O' }! b- t% z- M# ]. e) y
id: 18804abd-9cba-4a94-8ceb-ba9b12f9fc47* j3 ]) @" I, O$ S, l y, e" ]
name: RHEL-Server-7.9-hdd-2.4T
; c# u" Z" E4 U% S7 l: u size: 3006477312
1 a: ~, ]' [ T2 r6 t status: active, e5 B* F+ l( T) o% s: C+ Z
created_at: 2022-04-12 02:44:15
' `' D3 F6 h, ~0 \ {- T4 }8 B; K updated_at: 2022-04-15 01:04:39
# {( Z2 P7 l: Q C# {9 Q: {0 N deleted_at: NULL
4 s2 z* n; R9 \5 Y5 {3 E( u$ k+ [, n deleted: 0, m4 [, W! f! |4 f |
disk_format: raw
0 L, K! d" t& ?2 f8 i b! Xcontainer_format: bare& @$ J; t3 i3 k2 l. C
checksum: 3ddbd59c32a4ec8141018ee9a433c78e
H' \+ r0 S% W( }& r( G3 r3 h owner: 6f0124196ea74eb79fbcf370add3ca7e, W# j: F, n6 L* h1 O+ X1 \
min_disk: 0, X' B, I" g1 a3 b( _
min_ram: 0
& t. T) Z% M& N5 H protected: 0
# i$ b. B/ |* m/ R virtual_size: NULL
9 O/ c( x& n0 D7 m6 M5 ` visibility: private
0 T% g% n) @6 ]( R*************************** 3. row ***************************
8 ]& w' Q1 I) h: }" {) p6 \ id: b9c335c4-34a8-498c-a735-82567f7ef1862 F- x. h, Z2 t. h4 G0 b
name: rhel-server-7.9-ssd# R+ k) g* i7 S3 C
size: 2684354560
& m) a6 G4 h( o status: deleted
3 x9 i; @' c9 P2 r, M created_at: 2022-04-11 07:22:43
- D2 P- e% G% X updated_at: 2022-04-11 08:02:40: n3 z8 Z$ Y- s& w
deleted_at: 2022-04-11 08:02:404 G$ y* e8 |' y& S3 E# L
deleted: 1
" x# f0 d$ L2 \2 j5 ^: X' o6 h( E: Z disk_format: raw
9 p; Y) a4 l- I. w+ ucontainer_format: bare5 ], x, R" H; N6 ~+ N$ A; {, G8 V
checksum: 67e20fa3da128b17c3ec01d03e1e293d
7 _: ?) _% j& Z8 { owner: 6f0124196ea74eb79fbcf370add3ca7e- j7 s6 P2 F1 G; D& Z( A7 b9 I; D
min_disk: 0" p$ M3 n5 m' e- Z# C9 T/ R. M
min_ram: 0
0 h- b! s# K& f5 N5 O) f protected: 0! S/ l0 h9 K! b. b0 m, R
virtual_size: NULL
6 r& |' V) T$ G, y' K& m) ` visibility: public" j a# S. j' K5 @
*************************** 4. row ***************************3 c/ b, o( \& Z; U
id: ea333f95-79c3-4ce4-856b-a397cc963d77! e$ f/ j% Y3 M9 d; q% S3 |
name: windows_2019_x64-hdd-2.4T3 u: ?. l; e& }! E2 p i5 d
size: 128849018881 K* S% W# ]% k* `
status: active0 k8 S( Z' p2 T
created_at: 2022-04-13 01:25:56
$ ]' Z0 Q! w$ n updated_at: 2022-04-14 03:42:54
& v, J- ~1 T! L! S1 |8 @ deleted_at: NULL
# b2 K/ A/ ]! `- L8 Y6 H# j1 Q deleted: 0, R4 W) a) N' k0 X$ u$ d3 r% a- U
disk_format: raw
2 [9 ^! X3 B: i; ? zcontainer_format: bare
5 t0 _0 I$ {# @ checksum: 2eabbd70218411fdb021c4cdb790b82f
! p/ ~$ N- E3 s r2 Q o owner: 6f0124196ea74eb79fbcf370add3ca7e2 c \3 |' W% c4 T* ~7 B& N
min_disk: 0( ^2 E# a- k/ R( j$ z, x* L
min_ram: 0
' y4 n! _/ d$ f/ E: ?- ^ protected: 0* x, V+ b/ v8 Q% R+ e9 @- _9 r; b3 `* K& p
virtual_size: NULL
2 o, z W& D# F% |3 w t visibility: public
7 J5 z; b$ u. I*************************** 5. row ***************************( ]* ?# F! v0 {( e7 H
id: fb5fe7ed-ba56-4ae2-a483-af3cc0cce8912 m5 `* H, x4 t, [2 e# J p p4 Q4 u
name: RHEL-Server-7.9-ssd% {& p8 Z. p& H) v
size: 3006477312
! s: }, }: h8 g5 L status: active" h0 T8 q( w/ @- A" d+ z
created_at: 2022-04-12 02:16:14
9 q6 K. J% ]/ e3 H# ]& S0 N updated_at: 2022-04-15 01:04:46
/ z/ L6 y8 {+ K I" B7 s3 c2 \5 X deleted_at: NULL
8 j1 d6 t- w/ t' {$ C, Q% L deleted: 1
% O! r; i* w& ^7 s disk_format: raw
* r$ x7 N# i$ Ocontainer_format: bare
; n& q* p* g, d( S2 i0 n2 \ checksum: 3ddbd59c32a4ec8141018ee9a433c78e1 e5 ^ y. G" B5 f3 o# M' T1 {
owner: 6f0124196ea74eb79fbcf370add3ca7e
" I% u0 b: E8 n n5 L min_disk: 09 [4 z3 H6 V: N+ M6 U
min_ram: 03 W* b: Q1 d8 X$ S- W3 V
protected: 0
* N7 L' u d8 _1 R! q virtual_size: NULL
& t; b$ Z U" u( N ?# x( Y visibility: private# p: L: @0 L; j# k
5 rows in set (0.00 sec)* B. N, K/ H/ [8 B( x- o, c7 K
MariaDB [glance]> select id,name,deleted,status from images;
8 j6 g6 V& w0 j( k) J9 }+--------------------------------------+---------------------------+---------+---------+; P+ \ G& d% T( X3 h% H" W
| id | name | deleted | status |
/ [+ j* d. D# q& b$ p6 ~+--------------------------------------+---------------------------+---------+---------+' ?8 c/ ]5 B! I3 O0 @
| 0470245c-ee24-488f-89c9-622fd85e9ade | centOS7.9-x86-ssd | 1 | deleted |
5 r* j. K w% Q' S) e( J| 18804abd-9cba-4a94-8ceb-ba9b12f9fc47 | RHEL-Server-7.9-hdd-2.4T | 0 | active |) m9 @, ^: N; U5 b/ {$ B/ y
| b9c335c4-34a8-498c-a735-82567f7ef186 | rhel-server-7.9-ssd | 1 | deleted |
( N; \! A) c2 P) h* F ]2 e| ea333f95-79c3-4ce4-856b-a397cc963d77 | windows_2019_x64-hdd-2.4T | 0 | active | L, J, i: o- k7 H9 T- L
| fb5fe7ed-ba56-4ae2-a483-af3cc0cce891 | RHEL-Server-7.9-ssd | 1 | active |
/ X' M+ i/ ?( N- E8 `0 v3 s% u+--------------------------------------+---------------------------+---------+---------+
, K3 ?# S1 m8 W' q* _ B( b+ G5 rows in set (0.00 sec) L e- f3 k0 m7 R* ^. y
MariaDB [glance]> update glance.images set deleted='1' where id="18804abd-9cba-4a94-8ceb-ba9b12f9fc47";
4 p+ E; M9 }( B$ o2 J/ |Query OK, 1 row affected (0.00 sec)
8 j$ m) l/ I0 c5 `! |Rows matched: 1 Changed: 1 Warnings: 0
, f- Z6 ?* g" g+ u) i) @MariaDB [glance]> select id,name,deleted,status from images;
) u- y) k0 M, q2 _: t9 z$ c3 p+--------------------------------------+---------------------------+---------+---------+. D7 j6 O5 m8 w8 m, M% u' \
| id | name | deleted | status |
, ?! s/ i0 q4 Q+--------------------------------------+---------------------------+---------+---------+. s" B0 X- ^& M5 M* C
| 0470245c-ee24-488f-89c9-622fd85e9ade | centOS7.9-x86-ssd | 1 | deleted |6 B" x; q$ w. R: w4 H
| 18804abd-9cba-4a94-8ceb-ba9b12f9fc47 | RHEL-Server-7.9-hdd-2.4T | 1 | active |
( r6 y) H/ m$ [| b9c335c4-34a8-498c-a735-82567f7ef186 | rhel-server-7.9-ssd | 1 | deleted |
9 L3 o* }$ d! B# m+ || ea333f95-79c3-4ce4-856b-a397cc963d77 | windows_2019_x64-hdd-2.4T | 0 | active |6 _4 T8 B1 }' q. b, F* n" ~. b
| fb5fe7ed-ba56-4ae2-a483-af3cc0cce891 | RHEL-Server-7.9-ssd | 1 | active |
, w8 P/ F$ z; L" D. x) ~$ ^5 F+--------------------------------------+---------------------------+---------+---------+5 T( Z! x0 G+ Z8 h% }8 @, d
5 rows in set (0.01 sec)
0 v- y$ \* | W R
. M$ u; g* [$ V1 `# X& B
6 C4 p) L2 j( f8 |: H完成更新数据。切记不要delete数据,因为这些数据库表之间有关联,会导致数据库凌乱。解决办法一般都是update状态。切记切记。
1 q0 X0 _* o6 c' Q, O$ a# m/ L |
|