Server and network interface card (NIC) association registration methods, devices, electronic devices, and storage media
By acquiring address information and checking the association after power failure when the server and smart network card are connected through the central control platform, the problem of cumbersome registration of servers and smart network cards in the cloud management environment is solved, and automatic association registration is achieved, which improves efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MAIPU COMM TECH CO LTD
- Filing Date
- 2022-11-22
- Publication Date
- 2026-05-26
AI Technical Summary
In a cloud-managed environment, the process of associating and registering servers with smart network interface cards is cumbersome and prone to errors, resulting in long registration times and low efficiency.
The central control platform obtains address information when the server and smart network card are connected, and performs connectivity checks after the server is powered off to determine the associated smart network card, establish the association relationship and perform persistent processing to achieve automatic association registration.
The process has been simplified, registration time has been reduced, registration efficiency has been improved, and the accuracy of registration information has been ensured.
Smart Images

Figure CN115834531B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically, to a method, apparatus, electronic device, and storage medium for associating and registering a server with a network interface card (NIC). Background Technology
[0002] With the development of data centers, server computing power has gradually become a bottleneck for business deployment. Therefore, smart network interface cards (NICs) are introduced to free up server computing power. Data centers typically manage server resources using cloud management. Before deploying services, server resource information and the information of the smart NICs they carry need to be registered with the central control platform for subsequent service deployment. Therefore, resolving the association and registration issue between servers and smart NICs in a cloud management environment is essential. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a method, apparatus, electronic device and storage medium for registering server and network interface card association.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0005] In a first aspect, the present invention provides a method for associating and registering a server with a network interface card (NIC), applied to a central control platform, wherein the central control platform is communicatively connected to a first switch and a second switch, and the method includes:
[0006] When each server to be registered accesses the central control platform through the first switch, the address information of the server to be registered is obtained, and each server to be registered is equipped with at least one smart network card to be registered.
[0007] When each of the smart network cards to be registered accesses the central control platform through the second switch, the address information of the smart network card to be registered is obtained, thus obtaining the address information of each smart network card to be registered;
[0008] After powering off each of the servers to be registered, a connectivity check is performed on each of the smart network interface cards to be registered. Each smart network interface card that is not connected is taken as an associated smart network interface card of the server to be registered, thus obtaining all the associated smart network interfaces of each server to be registered.
[0009] The address information of each server to be registered is associated with the address information of all its associated smart network interface cards and the association is persisted to obtain the associated registration information table.
[0010] In an optional implementation, the central control platform stores a first address pool, where each IP address in the first address pool belongs to a first network segment;
[0011] The step of obtaining the address information of each server to be registered when it accesses the central control platform through the first switch includes:
[0012] When the server to be registered accesses the central control platform through the first switch, an IP address is assigned to the baseboard management controller in the server to be registered according to the first address pool.
[0013] Obtain the MAC address of the baseboard management controller in the server to be registered, and bind the MAC address and IP address of the server to be registered to obtain the address information of the server to be registered.
[0014] In an optional implementation, the central control platform stores a second address pool, where each IP address in the second address pool belongs to a second network segment;
[0015] The step of obtaining the address information of the smart network card to be registered when each of the smart network cards to be registered accesses the central control platform through the second switch includes:
[0016] When the smart network card to be registered accesses the central control platform through the second switch, an IP address is assigned to the smart network card to be registered according to the second address pool;
[0017] Obtain the MAC address of the smart network card to be registered, and bind the MAC address and IP address of the smart network card to be registered to obtain the address information of the smart network card to be registered.
[0018] In an optional implementation, after establishing and persistently processing the association between the address information of each server to be registered and the address information of all its associated smart network interface cards, the method further includes:
[0019] Based on the connection port between each of the servers to be registered and the first switch, the port number corresponding to each server to be registered is obtained;
[0020] The address information of each server to be registered is associated with its corresponding port number to obtain the associated registration information table.
[0021] In an optional implementation, the method further includes:
[0022] Connectivity checks are performed on the target server at a preset period, where the target server is any one of the servers to be registered.
[0023] If the target server is not connected within a preset N periods, then the address information of the target server and the address information of all its associated smart network cards are deleted from the associated registration information table; N is a positive integer.
[0024] In an optional implementation, the method further includes:
[0025] Connectivity checks are performed on the target server at a preset period, where the target server is any one of the servers to be registered.
[0026] If the target server is not connected within a preset N periods, an alarm message for the target server is generated; N is a positive integer.
[0027] If a user's deletion operation on the target server is received, the address information of the target server and the address information of all its associated smart network cards are deleted from the associated registration information table.
[0028] If an update operation for the target server is received from a user, the address information of the target server and the address information of all its associated smart network cards are deleted from the association registration information table. Then, the new associated smart network cards of the target server are determined and the association registration information table is updated.
[0029] Secondly, the present invention provides a server-network interface card (NIC) association registration device, applied to a central control platform, wherein the central control platform is communicatively connected to a first switch and a second switch, and the device includes:
[0030] The address acquisition module obtains the address information of each server to be registered when it accesses the central control platform through the first switch. The address information of each server to be registered is obtained. Each server to be registered is equipped with at least one smart network card to be registered.
[0031] The address acquisition module is also used to obtain the address information of each smart network card to be registered when each smart network card to be registered accesses the central control platform through the second switch, thereby obtaining the address information of each smart network card to be registered;
[0032] The association registration module is used to perform a connectivity check on each smart network interface card to be registered after powering down each of the servers to be registered, and to take each unconnected smart network interface card as an associated smart network interface card of the server to be registered, thereby obtaining all associated smart network interfaces of each server to be registered.
[0033] The association registration module is also used to establish an association between the address information of each server to be registered and the address information of all its associated smart network cards and perform persistent processing to obtain an association registration information table.
[0034] In an optional embodiment, the device further includes an information maintenance module, which is used to: perform connectivity checks on the target server according to a preset period, wherein the target server is any one of the servers to be registered;
[0035] If the target server is not connected within a preset N periods, then the address information of the target server and the address information of all its associated smart network cards are deleted from the associated registration information table; N is a positive integer.
[0036] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing a computer program, wherein when the processor executes the computer program, it implements the method described in any of the foregoing embodiments.
[0037] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any one of the foregoing embodiments.
[0038] This invention provides a server-network interface card (NIC) association registration method, apparatus, electronic device, and storage medium. The central control platform obtains the address information of each server to be registered when it connects to the platform via a first switch, and the address information of each smart NIC to be registered when it connects to the platform via a second switch. Each server to be registered has at least one smart NIC. After powering down each server, a connectivity check is performed on each smart NIC. Each disconnected smart NIC is designated as an associated smart NIC of the server to be registered, resulting in a complete list of associated smart NICs for each server. Finally, the address information of each server to be registered is associated with the address information of all its associated smart NICs and persistently processed to obtain an association registration information table. By determining the smart NIC of the server through power-off, the association between the server and the smart NIC is cleverly obtained, thus achieving automatic association registration between the server and the smart NIC, simplifying the operation, reducing time, and improving registration efficiency.
[0039] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0040] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This diagram illustrates the associated registration network provided in an embodiment of the present invention.
[0042] Figure 2 A block diagram of an electronic device provided in an embodiment of the present invention is shown;
[0043] Figure 3 This invention illustrates a flowchart of a server-network interface card (NIC) association registration method provided in an embodiment of the present invention.
[0044] Figure 4 This illustration shows another flowchart of the server and network card association registration method provided in an embodiment of the present invention;
[0045] Figure 5 This illustration shows another flowchart of the server and network card association registration method provided in an embodiment of the present invention;
[0046] Figure 6 This illustration shows another flowchart of the server and network card association registration method provided in an embodiment of the present invention;
[0047] Figure 7 This diagram illustrates a functional module diagram of a server and network interface card (NIC) association registration device provided in an embodiment of the present invention.
[0048] Icons: 100 - Electronic device; 110 - Bus; 120 - Processor; 130 - Memory; 170 - Communication module; 300 - Server and network card association registration device; 310 - Address acquisition module; 330 - Association registration module; 350 - Information maintenance module. Detailed Implementation
[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0050] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0051] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0052] With the development of data centers, server computing power has gradually become a bottleneck for business deployment. Therefore, smart network interface cards (NICs) are introduced to free up server computing power. Data centers typically manage server resources using cloud management. Before deploying services, server resource information and the information of the smart NICs they carry need to be registered with the central control platform for subsequent service deployment. Therefore, resolving the association and registration issue between servers and smart NICs in a cloud management environment is essential.
[0053] In a data center cloud management environment, servers are equipped with smart network interface cards (NICs). Before deploying business instances, the address information of both the servers and the smart NICs needs to be registered with the central control platform. This allows the platform to access server resources, smart NIC resources, and the connection between the servers and the smart NICs. Currently, manual registration is commonly used. For example, deploying 1000 servers, each equipped with a smart NIC, requires first configuring the address information of all 1000 servers, then configuring the address information of each smart NIC, and finally associating each server with its associated smart NIC. Manual registration is time-consuming, cumbersome, and prone to errors. Therefore, this invention provides a server-NIC association registration method that simplifies operations, reduces registration time, improves efficiency, and ensures the accuracy of registration information through automatic association registration.
[0054] Please see Figure 1 This is a schematic diagram of an associated registration network provided by an embodiment of the present invention. It includes a central control platform, a first switch, a second switch, a server, and a smart network interface card (NIC).
[0055] The central control platform is communicatively connected to both the first and second switches. The central control platform connects to multiple servers via multiple ports expanded through the first switch, and connects to multiple smart network interface cards (NICs) via multiple ports expanded through the second switch. The central control platform has a device management application installed, which implements the server-NIC association and registration method provided in this embodiment of the invention.
[0056] Both "Switch 1" and "Switch 2" refer to switches; the different names are used only to distinguish whether they connect to a server or an intelligent network. Furthermore, all ports on the first switch are in the first Virtual Local Area Network (VLAN), i.e., the first VLAN; all ports on the second switch are in the second Virtual Local Area Network (VLAN), i.e., the second VLAN. This can be understood as configuring these two types of switches with different VLANs to ensure that the server and the intelligent network interface card (NIC) are in different network domains.
[0057] The server is a general-purpose server equipped with at least one smart network interface card (NIC) and includes a Baseboard Manager Controller (BMC). The BMC can collect various information from the server and provide it to the upper-layer network management software. It can also monitor the health status of various components in the server, such as the temperature and voltage of memory, hard drive, and fans. Therefore, the BMC will operate normally even when the server is powered off.
[0058] A smart NIC, also known as a smart network adapter, not only performs the network transmission functions of a standard NIC, but also provides a built-in programmable and configurable hardware acceleration engine to offer more computing resources.
[0059] It should be understood that, Figure 1 For illustrative purposes only, the number of the first switch, second switch, server, and smart network card can be set according to the actual application, and this embodiment of the invention does not limit the number of such components.
[0060] Please see Figure 2 This is a block diagram of an electronic device 100 provided in an embodiment of the present invention. The electronic device 100 includes a bus 110, a processor 120, a memory 130, and a communication module 170.
[0061] Bus 110 may be a circuit that connects the above-mentioned components to each other and transmits information between the components.
[0062] The processor 120 can receive commands from the other components (such as memory 130 and communication module 170) via bus 110, interpret the received commands, and perform calculations or data processing according to the interpreted commands.
[0063] The processor 120 can be an integrated circuit chip with signal processing capabilities. The processor 120 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0064] The memory 130 may store commands or data received from the processor 120 or other components (such as the communication module 170, etc.) or commands or data generated by the processor 120 or other components.
[0065] The memory 130 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), or electrically erasable programmable read-only memory (EEPROM).
[0066] The communication module 170 can be used to communicate with other node devices for signaling or data.
[0067] Understandable, Figure 2 The structure shown is only a schematic diagram of the electronic device 100. The electronic device 100 may also include components that are larger than... Figure 2 The more or fewer components shown, or having the same Figure 2 The different configurations shown. Figure 2 The components shown can be implemented using hardware, software, or a combination thereof.
[0068] The electronic device 100 provided in this embodiment of the invention can be used to implement the above. Figure 1 The central control platform, first switch, second switch, and server are shown.
[0069] The above-mentioned central control platform will be used as the execution subject to execute the various steps of the methods provided in the embodiments of the present invention and achieve the corresponding technical effects.
[0070] Please see Figure 3 , Figure 3 This is a flowchart illustrating a method for associating and registering a server with a network interface card, as provided in an embodiment of the present invention.
[0071] Step S202: When each server to be registered accesses the central control platform through the first switch, the address information of the server to be registered is obtained, and each server to be registered is equipped with at least one smart network card to be registered.
[0072] In this embodiment, the method of obtaining the address information of each server to be registered is similar, so the following explanation will use one server to be registered as an example.
[0073] A server to be registered refers to a server that needs to be registered on the central control platform. It can be first placed on the corresponding rack, then powered on to supply power, and then connected to the port of the first switch to connect to the central control platform. After detecting the connection of the server to be registered, the central control platform assigns it an IP address and obtains the address information containing the IP address for subsequent association and registration operations.
[0074] Step S204: When each smart network card to be registered accesses the central control platform through the second switch, obtain the address information of the smart network card to be registered, and obtain the address information of each smart network card to be registered.
[0075] In this embodiment, the address information of each smart network card to be registered is obtained in a similar way, so the following explanation will use a smart network card to be registered as an example.
[0076] A smart network interface card (NIC) to be registered refers to a NIC that needs to be registered on the central control platform. Since the NIC is integrated into the registration server, it powers on when the server is powered on, meaning they share a power supply. The NIC is then connected to a port on the second switch to connect to the central control platform. Upon detecting the NIC's connection, the central control platform assigns it an IP address and obtains the IP address information for subsequent registration.
[0077] Step S206: After powering off each server to be registered, perform a connectivity check on each smart network interface card to be registered, and take each unconnected smart network interface card as an associated smart network interface card of the server to be registered, thereby obtaining all associated smart network interfaces of each server to be registered.
[0078] In this embodiment, the method for determining all associated smart network cards of each server to be registered is similar, so the following explanation will use one server to be registered as an example.
[0079] Since the server to be registered shares a power supply with its onboard smart network interface card (NIC), turning off the power to the server will also turn off the power to its onboard smart NIC. Therefore, this embodiment of the invention utilizes this shared power characteristic to identify the onboard smart NIC of the server to be registered, i.e., the associated smart NIC.
[0080] After powering off the server to be registered, a connectivity check is performed on each smart network interface card (NIC) to be registered, that is, the connection status between each NIC and the central control platform is checked. If the connection status is "connected," it indicates that the NIC is not powered off and is not installed on the server to be registered; therefore, it is determined that the NIC is not associated with that server. If the connection status is "disconnected," it indicates that the NIC is powered off and is installed on the server; therefore, it is determined that the NIC is associated with that server. Obtaining each NIC with a "disconnected" connection status yields all the associated smart network interfaces of that server.
[0081] For each server to be registered, all associated smart network interface cards (NICs) can be obtained using the method described above.
[0082] Step S208: Establish an association between the address information of each server to be registered and the address information of all its associated smart network interface cards and persist the association information to obtain the associated registration information table.
[0083] In this embodiment, after identifying all associated smart network interface cards (NICs) for each server to be registered, the association registration operation is performed on each server in the same manner: the address information of the server to be registered is associated with the address information of all its associated smart NICs, and this association is persisted to ensure that when the server to be registered is subsequently enabled, the address information of the server to be registered and its associated smart NICs remains consistent with that at the time of registration. After performing the association registration operation on each server to be registered, the association registration information table is obtained.
[0084] Optionally, after completing the association registration, the server can be powered on, and then services can be distributed through its associated smart network interface card to complete the service instance deployment.
[0085] As can be seen from the above steps, the central control platform obtains the address information of each server to be registered when it connects to the platform through the first switch, and the address information of each smart network interface card (NIC) to be registered when it connects to the platform through the second switch. Each server to be registered has at least one NIC to be registered. Then, after powering down each server, a connectivity check is performed on each NIC. Each NIC that is not connected is designated as an associated NIC of the server to be registered, thus obtaining all associated NICs for each server. Finally, the address information of each server to be registered is associated with the address information of all its associated NICs and persistently processed to obtain an association registration information table. By determining the NICs of the servers by powering them down, the association between servers and NICs is cleverly obtained, thus achieving automatic association registration between servers and NICs, simplifying the operation, reducing time, and improving registration efficiency.
[0086] Optionally, for step S202 above, this embodiment of the invention provides a possible implementation method, please refer to [link to relevant documentation]. Figure 4 .
[0087] Step S202-1: When the server to be registered accesses the central control platform through the first switch, an IP address is assigned to the baseboard management controller in the server to be registered according to the first address pool.
[0088] Step S202-3: Obtain the MAC address of the baseboard management controller in the server to be registered, and bind the MAC address and IP address of the server to be registered to obtain the address information of the server to be registered.
[0089] In this embodiment, the central control platform stores a first address pool, and each Internet Protocol address (IP address) in the first address pool belongs to a first network segment. The first address pool includes occupied IP addresses and unoccupied IP addresses.
[0090] When the server to be registered connects to the central control platform through the first switch, it obtains an IP address using Dynamic Host Configuration Protocol (DHCP). Specifically, when the server to be registered connects to the central control platform, it sends a request to the platform. The central control platform receives this request and obtains an unused IP address from the first address pool, sending it to the server to allocate an IP address to the baseboard management controller within that server.
[0091] Understandably, when dynamically allocating IP addresses via DHCP, an address lease period is set, and IP addresses are reclaimed based on this lease period. However, even when the server to be registered is powered off, its baseboard management controller continues to operate normally, so the server's IP address will not change. To make the association registration between the server and the smart network card more stable, the server's IP address can be made persistent, i.e., the address lease period can be set to permanent to prevent it from aging.
[0092] The central control platform can obtain basic information about the BMC in the server to be registered, such as the physical address (Media Access Control Address), i.e., the MAC address, through the Intelligent Platform Management Interface (IPMI). Then, it binds the MAC address and IP address of the server to be registered to associate the two addresses, thus obtaining the address information of the server to be registered.
[0093] Optionally, for step S204 above, this embodiment of the invention provides a possible implementation method, please refer to [link to relevant documentation]. Figure 5 .
[0094] Step S204-1: When the smart network card to be registered accesses the central control platform through the second switch, an IP address is assigned to the smart network card to be registered according to the second address pool.
[0095] Step S204-3: Obtain the MAC address of the smart network card to be registered, and bind the MAC address and IP address of the smart network card to be registered to obtain the address information of the smart network card to be registered.
[0096] In this embodiment, the central control platform stores a second address pool, where each IP address belongs to a second network segment. The second address pool includes both occupied and unoccupied IP addresses. It is understood that the first network segment and the second network segment are different; that is, the server and the smart network card are in different network domains.
[0097] When the smart network interface card (NIC) to be registered connects to the central control platform through the second switch, the NIC obtains an IP address via DHCP. Specifically, when the NIC connects to the central control platform, it sends a request to the platform. The central control platform receives this request and obtains an unused IP address from the second address pool, sending it to the NIC to assign it an IP address.
[0098] It is understandable that, since IP addresses are dynamically allocated via DHCP and an address lease period is set and the IP address is reclaimed based on the address lease period, in order to avoid the IP address of the smart network card to be registered changing, this embodiment of the invention will perform persistent processing on the IP address of the smart network card to be registered, that is, set the address lease period to be permanent so that it will not age.
[0099] The central control platform can obtain basic information about the smart network card to be registered, such as hardware information like the MAC address, through methods such as Secure Shell (SSH) and Telnet. Then, it binds the MAC address and IP address of the smart network card to be registered to associate the two addresses, thus obtaining the address information of the smart network card to be registered.
[0100] Optionally, in order to quickly locate the server, this embodiment of the invention also provides an implementation method for obtaining the associated registration information table. Please refer to [link to relevant documentation]. Figure 6 After establishing and persisting the address information of each server to be registered with the address information of all its associated smart network interface cards in step 208, the following steps are also included:
[0101] Step 210: Obtain the port number corresponding to each server to be registered based on the connection port between each server to be registered and the first switch;
[0102] Step 212: Establish an association between the address information of each server to be registered and its corresponding port number to obtain the associated registration information table.
[0103] In this embodiment, the central control platform connects to each server to be registered through the first switch. It can then use the dynamic MAC address learning information of the first switch to determine the connection port between the first switch and each server to be registered, and obtain the number of each connection port, thus obtaining the port number corresponding to each server to be registered.
[0104] Since the MAC addresses and IP addresses of the servers to be registered are already bound, the association between IP addresses and port numbers can be indirectly established based on the MAC addresses. Each server to be registered is associated with its address information and its corresponding port number in the same way, thus obtaining the associated registration information table.
[0105] It is understandable that recording the connection information between the server to be registered and the first switch in the associated registration information table can quickly locate the server to be registered, so as to facilitate the subsequent maintenance of the associated registration information table.
[0106] Optionally, a server already registered with the central control platform can be considered as a node. Changes to the node will affect changes to the associated registration information table. Therefore, this embodiment of the invention provides an implementation method, namely:
[0107] Step S214: Perform connectivity checks on the target server according to a preset period. The target server is any server to be registered.
[0108] Step S216: If the target server is not connected within the preset N periods, delete the address information of the target server and the address information of all its associated smart network cards in the associated registration information table; N is a positive integer.
[0109] In this embodiment, the central control platform periodically performs connectivity checks on each registered server according to a preset cycle to monitor the management status of the server and its associated smart network interface card (NIC). If the server has deployed services, it is powered on, and the central control platform can communicate normally with the server and its associated smart NIC. If the server has not deployed services, it is powered off, but its BMC (Browser Management Center) is still running. In this case, the central control platform can communicate with the server, but it cannot communicate with the server's associated smart NIC.
[0110] In other words, regardless of whether the server has deployed any services, it can communicate with the central control platform, meaning all nodes exist. Therefore, this embodiment of the invention sets corresponding policies on the central control platform. If the server is unable to connect for N periods, it is determined to be abnormal. Optionally, to avoid misjudgments due to network fluctuations, appropriate periods and the value of N should be set, for example, a period of 10 minutes with N equal to 6. It should be understood that the period and the value of N can be set according to actual application, and this embodiment of the invention does not impose limitations.
[0111] Understandably, the central control platform monitors each server in a similar way, so the following explanation will use the target server as an example.
[0112] The central control platform periodically checks the connectivity of the target server. If the connection between the target server and the central control platform is consistently disconnected for N cycles, indicating that the target server and the central control platform are not connected, the target server is determined to be abnormal. Then, it is automatically assumed that the node represented by the target server is lost, and the address information of the target server and all its associated smart network cards are deleted from the associated registration information table.
[0113] Optionally, in practical applications, two situations can lead to server anomalies: one is when the server is taken offline and no longer used, and the other is when the server is powered off for a short period of time to perform smart network card update operations such as adding, deleting, or replacing it. The server anomaly caused by the latter cannot be simply attributed to node loss. Therefore, this embodiment of the invention provides another implementation method, namely:
[0114] Step S218: Perform connectivity checks on the target server according to a preset cycle. The target server is any server to be registered.
[0115] Step S220: If the target server is not connected within the preset N periods, then generate alarm information for the target server; N is a positive integer.
[0116] Step S222A: If a user's deletion operation on the target server is received, then delete the address information of the target server and the address information of all its associated smart network cards in the associated registration information table.
[0117] In step S226B, if an update operation for the target server is received from the user, the address information of the target server and the address information of all its associated smart network cards are deleted from the association registration information table. Then, the new associated smart network card of the target server is determined and the association registration information table is updated.
[0118] In this embodiment, the central control platform periodically checks the connectivity of the target server. If the target server is not connected within N cycles, it is determined that the target server is abnormal, and then an alarm message for the target server is generated to prompt the user to investigate the cause of the target server abnormality.
[0119] If the investigation reveals that the target server's abnormality was caused by its removal from the platform, the user will perform a deletion operation on the target server. Based on the deletion operation, the address information of the target server and the address information of all its associated smart network cards will be deleted from the associated registration information table.
[0120] If the investigation reveals that the target server malfunction was caused by updating the smart network interface card (NIC), the user performs an update operation on the target server. The update operation first deletes the target server's address information and the address information of all its associated smart NICs from the association registration information table. Then, it obtains the target server's IP address, powers off the target server to re-determine its associated smart NICs, establishes the association between its address information and the address information of all newly associated smart NICs, and performs persistence processing to update the association registration information table.
[0121] Understandably, after deleting the target server IP address and its associated smart network card IP address from the associated registration information table, these IP addresses are released back into the two address pools respectively, in order to achieve the purpose of reclaiming addresses.
[0122] For ease of understanding, an example is provided in this embodiment of the invention. For example, the first VLAN is VLAN10, the second VLAN is VLAN20, the first network segment is 10.0.0.0 / 24, and the second network segment is 20.0.0.0 / 24; the server to be registered is server 1; the smart network cards to be registered are smart network card A and smart network card B. The server and network card association registration method provided in this embodiment of the invention will be described below based on this example.
[0123] First, server 1 is put on the rack and powered on, and then connected to the first switch. Smart network card A and smart network card B are then connected to the second switch.
[0124] Then, Server 1 connects to the central control platform through the first switch. It requests an IP address via DHCP. The central control platform receives this request and obtains an unused IP address, such as 10.0.0.1, from the first address pool, assigning it to the BMC in Server 1. The central control platform obtains the MAC address of the BMC in Server 1, such as 10.0.1, via IPMI and binds it to the IP address of Server 1, i.e., 10.0.0.1, to obtain the address information of Server 1. For example, if Server1_BMC_IP represents the IP address of Server 1 and Server1_BMC_MAC represents the MAC address of Server 1, then we get Server1_BMC_IP(10.0.0.1) and Server1_BMC_MAC(10.0.1).
[0125] Smart NIC A connects to the central control platform via a second switch. It requests an IP address via DHCP. The central control platform receives this request and obtains an unused IP address (e.g., 20.0.0.1) from the second address pool, assigning it to Smart NIC A. The central control platform then obtains Smart NIC A's MAC address (e.g., 20.0.1) via SSH and binds it to Smart NIC A's IP address (20.0.0.1) to obtain Smart NIC A's address information. If we use NicA_IP to represent Smart NIC A's IP address and NicA_MAC to represent its MAC address, we get NicA_IP(20.0.0.1) and NicA_MAC(20.0.1).
[0126] Smart NIC B connects to the central control platform via a second switch. It requests an IP address via DHCP. The central control platform receives this request and obtains an unused IP address (e.g., 20.0.0.2) from the second address pool, assigning it to Smart NIC B. The central control platform then obtains Smart NIC B's MAC address (e.g., 20.0.2) via SSH and binds it to Smart NIC B's IP address (20.0.0.2) to obtain Smart NIC B's address information. If we use NicB_IP to represent Smart NIC B's IP address and NicB_MAC to represent its MAC address, we get NicB_IP(20.0.0.2) and NicB_MAC(20.0.2).
[0127] Next, after the central control platform powers off server 1 via IPMI, it performs a connectivity check on the smart network interface card (NIC) corresponding to each occupied IP address in the second address pool. If a smart NIC, such as smart NIC A, is found to be disconnected, it will be designated as the associated smart NIC of server 1. The address information of server 1 will be associated with the address of smart NIC A, specifically establishing the associations between Server1_BMC_IP(10.0.0.1), Server1_BMC_MAC(10.0.1), NicA_IP(20.0.0.1), and NicA_MAC(20.0.1). Server1_BMC_IP(10.0.0.1) and NicA_IP(20.0.0.1) will be persisted so that when server 1 is subsequently activated, smart NIC A will still obtain an IP address of 20.0.0.1 when using the source address 20.0.1.
[0128] The central control platform obtains the dynamic MAC address learning information of the first switch. Assuming the port number connecting server 1 to the first switch is 11, it obtains the corresponding port number VLAN 10-11 for server 1. Understandably, through MAC address learning information, the central control platform can obtain the connection status between server 1 and the first switch without manual recording. The platform establishes a relationship between server 1's address information and its corresponding port number, and records server 1's address information, its corresponding port, and the address information of smart network card A in the association information table.
[0129] Subsequently, the central control platform performs connectivity checks on server 1 according to a preset cycle. If server 1 is not connected within N cycles, it is determined that server 1 is abnormal and generates alarm information for server 1. The alarm information includes the address information of server 1, namely Server1_BMC_IP (10.0.0.1) and Server1_BMC_MAC (10.0.1), as well as its corresponding port number, namely VLAN10-11.
[0130] If server 1 is delisted, then the address information of server 1, namely Server1_BMC_IP (10.0.0.1) and Server1_BMC_MAC (10.0.1), its corresponding port VLAN10-11, and the address information of smart network card A, namely NicA_IP (20.0.0.1) and NicA_MAC (20.0.1), are deleted from the association information table. Furthermore, the IP address of server 1 (10.0.0.1) is recycled to the first address pool, and the IP address of smart network card A (20.0.0.1) is recycled to the second address pool.
[0131] If the server updates its smart NIC, then the address information of Server 1 (Server1_BMC_IP (10.0.0.1) and Server1_BMC_MAC (10.0.1), its corresponding port VLAN10-11, and the address information of Smart NIC A (NicA_IP (20.0.0.1) and NicA_MAC (20.0.1)) are deleted from the association information table. Furthermore, Server 1's IP address (10.0.0.1) is recycled to the first address pool, and Smart NIC A's IP address (20.0.0.1) is recycled to the second address pool. Then, the new associated smart NIC for Server 1 is re-determined, and the address information of Server 1, its corresponding port number, and the address information of its new associated smart NIC are updated in the association registration information table.
[0132] To perform the corresponding steps in the above embodiments and various possible methods, an implementation method of a server-network interface card (NIC) association registration device is given below. Please refer to... Figure 7 , Figure 7 This is a functional block diagram of a server and network interface card (NIC) association registration device 300 provided in this embodiment of the invention. It should be noted that the basic principle and technical effects of the server and NIC association registration device 300 provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The server and NIC association registration device 300 includes:
[0133] Address acquisition module 310 is used to obtain the address information of each server to be registered when it accesses the central control platform through the first switch. Each server to be registered is equipped with at least one smart network card to be registered.
[0134] The address acquisition module 310 is also used to obtain the address information of each smart network card to be registered when it accesses the central control platform through the second switch.
[0135] The association registration module 330 is used to perform a connectivity check on each smart network interface card to be registered after powering down each server to be registered, and to take each unconnected smart network interface card to be registered as an associated smart network interface card of the server to be registered, so as to obtain all the associated smart network interfaces of each server to be registered.
[0136] The association registration module 330 is also used to establish an association between the address information of each server to be registered and the address information of all its associated smart network cards and perform persistent processing to obtain an association registration information table.
[0137] Optionally, the address acquisition module 310 is also used to: when the server to be registered accesses the central control platform through the first switch, allocate an IP address to the baseboard management controller in the server to be registered according to the first address pool; obtain the MAC address of the baseboard management controller in the server to be registered, and bind the MAC address and IP address of the server to be registered to obtain the address information of the server to be registered.
[0138] Optionally, the address acquisition module 310 is also used to: allocate an IP address to the smart network card to be registered according to the second address pool when the smart network card to be registered accesses the central control platform through the second switch; obtain the MAC address of the smart network card to be registered, and bind the MAC address and IP address of the smart network card to be registered to obtain the address information of the smart network card to be registered.
[0139] Optionally, the association registration module 330 is further configured to: obtain the port number corresponding to each server to be registered based on the connection port between each server to be registered and the first switch; and establish an association relationship between the address information of each server to be registered and its corresponding port number to obtain an association registration information table.
[0140] Optionally, the server and network card association registration device 300 further includes an information maintenance module 350, used for: performing connectivity checks on the target server according to a preset period, where the target server is any server to be registered; if the target server is not connected within a preset N periods, then deleting the address information of the target server and the address information of all its associated smart network cards from the association registration information table; where N is a positive integer.
[0141] Optionally, the information maintenance module 350 is also used to: perform connectivity checks on the target server according to a preset period, wherein the target server is any server to be registered;
[0142] If the target server is not connected within the preset N periods, an alarm message for the target server will be generated; N is a positive integer.
[0143] If a user's deletion operation on the target server is received, the address information of the target server and the address information of all its associated smart network cards will be deleted from the associated registration information table.
[0144] If an update operation for the target server is received from a user, the address information of the target server and the address information of all its associated smart network cards are deleted from the association registration information table. Then, the new associated smart network cards of the target server are determined and the association registration information table is updated.
[0145] This invention also provides an electronic device, including a processor and a memory. The memory stores a computer program, and when the processor executes the computer program, it implements the server and network card association registration method disclosed in this invention.
[0146] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the server-network interface card association registration method disclosed in this invention.
[0147] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0148] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0149] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0150] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for registering a server and a network interface card (NIC), characterized in that, The method is applied to a central control platform, which is communicatively connected to a first switch and a second switch, and includes: When each server to be registered accesses the central control platform through the first switch, the address information of the server to be registered is obtained, and each server to be registered is equipped with at least one smart network card to be registered. When each of the smart network cards to be registered accesses the central control platform through the second switch, the address information of the smart network card to be registered is obtained, thus obtaining the address information of each smart network card to be registered; After powering off each of the servers to be registered, a connectivity check is performed on each of the smart network interface cards to be registered. Each smart network interface card that is not connected is taken as an associated smart network interface card of the server to be registered, thus obtaining all the associated smart network interfaces of each server to be registered. The address information of each server to be registered is associated with the address information of all its associated smart network interface cards and the association is persisted to obtain the associated registration information table.
2. The method according to claim 1, characterized in that, The central control platform stores a first address pool, and each IP address in the first address pool belongs to a first network segment; The step of obtaining the address information of each server to be registered when it accesses the central control platform through the first switch includes: When the server to be registered accesses the central control platform through the first switch, an IP address is assigned to the baseboard management controller in the server to be registered according to the first address pool. Obtain the MAC address of the baseboard management controller in the server to be registered, and bind the MAC address and IP address of the server to be registered to obtain the address information of the server to be registered.
3. The method according to claim 1, characterized in that, The central control platform stores a second address pool, and each IP address in the second address pool belongs to a second network segment; The step of obtaining the address information of the smart network card to be registered when each of the smart network cards to be registered accesses the central control platform through the second switch includes: When the smart network card to be registered accesses the central control platform through the second switch, an IP address is assigned to the smart network card to be registered according to the second address pool; Obtain the MAC address of the smart network card to be registered, and bind the MAC address and IP address of the smart network card to be registered to obtain the address information of the smart network card to be registered.
4. The method according to claim 1, characterized in that, After establishing and persistently storing the address information of each server to be registered with the address information of all its associated smart network interface cards, the method further includes: Based on the connection port between each of the servers to be registered and the first switch, the port number corresponding to each server to be registered is obtained; The address information of each server to be registered is associated with its corresponding port number to obtain the associated registration information table.
5. The method according to claim 1, characterized in that, The method further includes: Connectivity checks are performed on the target server at a preset period, where the target server is any one of the servers to be registered. If the target server is not connected within a preset N periods, then the address information of the target server and the address information of all its associated smart network cards are deleted from the associated registration information table; N is a positive integer.
6. The method according to claim 1, characterized in that, The method further includes: Connectivity checks are performed on the target server at a preset period, where the target server is any one of the servers to be registered. If the target server is not connected within a preset N periods, an alarm message for the target server is generated; N is a positive integer. If a user's deletion operation on the target server is received, the address information of the target server and the address information of all its associated smart network cards are deleted from the associated registration information table. If an update operation for the target server is received from a user, the address information of the target server and the address information of all its associated smart network cards are deleted from the association registration information table. Then, the new associated smart network cards of the target server are determined and the association registration information table is updated.
7. A server-network interface card (NIC) association registration device, characterized in that, The device is applied to a central control platform, which is communicatively connected to a first switch and a second switch. The device includes: The address acquisition module is used to obtain the address information of each server to be registered when it accesses the central control platform through the first switch. The address information of each server to be registered is obtained, and the server to be registered is equipped with at least one smart network card to be registered. The address acquisition module is also used to obtain the address information of each smart network card to be registered when each smart network card to be registered accesses the central control platform through the second switch, thereby obtaining the address information of each smart network card to be registered; The association registration module is used to perform a connectivity check on each smart network interface card to be registered after powering down each of the servers to be registered, and to take each unconnected smart network interface card as an associated smart network interface card of the server to be registered, thereby obtaining all associated smart network interfaces of each server to be registered. The association registration module is also used to establish an association between the address information of each server to be registered and the address information of all its associated smart network cards and perform persistent processing to obtain an association registration information table.
8. The apparatus according to claim 7, characterized in that, The device further includes an information maintenance module, which is used to: perform connectivity checks on the target server according to a preset period, wherein the target server is any one of the servers to be registered; If the target server is not connected within a preset N periods, then the address information of the target server and the address information of all its associated smart network cards are deleted from the associated registration information table; N is a positive integer.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor, when executing the computer program, implements the method of any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method of any one of claims 1 to 6.