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

描述详细
  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 的。 
paste-147502061846531.jpg
paste-148249386156035.jpg
  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] 
 (ce8afde5-ad68-4b11-b356-e9d0272021ca) 
transitioned into state  from state  
{{(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.;volume:create' 
(13ad3eb3-3d4e-4f9d-87d3-8c60cd4ee1c7) transitioned into state  from state  
{{(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] 

{'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. 
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin None] 
 
{{(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.
[None req-ebb16520-df22-445e-82f7-4c8b8bf942f2 admin 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):  
{{(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] 
  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  -f -c 
%S %b %a  
{{(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  -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] 
 . 
{{(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]
 
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  -s 1G 
 
{{(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 
 
{{(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.;volume:create' 
(13ad3eb3-3d4e-4f9d-87d3-8c60cd4ee1c7) transitioned into state  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.;volume:create, create.end' 
(c63640e9-ecca-4789-a09a-65a853b1ad8f) transitioned into state  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] 

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.;volume:create, 
create.end' (c63640e9-ecca-4789-a09a-65a853b1ad8f) transitioned into state 
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] 
 (ce8afde5-ad68-4b11-b356-e9d0272021ca) transitioned into state 
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>”。paste-159296042041347.jpg
paste-159046933938179.jpg

paste-159150013153283.jpg
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值