|
|
楼主 |
发表于 2022-10-20 14:12:56
|
显示全部楼层
0
3 ^3 o' C6 e( Y
* n: b, c2 v& p1 n. o/ m7 u
, j# k, x, L, o' d- O" yI 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:
8 i0 w! m* a7 m8 H& c6 u' t3 V! Q/ x7 R. A( \
Image c1d9.... is unacceptable: Unable to rebuild with a different image for a volume-backed server" y+ Q5 L$ J& I
9 h0 [* r6 a H+ VHow can I rebuild volume-backend server?4 {0 x9 l$ L0 I% B) m, U ^, N: Z
. a7 C% u% v; j' K" }9 T; |% Mopenstackopenstack-nova# k: M0 i8 S' V8 H( [
Share. N* V2 a0 d' h0 \
Improve this question
3 d* p. X" b% V9 e# d1 b; YFollow
# w9 R1 [& C- ^, `* Casked May 18, 2021 at 11:34# C0 t$ s# q; R7 I$ ^6 G4 B
Bani's user avatar
+ U0 Y2 Q6 g# T! B- {Bani* s% q, H& e0 b( i% B
1966 bronze badges; a+ O6 t$ Y" @. W
Add a comment
/ X4 _+ ^" `4 v ^/ t& m+ S1 Answer3 J- ~" Z: @% U, }+ Y% `
Sorted by:! z0 a. t6 Q i8 j3 ?/ t+ D
& z7 F, E1 H, x( Q& l5 }. gHighest score (default)- A" T: H! E. s2 }; ~
& E+ f7 v9 j2 M T1 @" \7 Z2 J
0
9 Q4 [9 U* R- {1 s1 e: |: ~ | B2 w7 I3 _5 `' V
* u, g6 P( x7 s# d1 c& T- B0 ?4 y$ l4 UAs noted in Openstack docs [1], rebuild is not supported for volume-based VMs.& P) u( p: C, r
2 [ ? K* K& J$ d4 ?
Assuming 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.' ? Q2 B0 y! z( [1 {$ z+ y
5 H0 [7 e4 E) w+ ^4 H; tFor Ceph based backend, it would be something like( k+ {: T' k9 C3 B3 S
+ K: K+ e9 @5 w& F' uopenstack volume show <...> => Get pool/path from rbd backend: i8 O+ M3 X, e9 D! R
openstack image show <...> => Get pool/path from rbd backend
0 u# a [4 R7 e% n( zopenstack server stop <VM> => Stop the VM4 U6 e+ `5 { G" I* Z9 ^* O9 ^
% k2 q) ^' h' drbd -p <POOL NAME> mv <VM VOLUME UUID> <VM VOLUME UUID>.old+ ]$ @- n7 Q( F- l* g% w
rbd -p <POOL NAME> cp <IMAGE VOLUME UUID> <VM VOLUME UUID>
5 }+ ^. K: Y0 M. W8 E1 P' w0 dOnce the copy finishes, start the VM# \0 G/ g+ i' D! X" q1 l( K' F2 B
- y: e5 h3 ]3 A$ t0 j% [% popenstack server start <VM> |
|