|
|
楼主 |
发表于 2022-10-20 14:12:56
|
显示全部楼层
0
) \' [3 Q9 K6 H+ v8 Q) m& d8 \( V6 @% n+ t! d" a) ], F8 A
, b) f# `8 j# Z6 f4 eI create a volume then I use it to create server. I would like to rebuild this server such that its image is changed. When I call nova rebuild api with a new image, it is said:
& n8 | U( p0 `' }- t
* e5 A* w0 X% ?+ p# z+ JImage c1d9.... is unacceptable: Unable to rebuild with a different image for a volume-backed server
9 } g/ i, Y+ M5 H9 P! U. H6 l5 \9 L. l6 ]0 X; q2 v% `: h
How can I rebuild volume-backend server?
- i7 O0 V' w' E' }0 K. a; ~- C# e4 C8 v( ]9 v8 b5 E7 g
openstackopenstack-nova$ j$ J H# R% B p% u9 U, y8 l
Share
1 X1 d2 S, U, t/ x' rImprove this question
! d( U* m5 w* h! _# \9 a. ~Follow
- s7 l7 G8 p5 D9 Aasked May 18, 2021 at 11:34# u$ I4 y) L1 ~' G
Bani's user avatar
& [1 A- [' C* j* ]" ~" w& K! dBani
5 {: v. C5 D. e8 p% r8 R/ o; T4 \2 w1966 bronze badges7 m# ?7 h; [8 O2 H
Add a comment1 a- B. G3 @$ H _, B
1 Answer
9 Y7 A! K ]2 y2 S }# |Sorted by:
0 Y3 S' y8 T$ O' Y* d+ r& t/ `; z E
Highest score (default)
! N6 `/ |* n" p+ N* }! R ?' J, x/ p2 g% p% e0 b
0
) e0 O0 ~( ~+ j& W' X5 m. j6 O' [/ }
6 a# g+ I4 w7 ?9 i* |0 [* IAs noted in Openstack docs [1], rebuild is not supported for volume-based VMs.4 A% F% S( M! l/ L; r0 o+ e
# g4 n% h' Y, h$ n9 }& c7 KAssuming you are trying to rebuild the VM with a fresh image ("factory reset"), a slightly "hacky" solution is to replace the underlying volume with the fresh image while keeping the same pool/path.
$ t; u: T( Q1 z7 B3 P; z$ x; M' `" V. |; a, x
For Ceph based backend, it would be something like; b& |% {: @) E/ S$ K
: w7 t6 c' e+ F/ P
openstack volume show <...> => Get pool/path from rbd backend
. g/ B) C9 |6 ]. E4 D+ s& Ropenstack image show <...> => Get pool/path from rbd backend
5 c/ |7 f2 Z6 o" Fopenstack server stop <VM> => Stop the VM4 K9 U X( t5 p; B
: m$ A. i* s3 A: orbd -p <POOL NAME> mv <VM VOLUME UUID> <VM VOLUME UUID>.old e+ T* r+ g5 D' n
rbd -p <POOL NAME> cp <IMAGE VOLUME UUID> <VM VOLUME UUID> ' R/ n9 u9 W6 C. U* ~* w# E: `( s
Once the copy finishes, start the VM
4 I0 K: Q& f6 W# Q% ?
8 k& Z* ], d, e8 u Fopenstack server start <VM> |
|