- 创建 ceph volume 操作方法与 LVM volume 一样,唯一区别是在 volume type 的下拉列表中选择“ceph”。
- 点击“Create Volume”,cinder-api,cinder-scheduler 和 cinder-volume 共同协作创建 volume “vol-1”。这个流程与 LVM volume 一样。由于只有一个存储节点,因此筛选出的还是控制节点。
- 下面我们重点分析 cinder-volume 日志,看看 Ceph volume provider 是如何创建 volume 的。
|
|
- 查看日志cinder-volume日志:
- cinder-volume 也会启动 Flow 来完成 volume 创建工作,Flow 的名称为 volume_create_manager。
| | Jun 27 14:39:28 controller cinder-volume[9796]:
DEBUG cinder.volume.manager
[None req-9387d0b4-8fc5-4d0a-93fa-e381c8a33dfd demo None]
Flow 'volume_create_manager' (bc289638-f0c9-4296-9ea3-b8fee5ae0496)
transitioned into state 'RUNNING' from state 'PENDING'
{{(pid=9947) _flow_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:145 |
|
- volume_create_manager 首先执行 ExtractVolumeRefTask, OnFailureRescheduleTask, ExtractVolumeSpecTask, NotifyVolumeActionTask 为 volume创建做准备。然后由 CreateVolumeFromSpecTask 真正创建 volume。
| | Jun 27 14:39:28 controller cinder-volume[9796]:
DEBUG cinder.volume.manager
[None req-9387d0b4-8fc5-4d0a-93fa-e381c8a33dfd demo None]
Task 'cinder.volume.flows.manager.create_volume.CreateVolumeFromSpecTask;volume:create'
(f7f21bc6-326e-4dd7-ba44-9a1c7bcc34e0) transitioned into state 'RUNNING' from state 'PENDING'
{{(pid=9947) _task_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:194 |
| Jun 27 14:39:28 controller cinder-volume[9796]:
INFO cinder.volume.flows.manager.create_volume
[None req-9387d0b4-8fc5-4d0a-93fa-e381c8a33dfd demo None]
Volume 6babe822-1674-4687-a037-b483a2c62929: being created as raw with specification:
{'status': u'creating', 'volume_size': 1, 'volume_name': u'volume-6babe822-1674-4687-a037-b483a2c62929'} |
|
- 通过connecting to ceph创建volume,使用的是rbd driver
| | Jun 27 14:39:28 controller cinder-volume[9796]:
DEBUG cinder.volume.drivers.rbd
[None req-9387d0b4-8fc5-4d0a-93fa-e381c8a33dfd demo None]
creating volume 'volume-6babe822-1674-4687-a037-b483a2c62929'
{{(pid=9947) create_volume /opt/stack/cinder/cinder/volume/drivers/rbd.py:779
|
| Jun 27 14:39:28 controller cinder-volume[9796]:
DEBUG cinder.volume.drivers.rbd
[None req-9387d0b4-8fc5-4d0a-93fa-e381c8a33dfd demo None]
connecting to ceph (timeout=-1).
{{(pid=9947) _do_conn /opt/stack/cinder/cinder/volume/drivers/rbd.py:332 |
|
- create 操作完成
| | Jun 27 14:39:28 controller cinder-volume[9796]:
DEBUG cinder.volume.manager
[None req-9387d0b4-8fc5-4d0a-93fa-e381c8a33dfd demo None]
Task 'cinder.volume.flows.manager.create_volume.CreateVolumeFromSpecTask;volume:create'
(f7f21bc6-326e-4dd7-ba44-9a1c7bcc34e0) transitioned into state 'SUCCESS' from state 'RUNNING'
with result '{'status': u'creating', 'volume_size': 1,
'volume_name': u'volume-6babe822-1674-4687-a037-b483a2c62929'}'
{{(pid=9947) _task_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:183
|
| Jun 27 14:39:28 controller cinder-volume[9796]:
DEBUG cinder.volume.manager
[None req-9387d0b4-8fc5-4d0a-93fa-e381c8a33dfd demo None]
Task 'cinder.volume.flows.manager.create_volume.CreateVolumeOnFinishTask;volume:create, create.end'
(90ced764-c94d-4666-8b5b-8ec279e58fc1) transitioned into state 'RUNNING' from state 'PENDING'
{{(pid=9947) _task_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:194
|
| Jun 27 14:39:28 controller cinder-volume[9796]:
INFO cinder.volume.flows.manager.create_volume
[None req-9387d0b4-8fc5-4d0a-93fa-e381c8a33dfd demo None]
Volume volume-6babe822-1674-4687-a037-b483a2c62929
(6babe822-1674-4687-a037-b483a2c62929): created successfully
|
| Jun 27 14:39:28 controller cinder-volume[9796]:
DEBUG cinder.volume.manager
[None req-9387d0b4-8fc5-4d0a-93fa-e381c8a33dfd demo None]
Task 'cinder.volume.flows.manager.create_volume.CreateVolumeOnFinishTask;volume:create, create.end'
(90ced764-c94d-4666-8b5b-8ec279e58fc1)
transitioned into state 'SUCCESS' from state 'RUNNING' with result 'None'
{{(pid=9947) _task_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:183
|
| Jun 27 14:39:28 controller cinder-volume[9796]:
DEBUG cinder.volume.manager
[None req-9387d0b4-8fc5-4d0a-93fa-e381c8a33dfd demo None]
Flow 'volume_create_manager' (bc289638-f0c9-4296-9ea3-b8fee5ae0496)
transitioned into state 'SUCCESS' from state 'RUNNING'
{{(pid=9947) _flow_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:145 |
|
- Volume在ceph上以object存在。
| |