|
|
OpenStack cinder extend volume(cinder卷扩容)
! r" Q& Q$ ], Z0 u7 s) q3 o! ]# n; Z" Z. D j/ I
卷扩容分为2种情况。
- [7 C! b ~4 @1.开机扩容(热扩容)
) g1 E% a9 ^1 M- C3 H6 N! L! }9 Q此时 instance状态为active。卷状态为in-use。4 P" c4 x( z e' e
2.关机扩容0 c4 }. K9 V0 v; u+ j
此时instance状态为stop。卷状态为in-use。
9 t+ j! t5 p9 G/ g# Y1 O$ ~/ g在旧版本的openstack cinder中只允许对available的卷进行扩容 ^5 B a7 _2 f
; w0 R3 z3 ^- X+ L
openstack https://specs.openstack.org/openstack/cinder-specs/specs/pike/extend-attached-volume.html& o* N' j- M. I( W! V+ z
建议是先卸载掉在进行扩容。4 L- d" c+ O: x7 C- ~+ G
' N6 N( G0 k5 L) Y# u* o; P8 _较新的版本中已经加入了对‘in-use’的卷进行扩容: L* S8 ?) X6 }- ~3 D. T# N- U8 H
Add ability to extend 'in-use' volume. User should be aware of the
' I7 h* m Z) |' iwhole environment before using this feature because it's dependent
1 }; N% L, h% ron several external factors below:
P' ?' q% {3 ?* f1 i9 d( A2 m1. nova-compute version - needs to be the latest for Pike.' k j9 R( D W: o, e; P
2. only the libvirt compute driver supports this currently.
0 s' h/ n# M4 F4 u: |" \8 A3. only iscsi and fibre channel volume types are supported
9 g- M. P0 s+ z9 b, xon the nova side currently.
9 G$ Q% X, M5 i/ H4 ]7 TAdministrator can disable this ability by updating the
- J5 ^0 N7 F& S4 E'volume:extend_attached_volume' policy rule. Extend in reserved
, g. u7 b% U" ^( Gstate is intentionally NOT allowed.
/ L4 u6 I/ M8 m
; _$ J7 W3 b$ p- g注意:/ ?8 y2 A8 { z% x
目前支持使用os brick(如libvirt和hyper-v)的nova virt驱动,且只有 iscsi 和 fibre channel 协议的卷类型能支持
* H- j# b8 U( T' `8 P- c2 fcinder、nova做完热扩容后,fdisk -l查看可以看到磁盘大小变大,但是之前做的文件系统的大小是不会变化的,df -h 的结果跟扩容前一样。最终用户必须在guest中执行分区和/或文件系统大小调整(resize2fs),以充分利用新的卷大小。6 ~$ f6 L: Z- E3 M( E
参考:https://specs.openstack.org/openstack/nova-specs/specs/pike/implemented/nova-support-attached-volume-extend.html- ^! ^0 t; R4 F; T* o8 k4 w- e
3 V) c# C: [# e; n% i3 b9 i9 Z
还有一种情况是创建出的卷还未挂载给instance。这种情况很简单,直接调用扩容接口即可。
* y( B& _8 a' c6 B# B- ?
, m$ W9 ]! s+ t |
|