|
|
OpenStack cinder extend volume(cinder卷扩容)) J3 N% x( B5 ^. ~3 O$ J
7 i* Q7 J; R/ x7 |7 N
卷扩容分为2种情况。( Z) P& Z6 I D n- c& b; z
1.开机扩容(热扩容)7 h C8 ~2 c! ^$ t% n. r
此时 instance状态为active。卷状态为in-use。' l( H3 |4 \6 C8 u( A2 z' W) b
2.关机扩容
9 ^0 M, {3 l6 L! i |$ x9 X4 ?此时instance状态为stop。卷状态为in-use。
& d4 r: Q" i5 [在旧版本的openstack cinder中只允许对available的卷进行扩容8 M+ i' `2 ~5 K8 C: I# c# G; u. s
6 e' F U G6 @, J' v* h; c8 bopenstack https://specs.openstack.org/openstack/cinder-specs/specs/pike/extend-attached-volume.html
* Q* E5 k, R4 v2 o建议是先卸载掉在进行扩容。
2 P, A) n1 Y" u: s+ i
+ a8 Y/ l; b. H5 C% _较新的版本中已经加入了对‘in-use’的卷进行扩容
/ u1 \1 e" T3 Q2 g1 pAdd ability to extend 'in-use' volume. User should be aware of the v& Z6 ^3 W6 y
whole environment before using this feature because it's dependent9 h8 f! E$ x7 p. G
on several external factors below:
( m; K: F1 H5 I: `% J( j1. nova-compute version - needs to be the latest for Pike.6 n/ m; n B1 P1 J- Z
2. only the libvirt compute driver supports this currently.
# _- J1 E. ~- a2 H7 D" `5 O3. only iscsi and fibre channel volume types are supported C) I' o1 J4 M+ j- b
on the nova side currently.
7 C2 p9 B- }0 }7 F9 \6 PAdministrator can disable this ability by updating the! J1 K4 b% P" M' b; [
'volume:extend_attached_volume' policy rule. Extend in reserved) ? h/ T& }) Y6 o! @3 }) O
state is intentionally NOT allowed.* e7 }0 N8 J7 U# }
( R% g2 l5 i6 B1 `5 D/ V6 l
注意: D5 o; n4 Y. s A' `8 M+ y
目前支持使用os brick(如libvirt和hyper-v)的nova virt驱动,且只有 iscsi 和 fibre channel 协议的卷类型能支持
( ~1 S) X0 X+ [" J8 |& _5 Qcinder、nova做完热扩容后,fdisk -l查看可以看到磁盘大小变大,但是之前做的文件系统的大小是不会变化的,df -h 的结果跟扩容前一样。最终用户必须在guest中执行分区和/或文件系统大小调整(resize2fs),以充分利用新的卷大小。
* K K; A' n2 x" ~% u$ _. o- P' n参考:https://specs.openstack.org/openstack/nova-specs/specs/pike/implemented/nova-support-attached-volume-extend.html
3 _, c8 A7 t# X7 i) ]/ [+ i- U- A: x4 s& R0 u
还有一种情况是创建出的卷还未挂载给instance。这种情况很简单,直接调用扩容接口即可。
+ R) f1 B7 h* A6 j/ k1 _% n0 r
, p4 g6 t9 x7 q1 f" |# ^) l |
|