CN114244715B - vNIC main and standby port selection method, device and medium thereof - Google Patents

vNIC main and standby port selection method, device and medium thereof Download PDF

Info

Publication number
CN114244715B
CN114244715B CN202111555223.0A CN202111555223A CN114244715B CN 114244715 B CN114244715 B CN 114244715B CN 202111555223 A CN202111555223 A CN 202111555223A CN 114244715 B CN114244715 B CN 114244715B
Authority
CN
China
Prior art keywords
port
iov
vnic
selecting
standby
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
CN202111555223.0A
Other languages
Chinese (zh)
Other versions
CN114244715A (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.)
Inspur Power Commercial Systems Co Ltd
Original Assignee
Inspur Power Commercial Systems 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 Inspur Power Commercial Systems Co Ltd filed Critical Inspur Power Commercial Systems Co Ltd
Priority to CN202111555223.0A priority Critical patent/CN114244715B/en
Publication of CN114244715A publication Critical patent/CN114244715A/en
Application granted granted Critical
Publication of CN114244715B publication Critical patent/CN114244715B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/02Standardisation; Integration
    • H04L41/0246Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
    • H04L41/0253Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using browsers or web-pages for accessing management information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/0836Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability to enhance reliability, e.g. reduce downtime
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application discloses a vNIC master/slave port selection method, a device and a medium thereof, wherein the method comprises the following steps: adding a new network tag definition for each SR-IOV physical port of the physical host; receiving a network group tag value of an SR-IOV physical port; when the virtual machine is created, a main port is selected from SR-IOV physical ports located in network definition on a target host, a network group where the main port is located is recorded, and a standby port is selected from SR-IOV physical ports different from the network group where the main port is located, so that redundancy of the main port and the standby port can be realized, and the problem that the two selected SR-IOV physical ports are connected to the same switch is solved.

Description

vNIC main and standby port selection method, device and medium thereof
Technical Field
The present invention relates to the field of network communications technologies, and in particular, to a method, an apparatus, and a medium for selecting a vNIC active/standby port.
Background
Power: performance Optimization With Enhanced RISC, one of the most common CPU architectures. PowerVM: the general term for virtualization technology on a Power server. PowerVC: power Virtualiztion Center, is an official unique private cloud management platform based on a Power mini-machine server and is based on open-source OpenStack implementation. OpenStack: the cloud computing management platform project is an open source cloud computing management platform project, and is a combination of a series of software open source projects. OpenStack provides scalable and resilient cloud computing services for private and public clouds. The project aims to provide a cloud computing management platform which is simple to implement, can be expanded in a large scale, is rich and has unified standards. Currently, the PowerVM provides two ways to implement network virtualization, and when a virtual machine is deployed through an SR-IOV network virtualization way, the PowerVC selects an SR-IOV physical port to be used by the virtual machine through a port label way in network definition. SR-IOV: single Root I/O virtualization Single Root input/output (I/O) virtualization is an extension of PCIe (peripheral component interconnect express, high speed serial computer expansion bus standard) specification, and may simulate a physical PCIe device into multiple logical devices for use by different systems. vNIC: virtual Network Interface Controller, SR-IOV technology-based virtual network adapters, such devices support partition online migration. PowerVC adopts vNIC technology when deploying virtual machines through SR-IOV network virtualization. The SR-IOV supports redundant mode to deploy virtual machine, and the PowerVC randomly selects two mappings for the vNIC main and standby ports in the SR-IOV physical ports defined by the network. Meanwhile, in the current practical production environment, in order to reduce the influence of network problems on devices, there are generally two groups of physical ethernet networks, which are connected to each other and are redundant to each other, and different groups of physical ethernet networks correspond to different network switches. Therefore, when the virtual machine is deployed by using the SR-IOV redundancy mode, and the two selected SR-IOV physical ports on the same physical machine are connected to different network switches, the vNIC device of the virtual machine has redundancy of a switch layer.
In the current PowerVC design and implementation, the PowerVC cloud pipe platform cannot define or identify the topology structure of the traditional network, and the situation that two selected SR-IOV physical ports are connected to the same network switch occurs, at this time, the vNIC device of the virtual machine loses redundancy of the switch layer, and if the single-point switch fails, the vNIC of the virtual machine loses all network connections, so that the problem of service termination is caused.
Therefore, a need exists for a vNIC active/standby port selection method that solves the problem of connecting two selected SR-IOV physical ports to the same network switch in the current PowerVC design and implementation.
Disclosure of Invention
The purpose of the application is to provide a method, a device and a medium for selecting a main and standby port of a vNIC, which solve the problem that two selected SR-IOV physical ports are connected to the same network switch in the current PowerVC design and implementation.
In order to solve the above technical problems, the present application provides a vNIC active/standby port selection method, including: adding a new network tag definition for each SR-IOV physical port of the physical host; receiving a network group tag value of an SR-IOV physical port; when the virtual machine is created, a main port is selected from SR-IOV physical ports located in network definition on a target host, a network group where the main port is located is recorded, and a standby port is selected from SR-IOV physical ports different from the network group where the main port is located.
Preferably, selecting the backup port includes: and selecting the SR-IOV physical port which is not located in the same drawer as the main port as the standby port.
Preferably, selecting the backup port further includes: when the SR-IOV physical port which is not located in the same drawer with the main port does not exist, the SR-IOV physical port which is not located in the same adapter with the main port is selected as the standby port.
Preferably, when there is no SR-IOV physical port different from the network group in which the primary port is located, selecting the backup port further includes: an error message is returned.
Preferably, before selecting the master port, the method further comprises: according to the service condition of the SR-IOV physical port, carrying out corresponding addition and subtraction operation on the main port count value and the standby port count value of the SR-IOV physical port, wherein when a virtual machine is created, the SR-IOV physical port is selected to support the vNIC main port, the main port count value is increased by 1, the SR-IOV physical port is selected to support the vNIC standby port, the standby port count value is increased by 1, when the virtual machine is migrated or deleted, the SR-IOV physical port is selected to support the vNIC main port, the main port count value is decreased by 1, the SR-IOV physical port is selected to support the vNIC standby port, and the standby port count value is decreased by 1; correspondingly, selecting the master port includes: the SR-IOV physical ports meeting the conditions are arranged in ascending order according to the count value of the main port, and the first SR-IOV physical port is selected as the main port; selecting the backup port comprises: and arranging the SR-IOV physical ports meeting the conditions in ascending order according to the spare port count value, and selecting the first SR-IOV physical port as the spare port.
Preferably, the method further comprises: when the SR-IOV physical ports are arranged according to the main port count value or the standby port count value, if the count values are the same, the SR-IOV physical ports with the same count values are arranged according to the alphabetic order of the port slot numbers.
In order to solve the above technical problem, the present application further provides a vNIC active/standby port selection device, including: the port label adding module is used for adding a new network label definition for each SR-IOV physical port of the physical host; the port label setting module is used for receiving the network group label value of the SR-IOV physical port; and the main and standby port selection module is used for selecting a main port from SR-IOV physical ports positioned in network definition on the target host when the virtual machine is created, recording a network group where the main port is positioned, and selecting a standby port from SR-IOV physical ports which are different from the network group where the main port is positioned.
In order to solve the above technical problem, the present application further provides a vNIC active/standby port selection device, which is characterized by comprising: a memory for storing a computer program; and the processor is used for realizing the steps of the vNIC master and slave port selection method when executing the computer program.
In order to solve the above technical problem, the present application further provides a computer readable storage medium, where a computer program is stored on the computer readable storage medium, and the steps of a vNIC master port selection method described above are implemented when the computer program is executed by a processor.
According to the method for selecting the main and standby ports of the vNIC, network labels are added to the SR-IOV physical ports, and network label values of each SR-IOV physical port are defined by a user to distinguish the SR-IOV physical ports according to the network groups where the SR-IOV physical ports are located, at the moment, when a new virtual machine is created, one port is selected as the main port, the network group where the main port is located is recorded according to the network label values of the main port, when the standby port is selected, the ports of the other network group are selected, the main port and the standby port can be connected with different network groups, and the ports are connected with the network groups through network switches, so that the ports are connected with different network groups or are connected with different switches, and the problem that if the switches are faulty, all network connections of the virtual machine are lost, and service is terminated is further avoided.
The vNIC master port selection device and the computer readable storage medium provided by the application correspond to the method and have the same effects.
Drawings
For a clearer description of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a vNIC master port selection method provided by the present invention;
fig. 2 is a schematic diagram of a vNIC master port selection method provided by the present invention on a cloud management layer;
fig. 3 is a block diagram of a vNIC master port selection device provided by the present invention.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments herein without making any inventive effort are intended to fall within the scope of the present application.
The core of the application is to provide a vNIC master and slave port selection method, a vNIC master and slave port selection device and a medium thereof.
In order to provide a better understanding of the present application, those skilled in the art will now make further details of the present application with reference to the drawings and detailed description.
When deploying a virtual machine through an SR-IOV network virtualization manner, two mappings for vNIC active and standby ports may be randomly selected from SR-IOV physical ports defined by a network in the existing PowerVC design and implementation. In an actual production environment, in order to reduce the problem that the virtual machine is affected due to network reasons, two groups of physical ethernet networks are deployed, and the two groups of networks are mutually communicated and redundant, so as to ensure that when one group of networks fails, the virtual machine can continuously provide services to the outside through the other group of networks. However, since the vNIC device of the virtual machine is connected to the network group through the switch, when two ports for mapping the vNIC primary and secondary ports randomly selected by the existing PowerVC are located in the same network group, the two ports are connected to the network group through the same switch, which makes the vNIC device of the virtual machine lose redundancy of the switch layer. If this single point switch fails, then the vNIC of the virtual machine will lose all network connections, causing a traffic outage. Therefore, as shown in fig. 1, the present application provides a vNIC active/standby port selection method, including:
s110: adding a new network tag definition for each SR-IOV physical port of the physical host;
s120: receiving a network group tag value of an SR-IOV physical port;
s130: when the virtual machine is created, a main port is selected from SR-IOV physical ports located in network definition on a target host, a network group where the main port is located is recorded, and a standby port is selected from SR-IOV physical ports different from the network group where the main port is located.
It should be noted that, the specific form of the network group tag value is not limited in this application, and may be freely selected according to the actual situation and needs, but this example provides a possible implementation: the legal values of the network group labels are NG1 and NG2, which respectively indicate that the port is connected with the first network group and the port is connected with the second network group, meanwhile, when a larger number of network groups exist in actual use, the legal values of the network labels can also be NG3 and NG4, and the embodiment does not limit the number of the network groups to be only two.
Meanwhile, the present embodiment does not limit the selection of several ports as the primary port or the backup port, but the general implementation is as follows: the main port and the standby port are one. In addition, when the number of the alternative ports meeting the conditions described in the present embodiment is plural, the present embodiment does not limit the selection logic for specifically selecting the primary port or the backup port, and it is easy to understand that no matter what the selection logic is, the technical effect that the primary port and the backup port are not located in the same switch can be achieved as long as the ports that can be selected when the backup port is selected are located in different network groups from the primary port.
Because the structure of the traditional network cannot be identified in the design and implementation of the existing PowerVC, the description information of network topology is added for the SR-IOV physical ports defined by the network, and an operator sets the description information, namely the network group label value, to indicate the network group to which the corresponding SR-IOV physical ports are specifically connected, so that when a virtual machine is created, after one main port is randomly selected, the main port can be known to be connected with the network group through the network label value, and then the port on the other network group is selected when the spare port is selected, thereby enabling the main port and the spare port not to be connected with the same network group, namely not to be connected with the same switch, and when one switch fails, the vNIC device of the virtual machine cannot lose all network connections to cause service interruption.
As can be seen from the foregoing, the present application realizes redundancy of the vNIC device of the virtual machine on the switch layer, and does not cause loss of all network connections when a single switch fails, but in actual production use of the SR-IOV physical port to be used in the vNIC device of the virtual machine, in terms of the server, a plurality of physical entities are used together as one logical body when implementing a certain function, and each physical entity constituting the logical body may be referred to as a drawer. Therefore, if the SR-IOV physical ports corresponding to the main port and the standby port are located in the same drawer, when the drawer fails, the main port and the standby port cannot work normally, and in order to solve this problem, the embodiment provides a preferred implementation manner based on the above embodiment, and selecting the standby port includes:
s131: and selecting a port which is not positioned in the same drawer as the main port as a standby port.
It is easy to understand that when there is no port satisfying both conditions, a port satisfying the condition that the port is not located in the same network group as the master port may be selected at will, or the port may not be selected and reported or otherwise, which is not limited in this embodiment, and a suitable selection logic may be selected according to the actual situation.
The advantage of this embodiment over the above-described embodiments is that: according to the embodiment, when the standby port is selected on the basis of the embodiment, the selection logic is further subdivided, so that the selected standby port is selected if the port which is not located in the same drawer as the main port is located in the condition that the selected standby port is not located in the same network group with the main port, the problem that the main port and the standby port cannot work normally when the drawer fails is avoided, redundancy of the main port and the standby port is further guaranteed on the drawer level, and reliability is improved.
As described in the foregoing embodiment, on the basis of guaranteeing redundancy of the primary port and the backup port on the switch layer, redundancy of the primary port and the backup port on the drawer layer is further guaranteed, and meanwhile, because the SR-IOV physical port is also connected with different adapters, the embodiment further provides a preferred scheme on the basis of the foregoing embodiment, where selecting the backup port further includes:
s132: when there is no port which is not located in the same drawer as the main port, a port which is not located in the same adapter as the main port is selected as the standby port.
Based on the above embodiment, when the standby port is selected, the embodiment determines whether the standby port is located in the same network group or the same drawer as the main port, and also determines whether the standby port is located in the same adapter, and selects a port which is not located in the same adapter as the main port as the standby port, so that redundancy of the main port and the standby port on the adapter layer is realized, one of the adapters connected with the main port or the standby port is ensured not to be affected when the other adapter fails, and reliability is further enhanced.
In the method for selecting the primary and standby ports of the vNIC provided by the present application, only the ports which are not in the same network group as the primary port are selected when the standby port is selected, but the situation that the ports which do not meet the condition are not selected when the standby port is selected is unavoidable, so the present embodiment provides a preferred embodiment for the problem:
s133: selecting the backup port also includes returning an error message when there is no SR-IOV physical port other than the network group in which the primary port is located.
It should be noted that, in this embodiment, the specific embodiment of the return error information and the specific content of the error information are not limited, and may be freely selected according to practical situations. In addition, this embodiment is directed to the case when there is no SR-IOV physical port different from the network group where the master port is located, and if the conditions mentioned in the above embodiments are not satisfied, for example, if the SR-IOV physical port is not located in the same drawer or the same adapter as the master port, the embodiment does not limit whether to return the error information, and may return the error information, or may randomly select one as the backup port under the condition that the SR-IOV physical port is satisfied that the master port is not located in the same network group.
In the embodiment, when the SR-IOV physical port which is different from the network group where the main port is located is not available for selection as the standby port, the error information is returned to prompt an operator to process in time, so that the working reliability of the vNIC equipment of the virtual machine is further ensured.
Since one SR-IOV physical port may be used as a primary port or a backup port of multiple vNIC devices, and it is easy to understand that the more tasks that one SR-IOV physical port assumes for a primary port or a backup port of a vNIC device, the greater the network traffic it carries, and when exceeding the limit value, the effect on the normal operation of the vNIC device will be exerted, so this embodiment provides a preferred scheme, before selecting the primary port, further including:
s201: according to the service condition of the SR-IOV physical port, carrying out corresponding addition and subtraction operation on the main port count value and the standby port count value of the SR-IOV physical port, wherein when a virtual machine is created, the SR-IOV physical port is selected to support the vNIC main port, the main port count value is increased by 1, the SR-IOV physical port is selected to support the vNIC standby port, the standby port count value is increased by 1, when the virtual machine is migrated or deleted, the SR-IOV physical port is selected to support the vNIC main port, the main port count value is decreased by 1, the SR-IOV physical port is selected to support the vNIC standby port, and the standby port count value is decreased by 1;
correspondingly, selecting the master port includes:
s202: the SR-IOV physical ports meeting the conditions are arranged in ascending order according to the count value of the main port, and the first SR-IOV physical port is selected as the main port;
selecting the backup port comprises:
s203: and arranging the SR-IOV physical ports meeting the conditions in ascending order according to the spare port count value, and selecting the first SR-IOV physical port as the spare port.
It should be noted that, when the primary port count value or the backup port count value is arranged in ascending order, a situation may occur that some SR-IOV physical port count values are the same, and since the SR-IOV physical ports with the same count value will not affect the effect brought by the implementation provided in this embodiment no matter how the SR-IOV physical ports are arranged, the SR-IOV physical ports can be freely arranged according to actual needs, and this embodiment does not limit the implementation, but provides a possible implementation as follows:
s204: when the SR-IOV physical ports are arranged according to the main port count value or the standby port count value, if the count values are the same, the SR-IOV physical ports with the same count values are arranged according to the alphabetic order of the port slot numbers.
It is to be understood that this embodiment only requires that the SR-IOV physical ports with the same count value be arranged in the alphabetical order of the port slot numbers, and is not limited as to the arrangement of the ports in the alphabetical order, the descending order, or other order of the alphabetical order of the port slot numbers.
Because the primary port and the standby port are required to be allocated to the vNIC device when the virtual machine is created, the corresponding count value of the selected SR-IOV physical port needs to be increased every time the virtual machine is created, and deleting or migrating the virtual machine indicates that the current virtual machine is to stop working temporarily, and the corresponding primary port and the corresponding standby port are not used any more, so that the use condition of each SR-IOV physical port needs to be obtained by subtracting the corresponding count value of the selected SR-IOV physical port, and when the ports are allocated, the use condition of each SR-IOV physical port can be known.
When the two SR-IOV physical port count values are the same, the two SR-IOV physical port count values are arranged according to the alphabetical order of the port slot numbers, so that the whole ordering process is more accurate, the alphabetical order of the port slot numbers is the existing attribute of the ports, the alphabetical order of the port slot numbers is used as the ordering basis, new information is not required to be added additionally, and the storage space is saved.
As can be seen from the above embodiments, the method for selecting a vNIC primary and secondary port provided in the present application needs to be implemented on a cloud management layer, so in order to better illustrate the method for selecting a vNIC primary and secondary port provided in the present application, the embodiment provides a preferred implementation of the method for selecting a vNIC primary and secondary port implemented on a cloud management layer, as shown in fig. 2, including: host management module 21, network management module 22, resource scheduling module 23, and World Wide Web (Web) interface 24;
the host management module 21 adds a new tag definition to each SR-IOV physical port of the physical host, i.e. step S110, and stores the identification information in the host table of the cloud management platform database 25, and the WEB group tag value of each SR-IOV physical port is set by the WEB interface 24.
The WEB interface 24 provides an interface for an operator to set the network group tag value. The operator may select a tag value of the network group to which each SR-IOV physical port belongs at the SR-IOV port column of the host management menu of WEB interface 24, such as one of the implementations mentioned in the examples above: the legal values of the network group labels are NG1 and NG2, which respectively indicate that the port is located in the first network group and the port is located in the second network group. After the save network group tag is set, the network group tag value for each SR-IOV physical port is sent to the host management module 21 for its saving in the database.
The network management module 22 records that each SR-IOV physical port on the host is used to count the primary port count value and the backup port count value, that is, step S201 is implemented.
The resource scheduling module 23 is responsible for selecting appropriate primary and backup ports for the vNIC device when creating the virtual machine, and the selection logic for selecting the primary and backup ports is:
s301: the SR-IOV physical ports on the target host computer in the network definition are arranged according to the ascending order of the count value of the main port, if the count values are the same, the SR-IOV physical ports are arranged according to the alphabetical order of the port slot numbers;
s302: selecting a first port arranged in ascending order in the step S301 as a main port, and recording a network group in which the port is located;
s303: the SR-IOV ports which are positioned in the network definition and belong to another network group on the target host are arranged according to the ascending order of the count values of the standby ports, and if the count values are the same, the SR-IOV ports are arranged according to the alphabetical order of the port slot numbers;
s304: selecting the port which is arranged in ascending order and is not positioned in the same drawer with the main port in the step S303 as a standby port, and entering the step S305 if the port meeting the condition does not exist;
s305: selecting the port of the first adapter which is not located in the same adapter with the main port in ascending order in the step S303 as a standby port, and if no port meeting the condition exists, entering the step S306;
s306: selecting the first port in ascending order in the step S303 as a standby port, and if the first port does not exist, entering the step S307;
s307: an error message is returned.
In the foregoing embodiments, a detailed description is given of a method for selecting a primary and secondary vNIC port, and the present application further provides an embodiment corresponding to the device for selecting a primary and secondary vNIC port. It should be noted that the present application describes an embodiment of the device portion from two angles, one based on the angle of the functional module and the other based on the angle of the hardware.
The embodiment also provides a vNIC active/standby port selection device, including:
the port label adding module is used for adding a new network label definition for each SR-IOV physical port of the physical host;
the port label setting module is used for receiving the network group label value of the SR-IOV physical port;
and the main and standby port selection module is used for selecting a main port from SR-IOV physical ports positioned in network definition on the target host when the virtual machine is created, recording a network group where the main port is positioned, and selecting a standby port from SR-IOV physical ports which are different from the network group where the main port is positioned.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
Fig. 3 is a structural diagram of a vNIC primary and secondary port selecting device according to another embodiment of the present application, and as shown in fig. 3, the vNIC primary and secondary port selecting device includes: a memory 30 for storing a computer program;
the processor 31 is configured to implement the steps of the vNIC master port selection method according to the above embodiment when executing the computer program.
The vNIC master port selection device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Processor 31 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 31 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 31 may also comprise a main processor, which is a processor for processing data in an awake state, also called central processor (Central Processing Unit, CPU), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 31 may be integrated with an image processor (Graphics Processing Unit, GPU) for rendering and rendering of content required to be displayed by the display screen. In some embodiments, the processor 31 may also include an artificial intelligence (Artificial Intelligence, AI) processor for processing computing operations related to machine learning.
Memory 30 may include one or more computer-readable storage media, which may be non-transitory. Memory 30 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 30 is at least used for storing a computer program 301, where the computer program, after being loaded and executed by the processor 31, can implement the relevant steps of a vNIC master port selection method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 30 may further include an operating system 302, data 303, and the like, where the storage manner may be transient storage or permanent storage. The operating system 302 may include Windows, unix, linux, among other things. The data 303 may include, but is not limited to, a vNIC master port selection method, and the like.
In some embodiments, a vNIC host port selection device may further include a display 32, an input/output interface 33, a communication interface 34, a power supply 35, and a communication bus 36.
Those skilled in the art will appreciate that the configuration shown in fig. 3 is not limiting of a vNIC master port selection device and may include more or fewer components than shown.
The device for selecting the main and standby ports of the vNIC provided by the embodiment of the application includes a memory and a processor, and when executing a program stored in the memory, the processor can implement the following method: a vNIC master and slave port selection method.
Finally, the present application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when executed by a processor, performs the steps as described in the method embodiments above.
It will be appreciated that the methods of the above embodiments, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored on a computer readable storage medium. With such understanding, the technical solution of the present application, or a part contributing to the prior art or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium, performing all or part of the steps of the method described in the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The method, the device and the medium for selecting the active and standby ports of the vnics provided by the application are described in detail above. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it would be obvious to those skilled in the art that various improvements and modifications can be made to the present application without departing from the principles of the present application, and such improvements and modifications fall within the scope of the claims of the present application.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (8)

1. The method for selecting the active and standby ports of the vNIC is characterized by comprising the following steps:
adding a new network tag definition for each SR-IOV physical port of the physical host;
receiving a network group tag value of the SR-IOV physical port;
when a virtual machine is created, selecting a main port from the SR-IOV physical ports located in network definition on a target host, recording a network group where the main port is located, and selecting a standby port from the SR-IOV physical ports different from the network group where the main port is located;
before the selecting the master port, further comprising:
performing corresponding addition and subtraction operations on a main port count value and a standby port count value of the SR-IOV physical port according to the use condition of the SR-IOV physical port, wherein when the virtual machine is created, the SR-IOV physical port is selected to support a vNIC main port, the main port count value is increased by 1, the SR-IOV physical port is selected to support a vNIC standby port, the standby port count value is increased by 1, when the virtual machine is migrated or deleted, the SR-IOV physical port is selected to support the vNIC main port, the main port count value is decreased by 1, the SR-IOV physical port is selected to support the vNIC standby port, and the standby port count value is decreased by 1;
correspondingly, the selecting the master port includes:
arranging the SR-IOV physical ports meeting the conditions in an ascending order according to the main port count value, and selecting the first SR-IOV physical port as the main port;
the selecting backup port comprises:
and arranging the SR-IOV physical ports meeting the conditions in ascending order according to the standby port count value, and selecting the first SR-IOV physical port as the standby port.
2. The vNIC master port selection method of claim 1, wherein the selecting the master port comprises: and selecting the SR-IOV physical port which is not located in the same drawer as the main port as the standby port.
3. The vNIC master port selection method of claim 2, wherein the selecting the master port further comprises: and when the SR-IOV physical port which is not located in the same drawer with the main port does not exist, selecting the SR-IOV physical port which is not located in the same adapter with the main port as the standby port.
4. The vNIC master port selection method of claim 1, wherein when there is no SR-IOV physical port that is different from the network group in which the master port is located, the selecting a slave port further comprises: an error message is returned.
5. The vNIC master port selection method of claim 1, further comprising: when the SR-IOV physical ports are arranged according to the main port count value or the standby port count value, if the count values are the same, the SR-IOV physical ports with the same count values are arranged according to the alphabetic order of port slot numbers.
6. A vNIC active port selection device, comprising:
the port label adding module is used for adding a new network label definition for each SR-IOV physical port of the physical host;
the port label setting module is used for receiving the network group label value of the SR-IOV physical port;
the master/slave port selection module is used for selecting a master port from the SR-IOV physical ports located in network definition on a target host when creating a virtual machine, recording a network group where the master port is located, and selecting a slave port from the SR-IOV physical ports different from the network group where the master port is located;
wherein prior to said selecting the master port, further comprising:
performing corresponding addition and subtraction operations on a main port count value and a standby port count value of the SR-IOV physical port according to the use condition of the SR-IOV physical port, wherein when the virtual machine is created, the SR-IOV physical port is selected to support a vNIC main port, the main port count value is increased by 1, the SR-IOV physical port is selected to support a vNIC standby port, the standby port count value is increased by 1, when the virtual machine is migrated or deleted, the SR-IOV physical port is selected to support the vNIC main port, the main port count value is decreased by 1, the SR-IOV physical port is selected to support the vNIC standby port, and the standby port count value is decreased by 1;
correspondingly, the selecting the master port includes:
arranging the SR-IOV physical ports meeting the conditions in an ascending order according to the main port count value, and selecting the first SR-IOV physical port as the main port;
the selecting backup port comprises:
and arranging the SR-IOV physical ports meeting the conditions in ascending order according to the standby port count value, and selecting the first SR-IOV physical port as the standby port.
7. A vNIC active port selection device, comprising:
a memory for storing a computer program;
a processor, configured to implement the steps of a vNIC master port selection method according to any one of claims 1 to 5 when executing the computer program.
8. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, the computer program implementing the steps of a vNIC master port selection method according to any one of claims 1 to 5 when executed by a processor.
CN202111555223.0A 2021-12-17 2021-12-17 vNIC main and standby port selection method, device and medium thereof Active CN114244715B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111555223.0A CN114244715B (en) 2021-12-17 2021-12-17 vNIC main and standby port selection method, device and medium thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111555223.0A CN114244715B (en) 2021-12-17 2021-12-17 vNIC main and standby port selection method, device and medium thereof

Publications (2)

Publication Number Publication Date
CN114244715A CN114244715A (en) 2022-03-25
CN114244715B true CN114244715B (en) 2023-05-23

Family

ID=80758606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111555223.0A Active CN114244715B (en) 2021-12-17 2021-12-17 vNIC main and standby port selection method, device and medium thereof

Country Status (1)

Country Link
CN (1) CN114244715B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103560967A (en) * 2013-10-17 2014-02-05 电子科技大学 Virtual data center mapping method sensing service requirement

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9628374B1 (en) * 2016-01-19 2017-04-18 International Business Machines Corporation Ethernet link aggregation with shared physical ports
CN107181679A (en) * 2016-03-09 2017-09-19 中兴通讯股份有限公司 A kind of port binding implementation method and device
CN106685695B (en) * 2016-11-28 2020-02-14 上海华为技术有限公司 Fault detection method and equipment thereof
CN113127144B (en) * 2020-01-15 2023-04-14 中移(苏州)软件技术有限公司 Processing method, processing device and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103560967A (en) * 2013-10-17 2014-02-05 电子科技大学 Virtual data center mapping method sensing service requirement

Also Published As

Publication number Publication date
CN114244715A (en) 2022-03-25

Similar Documents

Publication Publication Date Title
US11704144B2 (en) Creating virtual machine groups based on request
CN103503414B (en) A kind of group system calculating storage and merge
CN106385329B (en) Processing method, device and the equipment of resource pool
CN110098946B (en) Method and device for deploying virtualized network element equipment
US20140325036A1 (en) Defining Disjoint Node Groups for Virtual Machines with Pre-Existing Placement Policies
CN106095335B (en) A kind of electric power big data elasticity cloud computing storage platform framework method
CN113114491B (en) Method, device and equipment for constructing network topology
CN105357042A (en) High-availability cluster system, master node and slave node
CN111143039A (en) Virtual machine scheduling method and device and computer storage medium
CN111309443B (en) Virtualization method, device, equipment and storage medium of Internet of things equipment system
CN106385330A (en) Network function virtualization composer realization method and device
CN111418187A (en) Scalable statistics and analysis mechanism in cloud networks
CN106796531A (en) The management method of kernel setup information, device and electronic equipment
CN112491592B (en) Storage resource grouping method, system, terminal and storage medium
CN114244715B (en) vNIC main and standby port selection method, device and medium thereof
CN112732408A (en) Method for computing node resource optimization
CN116841728A (en) Cluster resource scheduling method and device, electronic equipment and storage medium
CN115543543A (en) Application service processing method, device, equipment and medium
CN112395269B (en) MySQL high availability group building method and device
CN110703988B (en) Storage pool creating method, system, terminal and storage medium for distributed storage
US10809927B1 (en) Online conversion of storage layout
CN113553216A (en) Data recovery method and device, electronic equipment and storage medium
CN116303154B (en) Base address register resource allocation method and medium for data processing unit
CN110908783A (en) Management and control method, system and equipment for virtual machine of cloud data center
CN111142795A (en) Control method, control device and control equipment for write operation of distributed storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant