首页 > 其他 > 详细

08.存储Cinder→5.场景学习→11.NFS Volume Provider→2.Create Volume

时间:2019-07-14 20:58:33      阅读:88      评论:0      收藏:0      [点我收藏+]
描述详细
  1. 创建 NFS volume 操作方法与 LVM volume 一样,唯一区别是在 volume type 的下拉列表中选择“nfs”。
  2. 点击“Create Volume”,cinder-api,cinder-scheduler 和 cinder-volume 共同协作创建 volume “vol-3”。这个流程与 LVM volume 一样。由于只有一个存储节点,因此筛选出的还是控制节点。
  3. 下面我们重点分析 cinder-volume 日志,看看 NFS volume provider 是如何创建 volume 的。 
技术分享图片
技术分享图片
  1. 查看日志cinder-volume日志:
    1. cinder-volume 也会启动 Flow 来完成 volume 创建工作,Flow 的名称为 volume_create_manager。
1
2
3
4
5
6
Jun 24 15:15:29 controller cinder-volume[10526]: 
DEBUG cinder.volume.manager 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Flow ‘volume_create_manager‘ (ce8afde5-ad68-4b11-b356-e9d0272021ca) 
transitioned into state ‘RUNNING‘ from state ‘PENDING‘ 
{{(pid=10540) _flow_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:145
  1. volume_create_manager 首先执行 ExtractVolumeRefTask, OnFailureRescheduleTask, ExtractVolumeSpecTask, NotifyVolumeActionTask 为 volume创建做准备。然后由 CreateVolumeFromSpecTask 真正创建 volume。
1
2
3
4
5
6
Jun 24 15:15:29 controller cinder-volume[10526]: 
DEBUG cinder.volume.manager 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Task ‘cinder.volume.flows.manager.create_volume.CreateVolumeFromSpecTask;volume:create‘ 
(13ad3eb3-3d4e-4f9d-87d3-8c60cd4ee1c7) transitioned into state ‘RUNNING‘ from state ‘PENDING‘ 
{{(pid=10540) _task_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:194
1
2
3
4
5
Jun 24 15:15:29 controller cinder-volume[10526]: 
INFO cinder.volume.flows.manager.create_volume 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Volume 588b6bbe-8965-4dcb-ae87-1970b906a847: being created as raw with specification: 
{‘status‘: u‘creating‘, ‘volume_size‘: 1, ‘volume_name‘: u‘volume-588b6bbe-8965-4dcb-ae87-1970b906a847‘}
  1. 首先 mount 远程 NFS 目录挂载到本地
1
2
3
4
5
Jun 24 15:15:29 controller cinder-volume[10526]: 
DEBUG cinder.volume.drivers.remotefs 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Loading shares from /etc/cinder/nfs_shares. 
{{(pid=10540) _load_shares_config /opt/stack/cinder/cinder/volume/drivers/remotefs.py:499
1
2
3
4
Jun 24 15:15:29 controller cinder-volume[10526]: 
DEBUG cinder.volume.drivers.remotefs 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
shares loaded: {‘172.16.1.55:/storage‘: None}
1
2
3
4
5
6
{{(pid=10540) _load_shares_config /opt/stack/cinder/cinder/volume/drivers/remotefs.py:531
Jun 24 15:15:29 controller cinder-volume[10526]: 
DEBUG oslo_concurrency.processutils 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Running cmd (subprocess): mount 
{{(pid=10540) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:372
1
2
3
4
Jun 24 15:15:29 controller cinder-volume[10526]: 
INFO os_brick.remotefs.remotefs 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Already mounted: /opt/stack/data/cinder/mnt/784d250b26b539400de552b6137dccd0
  1. 执行stat、du 命令检查 NFS 目录。
1
2
3
4
5
6
Jun 24 15:15:29 controller cinder-volume[10526]: 
DEBUG oslo_concurrency.processutils 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf stat -f -c 
%S %b %a /opt/stack/data/cinder/mnt/784d250b26b539400de552b6137dccd0 
{{(pid=10540) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:372
1
2
3
4
5
6
Jun 24 15:15:29 controller cinder-volume[10526]: 
DEBUG oslo_concurrency.processutils 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf du -sb 
--apparent-size --exclude *snapshot* /opt/stack/data/cinder/mnt/784d250b26b539400de552b6137dccd0 
{{(pid=10540) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:372
  1. 执行truncate [?tr??ke?t]vt.  缩短; 创建 volume 文件
1
2
3
4
5
Jun 24 15:15:30 controller cinder-volume[10526]: 
DEBUG cinder.volume.drivers.nfs 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Selected 172.16.1.55:/storage as target NFS share. 
{{(pid=10540) _find_share /opt/stack/cinder/cinder/volume/drivers/nfs.py:263
1
2
3
4
Jun 24 15:15:30 controller cinder-volume[10526]: 
INFO cinder.volume.drivers.remotefs 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None]
 casted to 172.16.1.55:/storage
1
2
3
4
5
6
Jun 24 15:15:30 controller cinder-volume[10526]: 
DEBUG oslo_concurrency.processutils 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf truncate -s 1G 
/opt/stack/data/cinder/mnt/784d250b26b539400de552b6137dccd0/volume-588b6bbe-8965-4dcb-ae87-1970b906a847 
{{(pid=10540) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:372
  1. 设置 volume 文件为可读写。
1
2
3
4
5
6
Jun 24 15:15:30 controller cinder-volume[10526]: 
DEBUG oslo_concurrency.processutils 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf chmod ugo+rw 
/opt/stack/data/cinder/mnt/784d250b26b539400de552b6137dccd0/volume-588b6bbe-8965-4dcb-ae87-1970b906a847 
{{(pid=10540) execute /usr/local/lib/python2.7/dist-packages/oslo_concurrency/processutils.py:372
  1. create 操作完成
1
2
3
4
5
6
7
8
Jun 24 15:15:31 controller cinder-volume[10526]: 
DEBUG cinder.volume.manager 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Task ‘cinder.volume.flows.manager.create_volume.CreateVolumeFromSpecTask;volume:create‘ 
(13ad3eb3-3d4e-4f9d-87d3-8c60cd4ee1c7) transitioned into state ‘SUCCESS‘ from state ‘RUNNING‘ 
with result ‘{‘status‘: u‘creating‘, ‘volume_size‘: 1, ‘volume_name‘: 
u‘volume-588b6bbe-8965-4dcb-ae87-1970b906a847‘}‘ 
{{(pid=10540) _task_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:183
1
2
3
4
5
6
Jun 24 15:15:31 controller cinder-volume[10526]: 
DEBUG cinder.volume.manager 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Task ‘cinder.volume.flows.manager.create_volume.CreateVolumeOnFinishTask;volume:create, create.end‘ 
(c63640e9-ecca-4789-a09a-65a853b1ad8f) transitioned into state ‘RUNNING‘ from state ‘PENDING‘ 
{{(pid=10540) _task_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:194
1
2
3
4
5
Jun 24 15:15:31 controller cinder-volume[10526]: 
INFO cinder.volume.flows.manager.create_volume 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Volume volume-588b6bbe-8965-4dcb-ae87-1970b906a847 (588b6bbe-8965-4dcb-ae87-1970b906a847): 
created successfully
1
2
3
4
5
6
7
Jun 24 15:15:31 controller cinder-volume[10526]: 
DEBUG cinder.volume.manager 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Task ‘cinder.volume.flows.manager.create_volume.CreateVolumeOnFinishTask;volume:create, 
create.end‘ (c63640e9-ecca-4789-a09a-65a853b1ad8f) transitioned into state ‘SUCCESS‘ 
from state ‘RUNNING‘ with result ‘None‘ 
{{(pid=10540) _task_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:183
1
2
3
4
5
6
Jun 24 15:15:31 controller cinder-volume[10526]: 
DEBUG cinder.volume.manager 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
Flow ‘volume_create_manager‘ (ce8afde5-ad68-4b11-b356-e9d0272021ca) transitioned into state ‘SUCCESS‘ 
from state ‘RUNNING‘ 
{{(pid=10540) _flow_receiver /usr/local/lib/python2.7/dist-packages/taskflow/listeners/logging.py:145
  1. Volume 在 NFS 上以文件存在,命名为“volume-<volume ID>”。技术分享图片
技术分享图片

技术分享图片

08.存储Cinder→5.场景学习→11.NFS Volume Provider→2.Create Volume

原文:https://www.cnblogs.com/LeisureZhao/p/11185589.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!