Get metadata process details-5 minutes a day to play OpenStack (167)

Source: Internet
Author: User
Tags unix domain socket

Tag:open   stack    tutorial    

Next, start neutron router instance   C1   > Finally got the metadata, from the following     Startup log:


650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490189536818067249.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490190248448021225.jpg "style=" border:0px;margin:0px;padding:0px;float:none; Height:auto; "/>

C1 considers the metadata service address to be 169.254.169.254and the port is 80. We tried to visit metadata in C1 .


650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490190000720005006.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490190248701077572.png "alt=" 18.png "style=" border:0px;margin:0px;padding:0px; Height:auto; "/>


650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490189536774057730.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490190248925063580.jpg "style=" border:0px;margin:0px;padding:0px;float:none; Height:auto; "/>


650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490189536986066167.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490190249055085913.png "style=" border:0px;margin:0px;padding:0px;float:none; Height:auto; "/>


can actually get metadata. But we know that Nova-api-metadata is running on the control node, IP is not 169.254.169.254 , how is this implemented? Let's analyze the process below.


from  C1   's routing table to access  169.254.169.254   's request will go  17.17.17.1 .

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490189537086094964.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490190249169095704.png "style=" border:0px;margin:0px;padding:0px;float:none; Height:auto, "/>

17.17.17.1   is actually  test_router   in  test_net the interface IP on the  . This route is automatically added to instance by OpenStack, which forwards metadata requests to neutron router.


650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490189537364098278.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490190249288014373.jpg "style=" border:0px;margin:0px;padding:0px;float:none; Height:auto; "/>

ip netnsis the command that manages the Linux network namespace, if you are unfamiliar with namespace, refer to the relevant chapters in the previous tutorials.


test_routerThe received c1 request is forwarded to Port 9697 via the iptable rule.


650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490189537293004924.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490190249495053332.jpg "style=" border:0px;margin:0px;padding:0px;float:none; Height:auto; "/>


What is Port 9697 for? This is the Neutron-ns-metadata-proxy listening port.


650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490189537645020680.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490190249744050582.jpg "style=" border:0px;margin:0px;padding:0px;float:none; Height:auto; "/>


Here we can get back to the idea:


  1. The instance is metadata by a predefined 169.254.169.254 request.

  2. The request is forwarded to the neutron router.

  3. Router forwarded the request to Neutron-ns-metadata-proxy.

  4. The following is simple: Neutron-ns-metadata-proxy will request to send neutron-metadata-agent through the UNIX domain socket, which is then sent to nova-api-metadata through the management network.

OpenStack creates and manages Neutron-ns-metadata-proxy by default through L3-agent. But not all environments have l3-agent, such as scenes that use physical router directly. Then you need to let dhcp-agent to manage Neutron-ns-metadata-proxy.

In the next section we analyze how Dhcp-agent handles metadata requests.


650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170314-1489480541786069813.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170322-1490190249943042123.jpg "style=" border:0px;margin:0px;padding:0px;float:none; Height:auto; "/>


Get metadata process details-5 minutes a day to play OpenStack (167)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.