Movatterモバイル変換


[0]ホーム

URL:


CN114466011A - Metadata service request method, device, equipment and medium - Google Patents

Metadata service request method, device, equipment and medium
Download PDF

Info

Publication number
CN114466011A
CN114466011ACN202210111522.3ACN202210111522ACN114466011ACN 114466011 ACN114466011 ACN 114466011ACN 202210111522 ACN202210111522 ACN 202210111522ACN 114466011 ACN114466011 ACN 114466011A
Authority
CN
China
Prior art keywords
metadata
service request
agent
neutron
ovn
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210111522.3A
Other languages
Chinese (zh)
Other versions
CN114466011B (en
Inventor
朱亚伟
秦海中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co LtdfiledCriticalSuzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210111522.3ApriorityCriticalpatent/CN114466011B/en
Publication of CN114466011ApublicationCriticalpatent/CN114466011A/en
Application grantedgrantedCritical
Publication of CN114466011BpublicationCriticalpatent/CN114466011B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The application discloses a metadata service request method, a device, equipment and a medium, comprising the following steps: the method comprises the steps of deploying neutron-ovn-metadata-agent in management networks of each computing node and each network node in a cloud platform respectively, creating an ovnmeta network namespace in the service networks corresponding to each computing node and each network node by using the neutron-ovn-metadata-agent, obtaining a service request message based on metadata service sent by a target host from a preset routing route through the ovnmeta network namespace, forwarding the service request message to the neutron-ovn-metadata-agent by using preset proxy software in a preset communication mode, and forwarding the service request message to nova-api by using the neutron-ovn-metadata-agent so as to return metadata based on the service request to the target host. Therefore, in the cloud data request process, the neutron-ovn-metadata-agent is deployed in the management network of each computing node and each network node in the cloud platform, so that the cloud host and the cloud physical machine can successfully request metadata service.

Description

Translated fromChinese
一种元数据服务请求方法、装置、设备及介质Method, apparatus, device and medium for requesting metadata service

技术领域technical field

本发明涉及云平台分布式服务领域,特别涉及一种元数据服务请求方法、装置、设备及介质。The present invention relates to the field of cloud platform distributed services, in particular to a method, device, device and medium for requesting a metadata service.

背景技术Background technique

OpenStack是一个开源云计算平台管理平台项目,nova为OpenStack的一个组件,为云平台提供计算服务,其中包含metadata(即元数据)服务。云主机、云物理机需要请求metadata服务获取metadata数据,但云主机、云物理机和nova-api之间网络是不通的。这就导致了云主机、云物理机不能直接访问nova-api,请求metadata服务获取metadata数据。OpenStack is an open source cloud computing platform management platform project. Nova is a component of OpenStack, which provides computing services for cloud platforms, including metadata (metadata) services. Cloud hosts and cloud physical machines need to request the metadata service to obtain metadata data, but the network between the cloud hosts, cloud physical machines and nova-api is blocked. As a result, cloud hosts and cloud physical machines cannot directly access nova-api and request the metadata service to obtain metadata data.

早期OpenStack云平台的网络解决方案采用的是多neutron agent架构:neutron-dhcp-agent负责云主机、云物理机的动态IP分配;neutron-l3-agent云主机、云物理机的三层路由转发;neutron-metadata-agent负责转发云主机、云物理机的metadata请求到nova-metadata。此时云主机与云物理机虽均可请求到metadata服务,但由于此架构是一种集中式架构,当OpenStack云平台集群的越来越大时,会出现性能瓶颈。The network solution of the early OpenStack cloud platform adopts a multi-neutron agent architecture: neutron-dhcp-agent is responsible for the dynamic IP allocation of cloud hosts and cloud physical machines; neutron-l3-agent cloud hosts and cloud physical machines. Layer 3 routing forwarding; neutron-metadata-agent is responsible for forwarding metadata requests of cloud hosts and cloud physical machines to nova-metadata. At this time, although both the cloud host and the cloud physical machine can request the metadata service, because this architecture is a centralized architecture, when the OpenStack cloud platform cluster becomes larger and larger, a performance bottleneck will occur.

目前OpenStack云平台的网络解决方案更多的是采用ovn架构,通过OpenVSwitch流表提供云主机、云物理机的动态IP分配和三层路由转发功能,将neutron-ovn-metadata-agent添加在计算节点,而云物理机的网络请求都是在网络节点进行发送,导致了云物理机的metadata请求无法到达计算节点的ovnmeta网络命名空间,也就无法请求到metadata服务,无法获取metadata数据。At present, the network solution of the OpenStack cloud platform is more based on the ovn architecture, which provides dynamic IP allocation and Layer 3 routing and forwarding functions for cloud hosts and cloud physical machines through the OpenVSwitch flow table, and adds neutron-ovn-metadata-agent to the computing node. , and the network requests of the cloud physical machine are all sent on the network node, which causes the metadata request of the cloud physical machine to fail to reach the ovnmeta network namespace of the computing node, and thus unable to request the metadata service and obtain the metadata data.

由上可见,在云平台服务的过程中,如何保证云物理机与云主机均可成功请求到metadata服务是本领域有待解决的问题。It can be seen from the above that in the process of cloud platform service, how to ensure that both the cloud physical machine and the cloud host can successfully request the metadata service is a problem to be solved in this field.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明的目的在于提供一种元数据服务请求方法、装置、设备及介质,能够保证云物理机与云主机均可成功请求到metadata服务。其具体方案如下:In view of this, the purpose of the present invention is to provide a metadata service request method, apparatus, device and medium, which can ensure that both the cloud physical machine and the cloud host can successfully request the metadata service. Its specific plan is as follows:

第一方面,本申请公开了一种元数据服务请求方法,包括:In a first aspect, the present application discloses a metadata service request method, including:

将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中;Deploy neutron-ovn-metadata-agent in the management network of each computing node and each network node in the cloud platform;

利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间;Using the neutron-ovn-metadata-agent to create the ovnmeta network namespace in the service network corresponding to each computing node and each network node;

通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文;Obtain the service request message based on the metadata service sent by the target host from the preset routing route through the ovnmeta network namespace;

利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent;Use the preset agent software to forward the service request message to neutron-ovn-metadata-agent through a preset communication method;

利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。The service request message is forwarded to nova-api by using the neutron-ovn-metadata-agent, so that the nova-api returns the metadata based on the service request to the target host.

可选的,所述通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文之前,还包括:Optionally, before obtaining the service request message based on the metadata service sent by the target host from the preset routing route through the ovnmeta network namespace, the method further includes:

在所述ovnmeta网络命名空间创建本地端口,并将所述本地端口的IP地址设置为预设目标IP地址与所述目标主机所在子网的端口IP地址,以便目标主机将路由为预设目标IP地址的网关地址设置为所述本地端口的IP地址,并创建由所述目标主机到所述ovnmeta网络命名空间的路由路线后,根据所述路由路线将基于元数据服务的服务请求报文进行发送。Create a local port in the ovnmeta network namespace, and set the IP address of the local port to the preset target IP address and the port IP address of the subnet where the target host is located, so that the target host will route to the preset target IP The gateway address of the address is set to the IP address of the local port, and after creating a routing route from the target host to the ovnmeta network namespace, the service request message based on the metadata service is sent according to the routing route .

可选的,所述根据所述路由路线将基于元数据服务的服务请求报文进行发送,包括:Optionally, the sending the service request message based on the metadata service according to the routing route includes:

将服务请求报文的目的IP地址封装为预设目标IP地址,并将目的MAC地址封装为所述本地端口的MAC地址。The destination IP address of the service request message is encapsulated as a preset destination IP address, and the destination MAC address is encapsulated as the MAC address of the local port.

可选的,所述通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文之后,还包括:Optionally, after obtaining the service request message based on the metadata service sent by the target host from the preset routing route through the ovnmeta network namespace, the method further includes:

将所述报文发送至预设处理端口;sending the message to a preset processing port;

相应的,所述利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent,还包括:Correspondingly, the use of the preset agent software to forward the service request message to the neutron-ovn-metadata-agent through a preset communication method further includes:

利用预设代理软件对与预设目标IP地址对应的预设处理端口进行监听,以便在监听到所述服务请求报文后,对所述服务请求报文添加通用唯一识别码,以形成第一封装后报文,并通过预设通信方式将所述第一封装后报文转发至neutron-ovn-metadata-agent。Use the preset proxy software to monitor the preset processing port corresponding to the preset target IP address, so that after monitoring the service request message, add a universal unique identification code to the service request message to form a first After encapsulation, the first encapsulated packet is forwarded to neutron-ovn-metadata-agent through a preset communication method.

通过预设通信方式将所述第一封装后报文转发至neutron-ovn-metadata-agent。The first encapsulated packet is forwarded to neutron-ovn-metadata-agent through a preset communication method.

可选的,所述利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求报文的元数据,包括:Optionally, the use of the neutron-ovn-metadata-agent to forward the service request message to nova-api, so that the nova-api returns the metadata based on the service request message to the target host. data, including:

利用所述neutron-ovn-metadata-agent对所述第一封装后报文进行解析,以获取所述通用唯一识别码、源IP以及所述服务请求报文,并利用所述通用唯一识别码、源IP得到项目标识号与目标主机标识号,将所述项目标识号与所述目标主机标识号封装至所述服务请求报文中,以形成第二封装后报文,并将所述第二封装后报文转发至nova-api,以便所述nova-api基于所述第二封装后报文向所述目标主机返回相应的元数据Use the neutron-ovn-metadata-agent to parse the first encapsulated message to obtain the universal unique identifier, source IP and the service request message, and use the universal unique identifier, The source IP obtains the project identification number and the target host identification number, and encapsulates the project identification number and the target host identification number into the service request message to form a second encapsulated message, and the second The encapsulated message is forwarded to nova-api, so that the nova-api returns corresponding metadata to the target host based on the second encapsulated message

可选的,所述利用所述neutron-ovn-metadata-agent根据所述服务请求报文中的唯一通用识别码、源IP得到项目标识号与目标主机标识号之后,还包括:Optionally, after the use of the neutron-ovn-metadata-agent to obtain the project identification number and the target host identification number according to the unique universal identification code and the source IP in the service request message, it also includes:

利用所述neutron-ovn-metadata-agent将所述项目标识号、所述目标主机标识号与所述服务请求报文保存至预设数据库中。The project identification number, the target host identification number and the service request message are stored in a preset database by using the neutron-ovn-metadata-agent.

可选的,所述利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent,包括:Optionally, the use of preset agent software to forward the service request message to neutron-ovn-metadata-agent through a preset communication method, including:

利用HAproxy通过unix domian socket将所述服务请求报文转发至neutron-ovn-metadata-agent。Use HAproxy to forward the service request message to neutron-ovn-metadata-agent through unix domian socket.

第二方面,本申请公开了一种元数据服务请求装置,包括:In a second aspect, the present application discloses a metadata service requesting device, comprising:

节点部署模块,用于将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中;The node deployment module is used to deploy the neutron-ovn-metadata-agent in the management network of each computing node and each network node in the cloud platform;

空间创建模块,用于利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间;a space creation module, used to create the ovnmeta network namespace in the service network corresponding to each computing node and each network node by using the neutron-ovn-metadata-agent;

报文获取模块,用于通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文;A message acquisition module, configured to acquire a metadata service-based service request message sent by a target host from a preset routing route through the ovnmeta network namespace;

报文转发模块,用于利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent;A message forwarding module, used for forwarding the service request message to neutron-ovn-metadata-agent through a preset communication method by using preset agent software;

数据返回模块,用于利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。A data return module, configured to forward the service request message to nova-api by using the neutron-ovn-metadata-agent, so that the nova-api returns the metadata based on the service request to the target host.

第三方面,本申请公开了一种电子设备,包括:In a third aspect, the present application discloses an electronic device, comprising:

存储器,用于保存计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序,以实现前述的元数据服务请求方法。The processor is configured to execute the computer program to implement the aforementioned metadata service request method.

第四方面,本申请公开了一种计算机存储介质,用于保存计算机程序;其中,所述计算机程序被处理器执行时实现前述公开的元数据服务请求方法的步骤。In a fourth aspect, the present application discloses a computer storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned method for requesting a metadata service are implemented.

本申请先将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中;利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间;通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文;利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent;利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。这样一来,在每个计算节点、网络节点上均部署neutron-ovn-metadata-agent,既避免了使用neutron agent架构出现性能瓶颈的问题,又能解决使用ovn架构导致在网络节点发送数据请求的云物理机无法请求到metadata服务的问题,在此基础上,便可使云主机与云物理机均可成功请求到metadata服务。In this application, the neutron-ovn-metadata-agent is first deployed in the management network of each computing node and each network node in the cloud platform; The ovnmeta network namespace is created in the business network; the metadata service-based service request message sent by the target host is obtained from the preset routing route through the ovnmeta network namespace; the preset proxy software is used to transfer the The service request message is forwarded to neutron-ovn-metadata-agent; the service request message is forwarded to nova-api by using the neutron-ovn-metadata-agent, so that the nova-api returns to the target host based on Metadata for the service request. In this way, neutron-ovn-metadata-agent is deployed on each computing node and network node, which not only avoids the performance bottleneck problem of using the neutron agent architecture, but also solves the problem of using the ovn architecture to send data requests on network nodes. The cloud physical machine cannot request the metadata service. On this basis, both the cloud host and the cloud physical machine can successfully request the metadata service.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to the provided drawings without creative work.

图1为本申请提供的元数据服务请求方法流程图;1 is a flowchart of a metadata service request method provided by the present application;

图2为本申请提供的一种具体的元数据服务请求方法流程图;2 is a flowchart of a specific metadata service request method provided by the present application;

图3为本申请提供的一种具体的metadata服务请求的流程图;3 is a flowchart of a specific metadata service request provided by the present application;

图4为本申请提供的一种元数据服务请求装置结构示意图;4 is a schematic structural diagram of a metadata service requesting device provided by the present application;

图5为本申请提供的一种电子设备结构图。FIG. 5 is a structural diagram of an electronic device provided by the present application.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

现有技术中,对于云平台的网络解决方案中,使用neutron agent架构时会出现性能瓶颈的问题,使用ovn架构会导致在网络节点发送数据请求的云物理机无法请求到metadata服务的问题。在本申请中,在每个计算节点、网络节点上均进行相应的部署,可使云主机与云物理机均可成功请求到metadata服务。In the prior art, in the network solution of the cloud platform, there is a performance bottleneck problem when the neutron agent architecture is used, and the use of the ovn architecture causes the problem that the cloud physical machine sending data requests at the network node cannot request the metadata service. In this application, corresponding deployment is performed on each computing node and network node, so that both the cloud host and the cloud physical machine can successfully request the metadata service.

本发明实施例公开了一种元数据服务请求方法,参见图1所述,该方法包括:An embodiment of the present invention discloses a method for requesting a metadata service. Referring to FIG. 1 , the method includes:

步骤S11:将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中。Step S11: Deploy the neutron-ovn-metadata-agent in the management network of each computing node and each network node in the cloud platform, respectively.

本实施例中将云平台中计算节点与网络节点中的管理网中均进行neutron-ovn-metadata-agent的部署。In this embodiment, neutron-ovn-metadata-agent is deployed in both the computing node in the cloud platform and the management network in the network node.

步骤S12:利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间。Step S12: Using the neutron-ovn-metadata-agent to create an ovnmeta network namespace in the service network corresponding to each computing node and each network node.

本实施例利用各部署在管理网中的所述neutron-ovn-metadata-agent在本节点对应的业务网中创建ovnmeta网络命名空间。This embodiment uses the neutron-ovn-metadata-agent deployed in the management network to create the ovnmeta network namespace in the service network corresponding to the node.

步骤S13:通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文。Step S13: Acquire the service request message based on the metadata service sent by the target host from the preset routing route through the ovnmeta network namespace.

本实施例中,所述通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文之前,还可以包括:在所述ovnmeta网络命名空间创建本地端口,并将所述本地端口的IP地址设置为预设目标IP地址与所述目标主机所在子网的端口IP地址,以便目标主机将路由为预设目标IP地址的网关地址设置为所述本地端口的IP地址,并创建由所述目标主机到所述ovnmeta网络命名空间的路由路线后,根据所述路由路线将基于元数据服务的服务请求报文进行发送。In this embodiment, before obtaining the service request message based on the metadata service sent by the target host from the preset routing route through the ovnmeta network namespace, it may further include: creating a local port in the ovnmeta network namespace , and set the IP address of the local port to the preset target IP address and the port IP address of the subnet where the target host is located, so that the target host will route the gateway address of the preset target IP address to the local port. After creating a routing route from the target host to the ovnmeta network namespace, the service request message based on the metadata service is sent according to the routing route.

可以理解的是,本实施例中所述的本地端口(即localport端口)是在所述ovnmeta网络命名空间中的,是一种tap(即Test Access Point,分光器/分路器)设备,且本实施例中所述本地端口为基于metadata服务而设置的专用端口。在设置所述本地端口的IP地址时,将目标主机所在子网的端口IP地址于预设目标IP地址均设置为本地端口的IP地址,这样ovnmata网络命名空间就可以接收来自云主机和云物理机的metadata请求了。本实施例中,所述目标主机包括但不限于在计算节点业务网中工作的云主机或与网络节点相连的云物理机。所述预设目标IP地址包括但不限于169.254.169.254的IP地址。It can be understood that the local port (that is, the localport port) described in this embodiment is in the ovnmeta network namespace, and is a tap (that is, Test Access Point, optical splitter/splitter) device, and The local port in this embodiment is a dedicated port set based on the metadata service. When setting the IP address of the local port, the port IP address of the subnet where the target host is located and the preset target IP address are both set to the IP address of the local port, so that the ovnmata network namespace can receive data from the cloud host and cloud physical The metadata of the machine is requested. In this embodiment, the target host includes but is not limited to a cloud host working in a computing node service network or a cloud physical machine connected to a network node. The preset target IP address includes but is not limited to the IP address of 169.254.169.254.

本实施例中,因为所述预设目标IP地址不在云主机、云物理机所在的子网中。如果不设置这条路由,云主机、云物理机发送的metadata请求会根据默认路由发送给子网网关,就不能正常的请求到metadata服务了。设置这条路由后,云主机、云物理机发送的metadata请求会根据这条路由发送给本地端口。In this embodiment, because the preset target IP address is not in the subnet where the cloud host and the cloud physical machine are located. If this route is not set, the metadata request sent by the cloud host and the cloud physical machine will be sent to the subnet gateway according to the default route, and the metadata service cannot be requested normally. After setting this route, the metadata request sent by the cloud host and cloud physical machine will be sent to the local port according to this route.

本实施例中,所述根据所述路由路线将基于元数据服务的服务请求报文进行发送,可以包括:将服务请求报文的目的IP地址封装为预设目标IP地址,并将目的MAC地址(即MediaAccessControl地址,媒体存取控制位址)封装为所述本地端口的MAC地址。In this embodiment, the sending the service request message based on the metadata service according to the routing route may include: encapsulating the destination IP address of the service request message as a preset destination IP address, and converting the destination MAC address (ie MediaAccessControl address, media access control address) is encapsulated as the MAC address of the local port.

因为预设目标IP地址与云主机、云物理机不在同一网段中,云主机、云物理机发送metadata请求时,封装目的MAC地址会封装成网关MAC地址,即本地端口的MAC地址。这会使metadata请求经过OVS(即OpenVSwitch)进行二层转发时,会发送给本地端口,在本地端口收到报文后,会查看目的MAC地址是本机MAC地址,查看目的IP地址为169.254.169.254也是本机IP地址后,便开始对数据进行处理。Because the default destination IP address is not in the same network segment as the cloud host and cloud physical machine, when the cloud host and cloud physical machine send a metadata request, the encapsulation destination MAC address will be encapsulated into the gateway MAC address, that is, the MAC address of the local port. This will cause the metadata request to be sent to the local port when it is forwarded by OVS (ie OpenVSwitch) at Layer 2. After the local port receives the message, it will check that the destination MAC address is the local MAC address and the destination IP address is 169.254. After 169.254 is also the IP address of the machine, it starts to process the data.

步骤S14:利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent。Step S14: Use the preset agent software to forward the service request message to the neutron-ovn-metadata-agent through the preset communication mode.

本实施例中,所述利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent,可以包括:利用HAproxy通过unix domian socket将所述服务请求报文转发至neutron-ovn-metadata-agent。本实施例中所述预设代理软件包括但不限于HAproxy,且本实施例中所述的预设通信方式包括但不限于通过unix domiansocket的方式。In this embodiment, using the preset proxy software to forward the service request message to neutron-ovn-metadata-agent through a preset communication method may include: using HAproxy to forward the service request message through a unix domian socket Forward to neutron-ovn-metadata-agent. The preset proxy software described in this embodiment includes, but is not limited to, HAproxy, and the preset communication method described in this embodiment includes, but is not limited to, a way through unix domiansocket.

步骤S15:利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。Step S15: Use the neutron-ovn-metadata-agent to forward the service request message to nova-api, so that the nova-api returns the metadata based on the service request to the target host.

本申请先将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中,利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间,通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文,再利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent,利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。这样一来,在每个计算节点、网络节点上均部署neutron-ovn-metadata-agent,既避免了使用neutron agent架构出现性能瓶颈的问题,又能解决使用ovn架构导致在网络节点发送数据请求的云物理机无法请求到metadata服务的问题,在此基础上,便可使云主机与云物理机均可成功请求到metadata服务。In this application, the neutron-ovn-metadata-agent is first deployed in the management network of each computing node and each network node in the cloud platform, and the neutron-ovn-metadata-agent is used in each computing node and each network node corresponding to each network node. The ovnmeta network namespace is created in the business network, and the metadata service-based service request message sent by the target host is obtained from the preset routing route through the ovnmeta network namespace, and then the preset proxy software is used to transfer the metadata service through the preset communication method. The service request message is forwarded to neutron-ovn-metadata-agent, and the neutron-ovn-metadata-agent is used to forward the service request message to nova-api, so that the nova-api returns to the target host Metadata based on the service request. In this way, neutron-ovn-metadata-agent is deployed on each computing node and network node, which not only avoids the performance bottleneck problem of using the neutron agent architecture, but also solves the problem of using the ovn architecture to send data requests on network nodes. The cloud physical machine cannot request the metadata service. On this basis, both the cloud host and the cloud physical machine can successfully request the metadata service.

图2为本申请实施例提供的一种具体的元数据服务请求方法流程图。参见图2所示,该方法包括:FIG. 2 is a flowchart of a specific metadata service request method provided by an embodiment of the present application. Referring to Figure 2, the method includes:

步骤S21:将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中。Step S21: Deploy the neutron-ovn-metadata-agent on the management network of each computing node and each network node in the cloud platform, respectively.

步骤S22:利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间。Step S22: Using the neutron-ovn-metadata-agent to create an ovnmeta network namespace in the service network corresponding to each computing node and each network node.

步骤S23:通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文。Step S23: Acquire the service request message based on the metadata service sent by the target host from the preset routing route through the ovnmeta network namespace.

步骤S24:将所述报文发送至预设处理端口。Step S24: Send the message to a preset processing port.

此步骤中,若所述预设目标IP地址为169.254.169.254,则相对的,所述预设处理端口可以为169.254.169.254:80。In this step, if the preset target IP address is 169.254.169.254, then the preset processing port may be 169.254.169.254:80.

步骤S25:利用预设代理软件对与预设目标IP地址对应的预设处理端口进行监听,以便在监听到所述服务请求报文后,对所述服务请求报文添加通用唯一识别码,以形成第一封装后报文,并通过预设通信方式将所述第一封装后报文转发至neutron-ovn-metadata-agent。Step S25: Use the preset proxy software to monitor the preset processing port corresponding to the preset target IP address, so that after monitoring the service request message, add a universal unique identification code to the service request message to A first encapsulated message is formed, and the first encapsulated message is forwarded to neutron-ovn-metadata-agent through a preset communication method.

本实施例中所述的预设代理软件包括但不限于Haproxy,且在一种具体实施例中,本步骤的过程可以是:利用Haproxy对169.254.169.254:80进行监听,本地端口在收到metadata请求后,Haproxy就会接收到metadata请求报文。之后在metadata请求中加入网络UUID(即Universally Unique Identifier,通用唯一识别码),以形成第一封装后报文。The preset proxy software described in this embodiment includes but is not limited to Haproxy, and in a specific embodiment, the process of this step may be: use Haproxy to monitor 169.254.169.254:80, and the local port receives the metadata After the request, Haproxy will receive the metadata request message. Then, the network UUID (ie Universally Unique Identifier, Universal Unique Identifier) is added to the metadata request to form the first encapsulated packet.

本实施例中所述的预设通信方式包括但不限于通过unix domian socket的方式。The preset communication mode described in this embodiment includes, but is not limited to, a mode through unix domian socket.

步骤S26:利用所述neutron-ovn-metadata-agent对所述第一封装后报文进行解析,以获取所述通用唯一识别码、源IP以及所述服务请求报文,并利用所述通用唯一识别码、源IP得到项目标识号与目标主机标识号,将所述项目标识号与所述目标主机标识号封装至所述服务请求报文中,以形成第二封装后报文,并将所述第二封装后报文转发至nova-api,以便所述nova-api基于所述第二封装后报文向所述目标主机返回相应的元数据。Step S26: Use the neutron-ovn-metadata-agent to parse the first encapsulated message to obtain the universally unique identifier, source IP and the service request message, and use the universally unique The identification code and the source IP obtain the project identification number and the target host identification number, and the project identification number and the target host identification number are encapsulated into the service request message to form the second encapsulated message, and all the The second encapsulated message is forwarded to nova-api, so that the nova-api returns corresponding metadata to the target host based on the second encapsulated message.

可以理解的是,本步骤中所述服务请求报文中包含所述源IP。It can be understood that the source IP is included in the service request message in this step.

本步骤利用所述neutron-ovn-metadata-agent对接收到的所述服务请求报文进行相应的处理,以转发至nova-api,以便所述nova-api基于所述第二封装后报文向所述目标主机返回相应的元数据。In this step, the neutron-ovn-metadata-agent is used to perform corresponding processing on the received service request message to forward it to nova-api, so that the nova-api sends the message to nova-api based on the second encapsulated message. The target host returns corresponding metadata.

本实施例中,所述利用所述neutron-ovn-metadata-agent根据所述服务请求报文中的唯一通用识别码、源IP得到项目标识号与目标主机标识号之后,还可以包括:利用所述neutron-ovn-metadata-agent将所述项目标识号、所述目标主机标识号与所述服务请求报文保存至预设数据库中。所述预设数据库包括但不限于ovn-sb-db数据库。In this embodiment, after using the neutron-ovn-metadata-agent to obtain the project identification number and the target host identification number according to the unique universal identification code and the source IP in the service request message, it may further include: using the The neutron-ovn-metadata-agent saves the project identification number, the target host identification number and the service request message in a preset database. The preset database includes but is not limited to the ovn-sb-db database.

需要指出的是,本发明实施方案不依赖于底层CPU(即Central Processing Unit,中央处理器)架构,可支持多种架构,如x86(即The X86 architecture)、arm(AdvancedRISC Machine)等架构。It should be noted that the embodiments of the present invention do not depend on the underlying CPU (ie, Central Processing Unit, central processing unit) architecture, and can support multiple architectures, such as x86 (ie The X86 architecture), arm (AdvancedRISC Machine) and other architectures.

本实施例中先将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中,利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间,通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文,将所述报文发送至预设处理端口,利用预设代理软件对与预设目标IP地址对应的预设处理端口进行监听,以便在监听到所述服务请求报文后,对所述服务请求报文添加通用唯一识别码,以形成第一封装后报文,通过预设通信方式将所述第一封装后报文转发至neutron-ovn-metadata-agent,利用所述neutron-ovn-metadata-agent对所述第一封装后报文进行解析,以获取所述通用唯一识别码、源IP以及所述服务请求报文,并利用所述通用唯一识别码、源IP得到项目标识号与目标主机标识号,将所述项目标识号与所述目标主机标识号封装至所述服务请求报文中,以形成第二封装后报文,并将所述第二封装后报文转发至nova-api,以便所述nova-api基于所述第二封装后报文向所述目标主机返回相应的元数据。本实施例对metadata服务请求的详细过程做出了展示,提出了利用Haproxy对169.254.169.254:80进行监听,并将metadata请求进行通用唯一识别码的封装,最后由neutron-ovn-metadata-agent进行基于项目ID与目标主机ID的封装,最终通过管理网将metadata服务请求发送至nova-api的过程。本实施例详细展开了本方法中metadata服务请求的过程,可使云主机与云物理机均成功请求到metadata服务。In this embodiment, the neutron-ovn-metadata-agent is first deployed in the management network of each computing node and each network node in the cloud platform, and the neutron-ovn-metadata-agent is used in each computing node and each network node. Create an ovnmeta network namespace in the corresponding service network, obtain a metadata service-based service request message sent by the target host from a preset routing route through the ovnmeta network namespace, and send the message to a preset processing port , use the preset proxy software to monitor the preset processing port corresponding to the preset target IP address, so that after monitoring the service request message, add a universal unique identification code to the service request message to form the first An encapsulated message, the first encapsulated message is forwarded to neutron-ovn-metadata-agent through a preset communication method, and the first encapsulated message is processed by the neutron-ovn-metadata-agent Parse, to obtain the universal unique identification code, source IP and the service request message, and utilize the universal unique identification code, source IP to obtain the project identification number and the target host identification number, and the project identification number and all The target host identification number is encapsulated into the service request message to form a second encapsulated message, and the second encapsulated message is forwarded to nova-api, so that the nova-api is based on the first Second, the encapsulated message returns corresponding metadata to the target host. This example shows the detailed process of the metadata service request, and proposes to use Haproxy to monitor 169.254.169.254:80, and encapsulate the metadata request with a universal unique identifier, and finally neutron-ovn-metadata-agent Based on the encapsulation of the project ID and the target host ID, the metadata service request is finally sent to nova-api through the management network. This embodiment expands the process of requesting the metadata service in this method in detail, so that both the cloud host and the cloud physical machine can successfully request the metadata service.

如图3为云主机、云物理机请求metadata服务的流程图,图中展示了云主机或云物理机先将metadata请求发送至ovnmeta网络命名空间,并通过haproxy添加network_id(即实施例中所述唯一通用识别码),进而将metadata请求转发至neutron-ovn-metadata-agent,通过获取project_id与instance_id后将matadata请求保存至ovn-sb-db数据库中,最后在metadata请求中project_id与instance_id,并转发给nova-api,最终将相应的metadata数据返回给云主机或云物理机。Figure 3 is a flow chart of the cloud host and cloud physical machine requesting metadata service. The figure shows that the cloud host or cloud physical machine first sends the metadata request to the ovnmeta network namespace, and adds network_id through haproxy (that is, as described in the embodiment). Unique universal identification code), and then forward the metadata request to neutron-ovn-metadata-agent. After obtaining the project_id and instance_id, the matadata request is saved to the ovn-sb-db database, and finally the project_id and instance_id in the metadata request are forwarded. To nova-api, and finally return the corresponding metadata data to the cloud host or cloud physical machine.

参见图4所示,本申请实施例公开了一种元数据服务请求装置,具体可以包括:Referring to FIG. 4 , an embodiment of the present application discloses a metadata service requesting device, which may specifically include:

节点部署模块11,用于将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中;The node deployment module 11 is used to deploy the neutron-ovn-metadata-agent in the management network of each computing node and each network node in the cloud platform respectively;

空间创建模块12,用于利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间;The space creation module 12 is used for using the neutron-ovn-metadata-agent to create the ovnmeta network namespace in the service network corresponding to each computing node and each network node;

报文获取模块13,用于通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文;The message obtaining module 13 is used to obtain the service request message based on the metadata service sent by the target host from the preset routing route through the ovnmeta network namespace;

报文转发模块14,用于利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent;A message forwarding module 14, configured to forward the service request message to neutron-ovn-metadata-agent through a preset communication method by using preset agent software;

数据返回模块15,用于利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。A data return module 15, configured to use the neutron-ovn-metadata-agent to forward the service request message to nova-api, so that the nova-api returns the metadata based on the service request to the target host .

本申请先将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中;利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间;通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文;利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent;利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。这样一来,在每个计算节点、网络节点上均部署neutron-ovn-metadata-agent,既避免了使用neutron agent架构出现性能瓶颈的问题,又能解决使用ovn架构导致在网络节点发送数据请求的云物理机无法请求到metadata服务的问题,在此基础上,便可使云主机与云物理机均可成功请求到metadata服务。In this application, the neutron-ovn-metadata-agent is first deployed in the management network of each computing node and each network node in the cloud platform; The ovnmeta network namespace is created in the business network; the metadata service-based service request message sent by the target host is obtained from the preset routing route through the ovnmeta network namespace; the preset proxy software is used to transfer the The service request message is forwarded to neutron-ovn-metadata-agent; the service request message is forwarded to nova-api by using the neutron-ovn-metadata-agent, so that the nova-api returns to the target host based on Metadata for the service request. In this way, neutron-ovn-metadata-agent is deployed on each computing node and network node, which not only avoids the performance bottleneck problem of using the neutron agent architecture, but also solves the problem of using the ovn architecture to send data requests on network nodes. The cloud physical machine cannot request the metadata service. On this basis, both the cloud host and the cloud physical machine can successfully request the metadata service.

在一些具体实施例中,所述元数据服务请求装置,还包括:In some specific embodiments, the metadata service requesting apparatus further includes:

端口应用单元,用于在所述ovnmeta网络命名空间创建本地端口,并将所述本地端口的IP地址设置为预设目标IP地址与所述目标主机所在子网的端口IP地址,以便目标主机将路由为预设目标IP地址的网关地址设置为所述本地端口的IP地址,并创建由所述目标主机到所述ovnmeta网络命名空间的路由路线后,根据所述路由路线将基于元数据服务的服务请求报文进行发送。The port application unit is used to create a local port in the ovnmeta network namespace, and set the IP address of the local port to the preset target IP address and the port IP address of the subnet where the target host is located, so that the target host will The gateway address whose route is the preset target IP address is set to the IP address of the local port, and after creating a routing route from the target host to the ovnmeta network namespace, the metadata service-based A service request message is sent.

在一些具体实施例中,所述端口应用单元,还包括:In some specific embodiments, the port application unit further includes:

地址封装单元,用于将服务请求报文的目的IP地址封装为预设目标IP地址,并将目的MAC地址封装为所述本地端口的MAC地址。The address encapsulation unit is configured to encapsulate the destination IP address of the service request message into a preset destination IP address, and encapsulate the destination MAC address into the MAC address of the local port.

在一些具体实施例中,所述元数据服务请求装置,还包括:In some specific embodiments, the metadata service requesting apparatus further includes:

端口发送单元,用于将所述报文发送至预设处理端口;a port sending unit, configured to send the message to a preset processing port;

相应的,所述数据返回模块15,包括:Correspondingly, the data return module 15 includes:

第一封装单元,用于利用预设代理软件对与预设目标IP地址对应的预设处理端口进行监听,以便在监听到所述服务请求报文后,对所述服务请求报文添加通用唯一识别码,以形成第一封装后报文,并通过预设通信方式将所述第一封装后报文转发至neutron-ovn-metadata-agent。The first encapsulation unit is used to monitor the preset processing port corresponding to the preset target IP address by using preset proxy software, so that after monitoring the service request message, add a universal unique to the service request message. identification code to form a first encapsulated message, and forward the first encapsulated message to neutron-ovn-metadata-agent through a preset communication method.

报文转发单元,用于通过预设通信方式将所述第一封装后报文转发至neutron-ovn-metadata-agent。A message forwarding unit, configured to forward the first encapsulated message to neutron-ovn-metadata-agent through a preset communication method.

在一些具体实施例中,所述数据返回模块15,包括:In some specific embodiments, the data return module 15 includes:

第二封装单元,用于利用所述neutron-ovn-metadata-agent对所述第一封装后报文进行解析,以获取所述通用唯一识别码、源IP以及所述服务请求报文,并利用所述通用唯一识别码、源IP得到项目标识号与目标主机标识号,将所述项目标识号与所述目标主机标识号封装至所述服务请求报文中,以形成第二封装后报文,并将所述第二封装后报文转发至nova-api,以便所述nova-api基于所述第二封装后报文向所述目标主机返回相应的元数据The second encapsulation unit is configured to use the neutron-ovn-metadata-agent to parse the first encapsulated message to obtain the universal unique identifier, the source IP and the service request message, and use the The universal unique identification code and the source IP obtain the project identification number and the target host identification number, and encapsulate the project identification number and the target host identification number into the service request message to form a second encapsulated message , and forward the second encapsulated message to nova-api, so that the nova-api returns the corresponding metadata to the target host based on the second encapsulated message

在一些具体实施例中,所述利用所述neutron-ovn-metadata-agent根据所述服务请求报文中的唯一通用识别码、源IP得到项目标识号与目标主机标识号之后,还包括:In some specific embodiments, after using the neutron-ovn-metadata-agent to obtain the project identification number and the target host identification number according to the unique universal identification code and the source IP in the service request message, the method further includes:

利用所述neutron-ovn-metadata-agent将所述项目标识号、所述目标主机标识号与所述服务请求报文保存至预设数据库中。The project identification number, the target host identification number and the service request message are stored in a preset database by using the neutron-ovn-metadata-agent.

在一些具体实施例中,所述报文转发模块14,包括:In some specific embodiments, the packet forwarding module 14 includes:

报文转发单元,用于利用HAproxy通过unix domian socket将所述服务请求报文转发至neutron-ovn-metadata-agent。The message forwarding unit is used to forward the service request message to neutron-ovn-metadata-agent through the unix domian socket by using HAproxy.

进一步的,本申请实施例还公开了一种电子设备,图5是根据示例性实施例示出的电子设备20结构图,图中的内容不能认为是对本申请的使用范围的任何限制。Further, an embodiment of the present application also discloses an electronic device. FIG. 5 is a structural diagram of anelectronic device 20 according to an exemplary embodiment, and the content in the figure should not be considered as any limitation on the scope of application of the present application.

图5为本申请实施例提供的一种电子设备20的结构示意图。该电子设备20,具体可以包括:至少一个处理器21、至少一个存储器22、电源23、显示屏24、输入输出接口25、通信接口26以及通信总线27。其中,所述存储器22用于存储计算机程序,所述计算机程序由所述处理器21加载并执行,以实现前述任一实施例公开的元数据服务请求方法中的相关步骤。另外,本实施例中的电子设备20具体可以为电子计算机。FIG. 5 is a schematic structural diagram of anelectronic device 20 according to an embodiment of the present application. Theelectronic device 20 may specifically include: at least one processor 21 , at least one memory 22 , a power supply 23 , a display screen 24 , an input and output interface 25 , acommunication interface 26 and a communication bus 27 . Wherein, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the metadata service request method disclosed in any of the foregoing embodiments. In addition, theelectronic device 20 in this embodiment may specifically be an electronic computer.

本实施例中,电源23用于为电子设备20上的各硬件设备提供工作电压;通信接口26能够为电子设备20创建与外界设备之间的数据传输通道,其所遵循的通信协议是能够适用于本申请技术方案的任意通信协议,在此不对其进行具体限定;输入输出接口25,用于获取外界输入数据或向外界输出数据,其具体的接口类型可以根据具体应用需要进行选取,在此不进行具体限定。In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on theelectronic device 20; thecommunication interface 26 can create a data transmission channel between theelectronic device 20 and external devices, and the communication protocol it follows is applicable Any communication protocol in the technical solution of the present application is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, here No specific limitation is made.

另外,存储器22作为资源存储的载体,可以是只读存储器、随机存储器、磁盘或者光盘等,其上所存储的资源可以包括操作系统221、计算机程序222等,存储方式可以是短暂存储或者永久存储。In addition, as a carrier for resource storage, the memory 22 can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc. The resources stored on it can include an operating system 221, a computer program 222, etc., and the storage method can be short-term storage or permanent storage. .

其中,操作系统221用于管理与控制电子设备20上的各硬件设备以及计算机程序222,其可以是Windows Server、Netware、Unix、Linux等。计算机程序222除了包括能够用于完成前述任一实施例公开的由电子设备20执行的元数据服务请求方法的计算机程序之外,还可以进一步包括能够用于完成其他特定工作的计算机程序。The operating system 221 is used to manage and control various hardware devices and computer programs 222 on theelectronic device 20, which may be Windows Server, Netware, Unix, Linux, and the like. In addition to the computer program that can be used to complete the metadata service request method executed by theelectronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks.

进一步的,本申请还公开了一种计算机可读存储介质,用于存储计算机程序;其中,所述计算机程序被处理器执行时实现前述公开的元数据服务请求方法。关于该方法的具体步骤可以参考前述实施例中公开的相应内容,在此不再进行赘述。Further, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned method for requesting a metadata service is implemented. For the specific steps of the method, reference may be made to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments may be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method. Professionals may further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two, in order to clearly illustrate the possibilities of hardware and software. Interchangeability, the above description has generally described the components and steps of each example in terms of functionality. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in conjunction with the embodiments disclosed herein may be directly implemented in hardware, a software module executed by a processor, or a combination of the two. A software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.

最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

以上对本发明所提供的元数据服务请求方法、装置、设备、存储介质进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The metadata service request method, device, device, and storage medium provided by the present invention have been described in detail above. Specific examples are used in this paper to illustrate the principles and implementations of the present invention. The descriptions of the above embodiments are only for help. Understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. In summary, the content of this specification does not It should be understood as a limitation of the present invention.

Claims (10)

Translated fromChinese
1.一种元数据服务请求方法,其特征在于,包括:1. a metadata service request method, is characterized in that, comprises:将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中;Deploy neutron-ovn-metadata-agent in the management network of each computing node and each network node in the cloud platform;利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间;Using the neutron-ovn-metadata-agent to create the ovnmeta network namespace in the service network corresponding to each computing node and each network node;通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文;Obtain the service request message based on the metadata service sent by the target host from the preset routing route through the ovnmeta network namespace;利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent;Use the preset agent software to forward the service request message to neutron-ovn-metadata-agent through a preset communication method;利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。The service request message is forwarded to nova-api by using the neutron-ovn-metadata-agent, so that the nova-api returns the metadata based on the service request to the target host.2.根据权利要求1所述的元数据服务请求方法,其特征在于,所述通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文之前,还包括:2. The metadata service request method according to claim 1, characterized in that, before obtaining a metadata service-based service request message sent by a target host from a preset routing route through the ovnmeta network namespace, Also includes:在所述ovnmeta网络命名空间创建本地端口,并将所述本地端口的IP地址设置为预设目标IP地址与所述目标主机所在子网的端口IP地址,以便目标主机将路由为预设目标IP地址的网关地址设置为所述本地端口的IP地址,并创建由所述目标主机到所述ovnmeta网络命名空间的路由路线后,根据所述路由路线将基于元数据服务的服务请求报文进行发送。Create a local port in the ovnmeta network namespace, and set the IP address of the local port to the preset target IP address and the port IP address of the subnet where the target host is located, so that the target host will route to the preset target IP The gateway address of the address is set to the IP address of the local port, and after creating a routing route from the target host to the ovnmeta network namespace, the service request message based on the metadata service is sent according to the routing route .3.根据权利要求2所述的元数据服务请求方法,其特征在于,所述根据所述路由路线将基于元数据服务的服务请求报文进行发送,包括:3. The metadata service request method according to claim 2, wherein the sending a service request message based on the metadata service according to the routing route comprises:将服务请求报文的目的IP地址封装为预设目标IP地址,并将目的MAC地址封装为所述本地端口的MAC地址。The destination IP address of the service request message is encapsulated as a preset destination IP address, and the destination MAC address is encapsulated as the MAC address of the local port.4.根据权利要求1所述的元数据服务请求方法,其特征在于,所述通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文之后,还包括:4. The metadata service request method according to claim 1, wherein, after obtaining a metadata service-based service request message sent by a target host from a preset routing route through the ovnmeta network namespace, Also includes:将所述报文发送至预设处理端口;sending the message to a preset processing port;相应的,所述利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent,还包括:Correspondingly, the use of the preset agent software to forward the service request message to the neutron-ovn-metadata-agent through a preset communication method further includes:利用预设代理软件对与预设目标IP地址对应的预设处理端口进行监听,以便在监听到所述服务请求报文后,对所述服务请求报文添加通用唯一识别码,以形成第一封装后报文,并通过预设通信方式将所述第一封装后报文转发至neutron-ovn-metadata-agent。Use the preset proxy software to monitor the preset processing port corresponding to the preset target IP address, so that after monitoring the service request message, add a universal unique identification code to the service request message to form a first After encapsulation, the first encapsulated packet is forwarded to neutron-ovn-metadata-agent through a preset communication method.5.根据权利要求4所述的元数据服务请求方法,其特征在于,所述利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求报文的元数据,包括:5. The metadata service request method according to claim 4, wherein the neutron-ovn-metadata-agent is used to forward the service request message to nova-api, so that the nova-api Return the metadata based on the service request message to the target host, including:利用所述neutron-ovn-metadata-agent对所述第一封装后报文进行解析,以获取所述通用唯一识别码、源IP以及所述服务请求报文,并利用所述通用唯一识别码、源IP得到项目标识号与目标主机标识号,将所述项目标识号与所述目标主机标识号封装至所述服务请求报文中,以形成第二封装后报文,并将所述第二封装后报文转发至nova-api,以便所述nova-api基于所述第二封装后报文向所述目标主机返回相应的元数据。Use the neutron-ovn-metadata-agent to parse the first encapsulated message to obtain the universal unique identifier, source IP and the service request message, and use the universal unique identifier, The source IP obtains the project identification number and the target host identification number, and encapsulates the project identification number and the target host identification number into the service request message to form a second encapsulated message, and the second The encapsulated message is forwarded to nova-api, so that the nova-api returns corresponding metadata to the target host based on the second encapsulated message.6.根据权利要求5所述的元数据服务请求方法,其特征在于,所述利用所述neutron-ovn-metadata-agent根据所述服务请求报文中的唯一通用识别码、源IP得到项目标识号与目标主机标识号之后,还包括:6. metadata service request method according to claim 5 is characterized in that, described utilizes described neutron-ovn-metadata-agent to obtain project identification according to the unique universal identification code, source IP in described service request message After the number and the target host identification number, it also includes:利用所述neutron-ovn-metadata-agent将所述项目标识号、所述目标主机标识号与所述服务请求报文保存至预设数据库中。The project identification number, the target host identification number and the service request message are stored in a preset database by using the neutron-ovn-metadata-agent.7.根据权利要求1至6任一项所述的元数据服务请求方法,其特征在于,所述利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent,包括:7. The metadata service request method according to any one of claims 1 to 6, wherein the service request message is forwarded to neutron-ovn-metadata by using a preset proxy software through a preset communication mode -agent, including:利用HAproxy通过unix domian socket将所述服务请求报文转发至neutron-ovn-metadata-agent。Use HAproxy to forward the service request message to neutron-ovn-metadata-agent through unix domian socket.8.一种元数据服务请求装置,其特征在于,包括:8. An apparatus for requesting metadata services, comprising:节点部署模块,用于将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中;The node deployment module is used to deploy neutron-ovn-metadata-agent in the management network of each computing node and each network node in the cloud platform;空间创建模块,用于利用所述neutron-ovn-metadata-agent在各计算节点与各网络节点对应的业务网中创建ovnmeta网络命名空间;a space creation module, used to create the ovnmeta network namespace in the service network corresponding to each computing node and each network node by using the neutron-ovn-metadata-agent;报文获取模块,用于通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文;A message acquisition module, configured to acquire a metadata service-based service request message sent by a target host from a preset routing route through the ovnmeta network namespace;报文转发模块,用于利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent;A message forwarding module, used for forwarding the service request message to neutron-ovn-metadata-agent through a preset communication method by using preset agent software;数据返回模块,用于利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。A data return module, configured to forward the service request message to nova-api by using the neutron-ovn-metadata-agent, so that the nova-api returns the metadata based on the service request to the target host.9.一种电子设备,其特征在于,包括处理器和存储器;其中,所述处理器执行所述存储器中保存的计算机程序时实现如权利要求1至7任一项所述的元数据服务请求方法。9. An electronic device, comprising a processor and a memory; wherein, the processor implements the metadata service request according to any one of claims 1 to 7 when the processor executes the computer program stored in the memory method.10.一种计算机可读存储介质,其特征在于,用于存储计算机程序;其中,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的元数据服务请求方法。10. A computer-readable storage medium, characterized by being used for storing a computer program; wherein, when the computer program is executed by a processor, the method for requesting a metadata service according to any one of claims 1 to 7 is implemented.
CN202210111522.3A2022-01-292022-01-29Metadata service request method, device, equipment and mediumActiveCN114466011B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210111522.3ACN114466011B (en)2022-01-292022-01-29Metadata service request method, device, equipment and medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210111522.3ACN114466011B (en)2022-01-292022-01-29Metadata service request method, device, equipment and medium

Publications (2)

Publication NumberPublication Date
CN114466011Atrue CN114466011A (en)2022-05-10
CN114466011B CN114466011B (en)2023-08-04

Family

ID=81411679

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210111522.3AActiveCN114466011B (en)2022-01-292022-01-29Metadata service request method, device, equipment and medium

Country Status (1)

CountryLink
CN (1)CN114466011B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115442121A (en)*2022-08-312022-12-06济南浪潮数据技术有限公司 A traffic transmission method, system, device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105446797A (en)*2015-11-302016-03-30国云科技股份有限公司 A method for virtual machine to access service
CN105515978A (en)*2016-01-082016-04-20盛科网络(苏州)有限公司Method and device for realizing distributed routing and physical host access
CN106953848A (en)*2017-02-282017-07-14浙江工商大学 A software-defined network implementation method based on ForCES
CN108933844A (en)*2017-05-272018-12-04华为技术有限公司The method and apparatus of DHCP service is provided
US20200159563A1 (en)*2017-07-282020-05-21Huawei Technologies Co., Ltd.Virtual Machine Password Reset Method, Apparatus, and System
CN111277432A (en)*2020-01-102020-06-12腾讯科技(深圳)有限公司Configuration information updating method and device, electronic equipment and storage medium
CN112887440A (en)*2019-11-292021-06-01北京百度网讯科技有限公司IP address management method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105446797A (en)*2015-11-302016-03-30国云科技股份有限公司 A method for virtual machine to access service
CN105515978A (en)*2016-01-082016-04-20盛科网络(苏州)有限公司Method and device for realizing distributed routing and physical host access
CN106953848A (en)*2017-02-282017-07-14浙江工商大学 A software-defined network implementation method based on ForCES
CN108933844A (en)*2017-05-272018-12-04华为技术有限公司The method and apparatus of DHCP service is provided
US20200159563A1 (en)*2017-07-282020-05-21Huawei Technologies Co., Ltd.Virtual Machine Password Reset Method, Apparatus, and System
CN112887440A (en)*2019-11-292021-06-01北京百度网讯科技有限公司IP address management method and device
CN111277432A (en)*2020-01-102020-06-12腾讯科技(深圳)有限公司Configuration information updating method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115442121A (en)*2022-08-312022-12-06济南浪潮数据技术有限公司 A traffic transmission method, system, device and storage medium
CN115442121B (en)*2022-08-312025-02-18济南浪潮数据技术有限公司 A flow transmission method, system, device and storage medium

Also Published As

Publication numberPublication date
CN114466011B (en)2023-08-04

Similar Documents

PublicationPublication DateTitle
US11095711B2 (en)DNS Resolution of internal tenant-specific domain addresses in a multi-tenant computing environment
CN109561171B (en)Configuration method and device of virtual private cloud service
US10367753B2 (en)Virtual network interface records
US8819211B2 (en)Distributed policy service
WO2023098645A1 (en)Container network configuration method and apparatus, computing node, master node, and storage medium
US11625280B2 (en)Cloud-native proxy gateway to cloud resources
US10462009B1 (en)Replicating customers' information technology (IT) infrastructures at service provider networks
CN115086312A (en)Method and system for realizing kubernets service cross-cluster communication
TWI577164B (en)Scalable address resolution
CN115242882B (en) A method and device for accessing k8s container environment based on transport layer routing
CN113268308A (en)Information processing method, device and storage medium
US11032369B1 (en)System and method for non-disruptive migration of software components to a public cloud system
CN116132542B (en) Container network management method, container network plug-in and related equipment
CN114095430B (en)Access message processing method, system and working node
CN115379010B (en)Container network construction method, device, equipment and storage medium
CN115334018B (en)Container control method and device based on Openstack IaaS cloud architecture and container
CN111726400A (en)Reverse connection method, device and server-side system
CN100433645C (en)Network device management method and network management system
CN114297083B (en) Proxy testing method, device, electronic device and readable medium
CN114466011B (en)Metadata service request method, device, equipment and medium
CN114553771A (en)Method for loading virtual router and related equipment
CN116980229A (en)Network policy configuration method, device, electronic equipment and storage medium
US20230146880A1 (en)Management system and management method
CN113965571A (en)Management method, device, equipment and medium for distributed embedded equipment
CN114237738B (en)Device management method, device, electronic device and computer readable storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
CP03Change of name, title or address

Address after:Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee after:Suzhou Yuannao Intelligent Technology Co.,Ltd.

Country or region after:China

Address before:Building 9, No.1, guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Wuzhong District, Suzhou City, Jiangsu Province

Patentee before:SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before:China


[8]ページ先頭

©2009-2025 Movatter.jp