|
|
OpenStack cinder extend volume(cinder卷扩容)
4 _% c9 `. b7 C9 C1 n6 h$ S! R9 O
7 K7 `" Z$ { K: h3 J* ]; B O卷扩容分为2种情况。2 m# R5 D) R* s+ U, X* k4 s x
1.开机扩容(热扩容)
4 a _8 E+ U: }# ?* X此时 instance状态为active。卷状态为in-use。
- _ D4 T E. m. S' T0 A l" |2.关机扩容 D! `3 P2 h( u" ^+ [; g. D. B; [
此时instance状态为stop。卷状态为in-use。& j3 a! h6 H& L: \6 O# a' y5 a
在旧版本的openstack cinder中只允许对available的卷进行扩容: ~: x% j! p- Z6 G2 I3 M
, `" N: q* F4 c7 s. i* n! \- Q- Wopenstack https://specs.openstack.org/openstack/cinder-specs/specs/pike/extend-attached-volume.html4 l7 Z. Q: ~' o- ^1 f# E! N
建议是先卸载掉在进行扩容。
. _& i9 X' i% U: x- v+ h- g/ Z* a2 C) F5 u
较新的版本中已经加入了对‘in-use’的卷进行扩容% E% k/ `* \" B0 }# ?
Add ability to extend 'in-use' volume. User should be aware of the, q$ F2 Y; U* ]' a
whole environment before using this feature because it's dependent
4 c( n4 j% Q5 q+ C' ]. q! aon several external factors below:" V& h) [0 b+ F( o, r8 T
1. nova-compute version - needs to be the latest for Pike.
8 ]9 c- j7 g1 O- v% c2. only the libvirt compute driver supports this currently.2 |+ C- Y! F4 h6 m
3. only iscsi and fibre channel volume types are supported
) O" J Z* K' _1 _on the nova side currently.
$ m7 t, d) T3 m$ SAdministrator can disable this ability by updating the
2 k" p+ q1 u0 P* _'volume:extend_attached_volume' policy rule. Extend in reserved" m8 n, A4 x, H$ ?# q- ^# V5 R
state is intentionally NOT allowed.8 O" M& _' R; _8 }- X
, h2 v8 V( K: o+ a# A/ j. k; Z: e/ m
注意:
+ ^1 ~1 G! {2 u8 [1 B }( M目前支持使用os brick(如libvirt和hyper-v)的nova virt驱动,且只有 iscsi 和 fibre channel 协议的卷类型能支持2 G( Q4 i0 G( n# x8 H
cinder、nova做完热扩容后,fdisk -l查看可以看到磁盘大小变大,但是之前做的文件系统的大小是不会变化的,df -h 的结果跟扩容前一样。最终用户必须在guest中执行分区和/或文件系统大小调整(resize2fs),以充分利用新的卷大小。
/ W+ g0 a) _1 B参考:https://specs.openstack.org/openstack/nova-specs/specs/pike/implemented/nova-support-attached-volume-extend.html
* m4 M9 N2 F! z6 W) c7 c" ?- l" n9 z3 g: a( x A
还有一种情况是创建出的卷还未挂载给instance。这种情况很简单,直接调用扩容接口即可。
& @- `) n* v( w! b4 t8 g
) c L$ u! ?+ S6 G( z5 o1 h. Q' ^ |
|