08.存储Cinder→5.场景学习→05.Extend Volume

  1. 为了保护现有数据,cinder 不允许缩小 volume。
  2. Extend 操作用于扩大 Volume 的容量,状态为 Available 的 volume 才能够被 extend。
  3. 如果 volume 当前已经 attach 给 instance(状态变为In-use),需要先 detach 后才能 extend。
描述详细
  1. 向 cinder-api 发送 extend 请求
    1. 客户(可以是 OpenStack 最终用户,也可以是其他程序)向 cinder-api 发送请求:“请 extend 指定的 volume。”
    2. 这里我们将 extend volume “vol-1”。进入 GUI 操作菜单 Project -> Volumes -> Volumes。
    3. vol-1 当前大小为 1GB。其在存储节点上对应的 LV 信息如下:paste-344095599886339.jpgpaste-344018290475011.jpg
    4. 选择 volume “vol-1”,点击“Extend Volume”。指定新容量为 3GB,点击 “Extend Volume”。
paste-344224448905219.jpg
  1. cinder-api 将接收到 extend volume 的请求
    1. 查看c-api日志文件
1
2
3
4
Jun 20 18:51:46 controller devstack@c-api.service[31309]: 
INFO cinder.api.openstack.wsgi 
[None req-e2d3a028-8398-4d3f-80cd-367a71c12fca admin admin] 
 http://172.16.1.17/volume/v3/51743f081cb7477f9a1f4ccdf6490d8e/volumes/f0a54...
1
2
3
4
5
Jun 20 18:51:46 controller devstack@c-api.service[31309]: 
DEBUG cinder.api.openstack.wsgi 
[None req-e2d3a028-8398-4d3f-80cd-367a71c12fca admin admin] 
Action body: {: {"new_size": 3 
{{(pid=31312) get_method /opt/stack/cinder/cinder/api/openstack/wsgi.py:985
  1. cinder-api 发送消息
    1. cinder-api 发送消息 extend 消息。cinder-api 没有打印发送消息的日志,只能通过源代码查看。/opt/stack/cinder/cinder/volume/api.py,方法为 extend。
cloudman的:
paste-345607428374531.jpg
我的:
paste-345233766219779.jpg
为什么还有cinder-scheuler的参与?查看c-sch日志
1
2
3
4
5
6
Jun 20 18:51:47 controller cinder-scheduler[32043]: 
DEBUG cinder.scheduler.filters. 
[None req-e2d3a028-8398-4d3f-80cd-367a71c12fca admin None] 
 
f0a54ac7-5423-4794-8883-d753f6a903cd in 2 GB 
{{(pid=32043) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:55
  1. cinder-volume extend volume
    1. cinder-volume 执行 lvextend 命令 extend volume。查看c-vol日志:
1
2
3
4
5
6
Jun 20 18:51:47 controller cinder-volume[304]: 
DEBUG oslo_concurrency.processutils 
[None req-e2d3a028-8398-4d3f-80cd-367a71c12fca admin None] 
Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C 
 stack-volumes-lvmdriver-1/volume-f0a54ac7-5423-4794-8883-d753f6a903cd 
{{(pid=460) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:372
1
2
3
4
Jun 20 18:51:49 controller cinder-volume[304]: 
INFO cinder.volume.manager 
[None req-e2d3a028-8398-4d3f-80cd-367a71c12fca admin None] 
  1. 结果:
    1. LV 被 extend 到 3GB
    2. GUI 也会更新 volume 的状态信息paste-349258150576131.jpg
paste-345731982426115.jpg
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值