今天我们将前一小节中创建的 nfs-vol-xx attach 到Instance c1 上,这里重点分析 nova-compute如何将nfs-vol-xx attach到c1 上
![](https://i-blog.csdnimg.cn/blog_migrate/a7f27622e7eb757d6d0054cfde283fdd.png)
[root@DevStack-Rocky-Compute-22 ~]# virsh domblklist 1
Target Source
------------------------------------------------
vda /dev/sdb
vdb /opt/stack/data/nova/mnt/cc6a13e63509492ab709bb63b536feed/volume-07acd9e8-def4-434a-8657-d6c257929b67
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source dev='/dev/sdb'/>
<backingStore/>
<target dev='vda' bus='virtio'/>
<serial>06984f3c-44e1-42a5-b03c-08a0cfa19f73</serial>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none' io='native'/>
<source file='/opt/stack/data/nova/mnt/cc6a13e63509492ab709bb63b536feed/volume-07acd9e8-def4-434a-8657-d6c257929b67'/>
<backingStore/>
<target dev='vdb' bus='virtio'/>
<serial>07acd9e8-def4-434a-8657-d6c257929b67</serial>
<alias name='virtio-disk1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</disk>
1、通过findmnt和mkdir测试和创建mount点
2、mount NFS目录
3、更新 Instance 的XML 配置文件,将volume 文件映射给Instance
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@n-api.service: #033[00;32mDEBUG nova.api.openstack.wsgi [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mAction: 'create', calling method: <bound method VolumeAttachmentController.create of <nova.api.openstack.compute.volumes.VolumeAttachmentController object at 0x7f978927c690>>, body: {"volumeAttachment": {"volumeId": "07acd9e8-def4-434a-8657-d6c257929b67"}}#033[00m #033[00;33m{{(pid=3630) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:615}}#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@n-api.service: #033[00;32mDEBUG nova.compute.api [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m[instance: 502d7935-e350-4164-8ef4-95cc8b34bd54] #033[00;32mFetching instance by UUID#033[00m #033[00;33m{{(pid=3630) get /opt/stack/nova/nova/compute/api.py:2421}}#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@n-api.service: #033[00;32mDEBUG oslo_concurrency.lockutils [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mLock "fe4d50b2-4e42-45ad-af8c-acb570540b3c" acquired by "nova.context.get_or_set_cached_cell_and_set_connections" :: waited 0.000s#033[00m #033[00;33m{{(pid=3630) inner /usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py:273}}#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@n-api.service: #033[00;32mDEBUG oslo_concurrency.lockutils [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mLock "fe4d50b2-4e42-45ad-af8c-acb570540b3c" released by "nova.context.get_or_set_cached_cell_and_set_connections" :: held 0.000s#033[00m #033[00;33m{{(pid=3630) inner /usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py:285}}#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-94c5edcb-b686-4ae8-a27c-6314c33759f0 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mGET http://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/volumes/07acd9e8-def4-434a-8657-d6c257929b67#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-94c5edcb-b686-4ae8-a27c-6314c33759f0 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mEmpty body provided in request#033[00m #033[00;33m{{(pid=21071) get_body /opt/stack/cinder/cinder/api/openstack/wsgi.py:718}}#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-94c5edcb-b686-4ae8-a27c-6314c33759f0 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mCalling method 'show'#033[00m #033[00;33m{{(pid=21071) _process_stack /opt/stack/cinder/cinder/api/openstack/wsgi.py:872}}#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.volume.api [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-94c5edcb-b686-4ae8-a27c-6314c33759f0 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mVolume info retrieved successfully.#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-94c5edcb-b686-4ae8-a27c-6314c33759f0 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mhttp://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/volumes/07acd9e8-def4-434a-8657-d6c257929b67 returned with HTTP 200#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-16b6a75f-03cf-4066-beac-50a906968a8a #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mPOST http://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/attachments#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-16b6a75f-03cf-4066-beac-50a906968a8a #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mAction: 'create', calling method: version_select, body: {"attachment": {"instance_uuid": "502d7935-e350-4164-8ef4-95cc8b34bd54", "connector": null, "volume_uuid": "07acd9e8-def4-434a-8657-d6c257929b67"}}#033[00m #033[00;33m{{(pid=21071) _process_stack /opt/stack/cinder/cinder/api/openstack/wsgi.py:869}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-16b6a75f-03cf-4066-beac-50a906968a8a #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mhttp://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/attachments returned with HTTP 200#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Controller-21 devstack@n-api.service: #033[00;36mINFO nova.api.openstack.requestlog [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36m10.12.30.21 "POST /compute/v2.1/servers/502d7935-e350-4164-8ef4-95cc8b34bd54/os-volume_attachments" status: 200 len: 194 microversion: 2.1 time: 0.510263#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-60715c02-e389-475f-8a54-b3bcb7090e88 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mGET http://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/volumes/07acd9e8-def4-434a-8657-d6c257929b67#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-60715c02-e389-475f-8a54-b3bcb7090e88 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mEmpty body provided in request#033[00m #033[00;33m{{(pid=21070) get_body /opt/stack/cinder/cinder/api/openstack/wsgi.py:718}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-60715c02-e389-475f-8a54-b3bcb7090e88 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mCalling method 'show'#033[00m #033[00;33m{{(pid=21070) _process_stack /opt/stack/cinder/cinder/api/openstack/wsgi.py:872}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.volume.api [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-60715c02-e389-475f-8a54-b3bcb7090e88 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mVolume info retrieved successfully.#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-60715c02-e389-475f-8a54-b3bcb7090e88 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mhttp://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/volumes/07acd9e8-def4-434a-8657-d6c257929b67 returned with HTTP 200#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mPUT http://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/attachments/fd4f3dc0-0101-43b6-89ef-c74d8d2980d6#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mAction: 'update', calling method: version_select, body: {"attachment": {"connector": {"initiator": "iqn.1994-05.com.redhat:d77c331f2be5", "ip": "10.12.30.22", "platform": "x86_64", "host": "DevStack-Rocky-Compute-22", "do_local_attach": false, "mountpoint": "/dev/vdb", "os_type": "linux2", "multipath": false}}}#033[00m #033[00;33m{{(pid=21070) _process_stack /opt/stack/cinder/cinder/api/openstack/wsgi.py:869}}#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mhttp://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/attachments/fd4f3dc0-0101-43b6-89ef-c74d8d2980d6 returned with HTTP 200#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-8a58c80d-2615-41c7-8d90-2d863ad4c045 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mPOST http://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/attachments/fd4f3dc0-0101-43b6-89ef-c74d8d2980d6/action#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-8a58c80d-2615-41c7-8d90-2d863ad4c045 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mAction body: {"os-complete": null}#033[00m #033[00;33m{{(pid=21071) get_method /opt/stack/cinder/cinder/api/openstack/wsgi.py:986}}#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-8a58c80d-2615-41c7-8d90-2d863ad4c045 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mAction: 'action', calling method: complete, body: {"os-complete": null}#033[00m #033[00;33m{{(pid=21071) _process_stack /opt/stack/cinder/cinder/api/openstack/wsgi.py:869}}#033[00m#033[00m
Jul 3 22:27:05 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-8a58c80d-2615-41c7-8d90-2d863ad4c045 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mhttp://10.12.30.21/volume/v3/9ed27f1df9814f91b370d1003b066b0a/attachments/fd4f3dc0-0101-43b6-89ef-c74d8d2980d6/action returned with HTTP 204#033[00m#033[00m
Jul 3 22:27:07 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mGET http://10.12.30.21/volume//#033[00m#033[00m
Jul 3 22:27:07 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mEmpty body provided in request#033[00m #033[00;33m{{(pid=21070) get_body /opt/stack/cinder/cinder/api/openstack/wsgi.py:718}}#033[00m#033[00m
Jul 3 22:27:07 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mCalling method 'all'#033[00m #033[00;33m{{(pid=21070) _process_stack /opt/stack/cinder/cinder/api/openstack/wsgi.py:872}}#033[00m#033[00m
Jul 3 22:27:07 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mhttp://10.12.30.21/volume// returned with HTTP 300#033[00m#033[00m
Jul 3 22:27:07 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mGET http://10.12.30.21/volume//#033[00m#033[00m
Jul 3 22:27:07 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mEmpty body provided in request#033[00m #033[00;33m{{(pid=21070) get_body /opt/stack/cinder/cinder/api/openstack/wsgi.py:718}}#033[00m#033[00m
Jul 3 22:27:07 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;32mDEBUG cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mCalling method 'all'#033[00m #033[00;33m{{(pid=21070) _process_stack /opt/stack/cinder/cinder/api/openstack/wsgi.py:872}}#033[00m#033[00m
Jul 3 22:27:07 DevStack-Rocky-Controller-21 devstack@c-api.service: #033[00;36mINFO cinder.api.openstack.wsgi [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin admin#033[00;36m] #033[01;35m#033[00;36mhttp://10.12.30.21/volume// returned with HTTP 300#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG oslo_concurrency.lockutils [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mLock "502d7935-e350-4164-8ef4-95cc8b34bd54" acquired by "nova.compute.manager.do_reserve" :: waited 0.000s#033[00m #033[00;33m{{(pid=25886) inner /usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py:273}}#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.objects.instance [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mLazy-loading 'flavor' on Instance uuid 502d7935-e350-4164-8ef4-95cc8b34bd54#033[00m #033[00;33m{{(pid=25886) obj_load_attr /opt/stack/nova/nova/objects/instance.py:1111}}#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG oslo_concurrency.lockutils [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mLock "502d7935-e350-4164-8ef4-95cc8b34bd54" released by "nova.compute.manager.do_reserve" :: held 0.095s#033[00m #033[00;33m{{(pid=25886) inner /usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py:285}}#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG oslo_concurrency.lockutils [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mLock "502d7935-e350-4164-8ef4-95cc8b34bd54" acquired by "nova.compute.manager.do_attach_volume" :: waited 0.000s#033[00m #033[00;33m{{(pid=25886) inner /usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py:273}}#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Compute-22 nova-compute: #033[00;36mINFO nova.compute.manager [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;36m] #033[01;35m[instance: 502d7935-e350-4164-8ef4-95cc8b34bd54] #033[00;36mAttaching volume 07acd9e8-def4-434a-8657-d6c257929b67 to /dev/vdb#033[00m#033[00m
Jul 3 22:27:02 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.objects.instance [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mLazy-loading 'flavor' on Instance uuid 502d7935-e350-4164-8ef4-95cc8b34bd54#033[00m #033[00;33m{{(pid=25886) obj_load_attr /opt/stack/nova/nova/objects/instance.py:1111}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG os_brick.utils [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32m==> get_connector_properties: call u"{'execute': None, 'my_ip': '10.12.30.22', 'enforce_multipath': True, 'host': 'DevStack-Rocky-Compute-22', 'root_helper': 'sudo nova-rootwrap /etc/nova/rootwrap.conf', 'multipath': False}"#033[00m #033[00;33m{{(pid=25886) trace_logging_wrapper /usr/lib/python2.7/site-packages/os_brick/utils.py:146}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG os_brick.initiator.linuxfc [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mNo Fibre Channel support detected on system.#033[00m #033[00;33m{{(pid=25886) get_fc_hbas /usr/lib/python2.7/site-packages/os_brick/initiator/linuxfc.py:134}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG os_brick.initiator.linuxfc [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mNo Fibre Channel support detected on system.#033[00m #033[00;33m{{(pid=25886) get_fc_hbas /usr/lib/python2.7/site-packages/os_brick/initiator/linuxfc.py:134}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG os_brick.utils [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32m<== get_connector_properties: return (9ms) {'initiator': u'iqn.1994-05.com.redhat:d77c331f2be5', 'ip': u'10.12.30.22', 'platform': u'x86_64', 'host': u'DevStack-Rocky-Compute-22', 'do_local_attach': False, 'os_type': u'linux2', 'multipath': False}#033[00m #033[00;33m{{(pid=25886) trace_logging_wrapper /usr/lib/python2.7/site-packages/os_brick/utils.py:170}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.virt.block_device [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m[instance: 502d7935-e350-4164-8ef4-95cc8b34bd54] #033[00;32mUpdating existing volume attachment record: fd4f3dc0-0101-43b6-89ef-c74d8d2980d6#033[00m #033[00;33m{{(pid=25886) _volume_attach /opt/stack/nova/nova/virt/block_device.py:535}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 cinder-volume: #033[00;32mDEBUG cinder.volume.drivers.nfs [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin None#033[00;32m] #033[01;35m#033[00;32mInitializing connection to volume 07acd9e8-def4-434a-8657-d6c257929b67. Connector: {u'initiator': u'iqn.1994-05.com.redhat:d77c331f2be5', u'ip': u'10.12.30.22', u'platform': u'x86_64', u'host': u'DevStack-Rocky-Compute-22', u'do_local_attach': False, u'mountpoint': u'/dev/vdb', u'os_type': u'linux2', u'multipath': False}#033[00m #033[00;33m{{(pid=23760) initialize_connection /opt/stack/cinder/cinder/volume/drivers/nfs.py:128}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 cinder-volume: #033[00;32mDEBUG oslo_concurrency.processutils [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin None#033[00;32m] #033[01;35m#033[00;32mRunning cmd (subprocess): qemu-img --version#033[00m #033[00;33m{{(pid=23760) execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:372}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 cinder-volume: #033[00;32mDEBUG oslo_concurrency.processutils [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin None#033[00;32m] #033[01;35m#033[00;32mCMD "qemu-img --version" returned: 0 in 0.315s#033[00m #033[00;33m{{(pid=23760) execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:409}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 cinder-volume: #033[00;32mDEBUG oslo_concurrency.processutils [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin None#033[00;32m] #033[01;35m#033[00;32mRunning cmd (subprocess): /usr/bin/python -m oslo_concurrency.prlimit --as=1073741824 --cpu=8 -- sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C qemu-img info --force-share /nfs_storage/cc6a13e63509492ab709bb63b536feed/volume-07acd9e8-def4-434a-8657-d6c257929b67#033[00m #033[00;33m{{(pid=23760) execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:372}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 cinder-volume: #033[00;32mDEBUG oslo_concurrency.processutils [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin None#033[00;32m] #033[01;35m#033[00;32mCMD "/usr/bin/python -m oslo_concurrency.prlimit --as=1073741824 --cpu=8 -- sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C qemu-img info --force-share /nfs_storage/cc6a13e63509492ab709bb63b536feed/volume-07acd9e8-def4-434a-8657-d6c257929b67" returned: 0 in 0.324s#033[00m #033[00;33m{{(pid=23760) execute /usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py:409}}#033[00m#033[00m
Jul 3 22:27:03 DevStack-Rocky-Compute-22 cinder-volume: #033[00;32mDEBUG cinder.volume.drivers.nfs [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin None#033[00;32m] #033[01;35m#033[00;32mNfsDriver: conn_info: {'driver_volume_type': 'nfs', 'mount_point_base': '/nfs_storage', 'data': {'format': 'raw', 'export': u'10.12.28.8:/home/nfs1', 'name': u'volume-07acd9e8-def4-434a-8657-d6c257929b67', 'options': None}}#033[00m #033[00;33m{{(pid=23760) initialize_connection /opt/stack/cinder/cinder/volume/drivers/nfs.py:153}}#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Compute-22 cinder-volume: #033[00;36mINFO cinder.volume.manager [#033[01;36mreq-a40558ad-2e7d-4031-9b43-29ee7eacefbb req-f9d38cee-ae37-4b8c-a556-5a1fe962f8f1 #033[00;36madmin None#033[00;36m] #033[01;35m#033[00;36mattachment_update completed successfully.#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.virt.libvirt.volume.mount [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mGot _HostMountState generation 0#033[00m #033[00;33m{{(pid=25886) get_state /opt/stack/nova/nova/virt/libvirt/volume/mount.py:94}}#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.virt.libvirt.volume.mount [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32m_HostMountState.mount(fstype=nfs, export=10.12.28.8:/home/nfs1, vol_name=volume-07acd9e8-def4-434a-8657-d6c257929b67, /opt/stack/data/nova/mnt/cc6a13e63509492ab709bb63b536feed, options=[]) generation 0#033[00m #033[00;33m{{(pid=25886) mount /opt/stack/nova/nova/virt/libvirt/volume/mount.py:294}}#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.virt.libvirt.volume.mount [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mMounting /opt/stack/data/nova/mnt/cc6a13e63509492ab709bb63b536feed generation 0#033[00m #033[00;33m{{(pid=25886) mount /opt/stack/nova/nova/virt/libvirt/volume/mount.py:302}}#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.virt.libvirt.volume.mount [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32m_HostMountState.mount() for /opt/stack/data/nova/mnt/cc6a13e63509492ab709bb63b536feed generation 0 completed successfully#033[00m #033[00;33m{{(pid=25886) mount /opt/stack/nova/nova/virt/libvirt/volume/mount.py:336}}#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.virt.libvirt.guest [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mattach device xml: <disk type="file" device="disk">
Jul 3 22:27:04 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.virt.libvirt.driver [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mNo BDM found with device name vda, not building metadata.#033[00m #033[00;33m{{(pid=25886) _build_disk_metadata /opt/stack/nova/nova/virt/libvirt/driver.py:8721}}#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.virt.libvirt.driver [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mNo BDM found with device name vdb, not building metadata.#033[00m #033[00;33m{{(pid=25886) _build_disk_metadata /opt/stack/nova/nova/virt/libvirt/driver.py:8721}}#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG nova.virt.libvirt.driver [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mNo VIF found with MAC fa:16:3e:fb:35:7a, not building metadata#033[00m #033[00;33m{{(pid=25886) _build_interface_metadata /opt/stack/nova/nova/virt/libvirt/driver.py:8697}}#033[00m#033[00m
Jul 3 22:27:04 DevStack-Rocky-Compute-22 nova-compute: #033[00;32mDEBUG oslo_concurrency.lockutils [#033[01;36mNone req-a40558ad-2e7d-4031-9b43-29ee7eacefbb #033[00;36madmin admin#033[00;32m] #033[01;35m#033[00;32mLock "502d7935-e350-4164-8ef4-95cc8b34bd54" released by "nova.compute.manager.do_attach_volume" :: held 1.857s#033[00m #033[00;33m{{(pid=25886) inner /usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py:285}}#033[00m#033[00m
到此为止,关于cinder的内容就学习完了,总结一下:
Cinder 作为OpenStack的块存储服务,为Instance提供虚拟磁盘。本章我们首先学习了Cinder的架构,然后讨论了Cinder的各个服务组件,最后通过使用场景详细分析了Volume的各种操作。
操作中详细日志和截图可以帮助我们更好的理解Cinder内部运行机制,并为故障分析提供了非常有益的线索。