|
|
OpenStack cinder extend volume(cinder卷扩容)
2 B" }% m* X5 [4 g1 q0 `8 \" ?; v3 ^
卷扩容分为2种情况。
/ n' Q' ~0 @3 d1.开机扩容(热扩容)
3 ^& H8 a- V/ o( A6 W. Z此时 instance状态为active。卷状态为in-use。
' L4 _$ P3 h, \2 d8 T! C5 Y2.关机扩容
5 ]0 a' C; Y+ H' _5 K W此时instance状态为stop。卷状态为in-use。* \1 m: J, y; T. l3 [) g6 ]) Y
在旧版本的openstack cinder中只允许对available的卷进行扩容
6 m' I3 S+ g9 I& x3 f3 j7 C+ k% s5 G% G+ o7 s
openstack https://specs.openstack.org/openstack/cinder-specs/specs/pike/extend-attached-volume.html" Y0 o" T5 ^# }: Y) L0 C* J
建议是先卸载掉在进行扩容。2 ]9 \1 {1 K/ K: N1 x
' x) ?5 c# ~' b) S7 i
较新的版本中已经加入了对‘in-use’的卷进行扩容 |& G5 g. u! n
Add ability to extend 'in-use' volume. User should be aware of the
$ u! h* H; k% N- m, v6 B6 Hwhole environment before using this feature because it's dependent
& b7 P1 J5 @8 X* n7 F8 e" t* T9 F& oon several external factors below:
2 U4 D; ^3 w( X$ n6 w1. nova-compute version - needs to be the latest for Pike.
& D; d/ b# l$ E" Q9 v2. only the libvirt compute driver supports this currently.& @) n- \; |4 F5 D
3. only iscsi and fibre channel volume types are supported8 U6 D+ B; Z$ |8 c8 b4 } _1 M6 i
on the nova side currently.
t9 |+ `0 Q+ A! w3 bAdministrator can disable this ability by updating the" a) \1 ^1 i" o
'volume:extend_attached_volume' policy rule. Extend in reserved; B# @5 H! m* _. R7 i$ f
state is intentionally NOT allowed.
0 B) y% M* L7 V' `8 B6 V( C/ [
, ^& M K0 \2 b3 @: t' P9 z" I注意:
, i& w/ L4 _2 A' ~! l' X% c目前支持使用os brick(如libvirt和hyper-v)的nova virt驱动,且只有 iscsi 和 fibre channel 协议的卷类型能支持5 O2 _" w" S; P
cinder、nova做完热扩容后,fdisk -l查看可以看到磁盘大小变大,但是之前做的文件系统的大小是不会变化的,df -h 的结果跟扩容前一样。最终用户必须在guest中执行分区和/或文件系统大小调整(resize2fs),以充分利用新的卷大小。
8 ~7 r3 ^5 w% ]9 C7 e- t& A参考:https://specs.openstack.org/openstack/nova-specs/specs/pike/implemented/nova-support-attached-volume-extend.html
, Z# i. T( n3 S8 @; X) F0 h b# A$ T- @- A+ D: J- a5 w7 q8 y3 B' k
还有一种情况是创建出的卷还未挂载给instance。这种情况很简单,直接调用扩容接口即可。
+ m$ D) g, R4 L1 P
) u! _% t+ {( [1 ? |
|