CN114244715A - vNIC master/slave port selection method, device and medium - Google Patents

vNIC master/slave port selection method, device and medium Download PDF

Info

Publication number
CN114244715A
CN114244715A CN202111555223.0A CN202111555223A CN114244715A CN 114244715 A CN114244715 A CN 114244715A CN 202111555223 A CN202111555223 A CN 202111555223A CN 114244715 A CN114244715 A CN 114244715A
Authority
CN
China
Prior art keywords
port
standby
main
iov
vnic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111555223.0A
Other languages
Chinese (zh)
Other versions
CN114244715B (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 method, a device and a medium for selecting a vNIC main/standby port, wherein the method comprises the following steps: adding a new network label 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 which are positioned in the network definition on the target host, the network group where the main port is positioned is recorded, and a standby port is selected from SR-IOV physical ports which are different from the network group where the main port is positioned, so that the 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 master/slave port selection method, device and medium
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a method, an apparatus, and a medium for selecting a primary/secondary vNIC port.
Background
Power: performance Optimization With Enhanced RISC is one of the most common CPU architectures. The PowerVM: overview of virtualization technology on Power servers. PowerVC: the Power visualization Center is an official and unique private cloud management platform based on a Power small-sized machine server and is realized based on open source OpenStack. OpenStack: the method 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 a unified standard. At present, the PowerVM provides two ways to implement network virtualization, and when a virtual machine is deployed in an SR-IOV network virtualization way, the PowerVC selects an SR-IOV physical port to be used by the virtual machine in a network definition in a port tag way. SR-IOV: single Root I/O virtualization Single Root input/output (I/O) virtualization is an extension of the PCIe (peripheral component interconnect express) specification, and can emulate a physical PCIe device into multiple logical devices for use in different systems. vNIC: virtual Network Interface Controller, a Virtual Network adapter based on SR-IOV technology, such devices support partition online migration. And the PowerVC adopts vNIC technology when the virtual machine is deployed in a virtualized mode through the SR-IOV network. The SR-IOV supports the redundant mode to deploy the virtual machine, and the PowerVC randomly selects two mappings used 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 on the device due to the network problem, two sets of physical ethernet networks are usually present, the two sets of physical ethernet networks are connected with each other and are redundant to each other, and the physical ethernet networks of different sets correspond to different network switches. Therefore, when the virtual machine is deployed in an SR-IOV redundancy mode, and 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 at the switch level.
In the current design and implementation of PowerVC, a PowerVC cloud management platform cannot define or identify a topology structure of a traditional network, and a situation that two selected SR-IOV physical ports are connected to the same network switch may occur, at this time, a vNIC device of a virtual machine loses redundancy in the switch layer, and if the single-point switch fails, the vNIC of the virtual machine loses all network connections, resulting in a problem of service termination.
Therefore, those skilled in the art need a method for selecting a primary/standby vNIC port to solve the problem that two selected SR-IOV physical ports are connected to the same network switch in the current PowerVC design and implementation.
Disclosure of Invention
The application aims to provide a method, a device and a medium for selecting main and standby ports of a vNIC, and solves the problem that two selected SR-IOV physical ports are connected to the same network switch in the design and implementation of the conventional PowerVC.
In order to solve the above technical problem, the present application provides a method for selecting a primary/standby vNIC port, including: adding a new network label 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 which are positioned in the network definition on the target host, the network group where the main port is positioned is recorded, and a standby port is selected from SR-IOV physical ports which are different from the network group where the main port is positioned.
Preferably, selecting the alternate port comprises: an SR-IOV physical port not located in the same drawer as the primary port is selected as the standby port.
Preferably, selecting the backup port further comprises: 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 a 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: and returning error information.
Preferably, before selecting the master port, the method further comprises: 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 a 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, selecting the master port includes: the SR-IOV physical ports meeting the conditions are arranged in an ascending order according to the main port count value, and the first SR-IOV physical port is selected as a main port; selecting a standby port comprises: and arranging the SR-IOV physical ports meeting the conditions in an ascending order according to the count values of the standby ports, and selecting the first SR-IOV physical port as the standby port.
Preferably, the method further comprises the following steps: 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 value are arranged according to the alphabetical sequence of the port slot numbers.
In order to solve the above technical problem, the present application further provides a device for selecting a primary/standby vNIC port, including: the port label adding module is used for adding a new network label definition to each SR-IOV physical port of the physical host; the port label setting module is used for receiving a network group label value of the SR-IOV physical port; and the main/standby port selection module is used for selecting a main port from SR-IOV physical ports in the network definition on the target host when the virtual machine is created, recording a network group where the main port is located, and selecting a standby port from SR-IOV physical ports different from the network group where the main port is located.
In order to solve the above technical problem, the present application further provides a device for selecting a primary/standby vNIC port, including: a memory for storing a computer program; and the processor is used for implementing the steps of the method for selecting the main/standby vNIC ports when executing the computer program.
In order to solve the 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 when the computer program is executed by a processor, the steps of the method for selecting a main/standby vNIC port are implemented.
The method for selecting the main and standby ports of the vNIC adds network tags to SR-IOV physical ports, and defines the network tag value of each SR-IOV physical port by a user to distinguish the SR-IOV physical ports according to the network group where the SR-IOV physical port is located, at the moment, when a new virtual machine is created, one port is selected as a main port, the network group where the main port is located is recorded according to the network tag value of the main port, when the standby port is selected, the port of the other network group is selected to realize that the main port and the standby port are connected with different network groups, and as the ports are connected with the network groups through the network switch, the ports are connected to different network groups and are connected to different switches, thereby solving the problem that the two selected SR-IOV physical ports are connected to the same switch, the problem that if the single-point switch fails, all network connections of vNIC equipment of the virtual machine are lost, and service is terminated is further solved.
The vNIC main/standby port selection device and the computer-readable storage medium provided by the application correspond to the method and have the same effects.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a method for selecting a primary/secondary vNIC port according to the present invention;
fig. 2 is an architecture diagram of a vNIC master/slave port selection method on a cloud management layer according to the present invention;
fig. 3 is a structural diagram of a primary/secondary port selection device of a vNIC provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The core of the application is to provide a method, a device and a medium for selecting a vNIC main/standby port.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings.
When a virtual machine is deployed in an SR-IOV network virtualization manner, in the existing PowerVC design and implementation, two mappings for primary and standby ports of a vNIC are randomly selected from SR-IOV physical ports defined by a network. In an actual production environment, in order to reduce the concern that the virtual machine works due to network reasons, two sets of physical ethernet networks are deployed, and the two sets of physical ethernet networks are communicated and redundant to each other, so as to ensure that when a certain set of physical ethernet networks fails, the virtual machine can continuously provide services to the outside through the other set of physical ethernet networks. However, because the vNIC device of the virtual machine is connected to the network group through the switch, when the two ports that are randomly selected by the conventional PowerVC and used for the primary and secondary port mapping of the vNIC are located in the same network group, the two ports are connected to the network group through the same switch, which causes the vNIC device of the virtual machine to lose redundancy in the switch layer. If the single point switch fails, the vNIC of the virtual machine loses all network connections, resulting in service termination. Therefore, as shown in fig. 1, the present application provides a method for selecting a primary/standby vNIC port, including:
s110: adding a new network label 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 which are positioned in the network definition on the target host, the network group where the main port is positioned is recorded, and a standby port is selected from SR-IOV physical ports which are different from the network group where the main port is positioned.
It should be noted that, the present application does not limit the specific form of the network group tag value, and may freely select according to the actual situation and needs, but this example provides a possible implementation scheme: the legal values of the network group tags are NG1 and NG2, which respectively indicate that the port is connected to the first network group and the port is connected to the second network group, and meanwhile, when there are a greater number of network groups in actual use, the legal values of the network tags may also be NG3, NG4, etc., which is not limited to two network groups.
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: there is one master port and one standby port. In addition, when there are a plurality of selectable ports meeting the conditions described in this embodiment, this embodiment does not limit the selection logic for specifically selecting the master port or the standby port, and it is easy to understand that, no matter what selection logic is used, as long as the port that can be selected when selecting the standby port is located in a different network group from the master port, the technical effect that the master port and the standby port are not located in the same switch can be achieved.
Because the structure of a traditional network cannot be identified in the design and implementation of the conventional PowerVC, the description information of network topology is added to SR-IOV physical ports defined by the network, and an operator sets the description information, namely a network group label value to indicate a network group to which the corresponding SR-IOV physical ports are specifically connected, so that after a main port is randomly selected when a virtual machine is created, the main port can be known to be connected with the network group through the network label value, and then a port on another network group is selected when a standby port is selected, so that the main port and the standby port are not connected to the same network group, namely the same switch, and when one switch fails, vNIC equipment of the virtual machine cannot lose all network connections to cause service interruption.
As can be seen from the above description, the present application implements redundancy of the vNIC device of the virtual machine on a switch level, which does not result in losing all network connections when a single switch fails, but in actual production and use of the SR-IOV physical port to be used by the vNIC device of the virtual machine, as for the server, a plurality of physical entities are used together as a logic main body when implementing a certain function, and each physical entity constituting the logic main body may be referred to as a drawer. Therefore, if the SR-IOV physical ports corresponding to the primary port and the backup port are located in the same drawer, when the drawer fails, both the primary port and the backup port cannot work normally, and to solve this problem, this embodiment provides a preferred implementation scheme based on the above embodiment, and selecting the backup port includes:
s131: and selecting a port which is not positioned in the same drawer with the main port as the standby port.
It is easy to understand that when there is no port that simultaneously satisfies the above two conditions, a port that satisfies that the port is not in the same network group as the main port may be selected at will, or a selection and error reporting or other processes may not be performed.
The advantages of this embodiment over the above embodiments are: in this embodiment, on the basis of the above embodiment, when the backup port is selected, the selection logic is further subdivided, so that when the selected backup port is not located in the same network group as the main port, if there is a port that is not located in the same drawer as the main port, the port is selected, thereby avoiding the problem that the main port and the backup port cannot normally operate when the drawer fails, further ensuring the redundancy of the main port and the backup port on the drawer level, and enhancing the reliability.
As described in the foregoing embodiment, on the basis of ensuring the redundancy of the primary port and the backup port on the switch layer, the redundancy of the primary port and the backup port on the drawer layer is further ensured, and meanwhile, because the SR-IOV physical port is also connected to different adapters, this embodiment further provides an optimal solution on the basis of the foregoing embodiment, and selecting the backup port further includes:
s132: and when no port which is not positioned in the same drawer with the main port exists, selecting a port which is not positioned in the same adapter with the main port as a standby port.
In this embodiment, on the basis of the above embodiment, when selecting the standby port, it is determined whether the port is located in the same network group or the same drawer as the main port, and it is also determined whether the port is located in the same adapter, and a port that is not located in the same adapter as the main port is selected as the standby port, so that the main port and the standby port implement redundancy on the adapter layer, and it is ensured that when one of the adapters connected to the main port or the standby port fails, the other adapter is not affected, and reliability is further enhanced.
In the method for selecting a primary and a secondary vNIC ports provided by the present application, when selecting a secondary port, only a port that is not in the same network group as the primary port is selected, but it is inevitable that there is no port that meets the condition for selection when selecting a secondary port, so this embodiment provides an optimal implementation scheme for this problem:
s133: when there is no SR-IOV physical port different from the network group where the primary port is located, selecting the backup port further comprises returning error information.
It should be noted that, the embodiment does not limit the specific implementation of returning the error information and the specific content of the error information, and can be freely selected according to the actual situation. In addition, this embodiment is directed to a case when there is no SR-IOV physical port different from the network group where the master port is located, and if the condition mentioned in the above embodiment is not satisfied, for example, when the SR-IOV physical port is not located in the same drawer or the same adapter as the master port, whether to return the error information is not limited in this embodiment, the error information may be returned, or one may be randomly selected as the backup port when the condition that the master port is not located in the same network group is satisfied.
In the embodiment, when an SR-IOV physical port different from the network group where the main port is located does not exist for selecting as the standby port, an error message is returned to prompt an operator to process in time, so that the working reliability of the vNIC device of the virtual machine is further ensured.
Since one SR-IOV physical port can be used as a primary port or a backup port of a plurality of vNIC devices, and it is easily understood that the more tasks an SR-IOV physical port undertakes on the primary port or the backup port of a vNIC device, the larger the network traffic it carries, and when the network traffic exceeds a limit, the normal operation of the vNIC device will be affected, so this embodiment provides a preferable solution, before selecting the primary port, further comprising:
s201: 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 a 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, selecting the master port includes:
s202: the SR-IOV physical ports meeting the conditions are arranged in an ascending order according to the main port count value, and the first SR-IOV physical port is selected as a main port;
selecting a standby port comprises:
s203: and arranging the SR-IOV physical ports meeting the conditions in an ascending order according to the count values of the standby ports, and selecting the first SR-IOV physical port as the standby port.
It should be noted that, when the primary port count value or the backup port count value is arranged in an ascending order, a situation that some SR-IOV physical port count values are the same may occur, and since the SR-IOV physical ports with the same count value are not affected by how to sort the SR-IOV physical ports, the SR-IOV physical ports can be freely sorted according to actual needs, which is not limited in this embodiment, but a possible implementation scheme is provided:
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 value are arranged according to the alphabetical sequence of the port slot numbers.
It should be understood that the present embodiment only requires that the SR-IOV physical ports with the same count value be arranged according to the alphabetical order of the port slot numbers, and the present embodiment is not limited to the ascending order, the descending order or other sequential arrangement manner of the alphabetical order of the port slot numbers.
Because main and standby ports need to be allocated to the vNIC device when a virtual machine is created, each time the virtual machine is created, the corresponding count value of the SR-IOV physical port selected by the virtual machine needs to be increased, and the deletion or migration of the virtual machine indicates that the current virtual machine will stop working temporarily, and the corresponding main and standby ports are not used any more, so that the corresponding count value of the SR-IOV physical port selected by the virtual machine needs to be decreased, so that the use condition of each SR-IOV physical port can be known, when the port is allocated, the mode of selecting the first port according to the ascending sequence of the corresponding main port count value or standby port count value, that is, the selection logic when the port is selected is to preferentially select the SR-IOV physical port with less bearing tasks, thereby realizing the balanced allocation of the SR-IOV physical port load, and reducing the excessive load of a specific SR-IOV physical port, so as to become a network bottleneck of the vNIC device, thereby affecting the normal operation of the vNIC device.
When the two SR-IOV physical port counting values are the same, the two SR-IOV physical port counting values are arranged according to the alphabet sequence of the port slot numbers, so that the whole sorting process is more accurate, the alphabet of the port slot numbers is the existing attribute of the ports, the port slot numbers are used as the sorting basis, no additional new information is needed to be added, and the storage space is saved.
As can be seen from the foregoing embodiments, the method for selecting a primary and secondary vNIC port provided in this application needs to be implemented on a cloud management layer, so to better describe the method for selecting a primary and secondary vNIC port provided in this application, this embodiment provides a preferred embodiment of the method for selecting a primary and secondary vNIC port implemented on a cloud management layer, and as shown in fig. 2, the method includes: a host management module 21, a network management module 22, a resource scheduling module 23, and a World Wide Web (Web) interface 24;
the host management module 21 adds a new label definition to each SR-IOV physical port of the physical host, that is, step S110, and stores the identification information in the host table of the cloud management platform database 25, and the network group label value of each SR-IOV physical port is set by the WEB interface 24.
The WEB interface 24 provides an interface for the operator to set the tag values for the network group. The operator may select the tag value of the network group to which the SR-IOV physical port belongs for each SR-IOV physical port in the SR-IOV port column of the host management menu of the WEB interface 24, for example, one of the embodiments mentioned in the above example: the legal values of the network group tags are NG1, NG2, indicating that the port is in the first network group and the port is in the second network group, respectively. After saving the network group tag setting, the network group tag value for each SR-IOV physical port is sent to host management module 21 for 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, implement step S201.
The resource scheduling module 23 is responsible for selecting appropriate main and standby ports for the vNIC device when creating the virtual machine, and the selection logic for selecting the main and standby ports is as follows:
s301: arranging SR-IOV physical ports in the network definition on the target host according to the ascending order of the count values of the main ports, and if the count values are the same, arranging the SR-IOV physical ports according to the alphabetical order of the port slot numbers;
s302: selecting the first port in ascending order in step S301 as a master port, and recording the network group where the port is located;
s303: arranging SR-IOV ports which are positioned in the network definition and belong to another network group on the target host according to the ascending order of the count values of the standby ports, and if the count values are the same, arranging the SR-IOV ports according to the alphabetical order of the port slot numbers;
s304: selecting the port which is arranged in the ascending order in the step S303 and is not positioned in the same drawer with the main port as a standby port, and entering the step S305 if no port meeting the condition exists;
s305: selecting the port which is arranged in the ascending order in the step S303 and is not positioned in the same adapter as the main port as a standby port, and entering the step S306 if no port meeting the condition exists;
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: and returning error information.
In the foregoing embodiment, 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 the embodiments of the apparatus portion from two perspectives, one from the perspective of the function module and the other from the perspective of the hardware.
This embodiment also provides a device for selecting a primary/standby vNIC port, including:
the port label adding module is used for adding a new network label definition to each SR-IOV physical port of the physical host;
the port label setting module is used for receiving a network group label value of the SR-IOV physical port;
and the main/standby port selection module is used for selecting a main port from SR-IOV physical ports in the network definition on the target host when the virtual machine is created, recording a network group where the main port is located, and selecting a standby port from SR-IOV physical ports different from the network group where the main port is located.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
Fig. 3 is a structural diagram of a primary and secondary vNIC port selection device according to another embodiment of the present application, and as shown in fig. 3, a primary and secondary vNIC port selection device includes: a memory 30 for storing a computer program;
and a processor 31, configured to implement the steps of the method for selecting a vNIC active/standby port according to the foregoing embodiment when executing a computer program.
The vNIC active/standby port selection device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, or a desktop computer.
The processor 31 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 31 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 31 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 31 may be integrated with a Graphics Processing Unit (GPU) which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 31 may further include an Artificial Intelligence (AI) processor for processing computational 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 the following computer program 301, wherein after being loaded and executed by the processor 31, the computer program can implement the relevant steps of the vNIC active/standby port selection method disclosed in any one of the foregoing embodiments. In addition, the resources stored by the memory 30 may also include an operating system 302, data 303, and the like, and the storage may be transient storage or permanent storage. Operating system 302 may include Windows, Unix, Linux, etc. Data 303 may include, but is not limited to, a vNIC active/standby port selection method, etc.
In some embodiments, a vNIC active/standby port selection device may further include a display screen 32, an input/output interface 33, a communication interface 34, a power source 35, and a communication bus 36.
Those skilled in the art will appreciate that the configuration shown in fig. 3 is not intended to be limiting of a vNIC active/standby port selection device and may include more or fewer components than those shown.
The device for selecting the main/standby vNIC port provided by the embodiment of the application comprises a memory and a processor, wherein when the processor executes a program stored in the memory, the following method can be realized: a method for selecting a vNIC main/standby port is provided.
Finally, the 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 being executed by a processor, carries out the steps as set forth in the above-mentioned method embodiments.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The method, the device and the medium for selecting the primary and standby vNIC ports provided by the present application are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (9)

1. A method for selecting a vNIC main/standby port is characterized by comprising the following steps:
adding a new network label definition for each SR-IOV physical port of the physical host;
receiving a network group tag value for the SR-IOV physical port;
when a virtual machine is created, a main port is selected from the SR-IOV physical ports located in the network definition on a target host, a network group where the main port is located is recorded, and a standby port is selected from the SR-IOV physical ports different from the network group where the main port is located.
2. The method according to claim 1, wherein the selecting the standby port comprises: selecting the SR-IOV physical port which is not located in the same drawer with the main port as the standby port.
3. The method according to claim 2, wherein the selecting the standby port further comprises: 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.
4. The method according to claim 1, wherein when there is no SR-IOV physical port different from the network group in which the primary port is located, the selecting the secondary port further comprises: and returning error information.
5. A vNIC master/slave port selection method according to any of claims 1 to 4, further comprising, before said selecting master port:
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, and the SR-IOV physical port is selected to support the vNIC standby port, the standby port count value is decreased by 1;
correspondingly, the selecting the master port comprises:
the SR-IOV physical ports meeting the conditions are arranged in an ascending order according to the main port counting value, and the first SR-IOV physical port is selected as the main port;
the selecting of the standby port comprises:
and arranging the SR-IOV physical ports meeting the conditions in an ascending order according to the count value of the standby port, and selecting the first SR-IOV physical port as the standby port.
6. The method according to claim 5, 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 value are arranged according to the alphabetical order of port slot numbers.
7. A vNIC active/standby port selection apparatus, comprising:
the port label adding module is used for adding a new network label definition to each SR-IOV physical port of the physical host;
a port label setting module, configured to receive a network group label value of the SR-IOV physical port;
and the main/standby port selection module is used for selecting a main port from the SR-IOV physical ports in the network definition on the target host computer when the virtual machine is created, recording the 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.
8. A vNIC active/standby port selection apparatus, comprising:
a memory for storing a computer program;
a processor, configured to implement the steps of a vNIC active/standby port selection method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the steps of a vNIC master/slave port selection method according to any one of claims 1 to 6.
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 true CN114244715A (en) 2022-03-25
CN114244715B 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 (5)

* 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
US9628374B1 (en) * 2016-01-19 2017-04-18 International Business Machines Corporation Ethernet link aggregation with shared physical ports
CN106685695A (en) * 2016-11-28 2017-05-17 上海华为技术有限公司 Failure detecting method and device thereof
CN107181679A (en) * 2016-03-09 2017-09-19 中兴通讯股份有限公司 A kind of port binding implementation method and device
CN113127144A (en) * 2020-01-15 2021-07-16 中移(苏州)软件技术有限公司 Processing method, processing device and storage medium

Patent Citations (5)

* 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
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
CN106685695A (en) * 2016-11-28 2017-05-17 上海华为技术有限公司 Failure detecting method and device thereof
CN113127144A (en) * 2020-01-15 2021-07-16 中移(苏州)软件技术有限公司 Processing method, processing device and storage medium

Also Published As

Publication number Publication date
CN114244715B (en) 2023-05-23

Similar Documents

Publication Publication Date Title
US9864614B2 (en) Mapping virtual devices to computing nodes
US9092022B2 (en) Systems and methods for load balancing of modular information handling resources in a chassis
US9432301B2 (en) Defining disjoint node groups for virtual machines with pre-existing placement policies
US20060101203A1 (en) Storage virtualization apparatus
US10896058B2 (en) Managing virtual clustering environments according to requirements
US10346263B2 (en) Host swap hypervisor that provides high availability for a host of virtual machines
CN109783472A (en) Moving method, device, computer equipment and the storage medium of table data
CN106095335B (en) A kind of electric power big data elasticity cloud computing storage platform framework method
CN103609077A (en) Method, apparatus and system for data transmission, and physical adapter
CN109032788B (en) Reserved resource pool dynamic dispatching method, device, computer equipment and storage medium
CN111143039A (en) Virtual machine scheduling method and device and computer storage medium
CN114996003A (en) Cloud service deployment method and device, electronic equipment and storage medium
CN114968565A (en) Resource management method, device, electronic equipment, storage medium and server
US10552224B2 (en) Computer system including server storage system
US11055017B1 (en) Throttling a point-in-time snapshot copy operation within a data consistency application
CN104657216A (en) Resource allocation method and device for resource pool
CN114244715A (en) vNIC master/slave port selection method, device and medium
CN109828719A (en) Magnetic disc control method, device and relevant device where commitLog file based on cloud monitoring
CN110703988B (en) Storage pool creating method, system, terminal and storage medium for distributed storage
CN109558214B (en) Host machine resource management method and device in heterogeneous environment and storage medium
CN108959285A (en) Database key acquisition methods and device
CN112395269A (en) Method and device for building MySQL high-availability group
CN110908783A (en) Management and control method, system and equipment for virtual machine of cloud data center
CN116303154B (en) Base address register resource allocation method and medium for data processing unit
US9529828B1 (en) Automating configuration and migrating configurations of assets in a storage area network

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