- 向 cinder-api 发送 extend 请求
- 客户(可以是 OpenStack 最终用户,也可以是其他程序)向 cinder-api 发送请求:“请 extend 指定的 volume。”
- 这里我们将 extend volume “vol-1”。进入 GUI 操作菜单 Project -> Volumes -> Volumes。
- vol-1 当前大小为 1GB。其在存储节点上对应的 LV 信息如下:
- 选择 volume “vol-1”,点击“Extend Volume”。指定新容量为 3GB,点击 “Extend Volume”。
| |
- cinder-api 将接收到 extend volume 的请求
- 查看c-api日志文件
| | 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]
POST http://172.16.1.17/volume/v3/51743f081cb7477f9a1f4ccdf6490d8e/volumes/f0a54... |
| 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: {"os-extend": {"new_size": 3
{{(pid=31312) get_method /opt/stack/cinder/cinder/api/openstack/wsgi.py:985 |
|
- cinder-api 发送消息
- cinder-api 发送消息 extend 消息。cinder-api 没有打印发送消息的日志,只能通过源代码查看。/opt/stack/cinder/cinder/volume/api.py,方法为 extend。
| cloudman的: 我的: 为什么还有cinder-scheuler的参与?查看c-sch日志 | Jun 20 18:51:47 controller cinder-scheduler[32043]:
DEBUG cinder.scheduler.filters.capacity_filter
[None req-e2d3a028-8398-4d3f-80cd-367a71c12fca admin None]
Checking if host controller@lvmdriver-1#lvmdriver-1 can extend the volume
f0a54ac7-5423-4794-8883-d753f6a903cd in 2 GB
{{(pid=32043) backend_passes /opt/stack/cinder/cinder/scheduler/filters/capacity_filter.py:55 |
|
- cinder-volume extend volume
- cinder-volume 执行 lvextend 命令 extend volume。查看c-vol日志:
| | 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
lvextend -L 3g 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
|
| Jun 20 18:51:49 controller cinder-volume[304]:
INFO cinder.volume.manager
[None req-e2d3a028-8398-4d3f-80cd-367a71c12fca admin None]
Extend volume completed successfully. |
|
- 结果:
- LV 被 extend 到 3GB
- GUI 也会更新 volume 的状态信息
| |