WO2017152633A1 - 一种端口绑定实现方法及装置 - Google Patents

一种端口绑定实现方法及装置 Download PDF

Info

Publication number
WO2017152633A1
WO2017152633A1 PCT/CN2016/104081 CN2016104081W WO2017152633A1 WO 2017152633 A1 WO2017152633 A1 WO 2017152633A1 CN 2016104081 W CN2016104081 W CN 2016104081W WO 2017152633 A1 WO2017152633 A1 WO 2017152633A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
port
vnic
pci
information
Prior art date
Application number
PCT/CN2016/104081
Other languages
English (en)
French (fr)
Inventor
杨阳
杜铁刚
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017152633A1 publication Critical patent/WO2017152633A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • H04L45/245Link aggregation, e.g. trunking

Definitions

  • the present application relates to the field of communications technologies, and, for example, to a port binding implementation method and apparatus.
  • port aggregation is performed on the critical links in the access network to achieve redundancy backup and disaster tolerance against network load impact.
  • network aggregation networking applications of cloud computing platforms also need to support link aggregation.
  • SR-IOV is short for The Single Root I/O Virtualization technology, an input/output (I/O) virtualization technology that can be used in a physical PCIe adapter ( The PCI function supporting the SR-IOV function, Physical Function (PF), virtualizes multiple virtual PCIe adapters, called virtual functions (VF).
  • PF Physical Function
  • VF virtual functions
  • a physical network interface card (pNIC) adapter can virtualize multiple virtual network card (vNIC) adapters.
  • the VF in each virtual machine corresponds to a virtual machine.
  • NIC adapter In the SR-IOV specification, a virtual NIC can be directly connected to an I/O device. Therefore, virtual machines use SR-IOV technology to improve forwarding performance and scalability. This technology is widely used in network virtualization of cloud computing platforms.
  • the SR-IOV function When the SR-IOV function is used to implement the network virtualization of the Openstack cloud platform, in the process of link aggregation between the ports of the pNIC and the vNIC, the related technologies have at least the following problems:
  • the VFs of the vNICs may be from the same physical network port.
  • the physical network port fails, all vNICs are unavailable and cannot function as a link backup.
  • the PF on the Host is bound to the port.
  • the VF also performs port binding.
  • the network of the vNIC is unreachable.
  • the two bond ports are in the virtual machine (VM) VM1 and VM2.
  • the main ports of the two bond ports are different.
  • the main port of PF is bound to eth0 in VM1 in Figure 1.
  • the active port VF is on eth1.
  • the network port of VM2 is sent to the standby eth1. The packet cannot be sent and the VM2 network is unreachable.
  • the technical problem to be solved by the present invention is to provide a method and a device for implementing port binding, which can overcome the problem that the VF is from the same PF when the vNIC port of the virtual machine is aggregated and bound.
  • an embodiment of the present invention provides the following technical solutions:
  • a port binding implementation method is provided, which is applied to an SR-IOV virtualized network, where the method includes:
  • the method further includes:
  • the standard PCI address information of the logical port definition local bus and the active/standby state of the PF are sent to the virtual machine, so that the virtual machine selects the VF of the primary PF as the primary port.
  • the creating a virtual machine and selecting the virtual function VF to be assigned to the virtual machine includes:
  • the computing node generates a PCI resource pool of the VF, and reports the PCI resource pool information to the control node.
  • the PCI resource pool information includes at least the PCI address information of the virtual network internal virtual network card and the state of the VF corresponding to the port in the physical function PF;
  • the control node collects and stores PCI resource pool information of the VF of all computing nodes
  • the computing node receives the instruction to start the virtual machine, and requests the control node to allocate the VF to the virtual machine;
  • the control node checks whether the PCI information of the PF where the idle VF is located is the same as the PCI information of the PF where the allocated VF is located in the binding group according to the stored PCI resource pool information. If they are the same, the search continues; if not, the The idle VF is assigned to the virtual machine and exits the lookup.
  • the computing node receives an instruction to start the virtual machine, and requests the control node to allocate the VF to the virtual machine, including:
  • the computing node After receiving the instruction to start the virtual machine, the computing node collects resource information of the virtual machine, where the resource information includes a VF resource corresponding to the virtual network card vNIC;
  • the computing node requests the control node to allocate a VF to the virtual machine according to the resource information.
  • the method further includes:
  • the computing node generates a libvirt.xml file of the virtual machine instance, and starts the virtual machine.
  • the libvirt.xml file includes the PCI address information of the VF and the physical network card pNIC, and the PCI address information of the VF corresponding to the vNIC.
  • the standard PCI address information of the logical port defining the local bus and the active/standby state of the PF are sent to the virtual machine, so that the virtual machine selects the VF of the primary PF as the primary port, including:
  • the computing node obtains the active/standby state of the pNIC network port of the PF corresponding to the VF of the vNIC, and updates the pci_devices table of the corresponding VF in the control node according to the obtained information;
  • the application programming interface API of the virtual node's internal virtual network port information is read by the control node, and the PCI address information of the vNIC and the port binding active/standby state information of the PF of the VNIC corresponding to the vNIC are read and written into the Metadata file;
  • the computing node After the virtual machine is started, the computing node reads the PCI address information of the vNIC in the Metadata file and the port binding active/standby state information of the PF of the VNIC corresponding to the vNIC, and transmits the read information to the virtual machine;
  • the virtual machine parses the data transmitted by the computing node, and selects the VF of the primary PF as the primary port.
  • the computing node obtains the active/standby status of the pNIC network port of the PF corresponding to the VF of the vNIC, including:
  • the alias of the aggregation interface bound to the pNIC look up the aggregation interface configuration file on the host, and obtain the primary ethx from the host to see if it is consistent with the aggregation name of the pNIC. If they are consistent, the pNIC network port is used. If not, the pNIC network is inconsistent. Standby.
  • the control node reads the PCI address information of the vNIC and the port binding active/standby status information of the PF of the VF corresponding to the vNIC, and the writing of the Metadata file includes:
  • the embodiment of the present invention further provides a port binding implementation apparatus, which is applied to an SR-IOV virtualization network, where the apparatus includes:
  • the first creation module is configured to create an SR-IOV logical port, and the logical ports under the same aggregation interface belong to the same binding group;
  • the second creation module is configured to create a virtual machine, and select a virtual function VF to be assigned to the virtual machine, so that the physical function PF of the VF of the same binding group is different.
  • the device also includes:
  • the processing module is configured to send the standard PCI address information of the logical port definition local bus and the active/standby state of the PF to the virtual machine, so that the virtual machine selects the VF of the primary PF as the primary port.
  • the embodiment of the invention further provides a non-transitory computer readable storage medium storing computer executable instructions, the computer executable instructions being arranged to perform the above method.
  • An embodiment of the present invention further provides an electronic device, including:
  • At least one processor At least one processor
  • the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the method described above.
  • the SR-IOV logical port is created.
  • the logical port of the same aggregation port belongs to the same binding group.
  • the virtual machine is created and the virtual function VF is assigned to the virtual machine.
  • the function PF is different.
  • the technical solution of the present invention can overcome the problem that the VF is from the same PF when the vNIC port aggregation binding of the virtual machine in the related art is related, and the link backup can be implemented.
  • FIG. 1 is a networking diagram of a binding application of a PF and a VF in the related art
  • FIG. 2 is a schematic flowchart of cooperation between a PF binding and a VF binding according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an application of binding a pNIC binding to multiple virtual machine vNICs according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • the embodiment of the present invention provides a method and an apparatus for implementing port binding, which can overcome the problem that the VF is from the same PF when the vNIC port of the virtual machine is aggregated and bound.
  • the embodiment provides a port binding implementation method, which is applied to an SR-IOV virtualized network, and the method includes:
  • the SR-IOV logical port is created, and the logical port of the same aggregation port belongs to the same binding group, and the virtual machine is created, and the virtual function VF is allocated to the virtual machine, so that the VF of the same binding group is located.
  • the physical function PF is different.
  • the method further includes:
  • the standard PCI address information of the logical port definition local bus and the active/standby state of the PF are sent to the virtual machine, so that the virtual machine selects the VF of the primary PF as the primary port.
  • the creating a virtual machine and selecting the virtual function VF to be assigned to the virtual machine includes:
  • the computing node generates a PCI resource pool of the VF, and reports the PCI resource pool information to the control node.
  • the PCI resource pool information includes at least the PCI address information of the virtual network internal virtual network card and the state of the VF corresponding to the port in the physical function PF;
  • the control node collects and stores PCI resource pool information of the VF of all computing nodes
  • the computing node receives the instruction to start the virtual machine, and requests the control node to allocate the VF to the virtual machine;
  • the control node checks whether the PCI information of the PF where the idle VF is located is the same as the PCI information of the PF where the allocated VF is located in the binding group according to the stored PCI resource pool information. If they are the same, the search continues; if not, the The idle VF is assigned to the virtual machine and exits the lookup.
  • the computing node receives an instruction to start the virtual machine, and requests the control node to allocate the VF to the virtual machine, including:
  • the computing node After receiving the instruction to start the virtual machine, the computing node collects resource information of the virtual machine, where the resource information includes a VF resource corresponding to the virtual network card vNIC;
  • the computing node requests the control node to allocate a VF to the virtual machine according to the resource information.
  • the method further includes:
  • the computing node generates a libvirt.xml file of the virtual machine instance, and starts the virtual machine.
  • the libvirt.xml file includes the PCI address information of the VF and the physical network card pNIC, and the PCI address information of the VF corresponding to the vNIC.
  • the standard PCI address information of the logical port defining the local bus and the active/standby state of the PF are sent to the virtual machine, so that the virtual machine selects the VF of the primary PF as the primary port, including:
  • the computing node obtains the active/standby state of the pNIC network port of the PF corresponding to the VF of the vNIC, and updates the pci_devices table of the corresponding VF in the control node according to the obtained information;
  • the application programming interface API of the virtual node's internal virtual network port information is read by the control node, and the PCI address information of the vNIC and the port binding active/standby state information of the PF of the VNIC corresponding to the vNIC are read and written into the Metadata file;
  • the computing node After the virtual machine is started, the computing node reads the PCI address information of the vNIC in the Metadata file and the port binding active/standby state information of the PF of the VNIC corresponding to the vNIC, and transmits the read information to the virtual machine;
  • the virtual machine parses the data transmitted by the computing node, and selects the VF of the primary PF as the primary port.
  • the computing node obtains the active/standby status of the pNIC network port of the PF corresponding to the VF of the vNIC, including:
  • the alias of the aggregation interface bound to the pNIC look up the aggregation interface configuration file on the host, and obtain the primary ethx from the host to see if it is consistent with the aggregation name of the pNIC. If they are consistent, the pNIC network port is used. If not, the pNIC network is inconsistent. Standby.
  • the control node reads the PCI address information of the vNIC and the port binding active/standby status information of the PF of the VF corresponding to the vNIC, and the writing of the Metadata file includes:
  • the embodiment provides a port binding implementation device, which is applied to an SR-IOV virtualized network, and the device includes:
  • the first creation module is configured to create an SR-IOV logical port, and the logical ports under the same aggregation interface belong to the same binding group;
  • the second creation module is configured to create a virtual machine, and select a virtual function VF to be assigned to the virtual machine, so that the physical function PF of the VF of the same binding group is different.
  • the SR-IOV logical port is created, and the logical port of the same aggregation port belongs to the same binding group, and the virtual machine is created, and the virtual function VF is allocated to the virtual machine, so that the VF of the same binding group is located.
  • the physical function PF is different.
  • the device also includes:
  • the processing module is configured to send the standard PCI address information of the logical port definition local bus and the active/standby state of the PF to the virtual machine, so that the virtual machine selects the VF of the primary PF as the primary port.
  • Embodiments of the present invention have the following beneficial effects:
  • the SR-IOV function is enabled in the cloud computing virtual network, and the binding user of the PF and the VF is used.
  • the following functions can be realized:
  • Function A PF port binding
  • Function B VF port binding member port selection
  • neutron the module used to create the virtual network's openstack
  • nova creates the virtual machine
  • VF members of the assigned binding group are from different PFs.
  • Function C The PF binding port is bound to the VF port for consistency.
  • nova database In the nova database, increase the port PCI of the VM (the standard port of the logical port defines the local bus) and the active/standby state of the PF.
  • API application programming interface
  • PCI information of the nova query VM increase the PCI address and corresponding address of the VM internal vNIC.
  • the primary and secondary information of the PF, the PCI address and the primary and secondary information of the Metadata delivery port are given to the virtual machine.
  • the virtual machine when the VF port is bound, the data of the Metadata is parsed, and the VF of the primary PF is selected as the active (active) port.
  • Function A is the binding of the PF.
  • function C the binding configuration information of the PF is read.
  • the function B is to select the VF to be bound.
  • the function C the PCI information of the VF is expanded, and the VF of the PF on the virtual machine is selected as the active member port.
  • the embodiment supports the port aggregation technology in the cloud platform virtualization network SR-IOV in the communication network, and expands the PCI information of the virtual network card in the virtual machine in the nova component PCI device management in the openstack, and multiple network planes exist for the virtual machine. Multiple virtual network cards select the appropriate PF, which provides good support and is beneficial to application networking.
  • the pNIC port corresponds to the PF binding.
  • This operation is the same as the general physical network port port aggregation binding operation.
  • vNIC port corresponds to VF binding
  • the compute node enables the SR-IOV, generates a PCI resource pool of the VF, and reports it to the control node.
  • the vNIC_address (the PCI address information of the virtual machine internal virtual network card) and the master (the VF corresponds to the state of the port binding in the PF) are added to the PCI information of the reported VF.
  • vNIC_address is empty and master is false (non-primary).
  • the control node collects the PCI resource pools of the VFs of all computing nodes, numbers them, and writes them into the database pci_devices table of Nova. Add the vNIC_address and master fields to the Nova database.
  • the logical port under the same aggregation port has the same binding group name, such as:
  • the Nova API creates a virtual machine with the port in the same binding group in step 0030.
  • Nova scheduling select the appropriate compute node to start the virtual machine.
  • the computing node receives the scheduled start VM message and prepares to start the VM.
  • the resource information of the virtual machine is collected on the computing node, where the resource of the VF corresponding to the virtual network card vNIC is applied to the control node for allocation.
  • the VF's PCI resource management selects the VF to be assigned to the VM.
  • the vacant VF in the PCI device resource pool is traversed.
  • Check whether the PCI information of the PF where the VF is located is the same as the PCI information of the PF where the VF is allocated in the binding group. If they are the same, skip selecting the PCI of the next VF.
  • the device continues to judge the screening; if it is not the same, it is assigned to the VM, and the search is exited; if the appropriate one is not found, the startup VM is abnormally exited;
  • the libvirt.xml file contains the PCI address information of the VF and pNIC, and the VF corresponds to the PCI information of the vNIC. as follows:
  • the PCI address information of the VF is as follows:
  • the PCI address information of the VM internal vNIC is as follows:
  • the PCI address information of the vNIC can be obtained from the file.
  • 0090 Calculate the timed resource refresh task on the node, for example, every 1 s timed resource refresh task, check the virtual machine instance libvirt.xml file generated in step 0070, and read the PCI address information of the vNIC. Read the vNIC binding port status of the vNIC, and update the pci_devices table corresponding to the VF in the control node Nova database.
  • NFV Network Function Virtualization
  • the Metadata service is provided on the control node, and the computing node reads the PCI address information of the vNIC binding member port and the bound member port vNIC and the master information of the corresponding pNIC.
  • step 0090 the process of obtaining the active/standby status information of the pNIC network port of the PF corresponding to the VF of the vNIC is as follows:
  • aggregation interface alias such as bond0
  • the aggregation interface configuration file (/proc/net/bonding/bond0) in the host's kernel, and obtain the primary ethx from the following (pNIC binding interface as follows) Eth0 is used by the main function to see if it is consistent with the pNIC alias. If it is consistent, the port is used. If it is inconsistent, the port is reserved.
  • the configuration is as follows:
  • the process of writing the Metadata file is as follows: In the step 0100, the PCI address information of the vNIC and the port of the PF of the VNIC corresponding to the vNIC are bound to the active/standby state information.
  • FIG. 3 the application diagram of the pNIC binding and the binding of multiple virtual machine vNICs is shown in Figure 3.
  • the physical pNIC ports of the two SR-IOV NICs are bound to the external switch, and the binding interface is bond0, which can be set to backup mode or In lacp mode, multiple SRs are generated after SR-IOV is enabled on one pNIC.
  • bond0 can be set to backup mode or In lacp mode
  • multiple SRs are generated after SR-IOV is enabled on one pNIC.
  • the vNIC is selected from the VFs generated by the two pNICs.
  • the active vNICs are all from the same active PF. If the PF is switched, the SR-IOV driver will notify all VFs on the PF to go down, and the vNICs inside the three VMs will switch to another vNIC.
  • the embodiment of the present invention further provides a non-transitory computer readable storage medium storing computer executable instructions, the computer executable instructions being configured to perform the method in any of the above embodiments.
  • the embodiment of the invention further provides a schematic structural diagram of an electronic device.
  • the electronic device includes:
  • At least one processor 40 which is exemplified by a processor 40 in FIG. 4; and a memory 41, may further include a communication interface 42 and a bus 43.
  • the processor 40, the communication interface 42, and the memory 41 can complete communication with each other through the bus 43.
  • Communication interface 42 can be used for information transfer.
  • Processor 40 may invoke logic instructions in memory 41 to perform the methods of the above-described embodiments.
  • logic instructions in the memory 41 described above may be implemented in the form of a software functional unit and sold or used as a stand-alone product, and may be stored in a computer readable storage medium.
  • the memory 41 is used as a computer readable storage medium for storing software programs, computer executable programs, and program instructions/modules corresponding to the methods in the embodiments of the present invention.
  • the processor 40 executes the function application and the data processing by running the software program, the instruction and the module stored in the memory 41, that is, the port binding implementation method in the foregoing method embodiment.
  • the memory 41 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to use of the terminal device, and the like. Further, the memory 41 may include a high speed random access memory, and may also include a nonvolatile memory.
  • the technical solution of the embodiment of the present invention may be embodied in the form of a software product stored in a storage medium, including one or more instructions for causing a computer device (which may be a personal computer, a server, or a network) The device or the like) performs all or part of the steps of the method described in the embodiments of the present invention.
  • the foregoing storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM, Random).
  • ROM read-only memory
  • RAM random access memory
  • the modules may be implemented in software for execution by various types of processors.
  • an identified executable code module can comprise one or more physical or logical blocks of computer instructions, which can be constructed, for example, as an object, procedure, or function. Nonetheless, the executable code of the identified modules need not be physically located together, but may include different instructions stored in different physicalities that, when logically combined, constitute a module and implement the specified functions of the module. .
  • the executable code module can be a single instruction or a plurality of instructions, and can even be distributed across multiple different code segments, distributed among different programs, and distributed across multiple memory devices.
  • operational data may be identified within the modules and may be implemented in any suitable form and organized within any suitable type of data structure. The operational data may be collected as a single data set, or may be distributed at different locations (including on different storage devices), and may at least partially exist as an electronic signal on a system or network.
  • the module can be implemented by software, considering the level of the hardware process, the module can be implemented in software, and the technician can construct a corresponding hardware circuit to implement the corresponding function without considering the cost.
  • the hardware circuitry includes conventional Very Large Scale Integration (VLSI) circuits or gate arrays and semiconductors such as logic chips, transistors, or other discrete components.
  • VLSI Very Large Scale Integration
  • the modules can also be implemented with programmable hardware devices such as field programmable gate arrays, programmable array logic, programmable logic devices, and the like.
  • sequence numbers of the steps are not used to limit the sequence of the steps.
  • the steps of the steps are changed without any creative work. It is also within the scope of the invention.
  • the technical solution of the present invention can overcome the problem that the VF is from the same PF when the vNIC port of the virtual machine is aggregated and bound in the related art, and the link backup can be implemented.

Landscapes

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

Abstract

本发明提供了一种端口绑定实现方法及装置,属于通信技术领域。所述方法包括:创建SR-IOV逻辑端口,同一个聚合口下的逻辑端口属于同一个绑定组;创建虚拟机,并选择虚拟功能VF分配给虚拟机,使得同一绑定组的VF所在的物理功能PF不同。本发明的技术方案能够克服虚拟机的vNIC端口聚合绑定时,VF来自同一个PF的问题。

Description

一种端口绑定实现方法及装置 技术领域
本申请涉及通信技术领域,例如涉及一种端口绑定实现方法及装置。
背景技术
在通信领域组网中,为了提高传输网络的带宽性能和可靠性,通常会对接入网络中关键链路进行端口聚合,做到冗余备份,容灾抗网络负荷冲击。
随着电信领域云运营需求的发展,云计算平台网络虚拟化组网应用中也需要支持链路聚合。
SR-IOV是单根输入输出虚拟化(The Single Root I/O Virtualization)技术的简称,该技术是一种输入输出(Input/output,I/O)虚拟化技术,可以在一个物理PCIe适配器(支持SR-IOV功能的PCI功能,Physical Function,简称PF)上虚拟化出多个虚拟的PCIe适配器,称之为虚拟功能(Virtual function,VF)。以支持SR-IOV的网卡适配器为例,一块物理网卡(physical Network Interface Card,pNIC)适配器可以虚拟出多个虚拟网卡(virtuall Network Interface Card,vNIC)适配器,每台虚拟机中的VF对应一块虚拟网卡适配器。在SR-IOV规范中,虚拟网卡可直接连接到I/O设备。因此,虚拟机使用SR-IOV技术,可提高转发性能和可伸缩性,该技术云计算平台网络虚拟化中使用比较广泛。
在使用SR-IOV功能实现Openstack云平台网络虚拟化时,对pNIC和vNIC的端口进行链路聚合的过程中,相关技术至少存在以下问题:
(1)虚拟机中多个vNIC进行绑定时,生成vNIC的VF可能会来自同一个物理网口,当该物理网口出故障时,所有vNIC不可用,不能起到链路备份的作用。
(2)Host(主机)上的PF进行端口绑定,同时,VF也进行端口绑定,会出现vNIC的网络不通。如图1所示,两个bond(绑定)口分别在虚拟机(Virtual Machine,VM)VM1和VM2中,两个虚拟机初始启动后,经常会出现两个bond口的主用口不在同一个物理网口上,如图1中VM1中PF绑定后主用口是eth0, VM2中VF绑定后,主用口VF在eth1上,此时会出现VM2的网口报文发送到了备用的eth1上,报文发送不出来,VM2网络不通。
发明内容
本发明要解决的技术问题是提供一种端口绑定实现方法及装置,能够克服虚拟机的vNIC端口聚合绑定时,VF来自同一个PF的问题。
为解决上述技术问题,本发明的实施例提供技术方案如下:
一方面,提供一种端口绑定实现方法,应用于SR-IOV虚拟化网络中,所述方法包括:
创建SR-IOV逻辑端口,同一个聚合口下的逻辑端口属于同一个绑定组;
创建虚拟机,并选择虚拟功能VF分配给虚拟机,使得同一绑定组的VF所在的物理功能PF不同。
所述方法还包括:
将逻辑端口定义局部总线的标准PCI地址信息和PF的主备状态发送给虚拟机,以使所述虚拟机选择主用的PF的VF作为主用端口。
所述创建虚拟机,并选择虚拟功能VF分配给虚拟机包括:
计算节点生成VF的PCI资源池,并上报PCI资源池信息给控制节点,所述PCI资源池信息至少包括虚拟机内部虚拟网卡的PCI地址信息和VF对应在物理功能PF中端口绑定的状态;
控制节点收集并存储所有计算节点的VF的PCI资源池信息;
计算节点接收到启动虚拟机的指令,并向控制节点申请分配VF给虚拟机;
控制节点根据所存储的PCI资源池信息检查空闲VF所在的PF的PCI信息是否与绑定组下已分配的VF所在的PF的PCI信息相同,如果相同,则继续查找;如果不相同,将该空闲VF分配给虚拟机,退出查找。
所述计算节点接收到启动虚拟机的指令,并向控制节点申请分配VF给虚拟机包括:
所述计算节点接收到启动虚拟机的指令后,收集虚拟机的资源信息,所述资源信息包括有虚拟网卡vNIC对应的VF资源;
所述计算节点根据所述资源信息向所述控制节点申请分配VF给虚拟机。
所述收集虚拟机的资源信息之后,所述方法还包括:
所述计算节点生成虚拟机实例的libvirt.xml文件,启动虚拟机,所述libvirt.xml文件中包括有VF和物理网卡pNIC的PCI地址信息,以及VF对应vNIC的PCI地址信息。
所述将逻辑端口定义局部总线的标准PCI地址信息和PF的主备状态发送给虚拟机,以便所述虚拟机选择主用的PF的VF作为主用端口包括:
所述计算节点获取vNIC对应VF所在PF的pNIC网口主备状态,并根据获取的信息更新所述控制节点中对应VF的pci_devices表;
所述控制节点查找虚拟机内部虚拟网口信息的应用程序编程接口API,读取vNIC的PCI地址信息和vNIC对应的VF所在PF的端口绑定主备状态信息,写入Metadata文件;
启动虚拟机后,所述计算节点读取所述Metadata文件中的vNIC的PCI地址信息和vNIC对应的VF所在PF的端口绑定主备状态信息,并将读取的信息传递给虚拟机;
所述虚拟机解析所述计算节点传递的数据,选择主用的PF的VF作为主用端口。
所述计算节点获取vNIC对应VF所在PF的pNIC网口主备状态包括:
根据所述libvirt.xml文件查找vNIC对应的VF的PCI地址信息;
根据VF的PCI地址信息,查找PCI表得到PF的PCI地址信息;
根据PF的PCI地址信息,查找pNIC绑定的聚合口别名;
根据pNIC绑定的聚合口别名,在主机中查找聚合口配置文件,从中获取到主用ethx,看是否与pNIC的聚合口别名一致,如果一致,则pNIC网口主用,如果不一致,pNIC网口备用。
所述控制节点读取vNIC的PCI地址信息和vNIC对应的VF所在PF的端口绑定主备状态信息,写入Metadata文件包括:
在Nova数据库pci_devices对象中增加vNIC_address和master字段,升级Nova数据库;
修改虚拟机内部vNIC的PCI地址信息,在GET http://$api_Host/v3/os-hypervisors/$id响应消息中,增加Nova数据库新增加的vNIC_address和master字段。
本发明实施例还提供了一种端口绑定实现装置,应用于SR-IOV虚拟化网络中,所述装置包括:
第一创建模块,被配置为创建SR-IOV逻辑端口,同一个聚合口下的逻辑端口属于同一个绑定组;
第二创建模块,被配置为创建虚拟机,并选择虚拟功能VF分配给虚拟机,使得同一绑定组的VF所在的物理功能PF不同。
所述装置还包括:
处理模块,被配置为将逻辑端口定义局部总线的标准PCI地址信息和PF的主备状态发送给虚拟机,以使所述虚拟机选择主用的PF的VF作为主用端口。
本发明实施例还提供了一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行上述方法。
本发明实施例还提供了一种电子设备,包括:
至少一个处理器;以及
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器执行上述的方法。
本发明的实施例具有以下有益效果:
上述方案中,创建SR-IOV逻辑端口,同一个聚合口下的逻辑端口属于同一个绑定组,创建虚拟机,并选择虚拟功能VF分配给虚拟机,使得同一绑定组的VF所在的物理功能PF不同,本发明的技术方案能够克服相关技术中虚拟机的vNIC端口聚合绑定时,VF来自同一个PF的问题,能够实现链路备份。
附图概述
图1为相关技术中PF和VF的绑定应用组网图;
图2为本发明实施例中,PF绑定与VF绑定协作的流程示意图;
图3为本发明实施例中,pNIC绑定与多个虚拟机vNIC绑定的应用示意图;以及
图4是本发明实施例提供的电子设备的结构示意图。
本发明的实施方式
为使本发明的实施例要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及实施例进行详细描述。
本发明的实施例提供一种端口绑定实现方法及装置,能够克服虚拟机的vNIC端口聚合绑定时,VF来自同一个PF的问题。
实施例一
本实施例提供一种端口绑定实现方法,应用于SR-IOV虚拟化网络中,所述方法包括:
创建SR-IOV逻辑端口,同一个聚合口下的逻辑端口属于同一个绑定组;
创建虚拟机,并选择虚拟功能VF分配给虚拟机,使得同一绑定组的VF所在的物理功能PF不同。
本实施例中,创建SR-IOV逻辑端口,同一个聚合口下的逻辑端口属于同一个绑定组,创建虚拟机,并选择虚拟功能VF分配给虚拟机,使得同一绑定组的VF所在的物理功能PF不同,本发明的技术方案能够克服相关技术中虚拟机的vNIC端口聚合绑定时,VF来自同一个PF的问题,能够实现链路备份。
所述方法还包括:
将逻辑端口定义局部总线的标准PCI地址信息和PF的主备状态发送给虚拟机,以使所述虚拟机选择主用的PF的VF作为主用端口。
所述创建虚拟机,并选择虚拟功能VF分配给虚拟机包括:
计算节点生成VF的PCI资源池,并上报PCI资源池信息给控制节点,所述PCI资源池信息至少包括虚拟机内部虚拟网卡的PCI地址信息和VF对应在物理功能PF中端口绑定的状态;
控制节点收集并存储所有计算节点的VF的PCI资源池信息;
计算节点接收到启动虚拟机的指令,并向控制节点申请分配VF给虚拟机;
控制节点根据所存储的PCI资源池信息检查空闲VF所在的PF的PCI信息是否与绑定组下已分配的VF所在的PF的PCI信息相同,如果相同,则继续查找;如果不相同,将该空闲VF分配给虚拟机,退出查找。
所述计算节点接收到启动虚拟机的指令,并向控制节点申请分配VF给虚拟机包括:
所述计算节点接收到启动虚拟机的指令后,收集虚拟机的资源信息,所述资源信息包括有虚拟网卡vNIC对应的VF资源;
所述计算节点根据所述资源信息向所述控制节点申请分配VF给虚拟机。
所述收集虚拟机的资源信息之后,所述方法还包括:
所述计算节点生成虚拟机实例的libvirt.xml文件,启动虚拟机,所述libvirt.xml文件中包括有VF和物理网卡pNIC的PCI地址信息,以及VF对应vNIC的PCI地址信息。
所述将逻辑端口定义局部总线的标准PCI地址信息和PF的主备状态发送给虚拟机,以便所述虚拟机选择主用的PF的VF作为主用端口包括:
所述计算节点获取vNIC对应VF所在PF的pNIC网口主备状态,并根据获取的信息更新所述控制节点中对应VF的pci_devices表;
所述控制节点查找虚拟机内部虚拟网口信息的应用程序编程接口API,读取vNIC的PCI地址信息和vNIC对应的VF所在PF的端口绑定主备状态信息,写入Metadata文件;
启动虚拟机后,所述计算节点读取所述Metadata文件中的vNIC的PCI地址信息和vNIC对应的VF所在PF的端口绑定主备状态信息,并将读取的信息传递给虚拟机;
所述虚拟机解析所述计算节点传递的数据,选择主用的PF的VF作为主用端口。
所述计算节点获取vNIC对应VF所在PF的pNIC网口主备状态包括:
根据所述libvirt.xml文件查找vNIC对应的VF的PCI地址信息;
根据VF的PCI地址信息,查找PCI表得到PF的PCI地址信息;
根据PF的PCI地址信息,查找pNIC绑定的聚合口别名;
根据pNIC绑定的聚合口别名,在主机中查找聚合口配置文件,从中获取到主用ethx,看是否与pNIC的聚合口别名一致,如果一致,则pNIC网口主用,如果不一致,pNIC网口备用。
所述控制节点读取vNIC的PCI地址信息和vNIC对应的VF所在PF的端口绑定主备状态信息,写入Metadata文件包括:
在Nova数据库pci_devices对象中增加vNIC_address和master字段,升级Nova数据库;
修改虚拟机内部vNIC的PCI地址信息,在GET http://$api_Host/v3/os-hypervisors/$id响应消息中,增加Nova数据库新增加的vNIC_address和master字段。
实施例二
本实施例提供了一种端口绑定实现装置,应用于SR-IOV虚拟化网络中,所述装置包括:
第一创建模块,被配置为创建SR-IOV逻辑端口,同一个聚合口下的逻辑端口属于同一个绑定组;
第二创建模块,被配置为创建虚拟机,并选择虚拟功能VF分配给虚拟机,使得同一绑定组的VF所在的物理功能PF不同。
本实施例中,创建SR-IOV逻辑端口,同一个聚合口下的逻辑端口属于同一个绑定组,创建虚拟机,并选择虚拟功能VF分配给虚拟机,使得同一绑定组的VF所在的物理功能PF不同,本发明的技术方案能够克服相关技术中虚拟机的vNIC端口聚合绑定时,VF来自同一个PF的问题,能够实现链路备份。
所述装置还包括:
处理模块,被配置为将逻辑端口定义局部总线的标准PCI地址信息和PF的主备状态发送给虚拟机,以使所述虚拟机选择主用的PF的VF作为主用端口。本发明的实施例具有以下有益效果:
实施例三
本实施例在云计算虚拟网络中启用SR-IOV功能,PF和VF的绑定使用方 法中,能够实现以下功能:
功能A:PF口绑定;
功能B:VF口绑定成员口选择;
neutron(用来创建虚拟网络的openstack中的模块)创建端口时,引入绑定组参数;nova创建虚拟机,分配绑定组的VF成员来自不同的PF。
功能C:PF绑定口与VF口绑定主用口一致性。
nova数据库中增加VM的端口PCI(逻辑端口定义局部总线的标准)地址和PF的主备状态,nova查询VM的PCI信息的API(应用程序编程接口)中,增加VM内部vNIC的PCI地址和对应PF的主备信息,Metadata传递端口的PCI地址和主备信息给虚拟机;虚拟机中,VF端口绑定时,解析Metadata的数据,选择主用的PF的VF作为active(活动)的端口。
功能A、B、C关系如下:
功能A是实现PF的绑定,在功能C中,会读取PF的绑定配置信息;
功能B是选择VF进行绑定,在功能C中,会扩充VF的PCI信息,提供给虚拟机绑定选择主用的PF上的VF作为active成员口。
本实施例支持通信网络中使用云平台虚拟化网络SR-IOV中的端口聚合技术,扩展了openstack中nova组件PCI设备管理中虚拟机内虚拟网卡的PCI信息,对于虚拟机存在多个网络平面对应多个虚拟网卡选择合适的PF,提供了良好的支持,有利于应用组网。
实施例四
对于支持SR-IOV功能的网卡,存在着Host(主机)上PF对应pNIC的绑定和Guest虚拟机上VF对应的vNIC的绑定的应用场景。
如图2所示,实现过程如下:
A:pNIC端口对应PF绑定;
部署openstack云平台前时,根据发现节点的网卡资源,选择属性一致的SR-IOV物理网卡,进行端口绑定,配置聚合口内容如下:
(1)绑定聚合口名字。
(2)绑定的成员口,即选择的物理网卡。
(3)绑定模式,有backup、lacp。
该操作与通用的物理网口端口聚合绑定操作一样。
vNIC端口对应VF绑定
计算节点上,VM内部vNIC端口绑定结合VM的启动流程,操作步骤如下:
B:VF绑定成员口选择
0010:计算节点使能SR-IOV,生成VF的PCI资源池,上报给控制节点。在上报的VF的PCI信息中增加vNIC_address(虚拟机内部虚拟网卡的PCI地址信息)和master(VF对应在PF中端口绑定的状态)。初始生成时,vNIC_address为空,master为false(非主用)。
0020:控制节点收集所有计算节点的VF的PCI资源池,进行编号,写入Nova的数据库pci_devices表中。在Nova的数据库中增加vNIC_address和master字段。
0030:控制节点上,neutron API创建SR-IOV逻辑端口时,类型为binding:vnic_type=direct,增加binding:dev_group参数,表示绑定组。同一个聚合口下的逻辑端口,拥有相同的绑定组名字,如:
neutron port-create--binding:vnic_type=direct--binding:dev_group=groupname1bond_port1
0040:Nova API创建虚拟机,带上步骤0030中,同一个绑定组下的端口。Nova调度,选择合适的计算节点启动虚拟机。
0050:计算节点收到调度启动VM消息,准备启动VM。
0060:计算节点上收集虚拟机的资源信息,其中有虚拟网卡vNIC对应的VF的资源,向控制节点申请分配。
0070:控制节点上,VF的PCI资源管理选择VF分配给VM。分配VF时,遍历PCI设备资源池中空闲VF,检查VF所在的PF的PCI信息是否与绑定组下已分配的VF所在的PF的PCI信息相同,如果相同,跳过选择下一个VF的PCI设备继续判断筛选;如果不相同,分配给VM,退出查找;如果未找到合适的,启动VM异常退出;
0080:计算节点上虚拟机的资源信息收集完后,生成虚拟机实例的 libvirt.xml文件,里面有VF和pNIC的PCI地址信息,VF对应vNIC的PCI信息。如下:
<interface type=′Hostdev′managed=′yes′>
<mac address=′fa:16:3e:62:a5:22′/>
<driver name=′vfio′/>
<source>
VF的PCI地址信息如下:
<address type=′pci′domain=′0x0000′bus=′0x02′slot=′0x17′function=′0x4′/><origstates>
<unbind/>
<removeslot/>
<reprobe/>
</origstates>
</source>
<vlan>
<tag id=′1000′/>
</vlan>
<alias name=′Hostdev0′/>
VM内部vNIC的PCI地址信息如下:
<address type=′pci′domain=′0x0000′bus=′0x00′slot=′0x04′function=′0x0′/>
</interface>
可以从该文件中获取到vNIC的PCI地址信息。
C:PF绑定口与VF口绑定主用口一致性
0090:计算节点上定时资源刷新任务,比如每隔1s定时资源刷新任务,检查步骤0070生成的虚拟机实例libvirt.xml文件,从中读取vNIC的PCI地址信息。读取vNIC对应pNIC绑定口状态,更新控制节点Nova数据库中对应VF的pci_devices表。
0100:控制节点上,NFV(Network Function Virtualization,网络功能虚拟化)调用Nova扩展查VM内部虚拟网口信息的API,读取vNIC_address和master 信息,写入Metadata文件。
0110:控制节点上提供Metadata服务,供计算节点读取vNIC的绑定成员口与绑定的成员口vNIC的PCI地址信息与对应pNIC的master信息。
0120:VM启动成功后,读取Metadata文件中vNIC_address和master信息。VM内部vNIC端口绑定,根据vNIC_address找到对应的虚拟网卡的别名,该网卡的主备状态与master一致,至此,保证了PF绑定与VF绑定端口的一致性。
其中,步骤0090中,计算节点上,获取vNIC对应VF所在PF的pNIC网口主备状态信息过程如下:
(1)根据虚拟机的libvirt.xml文件,找到vNIC对应的VF的PCI地址信息。
(2)根据VF的PCI地址信息,查PCI表得到PF的PCI地址信息。
(3)根据PF的PCI地址信息,找到pNIC对应的聚合口别名。
(4)根据pNIC绑定的聚合口别名(如bond0),在Host的kernel下找到聚合口配置文件中(/proc/net/bonding/bond0),从中获取到主用ethx(如下pNIC绑定口eth0主用),看是否与pNIC的别名一致,如果一致,端口主用,如果不一致,端口备用。
配置内容如下:
/proc/net/bonding/bond0
Ethernet Channel Bonding Driver:V3.7.1(April 27,2011)
Bonding Mode:fault-tolerance(active-backup)
Primary Slave:eth0(primary_reselect always)
Currently Active Slave:eth0
MII Status:up
MII Polling Interval(ms):100
Up Delay(ms):0
Down Delay(ms):0
Slave Interface:eth1
MII Status:up
Speed:10000Mbps
Duplex:full
Link Failure Count:1
Permanent HW addr:00:22:93:74:0f:7b
Slave queue ID:0
Slave Interface:eth0
MII Status:up
Speed:10000Mbps
Duplex:full
Link Failure Count:1
Permanent HW addr:00:22:93:74:0f:7a
Slave queue ID:0
其中,步骤0100中,读取vNIC的PCI地址信息和vNIC对应的VF所在PF的端口绑定主备状态信息,写入Metadata文件的过程如下:
(1)Nova数据库pci_devices对象中增加vNIC_address和master字段;
(2)升级Nova数据库;
(3)修改虚拟机内部vNIC的PCI信息API,
GET http://$api_Host/v3/os-hypervisors/$id($id为PCI的编号)响应消息中,增加读取Nova数据库新增加的vNIC_address和master字段。
另外,pNIC绑定与多个虚拟机vNIC绑定的应用示意图如图3所示,两个SR-IOV网卡物理pNIC端口与外部交换机对接绑定,绑定口为bond0,可设置为backup模式或者lacp模式,在一个pNIC上启用SR-IOV后,产生多个VF;Guest虚拟机内部vNIC端口绑定时,选择vNIC来自两个pNIC产生的VF。
图3中3个Guest内部端口绑定后,主用的vNIC都是来自同一个active的PF。如果PF发生倒换,SR-IOV驱动会通知该PF上的所有VF状态down,3个虚拟机内部的vNIC都会断切换到另一个vNIC上运行。
本发明实施例还提供了一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行上述任一实施例中的方法。
本发明实施例还提供了一种电子设备的结构示意图。参见图4,该电子设备包括:
至少一个处理器(processor)40,图4中以一个处理器40为例;和存储器(memory)41,还可以包括通信接口(Communications Interface)42和总线43。其中,处理器40、通信接口42、存储器41可以通过总线43完成相互间的通信。通信接口42可以用于信息传输。处理器40可以调用存储器41中的逻辑指令,以执行上述实施例的方法。
此外,上述的存储器41中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。
存储器41作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序,如本发明实施例中的方法对应的程序指令/模块。处理器40通过运行存储在存储器41中的软件程序、指令以及模块,从而执行功能应用以及数据处理,即实现上述方法实施例中的端口绑定实现方法。
存储器41可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端设备的使用所创建的数据等。此外,存储器41可以包括高速随机存取存储器,还可以包括非易失性存储器。
本发明实施例的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括一个或多个指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明实施例所述方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random  Access Memory)、磁碟或者光盘等多种可以存储程序代码的介质,也可以是暂态存储介质。
此说明书中所描述的许多功能部件都被称为模块,以便更加特别地强调其实现方式的独立性。
本发明实施例中,模块可以用软件实现,以便由各种类型的处理器执行。举例来说,一个标识的可执行代码模块可以包括计算机指令的一个或多个物理或者逻辑块,举例来说,其可以被构建为对象、过程或函数。尽管如此,所标识模块的可执行代码无需物理地位于一起,而是可以包括存储在不同物理上的不同的指令,当这些指令逻辑上结合在一起时,其构成模块并且实现该模块的规定功能。
实际上,可执行代码模块可以是单条指令或者是许多条指令,并且甚至可以分布在多个不同的代码段上,分布在不同程序当中,以及跨越多个存储器设备分布。同样地,操作数据可以在模块内被识别,并且可以依照任何适当的形式实现并且被组织在任何适当类型的数据结构内。所述操作数据可以作为单个数据集被收集,或者可以分布在不同位置上(包括在不同存储设备上),并且至少部分地可以仅作为电子信号存在于系统或网络上。
在模块可以利用软件实现时,考虑到硬件工艺的水平,所以可以以软件实现的模块,在不考虑成本的情况下,本领域技术人员都可以搭建对应的硬件电路来实现对应的功能,所述硬件电路包括常规的超大规模集成(VLSI)电路或者门阵列以及诸如逻辑芯片、晶体管之类的半导体或者是其它分立的元件。模块还可以用可编程硬件设备,诸如现场可编程门阵列、可编程阵列逻辑、可编程逻辑设备等实现。
在本发明各方法实施例中,所述各步骤的序号并不能用于限定各步骤的先后顺序,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,对各步骤的先后变化也在本发明的保护范围之内。
以上所述,仅为本发明的实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。
工业实用性
本发明的技术方案能够克服相关技术中虚拟机的vNIC端口聚合绑定时,VF来自同一个PF的问题,能够实现链路备份。

Claims (11)

  1. 一种端口绑定实现方法,应用于SR-IOV虚拟化网络中;所述方法包括:
    创建SR-IOV逻辑端口,同一个聚合口下的逻辑端口属于同一个绑定组;
    创建虚拟机,并选择虚拟功能VF分配给虚拟机,使得同一绑定组的VF所在的物理功能PF不同。
  2. 根据权利要求1所述的方法,还包括:
    将逻辑端口定义局部总线的标准PCI地址信息和PF的主备状态发送给虚拟机,以使所述虚拟机选择主用的PF的VF作为主用端口。
  3. 根据权利要求2所述的方法,其中,所述创建虚拟机,并选择虚拟功能VF分配给虚拟机包括:
    计算节点生成VF的PCI资源池,并上报PCI资源池信息给控制节点,所述PCI资源池信息至少包括虚拟机内部虚拟网卡的PCI地址信息和VF对应在物理功能PF中端口绑定的状态;
    控制节点收集并存储所有计算节点的VF的PCI资源池信息;
    计算节点接收到启动虚拟机的指令,并向控制节点申请分配VF给虚拟机;
    控制节点根据所存储的PCI资源池信息检查空闲VF所在的PF的PCI信息是否与绑定组下已分配的VF所在的PF的PCI信息相同,如果相同,则继续查找;如果不相同,将该空闲VF分配给虚拟机,退出查找。
  4. 根据权利要求3所述的方法,其中,所述计算节点接收到启动虚拟机的指令,并向控制节点申请分配VF给虚拟机包括:
    所述计算节点接收到启动虚拟机的指令后,收集虚拟机的资源信息,所述资源信息包括有虚拟网卡vNIC对应的VF资源;
    所述计算节点根据所述资源信息向所述控制节点申请分配VF给虚拟机。
  5. 根据权利要求4所述的方法,其中,所述收集虚拟机的资源信息之后,所述方法还包括:
    所述计算节点生成虚拟机实例的libvirt.xml文件,启动虚拟机,所述libvirt.xml文件中包括有VF和物理网卡pNIC的PCI地址信息,以及VF对应vNIC的PCI地址信息。
  6. 根据权利要求5所述的方法,其中,所述将逻辑端口定义局部总线的标准PCI地址信息和PF的主备状态发送给虚拟机,以便所述虚拟机选择主用的PF的VF作为主用端口包括:
    所述计算节点获取vNIC对应VF所在PF的pNIC网口主备状态,并根据获取的信息更新所述控制节点中对应VF的pci_devices表;
    所述控制节点查找虚拟机内部虚拟网口信息的应用程序编程接口API,读取vNIC的PCI地址信息和vNIC对应的VF所在PF的端口绑定主备状态信息,写入Metadata文件;
    启动虚拟机后,所述计算节点读取所述Metadata文件中的vNIC的PCI地址信息和vNIC对应的VF所在PF的端口绑定主备状态信息,并将读取的信息传递给虚拟机;
    所述虚拟机解析所述计算节点传递的数据,选择主用的PF的VF作为主用端口。
  7. 根据权利要求6所述的,其中,所述计算节点获取vNIC对应VF所在PF的pNIC网口主备状态包括:
    根据所述libvirt.xml文件查找vNIC对应的VF的PCI地址信息;
    根据VF的PCI地址信息,查找PCI表得到PF的PCI地址信息;
    根据PF的PCI地址信息,查找pNIC绑定的聚合口别名;
    根据pNIC绑定的聚合口别名,在主机中查找聚合口配置文件,从中获取到主用ethx,看是否与pNIC的聚合口别名一致,如果一致,则pNIC网口主用,如果不一致,pNIC网口备用。
  8. 根据权利要求6所述的方法,其中,所述控制节点读取vNIC的PCI地址信息和vNIC对应的VF所在PF的端口绑定主备状态信息,写入Metadata文件包括:
    在Nova数据库pci_devices对象中增加vNIC_address和master字段,升级Nova数据库;
    修改虚拟机内部vNIC的PCI地址信息,在GET http://$api_Host/v3/os-hypervisors/$id响应消息中,增加Nova数据库新增加的 vNIC_address和master字段。
  9. 一种端口绑定实现装置,应用于SR-IOV虚拟化网络中;所述装置包括:
    第一创建模块,被配置为创建SR-IOV逻辑端口,同一个聚合口下的逻辑端口属于同一个绑定组;
    第二创建模块,被配置为创建虚拟机,并选择虚拟功能VF分配给虚拟机,使得同一绑定组的VF所在的物理功能PF不同。
  10. 根据权利要求9所述的装置,还包括:
    处理模块,被配置为将逻辑端口定义局部总线的标准PCI地址信息和PF的主备状态发送给虚拟机,以使所述虚拟机选择主用的PF的VF作为主用端口。
  11. 一种非暂态计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为执行权利要求1-8中任一项的方法。
PCT/CN2016/104081 2016-03-09 2016-10-31 一种端口绑定实现方法及装置 WO2017152633A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610132674.6 2016-03-09
CN201610132674.6A CN107181679A (zh) 2016-03-09 2016-03-09 一种端口绑定实现方法及装置

Publications (1)

Publication Number Publication Date
WO2017152633A1 true WO2017152633A1 (zh) 2017-09-14

Family

ID=59788928

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/104081 WO2017152633A1 (zh) 2016-03-09 2016-10-31 一种端口绑定实现方法及装置

Country Status (2)

Country Link
CN (1) CN107181679A (zh)
WO (1) WO2017152633A1 (zh)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019179453A1 (zh) * 2018-03-22 2019-09-26 华为技术有限公司 虚拟机创建方法及装置
CN112765915A (zh) * 2020-12-21 2021-05-07 上海逸集晟网络科技有限公司 通信端口的连接方法、终端及存储介质
CN112910802A (zh) * 2021-01-13 2021-06-04 新华三大数据技术有限公司 一种报文处理方法及装置
CN113553137A (zh) * 2021-06-17 2021-10-26 中国人民解放军战略支援部队信息工程大学 一种nfv架构下基于dpdk的接入能力网元高速数据处理方法
CN113709200A (zh) * 2020-05-21 2021-11-26 阿里巴巴集团控股有限公司 一种建立通信连接的方法及装置
CN113708954A (zh) * 2021-07-23 2021-11-26 苏州浪潮智能科技有限公司 一种网络切换方法、装置及电子设备和存储介质
CN113778626A (zh) * 2021-08-31 2021-12-10 山石网科通信技术股份有限公司 虚拟网卡的热插拔处理方法、装置、存储介质及处理器
CN113835829A (zh) * 2021-08-30 2021-12-24 广东浪潮智慧计算技术有限公司 指定网络端口类型的虚拟机创建方法、系统及相关组件
CN113965530A (zh) * 2020-07-01 2022-01-21 中移(苏州)软件技术有限公司 一种服务启动方法、装置和存储介质
US11252087B2 (en) * 2017-01-20 2022-02-15 Huawei Technologies Co., Ltd. Data packet forwarding method, network adapter, host device, and computer system
CN114050998A (zh) * 2022-01-07 2022-02-15 阿里巴巴(中国)有限公司 实现远程直接内存访问的方法、装置、电子设备及介质
CN114301808A (zh) * 2021-12-23 2022-04-08 北京集智达智能科技有限责任公司 基于dpdk技术的x86平台网口性能测试方法及装置
US11755753B2 (en) * 2018-06-13 2023-09-12 Kyndryl, Inc. Mechanism to enable secure memory sharing between enclaves and I/O adapters

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107733889A (zh) * 2017-10-13 2018-02-23 郑州云海信息技术有限公司 一种虚拟机的网络访问方法、装置、设备及存储介质
CN108965169B (zh) * 2018-07-12 2020-09-25 联想(北京)有限公司 一种报文传输方法、网卡控制器、网卡及电子设备
CN109240799B (zh) * 2018-09-06 2022-04-15 福建星瑞格软件有限公司 大数据平台集群容灾方法、系统及计算机可读存储介质
CN111063387B (zh) * 2019-12-29 2021-08-31 苏州浪潮智能科技有限公司 一种固态硬盘性能测试方法、装置、设备及存储介质
CN113127144B (zh) * 2020-01-15 2023-04-14 中移(苏州)软件技术有限公司 一种处理方法、装置及存储介质
CN112671561B (zh) * 2020-12-11 2022-05-17 苏州浪潮智能科技有限公司 一种云主机的网卡配置的方法和设备
CN116366379A (zh) * 2021-01-26 2023-06-30 北京百度网讯科技有限公司 智能网卡组件、物理机、云服务系统以及报文发送方法
CN113472635A (zh) * 2021-05-31 2021-10-01 杭州沃趣科技股份有限公司 一种实现双端口Active-Active的冗余保护方法和系统
CN114244715B (zh) * 2021-12-17 2023-05-23 浪潮商用机器有限公司 一种vNIC主备端口选择方法、装置及其介质
CN114995959A (zh) * 2022-06-30 2022-09-02 中国电信股份有限公司 虚拟机热迁移控制方法、装置、存储介质及电子设备
CN115314380B (zh) * 2022-06-30 2024-03-01 山东浪潮科学研究院有限公司 Vf配置方法及装置
CN117768292A (zh) * 2022-09-24 2024-03-26 华为技术有限公司 逻辑绑定口的管理方法、装置、系统及存储介质
CN117692382A (zh) * 2024-02-04 2024-03-12 珠海星云智联科技有限公司 链路聚合方法、网卡、设备以及介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621410A (zh) * 2008-06-30 2010-01-06 英特尔公司 启用多功能装置中的功能依赖性
US20120284437A1 (en) * 2011-05-06 2012-11-08 International Business Machines Corporation Pci express sr-iov/mr-iov virtual function clusters
CN103336708A (zh) * 2013-05-31 2013-10-02 华为技术有限公司 聚合网卡资源的方法和相关设备及计算机系统
CN103609077A (zh) * 2013-06-18 2014-02-26 华为技术有限公司 用于数据传输的方法、装置和系统以及物理网卡

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621410A (zh) * 2008-06-30 2010-01-06 英特尔公司 启用多功能装置中的功能依赖性
US20120284437A1 (en) * 2011-05-06 2012-11-08 International Business Machines Corporation Pci express sr-iov/mr-iov virtual function clusters
CN103336708A (zh) * 2013-05-31 2013-10-02 华为技术有限公司 聚合网卡资源的方法和相关设备及计算机系统
CN103609077A (zh) * 2013-06-18 2014-02-26 华为技术有限公司 用于数据传输的方法、装置和系统以及物理网卡

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220109628A1 (en) * 2017-01-20 2022-04-07 Huawei Technologies Co., Ltd. Data packet forwarding method, network adapter, host device, and computer system
US11805058B2 (en) 2017-01-20 2023-10-31 Huawei Technologies Co., Ltd. Data packet forwarding method, network adapter, host device, and computer system
US11252087B2 (en) * 2017-01-20 2022-02-15 Huawei Technologies Co., Ltd. Data packet forwarding method, network adapter, host device, and computer system
WO2019179453A1 (zh) * 2018-03-22 2019-09-26 华为技术有限公司 虚拟机创建方法及装置
US11960915B2 (en) 2018-03-22 2024-04-16 Huawei Cloud Computing Technologies Co., Ltd. Method and apparatus for creating virtual machine based on parameter information of a virtual network interface card
US11755753B2 (en) * 2018-06-13 2023-09-12 Kyndryl, Inc. Mechanism to enable secure memory sharing between enclaves and I/O adapters
CN113709200A (zh) * 2020-05-21 2021-11-26 阿里巴巴集团控股有限公司 一种建立通信连接的方法及装置
CN113709200B (zh) * 2020-05-21 2023-11-28 阿里巴巴集团控股有限公司 一种建立通信连接的方法及装置
CN113965530A (zh) * 2020-07-01 2022-01-21 中移(苏州)软件技术有限公司 一种服务启动方法、装置和存储介质
CN113965530B (zh) * 2020-07-01 2023-10-13 中移(苏州)软件技术有限公司 一种服务启动方法、装置和存储介质
CN112765915A (zh) * 2020-12-21 2021-05-07 上海逸集晟网络科技有限公司 通信端口的连接方法、终端及存储介质
CN112765915B (zh) * 2020-12-21 2023-06-23 上海逸集晟网络科技有限公司 通信端口的连接方法、终端及存储介质
CN112910802A (zh) * 2021-01-13 2021-06-04 新华三大数据技术有限公司 一种报文处理方法及装置
CN112910802B (zh) * 2021-01-13 2022-05-24 新华三大数据技术有限公司 一种报文处理方法及装置
CN113553137A (zh) * 2021-06-17 2021-10-26 中国人民解放军战略支援部队信息工程大学 一种nfv架构下基于dpdk的接入能力网元高速数据处理方法
CN113553137B (zh) * 2021-06-17 2022-11-01 中国人民解放军战略支援部队信息工程大学 一种nfv架构下基于dpdk的接入能力网元高速数据处理方法
CN113708954A (zh) * 2021-07-23 2021-11-26 苏州浪潮智能科技有限公司 一种网络切换方法、装置及电子设备和存储介质
US11979307B2 (en) 2021-07-23 2024-05-07 Inspur Suzhou Intelligent Technology Co., Ltd. Network switching method and apparatus, electronic device, and storage medium
CN113835829A (zh) * 2021-08-30 2021-12-24 广东浪潮智慧计算技术有限公司 指定网络端口类型的虚拟机创建方法、系统及相关组件
CN113778626A (zh) * 2021-08-31 2021-12-10 山石网科通信技术股份有限公司 虚拟网卡的热插拔处理方法、装置、存储介质及处理器
CN114301808A (zh) * 2021-12-23 2022-04-08 北京集智达智能科技有限责任公司 基于dpdk技术的x86平台网口性能测试方法及装置
CN114301808B (zh) * 2021-12-23 2023-11-10 北京集智达智能科技有限责任公司 基于dpdk技术的x86平台网口性能测试方法及装置
CN114050998A (zh) * 2022-01-07 2022-02-15 阿里巴巴(中国)有限公司 实现远程直接内存访问的方法、装置、电子设备及介质

Also Published As

Publication number Publication date
CN107181679A (zh) 2017-09-19

Similar Documents

Publication Publication Date Title
WO2017152633A1 (zh) 一种端口绑定实现方法及装置
US11960915B2 (en) Method and apparatus for creating virtual machine based on parameter information of a virtual network interface card
US10432460B2 (en) Network service scaling method and apparatus
US10050850B2 (en) Rack awareness data storage in a cluster of host computing devices
CN110809760B (zh) 资源池的管理方法、装置、资源池控制单元和通信设备
CN111669284B (zh) OpenStack自动化部署方法、电子设备、存储介质及系统
US9747240B2 (en) Dynamic connection of PCIe devices and functions to an array of hosts
CN107818104B (zh) 一种数据库部署方法、数据库部署装置、控制设备及系统
EP3820083B1 (en) Physical function multiplexing method and apparatus and computer storage medium
CN107395710B (zh) 一种云平台网元的配置和高可用ha实现方法和装置
US11941406B2 (en) Infrastructure (HCI) cluster using centralized workflows
US11894983B2 (en) Simulation and testing of infrastructure as a service scale using a container orchestration engine
US11929879B2 (en) NS instantiation method and NFVO
CN111857951A (zh) 容器化部署平台及部署方法
JP2013120552A (ja) 仮想計算機システム、仮想計算機管理プログラム、及びmacアドレス管理方法
CN113127144B (zh) 一种处理方法、装置及存储介质
US9760513B2 (en) Low latency efficient sharing of resources in multi-server ecosystems
WO2021103657A1 (zh) 网络操作方法、装置、设备和存储介质
CN107807840B (zh) 一种应用于虚拟机网络的设备直通方法以及装置
CN113342456A (zh) 一种连接方法、装置、设备和存储介质
CN109656674B (zh) 一种计算机设备、虚拟化芯片及数据传输方法
CN109818998B (zh) 信息同步方法和装置
CN117472440B (zh) 芯片控制方法和装置、存储介质及电子设备
WO2023197815A1 (zh) 一种消息的接收、发送方法及装置
KR102505996B1 (ko) 가상 머신 프로세서의 원격 처리 장치 및 방법

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16893278

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16893278

Country of ref document: EP

Kind code of ref document: A1