[go: up one dir, main page]

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

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

Info

Publication number
CN114466011B
CN114466011B CN202210111522.3A CN202210111522A CN114466011B CN 114466011 B CN114466011 B CN 114466011B CN 202210111522 A CN202210111522 A CN 202210111522A CN 114466011 B CN114466011 B CN 114466011B
Authority
CN
China
Prior art keywords
metadata
service request
agent
ovn
preset
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.)
Active
Application number
CN202210111522.3A
Other languages
Chinese (zh)
Other versions
CN114466011A (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 Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210111522.3A priority Critical patent/CN114466011B/en
Publication of CN114466011A publication Critical patent/CN114466011A/en
Application granted granted Critical
Publication of CN114466011B publication Critical patent/CN114466011B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • H04L67/306User profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a metadata service request method, a device, equipment and a medium, comprising the following steps: and respectively deploying a network-ovn-metadata-agent in each computing node and each network node management network in the cloud platform, creating an ovnmeta network naming space in a service network corresponding to each network node by using the network-ovn-metadata-agent, acquiring a service request message based on metadata service sent by a target host from a preset routing route through the ovnmeta network naming space, forwarding the service request message to the network-ovn-metadata-agent by using preset proxy software in a preset communication mode, and forwarding the service request message to a nova-api by using the network-ovn-metadata-agent so that the nova-api returns metadata based on the service request to the target host. In this way, in the cloud data request process, the invention can enable the cloud host and the cloud physical machine to successfully request the metadata service by deploying the neutron-ovn-metadata-agent in the management network of each computing node and each network node in the cloud platform.

Description

一种元数据服务请求方法、装置、设备及介质A metadata service request method, device, equipment and medium

技术领域technical field

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

背景技术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 that provides computing services for cloud platforms, including metadata (metadata) services. The cloud host and cloud physical machine need to request the metadata service to obtain metadata data, but the network between the cloud host, cloud physical machine and nova-api is disconnected. 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 adopted 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 is responsible for three-layer routing and forwarding of cloud hosts and cloud physical machines; neutron-metadata-agent is responsible for forwarding the 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, performance bottlenecks will occur.

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

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

发明内容Contents of the invention

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

第一方面,本申请公开了一种元数据服务请求方法,包括:In the 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网络命名空间;Utilize the neutron-ovn-metadata-agent to create an 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;Using 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向所述目标主机返回基于所述服务请求的元数据。Using the neutron-ovn-metadata-agent to forward the service request message to nova-api, so that the nova-api returns 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 preset target IP address and the port IP address of the subnet where the target host is located as the IP address of the local port, so that the target host will be routed to the preset The gateway address of the target IP address is set to the IP address of the local port, and after the routing route from the target host to the ovnmeta network namespace is created, the service request based on the metadata service is reported according to the routing route text to send.

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

将服务请求报文的目的IP地址封装为预设目标IP地址,并将目的MAC地址封装为所述本地端口的MAC地址。Encapsulating the destination IP address of the service request message into a preset destination IP address, and encapsulating the destination MAC address into 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:

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

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

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

通过预设通信方式将所述第一封装后报文转发至neutron-ovn-metadata-agent。Forwarding the first encapsulated message to neutron-ovn-metadata-agent through a preset communication mode.

可选的,所述利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求报文的元数据,包括:Optionally, using 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基于所述第二封装后报文向所述目标主机返回相应的元数据Utilize the neutron-ovn-metadata-agent to analyze the first encapsulated message to obtain the UUID, source IP and the service request message, and use the UUID, The source IP obtains the item identification number and the target host identification number, and encapsulates the item 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 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 source IP in the service request message, it also includes:

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

可选的,所述利用预设代理软件通过预设通信方式将所述服务请求报文转发至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 device for requesting a metadata service, including:

节点部署模块,用于将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中;The node deployment module is used to respectively 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, for 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;

报文获取模块,用于通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文;The message acquisition module 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;

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

数据返回模块,用于利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。A data return module, configured to use the neutron-ovn-metadata-agent to forward the service request message to nova-api, so that the nova-api returns 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;

处理器,用于执行所述计算机程序,以实现前述的元数据服务请求方法。A processor, configured to execute the computer program, so as 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 metadata service request method disclosed above 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服务。This application first deploys neutron-ovn-metadata-agent respectively in the management network of each computing node and each network node in the cloud platform; Create an ovnmeta network namespace in the business network; 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; 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 neutron agent architecture, but also solves the problem of sending data requests on network nodes caused by using ovn architecture 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 more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the 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, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.

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

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

图3为本申请提供的一种具体的metadata服务请求的流程图;FIG. 3 is a flow chart of a specific metadata service request provided by this application;

图4为本申请提供的一种元数据服务请求装置结构示意图;FIG. 4 is a schematic structural diagram of a metadata service request 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 following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

现有技术中,对于云平台的网络解决方案中,使用neutron agent架构时会出现性能瓶颈的问题,使用ovn架构会导致在网络节点发送数据请求的云物理机无法请求到metadata服务的问题。在本申请中,在每个计算节点、网络节点上均进行相应的部署,可使云主机与云物理机均可成功请求到metadata服务。In the prior art, in the network solution of the cloud platform, performance bottlenecks will occur when using the neutron agent architecture, and the use of the ovn architecture will lead to the problem that the cloud physical machine that sends the data request 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所述,该方法包括:The embodiment of the present invention discloses a metadata service request method, as described in Fig. 1, the method includes:

步骤S11:将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中。Step S11: Deploy 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, the neutron-ovn-metadata-agent is deployed in both the computing nodes in the cloud platform and the management network in the network nodes.

步骤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网络命名空间。In this embodiment, the neutron-ovn-metadata-agent deployed in the management network is used to create the ovnmeta network namespace in the service network corresponding to the node.

步骤S13:通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文。Step S13: 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.

本实施例中,所述通过所述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 also include: creating a local port in the ovnmeta network namespace , and set the preset target IP address and the port IP address of the subnet where the target host is located as the IP address of the local port, so that the target host can set the gateway address routed to the preset target IP address as the The IP address of the local port, and after creating a routing route from the target host to the ovnmeta network namespace, send the service request message based on the metadata service 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 (ie, localport port) described in this embodiment is in the ovnmeta network namespace, and is a tap (ie, Test Access Point, optical splitter/splitter) device, and The local port described 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 as 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 not limited to an 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 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 into a preset target IP address, and encapsulating 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 preset target 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 metadata requests, the encapsulated 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 through OVS (that is, OpenVSwitch) on the second layer. After the local port receives the message, it will check that the destination MAC address is the local MAC address, and check that 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: Using preset agent software to forward the service request message to neutron-ovn-metadata-agent through preset communication mode.

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

步骤S15:利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。Step S15: Utilize the neutron-ovn-metadata-agent to forward the service request message to nova-api, so that the nova-api returns 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服务。This application first deploys the neutron-ovn-metadata-agent in the management network of each computing node and each network node in the cloud platform, and uses the neutron-ovn-metadata-agent in each computing node and each network node corresponding Create an ovnmeta network namespace in the business network, 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, and then use the preset proxy software to transfer the service request message based on the metadata service through the preset communication method The service request message is forwarded to neutron-ovn-metadata-agent, and 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 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 neutron agent architecture, but also solves the problem of sending data requests on network nodes caused by using ovn architecture 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 flow chart of a specific metadata service request method provided by the embodiment of the present application. Referring to shown in Figure 2, the method includes:

步骤S21:将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中。Step S21: Deploy neutron-ovn-metadata-agent in 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: 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.

步骤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, relatively, the preset processing port may be 169.254.169.254:80.

步骤S25:利用预设代理软件对与预设目标IP地址对应的预设处理端口进行监听,以便在监听到所述服务请求报文后,对所述服务请求报文添加通用唯一识别码,以形成第一封装后报文,并通过预设通信方式将所述第一封装后报文转发至neutron-ovn-metadata-agent。Step S25: Use the default proxy software to monitor the preset processing port corresponding to the preset target IP address, so that after the service request message is monitored, 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 mode.

本实施例中所述的预设代理软件包括但不限于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 can be: use Haproxy to monitor 169.254.169.254:80, and the local port receives metadata After the request, Haproxy will receive the metadata request message. Then add the network UUID (Universally Unique Identifier) to the metadata request to form the first encapsulated message.

本实施例中所述的预设通信方式包括但不限于通过unix domian socket的方式。The preset communication methods described in this embodiment include but are not limited to the method of unix domian socket.

步骤S26:利用所述neutron-ovn-metadata-agent对所述第一封装后报文进行解析,以获取所述通用唯一识别码、源IP以及所述服务请求报文,并利用所述通用唯一识别码、源IP得到项目标识号与目标主机标识号,将所述项目标识号与所述目标主机标识号封装至所述服务请求报文中,以形成第二封装后报文,并将所述第二封装后报文转发至nova-api,以便所述nova-api基于所述第二封装后报文向所述目标主机返回相应的元数据。Step S26: Utilize the neutron-ovn-metadata-agent to analyze the first encapsulated message to obtain the UUID, source IP and the service request message, and use the UUID The 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 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, in this step, the service request message includes the source IP.

本步骤利用所述neutron-ovn-metadata-agent对接收到的所述服务请求报文进行相应的处理,以转发至nova-api,以便所述nova-api基于所述第二封装后报文向所述目标主机返回相应的元数据。In this step, the neutron-ovn-metadata-agent is used to process the received service request message accordingly, so as to forward it to nova-api, so that the nova-api sends information 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 source IP in the service request message, it may also include: using the The neutron-ovn-metadata-agent saves the item identification number, the target host identification number and the service request message into a preset database. The preset database includes but not limited to ovn-sb-db database.

需要指出的是,本发明实施方案不依赖于底层CPU(即Central Processing Unit,中央处理器)架构,可支持多种架构,如x86(即The X86 architecture)、arm(AdvancedRISC Machine)等架构。It should be pointed out that the embodiment of the present invention does not depend on the underlying CPU (i.e. Central Processing Unit, central processing unit) architecture, and can support multiple architectures, such as x86 (i.e. The X86 architecture), arm (Advanced RISC 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 business network, 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, and send the message to the preset processing port , using the preset proxy software to monitor the preset processing port corresponding to the preset target IP address, so that after the service request message is monitored, a universal unique identification code is added to the service request message to form the first An encapsulated message, forwarding the first encapsulated message to neutron-ovn-metadata-agent through a preset communication method, and using the neutron-ovn-metadata-agent to process the first encapsulated message Parse to obtain the UUID, source IP and the service request message, and use the UUID and source IP to obtain the project identification number and the target host identification number, and combine the project identification number with the 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 2. After the encapsulated message returns corresponding metadata to the target host. This embodiment 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 identification code, 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 metadata service request process 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 services. 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, save the matadata request to the ovn-sb-db database after obtaining project_id and instance_id, and finally project_id and instance_id in the metadata request, and forward to nova-api, and finally return the corresponding metadata data to the cloud host or cloud physical machine.

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

节点部署模块11,用于将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中;The node deployment module 11 is used to deploy 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网络命名空间;Space creating module 12, for utilizing said neutron-ovn-metadata-agent to create 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;The message forwarding module 14 is used to forward the service request message to neutron-ovn-metadata-agent by using the preset agent software through the preset communication mode;

数据返回模块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 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服务。This application first deploys neutron-ovn-metadata-agent respectively in the management network of each computing node and each network node in the cloud platform; Create an ovnmeta network namespace in the business network; 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; 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 neutron agent architecture, but also solves the problem of sending data requests on network nodes caused by using ovn architecture 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 device 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 preset target IP address and the port IP address of the subnet where the target host is located as the IP address of the local port, so that the target The host sets the gateway address of the preset target IP address as the IP address of the local port, and after creating a routing route from the target host to the ovnmeta network namespace, the routing route will be based on the meta Send the service request message of the data service.

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

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

在一些具体实施例中,所述元数据服务请求装置,还包括:In some specific embodiments, the metadata service requesting device 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 configured to use 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 to the service request message An identification code to form a first encapsulated message, and forward the first encapsulated message to neutron-ovn-metadata-agent through a preset communication mode.

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

在一些具体实施例中,所述数据返回模块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 analyze the first encapsulated message to obtain the universal unique identification code, source IP and the service request message, and use Obtaining a project identification number and a target host identification number from the UUID and the source IP, and encapsulating 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 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 source IP in the service request message, it also includes:

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

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

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

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

图5为本申请实施例提供的一种电子设备20的结构示意图。该电子设备20,具体可以包括:至少一个处理器21、至少一个存储器22、电源23、显示屏24、输入输出接口25、通信接口26以及通信总线27。其中,所述存储器22用于存储计算机程序,所述计算机程序由所述处理器21加载并执行,以实现前述任一实施例公开的元数据服务请求方法中的相关步骤。另外,本实施例中的电子设备20具体可以为电子计算机。FIG. 5 is a schematic structural diagram of an electronic device 20 provided in an embodiment of the present application. The electronic 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/output interface 25 , a communication 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, so as to implement the relevant steps in the metadata service request method disclosed in any of the foregoing embodiments. In addition, the electronic 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 the electronic device 20; the communication interface 26 can create a data transmission channel between the electronic 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 external, and its specific interface type can be selected according to specific application needs, here Not specifically limited.

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

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

进一步的,本申请还公开了一种计算机可读存储介质,用于存储计算机程序;其中,所述计算机程序被处理器执行时实现前述公开的元数据服务请求方法。关于该方法的具体步骤可以参考前述实施例中公开的相应内容,在此不再进行赘述。Furthermore, 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 disclosed metadata service request method is implemented. Regarding the specific steps of the method, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not repeated here.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can 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 for relevant details, please refer to the description of the method part. Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.

结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules 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 Any other known storage medium.

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

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

Claims (10)

1.一种元数据服务请求方法,其特征在于,包括:1. A metadata service request method, comprising: 将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网络命名空间;Utilize the neutron-ovn-metadata-agent to create an 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;Using 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向所述目标主机返回基于所述服务请求的元数据。Using the neutron-ovn-metadata-agent to forward the service request message to nova-api, so that the nova-api returns metadata based on the service request to the target host. 2.根据权利要求1所述的元数据服务请求方法,其特征在于,所述通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文之前,还包括:2. The metadata service request method according to claim 1, wherein, 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, Also includes: 在所述ovnmeta网络命名空间创建本地端口,并将预设目标IP地址,以及所述目标主机所在子网的端口IP地址均设置为所述本地端口的IP地址,以便目标主机将路由为预设目标IP地址的网关地址设置为所述本地端口的IP地址,并在创建由所述目标主机到所述ovnmeta网络命名空间的路由路线后,根据所述路由路线将基于元数据服务的服务请求报文进行发送。Create a local port in the ovnmeta network namespace, and set the preset target IP address and the port IP address of the subnet where the target host is located as the IP address of the local port, so that the target host will be routed to the preset The gateway address of the target IP address is set to the IP address of the local port, and after the routing route from the target host to the ovnmeta network namespace is created, the service request based on the metadata service is reported according to the routing route text to send. 3.根据权利要求2所述的元数据服务请求方法,其特征在于,所述根据所述路由路线将基于元数据服务的服务请求报文进行发送,包括:3. The metadata service request method according to claim 2, wherein the sending of the metadata service-based service request message according to the routing route comprises: 将服务请求报文的目的IP地址封装为预设目标IP地址,并将目的MAC地址封装为所述本地端口的MAC地址。Encapsulating the destination IP address of the service request message into a preset destination IP address, and encapsulating the destination MAC address into the MAC address of the local port. 4.根据权利要求1所述的元数据服务请求方法,其特征在于,所述通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文之后,还包括:4. The metadata service request method according to claim 1, characterized in that, 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, Also includes: 将所述报文发送至预设处理端口;Send the message to a preset processing port; 相应的,所述利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent,还包括:Correspondingly, the use of preset agent software to forward the service request message to neutron-ovn-metadata-agent through a preset communication method further includes: 利用预设代理软件对与预设目标IP地址对应的预设处理端口进行监听,以便在监听到所述服务请求报文后,对所述服务请求报文添加通用唯一识别码,以形成第一封装后报文,并通过预设通信方式将所述第一封装后报文转发至neutron-ovn-metadata-agent。Use preset proxy software to monitor the preset processing port corresponding to the preset target IP address, so that after listening to the service request message, add a universal unique identification code to the service request message to form the first Encapsulate the message, and forward the first encapsulated message to neutron-ovn-metadata-agent through a preset communication mode. 5.根据权利要求4所述的元数据服务请求方法,其特征在于,所述利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求报文的元数据,包括:5. The metadata service request method according to claim 4, wherein the service request message is forwarded to nova-api by using the neutron-ovn-metadata-agent, so that the nova-api Returning metadata based on the service request message to the target host, including: 利用所述neutron-ovn-metadata-agent对所述第一封装后报文进行解析,以获取所述通用唯一识别码、源IP以及所述服务请求报文,并利用所述通用唯一识别码、源IP得到项目标识号与目标主机标识号,将所述项目标识号与所述目标主机标识号封装至所述服务请求报文中,以形成第二封装后报文,并将所述第二封装后报文转发至nova-api,以便所述nova-api基于所述第二封装后报文向所述目标主机返回相应的元数据。Utilize the neutron-ovn-metadata-agent to analyze the first encapsulated message to obtain the UUID, source IP and the service request message, and use the UUID, The source IP obtains the item identification number and the target host identification number, and encapsulates the item 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. The metadata service request method according to claim 5, wherein said neutron-ovn-metadata-agent is used to obtain the item identification according to the unique universal identification code and source IP in the service request message number and the target host identification number, also include: 利用所述neutron-ovn-metadata-agent将所述项目标识号、所述目标主机标识号与所述服务请求报文保存至预设数据库中。Using the neutron-ovn-metadata-agent to save the item identification number, the target host identification number and the service request message into a preset database. 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 preset proxy software through a preset communication method -agents, 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. A metadata service requesting device, comprising: 节点部署模块,用于将neutron-ovn-metadata-agent分别部署在云平台中的各计算节点与各网络节点的管理网中;The node deployment module is used to respectively 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, for 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; 报文获取模块,用于通过所述ovnmeta网络命名空间从预设的路由路线获取目标主机发送的基于元数据服务的服务请求报文;The message acquisition module 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; 报文转发模块,用于利用预设代理软件通过预设通信方式将所述服务请求报文转发至neutron-ovn-metadata-agent;A message forwarding module, configured to forward the service request message to neutron-ovn-metadata-agent through a preset communication mode by using preset agent software; 数据返回模块,用于利用所述neutron-ovn-metadata-agent将所述服务请求报文转发至nova-api,以便所述nova-api向所述目标主机返回基于所述服务请求的元数据。A data return module, configured to use the neutron-ovn-metadata-agent to forward the service request message to nova-api, so that the nova-api returns metadata based on the service request to the target host. 9.一种电子设备,其特征在于,包括处理器和存储器;其中,所述处理器执行所述存储器中保存的计算机程序时实现如权利要求1至7任一项所述的元数据服务请求方法。9. An electronic device, characterized by comprising a processor and a memory; wherein, when the processor executes the computer program stored in the memory, the metadata service request according to any one of claims 1 to 7 is realized method. 10.一种计算机可读存储介质,其特征在于,用于存储计算机程序;其中,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的元数据服务请求方法。10. A computer-readable storage medium, characterized by being used to store a computer program; wherein, when the computer program is executed by a processor, the metadata service request method according to any one of claims 1 to 7 is implemented.
CN202210111522.3A 2022-01-29 2022-01-29 Metadata service request method, device, equipment and medium Active CN114466011B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210111522.3A CN114466011B (en) 2022-01-29 2022-01-29 Metadata service request method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210111522.3A CN114466011B (en) 2022-01-29 2022-01-29 Metadata service request method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN114466011A CN114466011A (en) 2022-05-10
CN114466011B true CN114466011B (en) 2023-08-04

Family

ID=81411679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210111522.3A Active CN114466011B (en) 2022-01-29 2022-01-29 Metadata service request method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114466011B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115442121B (en) * 2022-08-31 2025-02-18 济南浪潮数据技术有限公司 A flow transmission method, system, device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446797A (en) * 2015-11-30 2016-03-30 国云科技股份有限公司 A method for virtual machine to access service
CN105515978A (en) * 2016-01-08 2016-04-20 盛科网络(苏州)有限公司 Method and device for realizing distributed routing and physical host access
CN106953848A (en) * 2017-02-28 2017-07-14 浙江工商大学 A software-defined network implementation method based on ForCES
CN108933844A (en) * 2017-05-27 2018-12-04 华为技术有限公司 The method and apparatus of DHCP service is provided
CN111277432A (en) * 2020-01-10 2020-06-12 腾讯科技(深圳)有限公司 Configuration information updating method and device, electronic equipment and storage medium
CN112887440A (en) * 2019-11-29 2021-06-01 北京百度网讯科技有限公司 IP address management method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107577516B (en) * 2017-07-28 2020-08-14 华为技术有限公司 Virtual machine password resetting method, device and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105446797A (en) * 2015-11-30 2016-03-30 国云科技股份有限公司 A method for virtual machine to access service
CN105515978A (en) * 2016-01-08 2016-04-20 盛科网络(苏州)有限公司 Method and device for realizing distributed routing and physical host access
CN106953848A (en) * 2017-02-28 2017-07-14 浙江工商大学 A software-defined network implementation method based on ForCES
CN108933844A (en) * 2017-05-27 2018-12-04 华为技术有限公司 The method and apparatus of DHCP service is provided
CN112887440A (en) * 2019-11-29 2021-06-01 北京百度网讯科技有限公司 IP address management method and device
CN111277432A (en) * 2020-01-10 2020-06-12 腾讯科技(深圳)有限公司 Configuration information updating method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114466011A (en) 2022-05-10

Similar Documents

Publication Publication Date Title
US11095711B2 (en) DNS Resolution of internal tenant-specific domain addresses in a multi-tenant computing environment
US11429369B2 (en) Distributed upgrade in virtualized computing environments
CN107947961B (en) SDN-based Kubernetes network management system and method
CN112532675B (en) Method, device and medium for establishing network edge computing system
WO2023098645A1 (en) Container network configuration method and apparatus, computing node, master node, and storage medium
CN113268308B (en) Information processing method, device and storage medium
CN115086312A (en) Method and system for realizing kubernets service cross-cluster communication
CN115150410B (en) Multi-cluster access method and system
CN116132542B (en) Container network management method, container network plug-in and related equipment
CN115242882B (en) A method and device for accessing k8s container environment based on transport layer routing
US10237235B1 (en) System for network address translation
CN107210924A (en) Method and apparatus for configuring communication system
CN113364660A (en) Data packet processing method and device in LVS load balancing
CN113810230A (en) Method, device and system for carrying out network configuration on containers in container cluster
US20220141080A1 (en) Availability-enhancing gateways for network traffic in virtualized computing environments
CN115379010A (en) A container network construction method, device, equipment and storage medium
CN112217845A (en) A data transmission method and related equipment based on Netconf protocol
CN114466011B (en) Metadata service request method, device, equipment and medium
CN114297083B (en) Proxy testing method, device, electronic device and readable medium
CN116033000A (en) Cloud platform and cloud platform service calling method
CN115412549A (en) Information configuration method and device and request processing method and device
CN117834704A (en) Communication method and device for cloud multi-core application, computer equipment and storage medium
CN116208600A (en) File transfer protocol request processing method, device, equipment and storage medium
CN114048028A (en) Service calling method and device, storage medium and electronic equipment
CN111935336A (en) IPv 6-based network management method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change 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