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 netns
is the command that manages the Linux network namespace, if you are unfamiliar with namespace, refer to the relevant chapters in the previous tutorials.
test_router
The 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:
The instance is metadata by a predefined 169.254.169.254
request.
The request is forwarded to the neutron router.
Router forwarded the request to Neutron-ns-metadata-proxy.
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)