Movatterモバイル変換


[0]ホーム

URL:


CN113127144B - A processing method, device and storage medium - Google Patents

A processing method, device and storage medium
Download PDF

Info

Publication number
CN113127144B
CN113127144BCN202010041685.XACN202010041685ACN113127144BCN 113127144 BCN113127144 BCN 113127144BCN 202010041685 ACN202010041685 ACN 202010041685ACN 113127144 BCN113127144 BCN 113127144B
Authority
CN
China
Prior art keywords
virtual machine
sriov
port
vfs
sriov virtual
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
CN202010041685.XA
Other languages
Chinese (zh)
Other versions
CN113127144A (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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software 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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co LtdfiledCriticalChina Mobile Communications Group Co Ltd
Priority to CN202010041685.XApriorityCriticalpatent/CN113127144B/en
Publication of CN113127144ApublicationCriticalpatent/CN113127144A/en
Application grantedgrantedCritical
Publication of CN113127144BpublicationCriticalpatent/CN113127144B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The application provides a processing method, comprising the following steps: creating a logical port; creating a receiving Single Root Input Output Virtualized (SRIOV) virtual machine based on the logical port; respectively obtaining a virtual function VF from two physical network cards, and distributing the respectively obtained VF to the SRIOV virtual machine; the obtained two VFs have the same Media Access Control (MAC) address; and binding the two VFs. Therefore, the SRIOV virtual machine port can realize binding operation, the influence of load on a user is reduced, and the high availability of the network of the SRIOV virtual machine of the user is ensured.

Description

Translated fromChinese
一种处理方法、装置及存储介质A processing method, device and storage medium

技术领域technical field

本发明涉及云计算技术领域,尤其涉及一种处理方法、装置及存储介质。The present invention relates to the technical field of cloud computing, in particular to a processing method, device and storage medium.

背景技术Background technique

相关技术中,OpenStack云计算平台中主要使用单根输入输出虚拟化(SingleRoot I/O Virtualization,SRIOV)虚拟机透传虚拟功能(Virtual Function,VF)作为SRIOV虚拟机的端口(port)的功能,然而上述端口不支持绑定操作,这就造成了SRIOV虚拟机端口绑定(port bonding)功能无法使用,增加了负载对用户造成的影响,还会降低用户SRIOV虚拟机的网络高可用;因此,如何为SRIOV虚拟机提供端口绑定功能尚未被明确。In related technologies, the OpenStack cloud computing platform mainly uses the single-root input and output virtualization (SingleRoot I/O Virtualization, SRIOV) virtual machine to transparently transmit the virtual function (Virtual Function, VF) as the function of the port (port) of the SRIOV virtual machine. However, the above-mentioned ports do not support the binding operation, which causes the SRIOV virtual machine port binding (port bonding) function to be unavailable, increases the impact of load on users, and also reduces the network high availability of user SRIOV virtual machines; therefore, How to provide port binding functionality for SRIOV virtual machines has not yet been specified.

发明内容Contents of the invention

本发明实施例提供一种处理方法、装置及存储介质,使得SRIOV虚拟机的端口具备bonding功能,减少负载对用户造成的影响,还能保证用户SRIOV虚拟机的网络高可用。The embodiment of the present invention provides a processing method, device and storage medium, so that the port of the SRIOV virtual machine has a bonding function, reduces the impact of load on the user, and can also ensure the high availability of the network of the user's SRIOV virtual machine.

本发明实施例的技术方案是这样实现的:The technical scheme of the embodiment of the present invention is realized like this:

创建一个逻辑端口;Create a logical port;

基于所述逻辑端口创建接收单根输入输出虚拟化SRIOV虚拟机;Create and receive a single-root input-output virtualization SRIOV virtual machine based on the logical port;

从两个物理网卡分别获得一个虚拟功能VF,并将所述分别获得的VF分配给所述SRIOV虚拟机;所获得的两个VF具有相同的媒体接入控制(Media Access Control,MAC)地址;Obtain a virtual function VF from two physical network cards respectively, and the VF obtained respectively is distributed to the SRIOV virtual machine; The two VFs obtained have the same Media Access Control (Media Access Control, MAC) address;

对所述两个VF进行绑定操作。Perform a binding operation on the two VFs.

上述方案中,所述基于所述逻辑端口创建SRIOV虚拟机包括:In the above solution, the creation of the SRIOV virtual machine based on the logical port includes:

基于所述逻辑端口和SRIOV虚拟机参数创建所述SRIOV虚拟机;Create the SRIOV virtual machine based on the logical port and SRIOV virtual machine parameters;

所述SRIOV虚拟机参数包括以下至少一种:所述SRIOV虚拟机的操作系统、所述操作系统中的应用、所述应用的特性、所述SRIOV虚拟机包括的处理器的数目、所述SRIOV虚拟机的内存、或者所述SRIOV虚拟机的绑定端口。The SRIOV virtual machine parameters include at least one of the following: the operating system of the SRIOV virtual machine, the applications in the operating system, the characteristics of the applications, the number of processors included in the SRIOV virtual machine, the SRIOV The memory of the virtual machine, or the bound port of the SRIOV virtual machine.

上述方案中,所述方法还包括:In the above scheme, the method also includes:

缓存所述分别获得的VF分配给所述SRIOV虚拟机的过程形成的端口信息;Cache the port information formed in the process of assigning the respectively obtained VFs to the SRIOV virtual machine;

所述端口信息包括:所述两个VF的端口插槽信息。The port information includes: port slot information of the two VFs.

上述方案中,通过异步调用云平台内部Neutron接口的方式缓存所述端口信息。In the above solution, the port information is cached by calling the internal Neutron interface of the cloud platform asynchronously.

上述方案中,所述对所述两个VF进行绑定操作包括:In the above solution, the binding operation of the two VFs includes:

通过云平台内部NOVA的元数据传入绑定信息,根据所述绑定信息,对具有相同MAC地址的所述SRIOV虚拟机上的两个VF进行绑定操作。The binding information is imported through the metadata of the NOVA inside the cloud platform, and according to the binding information, the binding operation is performed on the two VFs on the SRIOV virtual machine with the same MAC address.

上述方案中,所述方法还包括:In the above scheme, the method also includes:

根据MAC地址配置所述两个VF的相关信息;Configuring relevant information of the two VFs according to the MAC addresses;

将所述逻辑端口加入到所述SRIOV虚拟机的物理网卡上;Add the logical port to the physical network card of the SRIOV virtual machine;

所述相关信息包括以下至少一种:所述两个VF的状态、欺骗检测(spoofchecking)状态、或者服务质量(Quality of Service,QoS)信息。The relevant information includes at least one of the following: states of the two VFs, spoof checking states, or Quality of Service (QoS) information.

本申请还提供一种处理装置,所述装置应用于云平台,包括:The present application also provides a processing device, the device is applied to a cloud platform, including:

创建单元,用于创建一个逻辑端口;用于基于所述逻辑端口创建接收单根输入输出虚拟化SRIOV虚拟机;The creating unit is used to create a logical port; it is used to create a virtualized SRIOV virtual machine that receives a single root input and output based on the logical port;

获得单元,从两个物理网卡分别获得一个虚拟功能VF,并将所述分别获得的VF分配给所述SRIOV虚拟机;所获得的两个VF具有相同的媒体接入控制MAC地址;The obtaining unit obtains a virtual function VF from two physical network cards respectively, and distributes the obtained VFs to the SRIOV virtual machine; the obtained two VFs have the same media access control MAC address;

绑定单元,用于对所述两个VF进行绑定操作。A binding unit, configured to perform a binding operation on the two VFs.

上述方案中,所述创建单元还用于:In the above scheme, the creation unit is also used for:

基于所述逻辑端口和SRIOV虚拟机参数创建所述SRIOV虚拟机;Create the SRIOV virtual machine based on the logical port and SRIOV virtual machine parameters;

所述SRIOV虚拟机参数包括以下至少一种:所述SRIOV虚拟机的操作系统、所述操作系统中的应用、所述应用的特性、所述SRIOV虚拟机包括的处理器的数目、所述SRIOV虚拟机的内存、或者所述SRIOV虚拟机的绑定端口。The SRIOV virtual machine parameters include at least one of the following: the operating system of the SRIOV virtual machine, the applications in the operating system, the characteristics of the applications, the number of processors included in the SRIOV virtual machine, the SRIOV The memory of the virtual machine, or the bound port of the SRIOV virtual machine.

上述方案中,所述装置还包括:In the above scheme, the device also includes:

存储单元,用于缓存所述分别获得的VF分配给所述SRIOV虚拟机的过程形成的端口信息;a storage unit, configured to cache the port information formed in the process of assigning the respectively obtained VFs to the SRIOV virtual machine;

所述端口信息包括:所述两个VF的端口插槽信息。The port information includes: port slot information of the two VFs.

上述方案中,所述存储单元还用于:In the above scheme, the storage unit is also used for:

通过异步调用云平台内部Neutron接口的方式缓存所述端口信息。The port information is cached by calling the internal Neutron interface of the cloud platform asynchronously.

上述方案中,所述绑定单元还用于:In the above scheme, the binding unit is also used for:

通过云平台内部NOVA的元数据传入绑定信息,根据所述绑定信息,对具有相同MAC地址的所述SRIOV虚拟机上的两个VF进行绑定操作。The binding information is imported through the metadata of the NOVA inside the cloud platform, and according to the binding information, the binding operation is performed on the two VFs on the SRIOV virtual machine with the same MAC address.

上述方案中,所述装置还包括:In the above scheme, the device also includes:

配置单元,用于根据MAC地址配置所述两个VF的相关信息;用于将所述逻辑端口加入到所述SRIOV虚拟机的物理网卡上;A configuration unit, configured to configure related information of the two VFs according to the MAC address; to add the logical port to the physical network card of the SRIOV virtual machine;

所述相关信息包括以下至少一种:所述两个VF的状态、欺骗检测spoof checking状态、或者QoS信息。The relevant information includes at least one of the following: states of the two VFs, spoof checking states, or QoS information.

本申请还提供一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现上述方案所述的处理方法。The present application also provides a storage medium storing an executable program. When the executable program is executed by a processor, the processing method described in the above solution is implemented.

本发明实施例提供的处理方法、装置及存储介质,通过创建一个逻辑端口,基于所述逻辑端口创建SRIOV虚拟机,并在创建所述SRIOV虚拟机的过程中,从两个物理网卡上分别获得一个具有相同MAC地址的VF,并将所述两个具有相同MAC地址的VF分配给所述SRIOV虚拟机,使所述SRIOV虚拟机的端口具备bonding功能,减少负载对用户造成的影响,还能保证用户SRIOV虚拟机的网络高可用。The processing method, device, and storage medium provided by the embodiments of the present invention create a logical port, create an SRIOV virtual machine based on the logical port, and obtain the SRIOV virtual machine from two physical network cards during the process of creating the SRIOV virtual machine. A VF with the same MAC address, and assign the two VFs with the same MAC address to the SRIOV virtual machine, so that the port of the SRIOV virtual machine has a bonding function, reducing the impact of load on the user, and also Ensure high network availability of user SRIOV virtual machines.

附图说明Description of drawings

图1为相关技术中SRIOV网卡的可选结构示意图;Fig. 1 is a schematic diagram of an optional structure of a SRIOV network card in the related art;

图2为本申请实施例提供的处理方法的可选流程示意图一;FIG. 2 is an optional schematic flow diagram 1 of the processing method provided by the embodiment of the present application;

图3为本申请实施例提供的处理方法的可选流程示意图二;FIG. 3 is an optional schematic flow diagram II of the processing method provided by the embodiment of the present application;

图4为本申请实施例提供的处理方法的可选流程示意图三;FIG. 4 is an optional schematic flow diagram III of the processing method provided by the embodiment of the present application;

图5为本申请实施例提供的处理方法的可选结构示意图一;FIG. 5 is an optional structural schematic diagram 1 of the processing method provided by the embodiment of the present application;

图6为本申请实施例提供的处理方法的可选结构示意图二。FIG. 6 is a second schematic diagram of an optional structure of the processing method provided by the embodiment of the present application.

具体实施方式Detailed ways

以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。The present invention will be described in further detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

对本发明进行进一步详细说明之前,对本发明实施例中涉及的名词和术语进行说明,本发明实施例中涉及的名词和术语适用于如下的解释。Before the present invention is further described in detail, the nouns and terms involved in the embodiments of the present invention are described, and the nouns and terms involved in the embodiments of the present invention are applicable to the following explanations.

云计算(Cloud Computing)是一种基于互联网的计算方法,通过云计算可以根据计算机和其他设备的需求,将共享的软件资源、硬件资源和信息,分配给计算机和其他设备。OpenStack作为云计算环境中的资源管理和调度平台,已经被广泛应用在通信、金融、工业等重要领域中。Cloud Computing (Cloud Computing) is a computing method based on the Internet. Through cloud computing, shared software resources, hardware resources and information can be allocated to computers and other devices according to the needs of computers and other devices. As a resource management and scheduling platform in the cloud computing environment, OpenStack has been widely used in communication, finance, industry and other important fields.

OpenStack是一个开源的云计算管理平台项目,是一系列软件开源项目的组合。在第I版之前,通常是使用虚拟机连接到linux网桥或者开放虚拟交换标准(OpenvSwitch,OVS)网桥,实现虚拟机的数据通信。OpenStack从Juno版本开始引入SRIOV,通过SRIOV port直接关联一个VF,SRIOV port由基于硬件的以太网桥接(Hardware-based VirtualEthernet Bridging,HW VEB)提供跨接,或SRIOV port连接到MACvtap设备再接入虚拟网络接口卡(Virtual Network Interface Card,vNIC),实现虚拟机的数据通信。OpenStack is an open source cloud computing management platform project, which is a combination of a series of software open source projects. Before the first version, a virtual machine was usually connected to a linux bridge or an Open Virtual Switching Standard (OpenvSwitch, OVS) bridge to realize data communication of the virtual machine. OpenStack has introduced SRIOV since the Juno version, and directly associates a VF through the SRIOV port. The SRIOV port is bridged by Hardware-based VirtualEthernet Bridging (HW VEB), or the SRIOV port is connected to the MACvtap device and then connected to the virtual A network interface card (Virtual Network Interface Card, vNIC) realizes data communication of virtual machines.

SRIOV是一种不需要软件模拟就可以共享I/O设备的技术。它弥补了外设部件互连直通(Peripheral Component Interconnect Passthrough,PCI Pass-through)技术造成的硬件资源受限问题。SRIOV通过把输入/输出(In/Out,I/O)物理设备端口的功能虚拟化为多个,每个虚拟功能都被直接分配到一个虚拟机,因此实现了接近本机的性能。总的来说,SRIOV实现了将外设部件互联(Peripheral Component Interconnect,PCI)功能分配到多个虚拟接口使得在虚拟化环境中共享一个PCI设备的资源的目的。SRIOV能够让网络传输绕过软件模拟层,直接分配到虚拟机。这样就降低了软件模拟层中的I/O开销,可以获得能够与本机性能媲美的I/O性能。SRIOV is a technology that can share I/O devices without software emulation. It makes up for the hardware resource limitation problem caused by Peripheral Component Interconnect Passthrough (PCI Pass-through) technology. SRIOV virtualizes the function of the input/output (In/Out, I/O) physical device port into multiples, and each virtual function is directly assigned to a virtual machine, thus achieving performance close to the native machine. In general, SRIOV achieves the purpose of distributing Peripheral Component Interconnect (PCI) functions to multiple virtual interfaces so that the resources of a PCI device can be shared in a virtualized environment. SRIOV enables network traffic to bypass the software emulation layer and distribute it directly to virtual machines. In this way, the I/O overhead in the software simulation layer is reduced, and the I/O performance comparable to that of the native machine can be obtained.

SRIOV使得一个单一的功能单元(例如一个以太网端口)变成具备多个独立功能的物理设备。一个带有SRIOV功能的物理设备能被配置为多个功能单元。SRIOV makes a single functional unit (such as an Ethernet port) into a physical device with multiple independent functions. A physical device with SRIOV function can be configured as multiple functional units.

图1示出了相关技术中SRIOV网卡的可选结构示意图,将根据各个部分进行说明。FIG. 1 shows a schematic diagram of an optional structure of an SRIOV network card in the related art, which will be described according to each part.

SRIOV包括物理功能(Physical Function,PF),用于支持SRIOV功能的PCI,包含SRIOV功能结构,所述SRIOV功能结构用于管理SRIOV功能。PF具备高速外设部件互连(Peripheral Component Interconnect Express,PCIe)的全部功能,可以像其他任何PCIe设备一样进行发现、管理和处理。PF拥有全部的配置资源,所述配置资源可以用于配置或控制PCIe设备。SRIOV还包括VF,所述VF是一种轻量级PCIe功能,可以与物理功能以及与同一物理功能关联的其他VF共享一个或多个物理资源。VF仅允许拥有用于其自身行为的配置资源。SRIOV includes a physical function (Physical Function, PF), which is used to support the PCI of the SRIOV function, and includes the SRIOV function structure, and the SRIOV function structure is used to manage the SRIOV function. PF has all the functions of high-speed peripheral component interconnection (Peripheral Component Interconnect Express, PCIe), and can be discovered, managed and processed like any other PCIe device. The PF owns all configuration resources, which can be used to configure or control PCIe devices. SRIOV also includes a VF, which is a lightweight PCIe function that can share one or more physical resources with a physical function and other VFs associated with the same physical function. A VF is only allowed to have configuration resources for its own behavior.

网络接口卡(Network Interface Card,NIC)在启用SRIOV之后会生成若干虚拟端口(Virtual Port,Vport),转发物理端口与虚拟端口之间的数据。After SRIOV is enabled, the Network Interface Card (NIC) will generate several virtual ports (Virtual Port, Vport) to forward data between the physical port and the virtual port.

相关技术中,为了解决无法合理动态地部署SRIOV网卡的问题,通常采用将SRIOV网卡资源部署到网络虚拟机后,采集所有虚拟机的实时业务状态数据,并根据第一预设周期内采集到的实时业务状态数据评价每个虚拟机的当前业务运行状况;根据每个虚拟机的当前业务运行状况,获取待迁入虚拟机,并将已部署SRIOV网卡资源的虚拟机作为待迁出虚拟机,待迁入虚拟机的当前业务运行状况不优于待迁出虚拟机的当前业务运行状况;将待迁出虚拟机的SRIOV网卡资源迁移到待迁入虚拟机中。该方案动态合理地部署SRIOV网卡资源,达到了负荷均衡的目的。在该方案中,采用实时监控业务流量,根据业务运行情况,通过迁入迁出虚拟机保证SRIOV虚拟机的流量达到均衡负载的目的。但上述方案涉及虚拟机资源迁移,操作和流程较为复杂,在迁移过程中还会额外消耗大量物理资源。In related technologies, in order to solve the problem that the SRIOV network card cannot be reasonably and dynamically deployed, it is usually adopted to collect the real-time business status data of all virtual machines after deploying the SRIOV network card resources to the network virtual machines, and based on the data collected in the first preset period The real-time business status data evaluates the current business operation status of each virtual machine; according to the current business operation status of each virtual machine, the virtual machine to be migrated is obtained, and the virtual machine with deployed SRIOV network card resources is used as the virtual machine to be migrated out. The current business operation status of the virtual machine to be migrated in is not better than the current business operation status of the virtual machine to be migrated out; migrate the SRIOV network card resources of the virtual machine to be migrated out to the virtual machine to be migrated in. This scheme dynamically and rationally deploys SRIOV network card resources to achieve the purpose of load balancing. In this solution, real-time monitoring of business traffic is adopted, and the traffic of SRIOV virtual machines is ensured to achieve load balancing by migrating in and out of virtual machines according to business operation conditions. However, the above solution involves the migration of virtual machine resources, the operation and process are relatively complicated, and a large amount of additional physical resources will be consumed during the migration process.

或者,相关技术中为了增加网络设备的可靠性,还采用获取为网络设备创建的虚拟网卡以及安装在所述网络设备上的至少两个物理网卡;利用ifenslave控制工具指定所述虚拟网卡采用所述至少两个物理网卡作为物理端口;确定所述虚拟网卡调用所述物理端口的工作模式;将所述虚拟网卡及其工作模式写入指定的配置文件中,以使所述网络设备的系统在启动时根据所述指定的配置文件,加载用于驱动所述虚拟网卡的Bonding模块,从而实现网卡的绑定。在该方案中,从物理机的物理网卡出发进行Bonding操作,不涉及云环境、也未涉及SRIOV技术。Or, in the related art, in order to increase the reliability of the network equipment, it is also used to obtain the virtual network card created for the network equipment and at least two physical network cards installed on the network equipment; At least two physical network cards are used as physical ports; determining the working mode of the virtual network card calling the physical port; writing the virtual network card and its working mode into a specified configuration file, so that the system of the network device is started At this time, according to the specified configuration file, the Bonding module for driving the virtual network card is loaded, so as to realize the binding of the network card. In this solution, the Bonding operation is performed starting from the physical network card of the physical machine, which does not involve the cloud environment or SRIOV technology.

或者,相关技术中还提供为每个网络设备配置若干以太网卡以实现网络设备两两连接;基于bond技术为每个网络设备建立虚拟网卡并配置对应IP;发送/接收ARP请求以建立网络设备之间的路由规则;基于路由规则进行数据包的传输的技术方案。通过网卡进行网络设备的两两连接,基于bond技术对网卡进行管理,通过获取网络设备之间的地址信息以实现数据的传输过程,可以节省独立的交换机,有利于对现有的系统进行改造。Or, in the related art, it is also provided to configure several Ethernet cards for each network device to realize pairwise connection of network devices; to establish a virtual network card and configure corresponding IP for each network device based on bond technology; to send/receive ARP requests to establish network devices. Inter-routing rules; a technical solution for transmitting data packets based on routing rules. The two-to-two connection of network devices is carried out through the network card, and the network card is managed based on the bond technology. By obtaining the address information between network devices to realize the data transmission process, independent switches can be saved, which is beneficial to the transformation of the existing system.

或者,相关技术中还提供一种自动配置网口bond的装置,所述装置包括:系统配置模块,用于配置Linux OS;脚本配置模块,用于在Linux OS下配置用于网口bond的脚本;网口bond模块,用于执行所述用于网口bond的脚本,以便查看网口连接状态;以及选择需要bond的网口;以及选择网口bond模式;以及对应配置需要bond的网口以及网口bond模式;以及重启网络,完成网口bond。能够自动配置网口的bond,大大简化了工作流程,节省了配置时间,同时降低了人力资源的消耗,大大提升了服务器的工作效率。Alternatively, a device for automatically configuring network port bond is also provided in the related art, and the device includes: a system configuration module for configuring Linux OS; a script configuration module for configuring a script for network port bond under Linux OS ; The network port bond module is used to execute the script for the network port bond, so as to check the connection status of the network port; and select the network port that needs to be bonded; and select the network port bond mode; and correspondingly configure the network port that needs to be bonded; Network port bond mode; and restart the network to complete the network port bond. The ability to automatically configure the bond of the network port greatly simplifies the workflow, saves configuration time, reduces the consumption of human resources, and greatly improves the work efficiency of the server.

但上述方案均无法解决在OpenStack云平台下SRIOV虚拟机网卡的bonding问题。However, none of the above solutions can solve the bonding problem of the SRIOV virtual machine network card under the OpenStack cloud platform.

基于目前SRIOV虚拟机网卡的bonding中存在的问题,本申请实施例提供一种处理方法,能够解决现有技术方案中无法解决的技术难题和缺点。Based on the current problems existing in the bonding of the network card of the SRIOV virtual machine, the embodiment of the present application provides a processing method, which can solve the technical problems and shortcomings that cannot be solved in the existing technical solutions.

图2示出了本申请实施例提供的一种处理方法的可选流程示意图一,将根据各个步骤进行说明。FIG. 2 shows an optional schematic flowchart 1 of a processing method provided by an embodiment of the present application, which will be described according to each step.

步骤S101,创建一个逻辑端口。Step S101, create a logical port.

在一些实施例中,OpenStack云平台的其中一个组件创建一个逻辑端口。所述OpenStack云平台的其中一个组件可以是Neutron。In some embodiments, one of the components of the OpenStack cloud platform creates a logical port. One of the components of the OpenStack cloud platform may be Neutron.

在一些实施例中,所述逻辑端口用于创建SRIOV虚拟机。In some embodiments, the logical ports are used to create SRIOV virtual machines.

在一些实施例中,所述Neutron无法创建两个相同MAC地址的端口,因此,Neutron创建一个逻辑端口,在后续利用所述逻辑端口创建SRIOV虚拟机的过程中,可以在OpenStack云平台的另一个组件侧创建两个相同MAC地址的VF,为SRIOV虚拟机提供端口绑定功能。所述OpenStack云平台的另一个组件可以是Nova。In some embodiments, the Neutron cannot create two ports with the same MAC address. Therefore, Neutron creates a logical port. In the subsequent process of using the logical port to create an SRIOV virtual machine, it can be used in another instance of the OpenStack cloud platform. Create two VFs with the same MAC address on the component side to provide the port binding function for the SRIOV virtual machine. Another component of the OpenStack cloud platform may be Nova.

在一些实施例中,所述逻辑端口为带有bond属性的port。In some embodiments, the logical port is a port with a bond attribute.

步骤S102,基于所述逻辑端口创建SRIOV虚拟机。Step S102, creating an SRIOV virtual machine based on the logical port.

在一些实施例中,OpenStack云平台的其中一个组件基于所述逻辑端口创建SRIOV虚拟机。In some embodiments, one of the components of the OpenStack cloud platform creates a SRIOV virtual machine based on the logical port.

在一些实施例中,所述OpenStack云平台的其中一个组件可以是Nova。所述Nova基于所述逻辑端口和SRIOV虚拟机参数创建所述SRIOV虚拟机。In some embodiments, one of the components of the OpenStack cloud platform may be Nova. The Nova creates the SRIOV virtual machine based on the logical port and SRIOV virtual machine parameters.

在一些实施例中,所述SRIOV虚拟机参数包括以下至少一种:所述SRIOV虚拟机的操作系统、所述操作系统中的应用、所述应用的特性、所述SRIOV虚拟机包括的处理器的数目、所述SRIOV虚拟机的内存、或者所述SRIOV虚拟机的绑定端口。In some embodiments, the SRIOV virtual machine parameters include at least one of the following: the operating system of the SRIOV virtual machine, applications in the operating system, characteristics of the applications, and processors included in the SRIOV virtual machine The number of the SRIOV virtual machine, the memory of the SRIOV virtual machine, or the bound port of the SRIOV virtual machine.

步骤S103,从两个物理网卡分别获得一个VF,并将所述分别获得的VF分配给所述SRIOV虚拟机。Step S103, obtaining a VF from two physical network cards respectively, and assigning the obtained VFs to the SRIOV virtual machine.

在一些实施例中,OpenStack云平台的其中一个组件在创建SRIOV虚拟机的过程中,从两个物理网卡上,分别获得一个VF,并将所述从两个物理网卡上分别获得的一个VF分配给所述SRIOV虚拟机。In some embodiments, during the process of creating the SRIOV virtual machine, one of the components of the OpenStack cloud platform obtains a VF from two physical network cards respectively, and allocates a VF obtained from the two physical network cards respectively to the SRIOV virtual machine.

在一些实施例中,所述从两个物理网卡上,分别获得一个VF包括:在两个物理网卡上分别创建一个具有相同MAC地址的PCI设备。所述PCI设备包括:VF。In some embodiments, obtaining a VF from two physical network cards respectively includes: creating a PCI device with the same MAC address on the two physical network cards respectively. The PCI device includes: VF.

在一些实施例中,所述具有相同MAC地址的两个VF可以进行bonding操作,使SRIOV虚拟机具备bond功能。In some embodiments, the two VFs with the same MAC address can perform a bonding operation, so that the SRIOV virtual machine has a bonding function.

步骤S104,对所述两个VF进行绑定操作。Step S104, performing a binding operation on the two VFs.

在一些实施例中,OpenStack云平台的其中一个组件对具有相同MAC地址的所述SRIOV虚拟机上的两个VF进行绑定操作,包括:通过云平台内部NOVA的元数据传入绑定信息,根据所述绑定信息,对具有相同MAC地址的所述SRIOV虚拟机上的两个VF进行绑定操作。In some embodiments, one of the components of the OpenStack cloud platform performs a binding operation on the two VFs on the SRIOV virtual machine with the same MAC address, including: passing in the binding information through the metadata of the NOVA inside the cloud platform, According to the binding information, a binding operation is performed on two VFs on the SRIOV virtual machine with the same MAC address.

在另一些实施例中,所述对具有相同MAC地址的所述SRIOV虚拟机上的两个VF进行绑定操作还包括:手动进行bonding操作。In some other embodiments, the performing the binding operation on the two VFs on the SRIOV virtual machine with the same MAC address further includes: manually performing the bonding operation.

在一些实施例中,所述绑定信息包括:bond模式、链路监测间隔、IP地址、子网掩码、端口ID、广播地址中至少一种。In some embodiments, the binding information includes: at least one of bond mode, link monitoring interval, IP address, subnet mask, port ID, and broadcast address.

在一些实施例中,所述Bond模式包括:平衡循环模式、主备模式、均衡负载模式、广播模式、IEEE 802.3ad动态链接聚合模式、适配器传输负载均衡模式、适配器适应性负载均衡模式中至少一种。In some embodiments, the Bond mode includes: at least one of: balanced round-robin mode, active-standby mode, balanced load mode, broadcast mode, IEEE 802.3ad dynamic link aggregation mode, adapter transmission load balancing mode, and adapter adaptive load balancing mode kind.

如此,在OpenStack云平台无法创建两个相同MAC地址进行bonding操作的情况下,通过创建一个逻辑端口,基于所述逻辑端口创建SRIOV虚拟机;并在创建所述SRIOV虚拟机的过程中,从两个物理网卡上分别获得一个具有相同MAC地址的VF,并将所述两个具有相同MAC地址的VF分配给所述SRIOV虚拟机,使所述SRIOV虚拟机的端口具备bonding功能,减少负载对用户造成的影响,还能保证用户SRIOV虚拟机的网络高可用。In this way, when the OpenStack cloud platform cannot create two identical MAC addresses for bonding operations, by creating a logical port, a SRIOV virtual machine is created based on the logical port; and during the process of creating the SRIOV virtual machine, from two Obtain a VF with the same MAC address on each physical network card, and assign the two VFs with the same MAC address to the SRIOV virtual machine, so that the port of the SRIOV virtual machine has a bonding function, reducing the load on the user The impact caused can also ensure the high availability of the network of the user's SRIOV virtual machine.

同时,本申请提供的实施例通过云平台的其中一个组件的元数据在虚拟机内部进行bonding操作,避免了相关技术中在物理机上进行VF bonding操作需要网卡驱动支持,对网卡驱动依赖性较大的缺点。At the same time, the embodiment provided by this application uses the metadata of one of the components of the cloud platform to perform the bonding operation inside the virtual machine, avoiding the need for network card driver support in the related art to perform VF bonding operations on physical machines, which is highly dependent on the network card driver. Shortcomings.

并且,相关技术中,为了保证SRIOV虚拟机网络的高可用性,只能使用主备模式,即一台虚拟机作为主机处于工作状态,另一台虚拟机作为备用机处于监视状态,同时所述备用机同步所述主机的数据,一旦备用机发现主机异常,备用机将会代替主机,实现主机的功能。但是主备模式会消耗大量的物理资源,而且切换需要的时间长,切换流程也复杂。而本申请实施例提供的SRIOV虚拟机端口bonding方法,是基于Linux的bond功能,并使用OpenStack云平台完成,无需增加额外的物理资源开销。Moreover, in related technologies, in order to ensure the high availability of the SRIOV virtual machine network, only the master-standby mode can be used, that is, one virtual machine is in the working state as the host machine, and the other virtual machine is in the monitoring state as the standby machine. The data of the main machine is synchronized with the main machine. Once the standby machine finds that the main machine is abnormal, the standby machine will replace the main machine to realize the function of the main machine. However, the active/standby mode consumes a large amount of physical resources, and the switching takes a long time, and the switching process is also complicated. However, the SRIOV virtual machine port bonding method provided in the embodiment of the present application is based on the Linux bond function, and is completed using the OpenStack cloud platform without adding additional physical resource overhead.

图3为本申请实施例提供的一种处理方法的可选流程示意图二,将根据各个步骤进行说明。FIG. 3 is an optional schematic flowchart II of a processing method provided in an embodiment of the present application, which will be described according to each step.

步骤S201,创建一个逻辑端口。Step S201, creating a logical port.

在一些实施例中,OpenStack云平台中的Neutron创建一个逻辑端口。In some embodiments, Neutron in the OpenStack cloud platform creates a logical port.

在一些实施例中,所述逻辑端口用于创建SRIOV虚拟机。In some embodiments, the logical ports are used to create SRIOV virtual machines.

在一些实施例中,所述Neutron无法创建两个具有相同MAC地址的端口,因此,Neutron创建一个逻辑端口,在后续利用所述逻辑端口创建SRIOV虚拟机的过程中,可以在OpenStack云平台的另一个组件侧创建两个相同MAC地址的VF,为SRIOV虚拟机提供端口绑定功能。In some embodiments, the Neutron cannot create two ports with the same MAC address. Therefore, Neutron creates a logical port. In the subsequent process of using the logical port to create an SRIOV virtual machine, it can be used on another OpenStack cloud platform. A component side creates two VFs with the same MAC address to provide the port binding function for the SRIOV virtual machine.

在一些实施例中,所述Neutron创建所述逻辑端口后,将所述逻辑端口发送至Nova应用程序接口(Nova-Application Programming Interface,Nova-Api)。In some embodiments, after the Neutron creates the logical port, it sends the logical port to a Nova application programming interface (Nova-Application Programming Interface, Nova-Api).

步骤S202,接收所述逻辑端口。Step S202, receiving the logical port.

在一些实施例中,所述Nova-api具备接收逻辑端口的功能,以及将所述逻辑端口识别为SRIOV虚拟机的功能。In some embodiments, the Nova-api has a function of receiving a logical port and a function of identifying the logical port as a SRIOV virtual machine.

在一些实施例中,Nova-api接收所述Neutron创建并发送的所述逻辑端口,并将所述逻辑端口识别为SRIOV虚拟机。所述Nova-api在SRIOV虚拟机创建指令中封装所述SRIOV虚拟机参数与所述逻辑端口,并将所述SRIOV虚拟机创建指令通过Nova-conductor发送给Nova-compute。In some embodiments, Nova-api receives the logical port created and sent by the Neutron, and recognizes the logical port as an SRIOV virtual machine. The Nova-api encapsulates the SRIOV virtual machine parameters and the logical port in the SRIOV virtual machine creation instruction, and sends the SRIOV virtual machine creation instruction to Nova-compute through the Nova-conductor.

在一些实施例中,所述SRIOV虚拟机参数包括以下至少一种:所述SRIOV虚拟机的操作系统、所述操作系统中的应用、所述应用的特性、所述SRIOV虚拟机包括的处理器的数目、所述SRIOV虚拟机的内存、或者所述SRIOV虚拟机的绑定端口。In some embodiments, the SRIOV virtual machine parameters include at least one of the following: the operating system of the SRIOV virtual machine, applications in the operating system, characteristics of the applications, and processors included in the SRIOV virtual machine The number of the SRIOV virtual machine, the memory of the SRIOV virtual machine, or the bound port of the SRIOV virtual machine.

步骤S203,根据SRIOV虚拟机创建指令创建SRIOV虚拟机。Step S203, creating an SRIOV virtual machine according to the SRIOV virtual machine creation instruction.

在一些实施例中,OpenStack云平台的Nova-compute接收Nova-api通过Nova-conductor发送的SRIOV虚拟机创建指令,所述SRIOV虚拟机创建指令包括:逻辑端口和SRIOV虚拟机参数。In some embodiments, the Nova-compute of the OpenStack cloud platform receives the SRIOV virtual machine creation instruction sent by the Nova-api through the Nova-conductor, and the SRIOV virtual machine creation instruction includes: logical ports and SRIOV virtual machine parameters.

在另一些实施例中,所述Nova-compute基于所述逻辑端口创建SRIOV虚拟机。In other embodiments, the Nova-compute creates an SRIOV virtual machine based on the logical port.

步骤S204,从两个物理网卡分别获得一个VF,并将所述分别获得的VF分配给所述SRIOV虚拟机。Step S204, obtaining a VF from two physical network cards respectively, and assigning the obtained VFs to the SRIOV virtual machine.

在一些实施例中,OpenStack云平台的Nova-compute在创建SRIOV虚拟机的过程中,从两个物理网卡上,分别获得一个VF,并将所述从两个物理网卡上分别获得的一个VF分配给所述SRIOV虚拟机。In some embodiments, during the process of creating the SRIOV virtual machine, the Nova-compute of the OpenStack cloud platform obtains a VF from two physical network cards respectively, and distributes a VF obtained from the two physical network cards respectively to the SRIOV virtual machine.

在一些实施例中,所述Nova-compute从两个物理网卡上,分别获得一个VF包括:在两个物理网卡上分别创建一个具有相同MAC地址的PCI设备。所述PCI设备包括:VF。In some embodiments, the Nova-compute obtaining a VF from two physical network cards respectively includes: creating a PCI device with the same MAC address on the two physical network cards respectively. The PCI device includes: VF.

在一些实施例中,所述Nova-compute将所述具有相同MAC地址的两个VF分配给所述SRIOV虚拟机。In some embodiments, the Nova-compute assigns the two VFs with the same MAC address to the SRIOV virtual machine.

在一些实施例中,所述具有相同MAC地址的两个VF可以进行bonding操作,使SRIOV虚拟机具备bonding功能。In some embodiments, the two VFs with the same MAC address can perform a bonding operation, so that the SRIOV virtual machine has a bonding function.

步骤S205,缓存所述分别获得的VF分配给所述SRIOV虚拟机的过程形成的端口信息。Step S205, cache the port information formed in the process of assigning the respectively obtained VFs to the SRIOV virtual machine.

在一些实施例中,Nova-compute从两个物理网卡上,分别获得一个VF,并将所述从两个物理网卡上分别获得的一个VF分配给所述SRIOV虚拟机的过程中,Nova会生成端口信息,所述端口信息包括所述具有相同MAC地址的两个VF的插槽(PCI Slot)信息。In some embodiments, Nova-compute obtains a VF from two physical network cards respectively, and assigns the VF obtained from the two physical network cards to the SRIOV virtual machine, Nova will generate Port information, the port information includes the slot (PCI Slot) information of the two VFs with the same MAC address.

在一些实施例中,所述缓存所述端口信息包括:Nova-compute通过异步调用Neutron端口,将所述端口信息写入到Neutron数据库中。In some embodiments, the caching of the port information includes: Nova-compute calls the Neutron port asynchronously, and writes the port information into a Neutron database.

步骤S206,对所述具有相同MAC地址的两个VF进行配置。Step S206, configure the two VFs with the same MAC address.

在一些实施例中,OpenStack云平台的Neutron-sriov-nic-agent对所述具有相同MAC地址的两个VF进行配置,将所述逻辑端口加入到所述SRIOV虚拟机的物理网卡上。In some embodiments, the Neutron-sriov-nic-agent of the OpenStack cloud platform configures the two VFs with the same MAC address, and adds the logical port to the physical network card of the SRIOV virtual machine.

在一些实施例中,所述对所述具有相同MAC地址的两个VF进行配置包括:根据MAC地址配置所述两个VF的相关信息;所述相关信息包括以下至少一种:所述两个VF的状态、spoof checking状态、或者QoS信息。In some embodiments, the configuring the two VFs with the same MAC address includes: configuring related information of the two VFs according to the MAC addresses; the related information includes at least one of the following: the two VF status, spoof checking status, or QoS information.

步骤S207,对具有相同MAC地址的所述SRIOV虚拟机上的两个VF进行绑定操作。Step S207, performing a binding operation on the two VFs on the SRIOV virtual machine with the same MAC address.

在一些实施例中,OpenStack云平台的Nova对具有相同MAC地址的所述SRIOV虚拟机上的两个VF进行绑定操作,包括:通过云平台内部NOVA的元数据传入绑定信息,根据所述绑定信息,对具有相同MAC地址的所述SRIOV虚拟机上的两个VF进行绑定操作。In some embodiments, the Nova of the OpenStack cloud platform performs a binding operation on the two VFs on the SRIOV virtual machine with the same MAC address, including: passing in the binding information through the metadata of the internal NOVA of the cloud platform, according to the The above binding information is used to perform a binding operation on the two VFs on the SRIOV virtual machine with the same MAC address.

在另一些实施例中,所述对具有相同MAC地址的所述SRIOV虚拟机上的两个VF进行绑定操作还包括:手动进行bonding操作。In some other embodiments, the performing the binding operation on the two VFs on the SRIOV virtual machine with the same MAC address further includes: manually performing the bonding operation.

在一些实施例中,所述绑定信息包括:bond模式、链路监测间隔、IP地址、子网掩码、端口ID、广播地址中至少一种。In some embodiments, the binding information includes: at least one of bond mode, link monitoring interval, IP address, subnet mask, port ID, and broadcast address.

在一些实施例中,所述bond模式包括:平衡循环模式、主备模式、均衡负载模式、广播模式、IEEE 802.3ad动态链接聚合模式、适配器传输负载均衡模式、适配器适应性负载均衡模式中至少一种。In some embodiments, the bond mode includes: at least one of: balanced round-robin mode, active-standby mode, balanced load mode, broadcast mode, IEEE 802.3ad dynamic link aggregation mode, adapter transmission load balancing mode, and adapter adaptive load balancing mode kind.

如此,本申请实施例中,基于成熟的OpenStack云平台,对SRIOV虚拟机进行bonding操作,不仅减少了人工配置成本,还能保证SRIOV虚拟机的网络高可用、提高网络吞吐量,从而减少网络故障和负载对用户业务造成的影响。同时,本申请提供的实施例通过云平台的Nova的元数据在虚拟机内部进行bonding操作,避免了相关技术中在物理机上进行VF bonding操作需要网卡驱动支持,对网卡驱动依赖性较大的缺点。并且,相关技术中,为了保证SRIOV虚拟机网络的高可用,只能使用主备模式,但是主备模式会消耗大量的物力资源,而且切换需要的时间长,切换流程也复杂。但本申请实施例提供的SRIOV虚拟机端口bonding方法,是基于Linux的bond功能,并使用OpenStack云平台完成,无需增加额外的物理资源开销。In this way, in the embodiment of the present application, based on the mature OpenStack cloud platform, the bonding operation of the SRIOV virtual machine not only reduces the cost of manual configuration, but also ensures the high availability of the network of the SRIOV virtual machine and improves the network throughput, thereby reducing network failures and the impact of load on user services. At the same time, the embodiment provided by this application uses the Nova metadata of the cloud platform to perform the bonding operation inside the virtual machine, avoiding the disadvantages in related technologies that the VF bonding operation on the physical machine requires the support of the network card driver and is highly dependent on the network card driver. . Moreover, in related technologies, in order to ensure the high availability of the SRIOV virtual machine network, only the active-standby mode can be used, but the active-standby mode consumes a lot of material resources, and the switching takes a long time and the switching process is also complicated. However, the SRIOV virtual machine port bonding method provided in the embodiment of the present application is based on the bond function of Linux, and is completed using the OpenStack cloud platform without adding additional physical resource overhead.

图4示出了本申请实施例提供的一种处理方法的可选流程示意图三,将根据各个步骤进行说明。FIG. 4 shows an optional schematic flowchart third of a processing method provided by an embodiment of the present application, which will be described according to each step.

本申请可选实施例包括控制节点和计算节点,所述控制节点安装Neutron-server软件和Nova-api软件;所述计算节点安装Neutron-sriov-nic-agent软件和Nova-compute软件。所述控制节点和计算节点为物理机。An optional embodiment of the present application includes a control node and a computing node. The control node is installed with Neutron-server software and Nova-api software; the computing node is installed with Neutron-sriov-nic-agent software and Nova-compute software. The control node and computing node are physical machines.

步骤S301,创建逻辑端口。Step S301, creating a logical port.

在一些实施例中,由于Neutron无法创建两个相同MAC的port,为了保证SRIOVport bonding的实现,需要使用Neutron创建一个逻辑port,即bond port,利用所述bondport创建虚拟机的过程中,可以在Nova侧创建两个相同MAC地址的PCI设备供虚拟机做bonding。In some embodiments, since Neutron cannot create two ports with the same MAC, in order to ensure the realization of SRIOVport bonding, it is necessary to use Neutron to create a logical port, that is, a bond port. Create two PCI devices with the same MAC address on the side for virtual machine bonding.

步骤S302,Nova-api接收带有bond port的SRIOV虚拟机创建命令。In step S302, Nova-api receives an SRIOV virtual machine creation command with a bond port.

在一些实施例中,所述Nova-api需要能够接收带有bond属性的port,并识别其为SRIOV虚拟机的功能。所述Nova-api将虚拟机参数进行整合通过Nova-conductor发送给Nova-compute。In some embodiments, the Nova-api needs to be able to receive a port with a bond attribute and identify it as a function of the SRIOV virtual machine. The Nova-api integrates the virtual machine parameters and sends them to Nova-compute through the Nova-conductor.

步骤S303,Nova-compute进行带有bond port的SRIOV虚拟机创建;Step S303, Nova-compute creates a SRIOV virtual machine with a bond port;

Nova-compute接收到Nova-conductor发送而来的带有bond port的SRIOV虚拟机参数,在分配PCI设备(VF)时,需要从两个不同物理网卡上分别拿取一个VF分配给SRIOV虚拟机。此时,Nova会形成一个端口缓存(port cache)所述端口缓存中包括两个VF的PCIslot,通过异步调用Neutron port接口,将所述port cache写入到Neutron数据库中。Nova-compute receives the SRIOV virtual machine parameters with bond port sent by Nova-conductor. When assigning PCI devices (VFs), it needs to take a VF from two different physical network cards and assign them to the SRIOV virtual machine. At this time, Nova will form a port cache (port cache), which includes the PCI slots of two VFs, and write the port cache into the Neutron database by calling the Neutron port interface asynchronously.

步骤S304,Neutron-sriov-nic-agent对VF进行相应的配置;Step S304, Neutron-sriov-nic-agent configures the VF accordingly;

Neutron-sriov-nic-agent负责VF的状态、spoof check和QoS的设定,因此,SRIOV-nic-agent接收到这个bond port加入到SRIOV物理网卡上,需要根据MAC地址在两个VF上进行相关信息的配置。Neutron-sriov-nic-agent is responsible for VF status, spoof check and QoS settings. Therefore, SRIOV-nic-agent receives this bond port and adds it to the SRIOV physical network card. It needs to be correlated on the two VFs according to the MAC address. information configuration.

如此,本申请实施例中,基于成熟的OpenStack云平台,将对SRIOV虚拟机进行bonding操作,不仅减少了人工配置成本,还能保证SRIOV虚拟机的网络高可用、提高网络吞吐量,从而减少网络故障和负载对用户业务造成的影响。同时,本申请提供的实施例通过云平台的Nova的元数据在虚拟机内部进行bonding操作,避免了相关技术中在物理机上进行VF bonding操作需要网卡驱动支持,对网卡驱动依赖性较大的缺点。并且,相关技术中,为了保证SRIOV虚拟机网络的高可用,只能使用主备模式,但是主备模式会消耗大量的物力资源,而且切换需要的时间长,切换流程也复杂。但本申请实施例提供的SRIOV虚拟机端口bonding方法,是基于Linux的bond功能,并使用OpenStack云平台完成,无需增加额外的物理资源开销。In this way, in the embodiment of this application, based on the mature OpenStack cloud platform, the bonding operation will be performed on the SRIOV virtual machine, which not only reduces the cost of manual configuration, but also ensures the high availability of the network of the SRIOV virtual machine and improves the network throughput, thereby reducing network traffic. The impact of faults and loads on user services. At the same time, the embodiment provided by this application uses the Nova metadata of the cloud platform to perform the bonding operation inside the virtual machine, avoiding the disadvantages in related technologies that the VF bonding operation on the physical machine requires the support of the network card driver and is highly dependent on the network card driver. . Moreover, in related technologies, in order to ensure the high availability of the SRIOV virtual machine network, only the active-standby mode can be used, but the active-standby mode consumes a lot of material resources, and the switching takes a long time and the switching process is also complicated. However, the SRIOV virtual machine port bonding method provided in the embodiment of the present application is based on the bond function of Linux, and is completed using the OpenStack cloud platform without adding additional physical resource overhead.

图5示出了本申请实施例提供的一种处理装置的可选结构示意图一,将根据各个步骤进行说明。FIG. 5 shows a schematic diagram of an optional structure of a processing device provided in an embodiment of the present application, which will be described according to various steps.

创建单元501,用于创建一个逻辑端口;用于基于所述逻辑端口创建接收单根输入输出虚拟化SRIOV虚拟机。The creating unit 501 is configured to create a logical port; and is configured to create a virtualized SRIOV virtual machine that receives a single root input and output based on the logical port.

获得单元502,用于从两个物理网卡分别获得一个虚拟功能VF,并将所述分别获得的VF分配给所述SRIOV虚拟机;所获得的两个VF具有相同的媒体接入控制MAC地址。The obtaining unit 502 is configured to respectively obtain a virtual function VF from two physical network cards, and distribute the obtained VFs to the SRIOV virtual machine; the two obtained VFs have the same media access control MAC address.

绑定单元503,用于对所述两个VF进行绑定操作。The binding unit 503 is configured to perform a binding operation on the two VFs.

所述创建单元501还用于:基于所述逻辑端口和SRIOV虚拟机参数创建所述SRIOV虚拟机;所述SRIOV虚拟机参数包括以下至少一种:所述SRIOV虚拟机的操作系统、所述操作系统中的应用、所述应用的特性、所述SRIOV虚拟机包括的处理器的数目、所述SRIOV虚拟机的内存、或者所述SRIOV虚拟机的绑定端口。The creating unit 501 is further configured to: create the SRIOV virtual machine based on the logical port and SRIOV virtual machine parameters; the SRIOV virtual machine parameters include at least one of the following: the operating system of the SRIOV virtual machine, the operation The application in the system, the characteristics of the application, the number of processors included in the SRIOV virtual machine, the memory of the SRIOV virtual machine, or the bound port of the SRIOV virtual machine.

存储单元504,用于缓存所述分别获得的VF分配给所述SRIOV虚拟机的过程形成的端口信息;所述端口信息包括:所述两个VF的端口插槽信息。The storage unit 504 is configured to cache the obtained port information obtained during the process of assigning the VFs to the SRIOV virtual machine; the port information includes: port slot information of the two VFs.

所述存储单元504还用于:通过异步调用云平台内部Neutron接口的方式缓存所述端口信息。The storage unit 504 is further configured to: cache the port information by calling the internal Neutron interface of the cloud platform asynchronously.

所述绑定单元503还用于:通过云平台内部NOVA的元数据传入绑定信息,根据所述绑定信息,对具有相同MAC地址的所述SRIOV虚拟机上的两个VF进行绑定操作。The binding unit 503 is further configured to: import the binding information through the NOVA metadata inside the cloud platform, and bind the two VFs on the SRIOV virtual machine with the same MAC address according to the binding information operate.

配置单元505,用于根据MAC地址配置所述两个VF的相关信息;用于将所述逻辑端口加入到所述SRIOV虚拟机的物理网卡上;所述相关信息包括以下至少一种:所述两个VF的状态、欺骗检测spoof checking状态、或者QoS信息。Configuration unit 505, configured to configure related information of the two VFs according to the MAC address; used to add the logical port to the physical network card of the SRIOV virtual machine; the related information includes at least one of the following: Status of two VFs, spoof checking status, or QoS information.

图6示出了本申请实施例提供的一种处理装置的可选结构示意图二,将根据各个步骤进行说明。FIG. 6 shows an optional structural schematic diagram II of a processing device provided in an embodiment of the present application, which will be described according to various steps.

Neutron-server,用于创建一个逻辑port——bond port,利用该bond port创建虚拟机的时候,可以在Nova侧创建两个相同MAC地址的PCI设备供虚拟机做bonding;还用于存储Nova-compute发送的端口缓存。Neutron-server is used to create a logical port—bond port. When using this bond port to create a virtual machine, two PCI devices with the same MAC address can be created on the Nova side for the virtual machine to do bonding; it is also used to store Nova- The port cache sent by compute.

Nova-api,用于接收带有bond属性的port,并识别其为SRIOV虚拟机,将虚拟机参数进行整合通过Nova-conductor发送给Nova-compute。Nova-api is used to receive the port with the bond attribute, identify it as a SRIOV virtual machine, and integrate the virtual machine parameters and send them to Nova-compute through Nova-conductor.

Nova-compute,用于接收Nova-conductor发送而来的带有bond port的SRIOV虚拟机参数,在分配PCI设备(VF)时,从两个不同物理网卡上分别拿取一个VF分配给SRIOV虚拟机。此时,Nova会形成一个port cache(包含两个VF的PCI slot),通过异步的调用Neutron网络接口,更新port cache(bonding信息),完成后通过rpc消息发送给Neutron-server。Nova-compute, used to receive the SRIOV virtual machine parameters with bond port sent by Nova-conductor, when assigning PCI devices (VF), take a VF from two different physical network cards and assign them to the SRIOV virtual machine . At this point, Nova will form a port cache (including two VF PCI slots), call the Neutron network interface asynchronously, update the port cache (bonding information), and send it to the Neutron-server through an rpc message after completion.

Neutron-sriov-nic-agent,用于接收所述bond port,并将所述bond port加入到SRIOV虚拟机的物理网卡上;还用于根据MAC地址在两个VF上进行相关信息的配置。Neutron-sriov-nic-agent is used to receive the bond port and add the bond port to the physical network card of the SRIOV virtual machine; it is also used to configure related information on the two VFs according to the MAC address.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序命令相关的硬件来完成,前述的程序可以存储于一存储介质中,所述存储介质包括:移动存储设备、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random AccessMemory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed through program commands related hardware, and the aforementioned programs can be stored in a storage medium, and the storage medium includes: removable storage devices, only Various media that can store program codes such as Read-Only Memory (ROM), Random Access Memory (Random Access Memory, RAM), magnetic disk or optical disk.

或者,本发明上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干命令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated units of the present invention are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the embodiment of the present invention or the part that contributes to the prior art can be embodied in the form of a software product, the computer software product is stored in a storage medium, including several commands for Make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media capable of storing program codes such as removable storage devices, ROM, RAM, magnetic disks or optical disks.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.

Claims (10)

CN202010041685.XA2020-01-152020-01-15 A processing method, device and storage mediumActiveCN113127144B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010041685.XACN113127144B (en)2020-01-152020-01-15 A processing method, device and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010041685.XACN113127144B (en)2020-01-152020-01-15 A processing method, device and storage medium

Publications (2)

Publication NumberPublication Date
CN113127144A CN113127144A (en)2021-07-16
CN113127144Btrue CN113127144B (en)2023-04-14

Family

ID=76771306

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010041685.XAActiveCN113127144B (en)2020-01-152020-01-15 A processing method, device and storage medium

Country Status (1)

CountryLink
CN (1)CN113127144B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114244715B (en)*2021-12-172023-05-23浪潮商用机器有限公司vNIC main and standby port selection method, device and medium thereof
CN115484212B (en)*2022-07-262023-10-20浪潮通信技术有限公司QoS adjustment method and device for VF and electronic equipment
CN115801750A (en)*2022-10-202023-03-14浪潮通信技术有限公司Virtual machine communication method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107181679A (en)*2016-03-092017-09-19中兴通讯股份有限公司A kind of port binding implementation method and device

Also Published As

Publication numberPublication date
CN113127144A (en)2021-07-16

Similar Documents

PublicationPublication DateTitle
US10768972B2 (en)Managing virtual machine instances utilizing a virtual offload device
US10409628B2 (en)Managing virtual machine instances utilizing an offload device
US10360061B2 (en)Systems and methods for loading a virtual machine monitor during a boot process
US10701139B2 (en)Life cycle management method and apparatus
CA2991208C (en)Packet processing method in cloud computing system, host, and system
US10050850B2 (en)Rack awareness data storage in a cluster of host computing devices
CN106557444B (en)Method and device for realizing SR-IOV network card and method and device for realizing dynamic migration
CN103346981B (en)Virtual switch method, relevant apparatus and computer system
US8589554B2 (en)Intelligent and elastic resource pools for heterogeneous datacenter environments
US20110093849A1 (en)System and Method for Reconfigurable Network Services in Dynamic Virtualization Environments
US20140201735A1 (en)Master automation service
CN116155912A (en)Performance adjustment in a network system
CN113127144B (en) A processing method, device and storage medium
CN113268308A (en)Information processing method, device and storage medium
US9712436B2 (en)Adaptive load balancing for bridged systems
CN113886153B (en) A container-based network card stress testing method and device
CN113312143A (en)Cloud computing system, command processing method and virtualization simulation device
US20230153140A1 (en)Live migration between hosts of a virtual machine connection to a host interface
US20160254958A1 (en)Method, apparatus and system for virtualizing a policy and charging rules function
CN108351802B (en) Computer data processing system and method for communication flow-based optimization for virtual machine communication
CN118819873A (en) Virtual function management method, computer equipment, medium and system
CN111580935A (en) A network communication method, device, device and storage medium
CN108667750A (en) Virtual resource management method and device
US12107763B2 (en)Virtual network interfaces for managed layer-2 connectivity at computing service extension locations
CN118467093A (en)Resource processing method, device, apparatus, readable storage medium and program product

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

[8]ページ先頭

©2009-2025 Movatter.jp