|
|
楼主 |
发表于 2022-10-20 14:12:56
|
显示全部楼层
02 I% _+ w) b% i. O3 W$ [
" A7 A3 R4 }9 `( R6 c8 D5 P) h8 B
, X' H' f( G5 B% LI 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:
" U5 B- C8 q p/ K1 |% F
3 \, _: L7 T+ l. Y2 K9 C" AImage c1d9.... is unacceptable: Unable to rebuild with a different image for a volume-backed server
2 ]( ]5 G0 {8 x! R$ |' m
c9 C0 W3 T* b3 D. q7 e8 W+ UHow can I rebuild volume-backend server?: B7 N" ?) x3 a" J8 y: L# }6 ?
9 l! M, C; \/ ?2 F: m' Y) A
openstackopenstack-nova
1 r& A+ F' x9 Q Z' u+ t9 zShare4 u1 ^/ M) S6 c. z4 w4 Q
Improve this question2 x ?4 C; S2 o) z+ R( w
Follow
$ k6 y, E( e" L& @asked May 18, 2021 at 11:343 _; A5 S2 N' v" F; q
Bani's user avatar
. E' d! ~7 k0 ]Bani& w4 H' l1 ^9 X: K: m. _5 ?
1966 bronze badges
7 b9 h4 ], m7 P5 C+ U, KAdd a comment
) X, e: I- P' u4 G6 ~1 Answer
/ |4 b& |8 j1 s! ]& z; y3 h# aSorted by:' c! k: r* |$ P% E8 c
: J$ n0 l9 ?4 Y( f* ?; J }; n1 Y% hHighest score (default)
) q7 i9 m" e+ m8 x7 j/ s& T9 s; D! k) e2 N* X% d
0
* ?( t! L! F' T, c, W- `, g
0 ~; X! ]/ X2 Q+ L( Y- @# q) b/ G B8 k
As noted in Openstack docs [1], rebuild is not supported for volume-based VMs., {1 `/ R# X7 t q8 T9 H& V& W# r
0 e0 r; j! A. I8 }1 y3 V
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.
z5 e4 j4 c; y" U5 r+ ^- p/ r* c
* ~5 L' X a( t# ?/ t1 e, R& eFor Ceph based backend, it would be something like
9 Q: @! q; m3 i$ y7 b6 f
9 E& W/ E1 p0 U. ]6 |$ ~2 Hopenstack volume show <...> => Get pool/path from rbd backend
$ b$ O1 U) _& copenstack image show <...> => Get pool/path from rbd backend0 \8 L- F% J; J7 O3 h& |; k* w, E
openstack server stop <VM> => Stop the VM
. \) M- p. \ P! Y: f7 g; W
" Z5 k5 [9 @1 u" U* v# T1 mrbd -p <POOL NAME> mv <VM VOLUME UUID> <VM VOLUME UUID>.old6 w" }1 j. t8 L! P+ ]
rbd -p <POOL NAME> cp <IMAGE VOLUME UUID> <VM VOLUME UUID>
6 j* J: W& x: E7 zOnce the copy finishes, start the VM5 ^0 e+ t5 j G8 v, t8 S4 i1 Z
4 h' R( K, ^$ I3 [
openstack server start <VM> |
|