In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how instance gets its own Metadata. Many people may not know much about it. In order to make you understand better, the editor summed up the following content for you. I hope you can get something according to this article.
To get the metadata from nova-api-metadata, you need to specify the id of the instance. However, instance cannot know its id when it is started, so there is no instance id information in the http request. Id is added by neutron-metadata-agent. In view of the differences in implementation details between l3-agent and dhcp-agent, they are discussed below.
L3-agent
Process: instance-> neutron-ns-metadata-proxy-> neutron-metadata-agent-> nova-api-metadata. The processing details are as follows:
① neutron-ns-metadata-proxy receives the request and adds instance ip and router id to the head of the http request before forwarding it to neutron-metadata-agent, which is easily available to l3-agent.
When ② neutron-metadata-agent receives the request, it queries the id of instance by:
1) find all the subnet connected to the router through router id, and then filter out the subnet where the instance ip is located.
2) find the port corresponding to instance ip in subnet.
3) find the corresponding instance and its id through port.
③ neutron-metadata-agent adds instance id to the head of the http request and forwards it to nova-api-metadata so that nova-api-metadata can return the metadata of the specified instance.
Let's take a look at dhcp-agent.
Dhcp-agent
① neutron-ns-metadata-proxy adds instance ip and network id to the head of the http request before forwarding the request, which is easily available to dhcp-agent.
When ② neutron-metadata-agent receives the request, it queries the id of instance by:
1) find all the subnet of network through network id, and then filter out the subnet where the instance ip is located.
2) find the port corresponding to instance ip in subnet.
3) find the corresponding instance and its id through port.
③ neutron-metadata-agent adds instance id to the head of the http request and forwards it to nova-api-metadata so that nova-api-metadata can return the metadata of the specified instance.
In this way, whether instance sends the request to l3-agent or dhcp-agent,nova-api-metadata will eventually know the id of instance and return the correct metadata.
From the point of view of the process of obtaining the metadata, one step is crucial: the instance must first be able to get the DHCP IP correctly, otherwise the request will be sent less than 169.254.169.254. But not all environments will enable dhcp, and more extreme, some environments may not even enable nova-api-metadata services.
After reading the above, do you have any further understanding of how instance gets its own Metadata? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.