- 积分
- 16840
在线时间 小时
最后登录1970-1-1
|

楼主 |
发表于 2022-10-20 14:12:56
|
显示全部楼层
0
* r: _! y: ?- Y+ O3 ~# O
' M2 Q# p- D) F* a, Z9 b+ b
# F9 ?3 v6 N1 o6 X: e8 y1 fI 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:
! K2 ?& ]9 Z) C9 H
! O, z% q# q4 nImage c1d9.... is unacceptable: Unable to rebuild with a different image for a volume-backed server
$ k6 B/ V7 {6 g8 D; ~8 ^5 E, b7 ?2 k1 q+ j* V1 p, V& v
How can I rebuild volume-backend server?
9 g$ C7 \3 a: W+ x; y4 e9 C# u, C# e4 z5 Z7 t
openstackopenstack-nova
, h# c7 I0 D6 u' w' VShare
! \; N/ w! c9 `# `4 CImprove this question" M6 x) P- t' _# T+ y7 w) b6 w* F
Follow- x% |3 D" M% e
asked May 18, 2021 at 11:345 Y( }( y8 V+ B0 ]+ A
Bani's user avatar
1 m5 F3 h* H9 |) ` zBani
4 y# e* C' Q/ w5 [1 B, [7 M. p1966 bronze badges
/ `) X+ r. S8 L4 ?; K* z; f' Q0 pAdd a comment; F* w* Y. r* X$ {
1 Answer$ F( }6 t! g8 R
Sorted by:, e# ~4 Z# ]8 x0 |* i
P7 d2 ^/ J- m6 m
Highest score (default)
1 `& K0 A% i I: v. _6 {
: x g8 C7 _. o0 |6 v0 V& m, C0; F1 u& U# ?; j
. L2 r' J* c1 D7 R; [+ t1 r5 P
' `, m3 n$ e1 c3 b2 d( p- D) l; _As noted in Openstack docs [1], rebuild is not supported for volume-based VMs.
5 S! O# T: E) q7 E$ Y$ q$ w! P$ E/ ^# {) y" j1 b5 u I
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.# P3 ^# {! K0 o" I
0 {9 B5 H! _' l6 q
For Ceph based backend, it would be something like" ~- K/ _3 Z) D; c
7 R3 h0 E8 h! Hopenstack volume show <...> => Get pool/path from rbd backend
/ y! I7 p9 u/ K0 [7 V+ b7 W" r3 Lopenstack image show <...> => Get pool/path from rbd backend
/ _3 M% D) W5 t* c- K8 _" N6 Bopenstack server stop <VM> => Stop the VM
& K* m- L( H1 I& H! b4 ], P( U2 k8 N. F4 X" s0 E8 _
rbd -p <POOL NAME> mv <VM VOLUME UUID> <VM VOLUME UUID>.old
. |8 K. b/ ?8 t. x* I! Y5 J% J0 trbd -p <POOL NAME> cp <IMAGE VOLUME UUID> <VM VOLUME UUID>
; m/ f% r+ a: _% ROnce the copy finishes, start the VM4 T- _3 q8 p- g; @+ w" |
2 M* \; [ F% b I: A0 Jopenstack server start <VM> |
|