Power supply control method and device of dual-node server, computer device and medium

By using a power control method with a single baseboard management controller and leveraging network virtualization technology, efficient management of dual-node servers is achieved. This solves the problems of uneven hardware resource allocation and security risks in traditional solutions, reducing costs and improving security.

CN120762514BActive Publication Date: 2025-12-09INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511279554.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-12-09
Estimated Expiration
2045-09-09

AI Technical Summary

Technical Problem

Traditional dual-node server baseboard management controllers suffer from uneven hardware resource allocation and low management efficiency, resulting in high material costs, complex deployment, and security risks.

Method used

A single baseboard management controller receives power control requests through the target network interface, directs them to the virtual network interface bound to the target IP address, determines the target node identifier and operation type, generates power control commands, and controls the power status of the target node through an independent data interface. This utilizes network virtualization technology to achieve physical isolation and enhanced security.

Benefits of technology

It reduced material costs, simplified deployment operations, improved security, avoided resource contention and security risks, and enabled efficient management of dual-node servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120762514B_ABST
    Figure CN120762514B_ABST
Patent Text Reader

Abstract

The application relates to a power supply control method and device of a dual-node server, computer equipment and a medium. The method comprises the following steps: receiving a power supply control request directed to a target IP address through a target network interface; directing the power supply control request to a target virtual network interface bound to the target IP address, and sending the power supply control request to a target network namespace where the target virtual network interface is located through the target virtual network interface; determining a target node identifier and a target operation type related to the power supply control request in the target network namespace; generating a power supply control instruction according to the target node identifier and the target operation type; and sending the power supply control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, so as to control the target node to execute a power supply control operation corresponding to the power supply control instruction. The method can reduce material costs, make deployment operations simple, and improve safety.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of server, and particularly relate to a power control method and device of a dual-node server, a computer device and a medium. BACKGROUND

[0002] With the rapid development of cloud computing, edge computing and high-performance computing, dual-node server architecture has gradually become the mainstream form in data centers and edge scenarios due to its high density, low power consumption and resource intensification advantages.

[0003] Traditional baseboard management controller technology mainly faces single-node design, and when extended to dual-node, it will face the problems of competition and uneven distribution of hardware resources (such as network interfaces and power control channels), thereby leading to low management efficiency of the baseboard management controller and being unable to independently control the dual-node. In order to improve the management efficiency of the baseboard management controller for the dual-node and enable the baseboard management controller to independently control the dual-node, the traditional scheme usually configures independent baseboard management controllers for each node, or introduces a complex expansion board such as a PCIe exchange chip, however, this scheme will cause a significant increase in material costs.

[0004] In addition, the traditional scheme usually divides multiple VLANs on a single physical network interface of the baseboard management controller, each VLAN corresponds to a node (such as node Node1 corresponding to VLAN 100 and node Node2 corresponding to VLAN 200), and multiple virtual IP addresses (such as IP1 and IP2) are configured, and each virtual IP address is bound to a virtual interface of a different VLAN (such as eth0.100 and eth0.200), so as to realize management traffic isolation of the dual-node. In the control logic, the baseboard management controller will specifically distinguish the target node according to the VLAN ID, and control the power state (such as on, off, reset) of each node in a time-division multiplexing manner through the GPIO pin shared by the dual-node. However, this dual-node management method must rely on a switch supporting VLAN to mark (Tagging) and isolate the management traffic, which is more complex to deploy and needs to be configured across devices, and also increases the operation and maintenance cost. Moreover, all VLAN interfaces will share the same network namespace, which will lead to global visibility of the routing table, firewall rules, socket resources (such as port numbers), etc., and there is a security risk (such as routing table conflict or leakage, firewall rule conflict, socket resource contention, etc.). SUMMARY

[0005] The present application provides a power control method and device of a dual-node server, a computer device and a medium to address the above-mentioned deficiencies or shortcomings. The method can reduce material costs, make deployment operations simple, and improve security.

[0006] According to the first aspect, the application provides a power control method of a dual-node server, the method comprising: receiving, through a target network interface, a power control request directed to a target IP address; directing the power control request to a target virtual network interface bound to the target IP address, and sending the power control request to a target network namespace in which the target virtual network interface is located through the target virtual network interface; determining, in the target network namespace, a target node identifier and a target operation type related to the power control request; generating a power control instruction according to the target node identifier and the target operation type; and sending the power control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, so as to control the target node to perform a power control operation corresponding to the power control instruction.

[0007] In some embodiments, the determining of the target node identifier and the target operation type related to the power control request comprises: when the power control request belongs to an IPMI request, determining a node identifier corresponding to the target network namespace as the target node identifier, and determining the target operation type according to a request content of the power control request; and when the power control request belongs to a Redfish request, determining the target node identifier according to a request path of the power control request, and determining the target operation type according to a request content of the power control request.

[0008] In some embodiments, the method is applied to a baseboard management controller, the dual-node server comprises a first node and a second node, the baseboard management controller comprises a first group of general-purpose input / output ports assigned to the first node and a second group of general-purpose input / output ports assigned to the second node, each group of general-purpose input / output ports comprises a plurality of general-purpose input / output ports corresponding to different operation types, and the generating of the power control instruction according to the target node identifier and the target operation type comprises: determining a target general-purpose input / output port according to the target node identifier and the target operation type, and generating the power control instruction through the target general-purpose input / output port.

[0009] In some embodiments, the method further comprises: when the number of power control requests to be processed is a plurality, obtaining association information of each power control request, the association information comprising at least one of a time stamp, a node health status and a user role, determining priority information of each power control request according to the association information of each power control request, determining a processing order of each power control request according to the priority information of each power control request, and processing each power control request according to the processing order of each power control request.

[0010] In some embodiments, the memory of the baseboard management controller comprises a first shared area and a second shared area; the first shared area is used to store the node state of a first node in the dual-node server, the power control instruction to be executed or being executed; the second shared area is used to store the node state of a second node in the dual-node server, the power control instruction to be executed or being executed; the first shared area and the second shared area each have a corresponding mutex; sending the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier comprises: detecting whether the mutex of the target shared area corresponding to the target node identifier is in an unlocked state; when the mutex of the target shared area is in the unlocked state, writing the power control instruction into the target shared area, setting the mutex of the target shared area to a locked state, and sending the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier.

[0011] The method further comprises: after sending the power control instruction, setting the mutex of the target shared area to the unlocked state.

[0012] In some embodiments, after determining the target node identifier according to the request path of the power control request and determining the target operation type according to the request content of the power control request when the power control request belongs to a Redfish request, the method further comprises: detecting whether the target node identifier is a node identifier corresponding to a target network namespace; if not, generating internal control information according to the target node identifier and the target operation type, and forwarding the internal control information to other network namespaces through a Unix domain socket; when the target network namespace is a first network namespace, the other network namespaces are second network namespaces; when the target network namespace is a second network namespace, the other network namespaces are first network namespaces.

[0013] In some embodiments, the priority information is a weight value; when the weight values of any two power control requests are different, the processing order corresponding to the power control request with the higher weight value is earlier; when the weight values of any two power control requests are the same, the processing order corresponding to the power control request with the earlier timestamp is earlier.

[0014] According to the second aspect, the application provides a power control device of a dual-node server, which comprises: a request receiving module, configured to receive a power control request directed to a target IP address through a target network interface; a namespace determining module, configured to direct the power control request to a target virtual network interface bound to the target IP address, and send the power control request to a target network namespace in which the target virtual network interface is located through the target virtual network interface; and a power control module, configured to determine a target node identifier and a target operation type related to the power control request in the target network namespace, generate a power control instruction according to the target node identifier and the target operation type, and send the power control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, so as to control the target node to perform a power control operation corresponding to the power control instruction.

[0015] According to the third aspect, the application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the power control method of the dual-node server according to any one of the above-mentioned embodiments.

[0016] According to the fourth aspect, the application provides a computer device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor is executed to implement the steps of the power control method of the dual-node server according to any one of the above-mentioned embodiments.

[0017] The power control method of the dual-node server can be applied to a baseboard management controller in the dual-node server, and the dual-node server comprises the baseboard management controller and two server nodes, i.e., a first node and a second node. Since only a single baseboard management controller is used, the material cost is cheaper. The method receives a power control request directed to a target IP address (which can be a first IP address or a second IP address) through a target network interface, then directs the power control request to a target virtual network interface bound to the target IP address, sends the power control request to a target network namespace in which the target virtual network interface is located through the target virtual network interface, finally determines a target node identifier and a target operation type related to the power control request in the target network namespace, generates a power control instruction according to the target node identifier and the target operation type, and sends the power control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, so as to control the target node to perform a power control operation corresponding to the power control instruction.

[0018] The method can realize physical isolation of power control, sensor collection and other functions, and avoid resource contention, by means of the dual-host hardware channel of the substrate management controller independently connecting the power management units of the two nodes. Moreover, by means of the network virtualization operation (including setting two independent virtual network interfaces, two independent network namespaces, configuring independent IP addresses for different virtual network interfaces, and moving the two virtual network interfaces into different network namespaces), the dual-host hardware architecture of the single substrate management controller can be deeply integrated with the virtualization network technology (such as MACVLAN), the network namespace, the external management terminal can perform power control and other operations on the first node or the second node as if it is facing two independent substrate management controllers, and the substrate management controller does not rely on a VLAN-supported switch to mark and isolate management traffic, so that the deployment is simpler and the maintenance cost is lower in implementation. Moreover, different virtual networks have independent network namespaces, and the security is higher, and problems such as routing table conflict or leakage, firewall rule conflict, and socket resource contention do not occur. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 a flowchart of a power control method for a dual-node server based on a single substrate management controller in one or more embodiments of the present application;

[0020] Figure 2 a hardware architecture diagram in one or more embodiments of the present application;

[0021] Figure 3 a system architecture diagram in one or more embodiments of the present application;

[0022] Figure 4 a structure diagram of a power control device for a dual-node server based on a single substrate management controller in one or more embodiments of the present application;

[0023] Figure 5 an internal structure diagram of a computer device in one or more embodiments of the present application. DETAILED DESCRIPTION

[0024] To make the purposes, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings. It should be clear that the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0025] The following description refers to the accompanying drawings. Unless otherwise noted, same or similar components in different drawings have same or similar reference numerals. The implementations described in the following exemplary embodiments are not meant to represent all implementations consistent with the present disclosure. Rather, they are simply examples in accordance with some aspects of the present disclosure.

[0026] In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not necessarily mean a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, "multiple" means two or more, unless otherwise specified. "And / or", which describes the association between objects, means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the associated objects before and after are in an "or" relationship.

[0027] In view of the deficiencies or defects of the related art, the present application provides a power control method for a dual-node server based on a single baseboard management controller. The method will be described in detail below through some examples.

[0028] In some embodiments, the architecture of the dual-node server in relation to the above power control method is introduced as follows:

[0029] The dual-node server includes a single baseboard management controller (BMC) and two server nodes (also referred to as host nodes), namely a first node (which can be marked as node1) and a second node (which can be marked as node2).

[0030] The baseboard management controller needs to have a dual-host hardware channel, which includes two data interfaces, namely a first data interface and a second data interface. When the baseboard management controller selects an ASPEED 2750 chip, the dual-host hardware channel is specifically a dual-LTPI (Low Speed Tunneled Protocol Interface) interface, which can be represented as LTPI Channel 0 and LTPI Channel 1.

[0031] The baseboard management controller needs to connect the power management units of the first node and the second node in the dual-node server through the first data interface and the second data interface, that is, the first data interface connects the power management unit (PMU) of the first node, and the second data interface connects the power management unit of the second node. On this basis, the first data interface can independently control the power state of the first node, that is, power on, power off, and reset, and the second data interface can independently control the power state of the second node. In addition, the baseboard management controller can also allocate two groups of general-purpose input / output ports (GPIO) on the hardware, that is, a group of GPIO pins (which can be referred to as general-purpose input / output ports) are used to generate power control instructions (including power on, power off, reset, etc.) of the first node, and another group of GPIO pins are used to generate power control instructions of the second node. Generally, each group of GPIO pins includes 3 GPIO pins, and different pins are used to generate different power control instructions. For example, the GPIO pins corresponding to the first node are GPIO12 (power on), GPIO13 (power off), and GPIO14 (reset), and the GPIO pins corresponding to the second node are GPIO16 (power on), GPIO17 (power off), and GPIO18 (reset). In this way, the power control instructions of the first node and the second node can be completely isolated at the physical layer, avoiding the case of one line controlling two nodes. In addition, the dual-host hardware channel can also be enabled in the firmware configuration of the baseboard management controller, and an independent interrupt controller (IRQ) and DMA (Direct Memory Access) buffer are allocated for each node.

[0032] The target network interface of the baseboard management controller is created with a first virtual network interface and a second virtual network interface. The target network interface is a physical network interface on the baseboard management controller. Two virtual network interfaces can be created on the target network interface through MAC (Media Access Control)-VLAN (Virtual Local Area Network) technology, such as a first macvlan interface and a second macvlan interface.

[0033] The baseboard management controller is also configured with a first network namespace and a second network namespace corresponding to the first node and the second node respectively. The first network namespace (may be labeled as ns1) and the second network namespace (may be labeled as ns2) are two different network namespaces. A network namespace is a mechanism in a Linux system for isolating network stack resources such as network devices, IP (Internet Protocol) addresses, routing tables, port numbers, etc. Each network namespace has its own independent network configuration, just like an independent network environment. This isolation enables different processes, containers or virtual machines to have completely independent network views without interfering with each other, avoiding problems such as routing table conflicts or leaks, firewall rule conflicts, socket resource contention, etc. that often occur when multiple virtual networks share the same network namespace.

[0034] The first virtual network interface and the second virtual network interface are configured in the first network namespace and the second network namespace respectively. The first virtual network interface and the second virtual network interface are bound to a first IP address and a second IP address respectively, and the first IP address and the second IP address are two independent IP addresses. The first virtual network interface is bound to the first IP address, and the second virtual network interface is bound to the second IP address. On this basis, the first virtual network interface is also bound to a first MAC address, and the second virtual network interface is bound to a second MAC address. The first MAC address and the second MAC address are two independent MAC addresses. A MAC address (Media Access Control Address) is commonly known as a media access control address, a local area network address, a hardware address, etc.

[0035] In the above two-node server architecture, the power management units of the two nodes are independently connected through the dual-host hardware channel of the baseboard management controller, so that physical isolation of power control, sensor collection and other functions can be achieved, and resource contention can be avoided. Moreover, through specific network virtualization operations (including setting two independent virtual network interfaces, two independent network namespaces, configuring independent IP addresses for different virtual network interfaces, and moving the two virtual network interfaces into different network namespaces), the dual-host hardware architecture of the single baseboard management controller can be deeply integrated with virtualized network technologies (such as MAC-VLAN) and network namespaces. The external management terminal can perform power control operations on the first node or the second node as if it is facing two independent baseboard management controllers. The baseboard management controller does not rely on a VLAN-enabled switch to mark and isolate management traffic, so the deployment is simpler and the maintenance cost is lower. Moreover, different virtual networks have independent network namespaces, which are more secure and do not have problems such as routing table conflicts or leaks, firewall rule conflicts, socket resource contention, and the like.

[0036] Please refer to Figure 1 The method includes steps S110 to S130. In the following, the method is applied to the baseboard management controller as an example, and is described in combination with the hardware architecture diagram shown in Figure 2 and the system architecture diagram shown in Figure 3 .

[0037] S110: Receive a power control request directed to a target Internet Protocol address through a target network interface.

[0038] After the baseboard management controller is powered on, the firmware will perform a series of initialization operations. These operations include allocating data interfaces for the first node and the second node, and allocating corresponding GPIO pins for the first node and the second node.

[0039] After the initialization operation is completed, the Linux kernel of the baseboard management controller loads a network virtualization module (a MACVLAN module) and a network namespace module. The network virtualization module creates two virtual network interfaces on the physical network interface (such as an eth0 interface) of the baseboard management controller, such as a virtual local area network interface 0 (which can be identified as macvlan0) based on the physical network interface and a virtual local area network interface 1 (which can be identified as macvlan1) based on the physical network interface, and the mode can be bridge. The network namespace module creates two independent network namespaces, such as a first network namespace (which can be identified as ns1) and a second network namespace (which can be identified as ns2), and moves different virtual network interfaces into different network namespaces to achieve network namespace isolation. On this basis, the baseboard management controller configures independent MAC addresses (such as mac1 and mac2) for each virtual network interface, and allocates independent IP addresses (such as a first address (which can be identified as ip1, or referred to as a first IP address) and a second address (which can be identified as ip2, or referred to as a second IP address)) to each virtual network interface through a DHCP (Dynamic Host Configuration Protocol).

[0040] The power control request is a request sent by the external management end to control the power state of the first node or the second node. The target IP address is an IP address to which the power control request is directed, which can be the first IP address or the second IP address. A binding relationship can be set in advance between the IP address, the network namespace, and the node, such as: the first IP address corresponds to the first network namespace, the first network namespace corresponds to the first node, the second IP address corresponds to the second network namespace, and the second network namespace corresponds to the second node.

[0041] The power control request can be a request sent by the external management end through a specific protocol. The specific protocol can be an IPMI (Intelligent Platform Management Interface) protocol or a Redfish protocol. The Redfish protocol (which can be referred to as the Redfish protocol) is an open industry standard protocol based on a RESTful API (Application Programming Interface) and is dedicated to the out-of-band management of hardware devices (such as servers, storage, and network devices).

[0042] S120: Direct the power control request to the target virtual network interface of the binding target IP address, and send the power control request to the target network namespace in which the target virtual network interface is located through the target virtual network interface.

[0043] The kernel is pre-configured with a target IP-based traffic direction rule, for example, "traffic with target IP ip1 is transmitted through macvlan0, and traffic with target IP ip2 is transmitted through macvlan1".

[0044] After receiving the power control request, the power control request is directed to the target virtual network interface based on the traffic direction rule. The target virtual network interface can be the first virtual network interface or the second virtual network interface. It is determined according to the target IP address. When the target IP address is the first IP address, it is the first virtual network interface, and when the target IP address is the second IP address, it is the second virtual network interface.

[0045] After the target virtual network interface receives the power control request, it sends it to the target network namespace. The target network namespace refers to the network namespace where the target virtual network interface is located. When the target virtual network interface is the first virtual network interface, the target network namespace is the first network namespace; when the target virtual network interface is the second virtual network interface, the target network namespace is the second network namespace.

[0046] S130: In the target network namespace, determine the target node identifier and the target operation type related to the power control request; generate a power control instruction according to the target node identifier and the target operation type; send the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier, to control the target node to execute the power control operation corresponding to the power control instruction.

[0047] Each node has a corresponding unique node identifier, and the target node identifier refers to the node identifier of the target node. For example, the node identifier of node 1 can be node1, and the node identifier of node 2 can be node2. The target operation type refers to the power control operation that the external management end wants to perform on the target node, such as starting, shutting down, or resetting.

[0048] The external management end can use multiple protocols to send the power control request. Therefore, the baseboard management controller will determine the target node identifier and the target operation type related to the power control request according to the protocol type used by the power control request.

[0049] When the power control request belongs to an IPMI request (i.e., the protocol used by the power control request is the IPMI protocol), the node identifier corresponding to the target network namespace is determined as the target node identifier, and the target operation type is determined according to the request content of the power control request. The operation of determining the target operation type according to the request content of the power control request can be to extract the relevant information of the operation type from the request content and use it as the target operation type.

[0050] When the power control request belongs to a Redfish request (i.e., the protocol used by the power control request is the Redfish protocol), the target node identifier is determined according to the request path of the power control request, and the target operation type is determined according to the request content of the power control request. The target node identifier can be determined according to the request path of the power control request, that is, the node identifier carried in the request path is extracted as the target node identifier. For example, the node identifier of the first node is CPU1, and the request path in the power control request is / redfish / v1 / Systems / CPU1. Then, the information "CPU1" can be extracted, and it is determined that the target node identifier is the first node. The operation of determining the target operation type according to the request content of the power control request can still be to extract the relevant information of the operation type from the request content, and take it as the target operation type.

[0051] As for the operation of generating the power control instruction according to the target node identifier and the target operation type, it is used to determine the target general input and output port, and the power control instruction is generated by using the port.

[0052] In some embodiments, the baseboard management controller includes a first group of general input and output ports assigned to the first node and a second group of general input and output ports assigned to the second node; each group of general input and output ports includes a plurality of general input and output ports corresponding to different operation types. On this basis, the operation of generating the power control instruction according to the target node identifier and the target operation type includes:

[0053] (1) determining the target general input and output port according to the target node identifier and the target operation type; for example, the GPIO pins corresponding to the first node are GPIO12 (power on), GPIO13 (power off), and GPIO14 (reset), the GPIO pins corresponding to the second node are GPIO16 (power on), GPIO17 (power off), and GPIO18 (reset). Assuming that the target node identifier is the identifier of the first node, and the target operation type is power on, the target general input and output port can be determined as GPIO12 (power on).

[0054] (2) generating the power control instruction by the target general input and output port. After the target general input and output port is determined, the target general input and output port can be controlled to generate the power control instruction, which can be a level pulse.

[0055] In some embodiments, two instances are deployed in each network namespace, that is, an instance using the IPMI protocol, which can be referred to as an IPMI service instance, and an instance using the Redfish protocol, which can be referred to as a Redfish service instance.

[0056] In the first network namespace and the first network namespace, respectively, an IPMI service instance is running, which is responsible for listening to the 623 port. When it receives a power control request, it will determine the target node (such as CPU1 or CPU2) according to the target IP address (ip1 or ip2) pointed by the request. After determining the target node, it will determine the target node identifier and the target operation type according to the operation of the above embodiment. Then it will pass these information to the LTPI control module of the target node through the shared memory, and the LTPI control module will control the target general input / output port to generate a power control signal.

[0057] In the first network namespace and the first network namespace, respectively, a Redfish service instance is running, which listens to the 443 port and supports RESTful API. When the Redfish service instance receives a power control request, it parses the request path (such as / redfish / v1 / Systems / CPU1), and then determines the target node identifier. Then it will process the power control request in the target network namespace (such as the first network namespace).

[0058] This embodiment can deploy a dual-IPMI / Redfish protocol stack instance in an independent network namespace (ns1 or ns2), and can use a lock-free queue (Ring Buffer) to isolate resources.

[0059] In some embodiments, the method further comprises: when the number of power control requests to be processed is multiple, obtaining the association information of each power control request, the association information including at least one of a timestamp, a node health state and a user role, determining the priority information of each power control request according to the association information of each power control request, determining the processing order of each power control request according to the priority information of each power control request, and processing each power control request according to the processing order of each power control request.

[0060] When the weight values of any two power control requests are different, the higher the weight value, the earlier the processing order, and if their weight values are the same, the earlier the timestamp, the earlier the processing order.

[0061] This embodiment can avoid conflicts in processing power control requests by setting a priority calculation strategy.

[0062] The timestamp is a timestamp carried by the power control request, and the node health status can be a health status of a node corresponding to a target node identification related to the power control request. The BMC can collect the power state and the health status (such as healthy, good, and poor) of each node through a data interface. The user role is information (such as a position) carried in the power control request itself or determined by the baseboard management controller according to a user identification in the power control request. Taking the association information including the timestamp, the node health status, and the user role as an example, the priority information of the power control request can be calculated through the three pieces of information. The priority information can be a weight value. The weight value can be calculated by the following formula:

[0063] ;

[0064] First, the timestamp (T cmd ), the node health status (H node ), and the user role (R) are converted into numerical values according to a preset rule. Then, the weight value (i.e., W) can be obtained by substituting the values into the formula. In the formula, T current refers to the current time. In the formula, 0.5, 0.3, and 0.2 are coefficients corresponding to the timestamp, the node health status, and the user role, respectively. The sum of the three coefficients is 1, and the values of the coefficients can be adjusted according to actual needs. For example, the coefficients can be set according to the importance of the timestamp, the node health status, and the user role. The higher the importance, the higher the coefficient.

[0065] In some embodiments, a shared memory (such as / dev / shm / node_control) is pre-allocated in the memory of the baseboard management controller. The shared memory includes two regions, i.e., a first shared region and a second shared region. The first shared region is used to store the node state of the first node and the power control instruction to be executed or being executed. The second shared region is used to store the node state of the second node and the power control instruction to be executed or being executed. The first shared region and the second shared region each have a corresponding mutex. On this basis, the operation of sending the power control instruction to the target node corresponding to the target node identification through the data interface corresponding to the target node identification includes: detecting whether the mutex of the target shared region corresponding to the target node identification is in an unlocked state; when the mutex of the target shared region is in the unlocked state, writing the power control instruction into the target shared region, setting the mutex of the target shared region to a locked state, and sending the power control instruction to the target node corresponding to the target node identification through the data interface corresponding to the target node identification. Correspondingly, the method further includes: after sending the power control instruction, setting the mutex of the target shared region to the unlocked state.

[0066] By setting the mutex for the shared region corresponding to each node, atomic operation can be ensured.

[0067] In some embodiments, after determining the target node identifier according to the request path of the power control request and determining the target operation type according to the request content of the power control request when the power control request belongs to a Redfish request, the method further includes: detecting whether the target node identifier is a node identifier corresponding to the target network namespace; if not, generating internal control information according to the target node identifier and the target operation type, and forwarding the internal control information to another network namespace through a Unix domain socket; when the target network namespace is the first network namespace, the other network namespace is the second network namespace; when the target network namespace is the second network namespace, the other network namespace is the first network namespace.

[0068] The internal control information includes the target node identifier and the target operation type. When the target node identifier is not a node identifier corresponding to the target network namespace, information transmission across network namespaces can be achieved through a Unix domain socket. The Unix domain socket can implement a bidirectional communication channel (such as / var / run / node_comm.sock), which has a lower delay, usually less than or equal to 50 microseconds.

[0069] It should be noted that, as for each step included in the power control method of the dual-node server based on a single baseboard management controller provided in any one of the above embodiments, unless otherwise specified herein, the execution of these steps does not have strict order restrictions, and these steps can be executed in other orders. Moreover, at least part of these steps can include multiple sub-steps or multiple stages, which do not necessarily be executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages does not necessarily be sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.

[0070] Based on the same inventive concept, the present application also provides a power control device of a dual-node server based on a single baseboard management controller. In some embodiments, as shown in Figure 4 The device includes the following modules:

[0071] The request receiving module 110 is configured to receive a power control request directed to a target IP address through a target network interface; the target IP address is a first IP address or a second IP address;

[0072] The namespace determining module 120 is configured to direct the power control request to a target virtual network interface that binds the target IP address, and send the power control request to a target network namespace where the target virtual network interface is located through the target virtual network interface;

[0073] The power supply control module 130 is configured to determine a target node identifier and a target operation type related to the power supply control request in the target network namespace, generate a power supply control instruction according to the target node identifier and the target operation type, and send the power supply control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, so as to control the target node to perform a power supply control operation corresponding to the power supply control instruction.

[0074] In some embodiments, the power supply control module 130 determines the target node identifier and the target operation type related to the power supply control request, including: when the power supply control request belongs to an IPMI request, determining a node identifier corresponding to the target network namespace as the target node identifier, and determining the target operation type according to the request content of the power supply control request; when the power supply control request belongs to a Redfish request, determining the target node identifier according to the request path of the power supply control request, and determining the target operation type according to the request content of the power supply control request.

[0075] In some embodiments, the baseboard management controller includes a first group of general input / output ports assigned to the first node and a second group of general input / output ports assigned to the second node; each group of general input / output ports includes a plurality of general input / output ports corresponding to different operation types; accordingly, the power supply control module 130 generates the power supply control instruction according to the target node identifier and the target operation type, including: determining a target general input / output port according to the target node identifier and the target operation type; and generating the power supply control instruction through the target general input / output port.

[0076] In some embodiments, the device further includes a priority calculation module. The priority calculation module is configured to: when the number of power supply control requests to be processed is a plurality, obtain associated information of each power supply control request, the associated information including at least one of a timestamp, a node health state and a user role, determine priority information of each power supply control request according to the associated information of each power supply control request, determine a processing order of each power supply control request according to the priority information of each power supply control request, and process each power supply control request according to the processing order of each power supply control request.

[0077] In some embodiments, the memory of the baseboard management controller comprises a first shared area and a second shared area; the first shared area is used to store the node state of the first node and the power control instruction to be executed or being executed; the second shared area is used to store the node state of the second node and the power control instruction to be executed or being executed; the first shared area and the second shared area each have a corresponding mutex; accordingly, the step of the power control module 130 sending the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier, comprises: detecting whether the mutex of the target shared area corresponding to the target node identifier is in an unlocked state; when the mutex of the target shared area is in the unlocked state, writing the power control instruction into the target shared area, setting the mutex of the target shared area to a locked state, and sending the power control instruction to the target node corresponding to the target node identifier through the data interface corresponding to the target node identifier.

[0078] The power control module 130 is further configured to set the mutex of the target shared area to the unlocked state after sending the power control instruction.

[0079] In some embodiments, after determining the target node identifier according to the request path of the power control request and determining the target operation type according to the request content of the power control request when the power control request belongs to a Redfish request, the power control module 130 is configured to: detect whether the target node identifier is a node identifier corresponding to a target network namespace; if not, generate internal control information according to the target node identifier and the target operation type, and forward the internal control information to other network namespaces through a Unix domain socket; when the target network namespace is a first network namespace, the other network namespaces are second network namespaces; when the target network namespace is a second network namespace, the other network namespaces are first network namespaces.

[0080] In some embodiments, the priority information is a weight value; when the weight values of any two power control requests are different, the processing order of the power control request corresponding to the higher weight value is earlier; when the weight values of any two power control requests are the same, the processing order of the power control request corresponding to the earlier timestamp is earlier.

[0081] The specific definitions of the power control apparatus of the dual-node server based on the single baseboard management controller can refer to the definitions of the power control method of the dual-node server based on the single baseboard management controller, which will not be repeated here. Each module in the power control apparatus of the dual-node server based on the single baseboard management controller can be implemented by software, hardware, or a combination thereof, in whole or in part. Each module can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0082] The computer device provided in the present application includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the power control method of the dual-node server based on the single baseboard management controller provided in any of the above embodiments can be implemented.

[0083] In some embodiments, the internal structure of the computer device can be as shown in Figure 5 The computer device includes a processor, a memory, and a network interface connected by a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store data such as sorting task information corresponding to a package, and the specific data stored can refer to the definitions in the above method embodiments. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a power control method of a dual-node server based on a single baseboard management controller.

[0084] Those skilled in the art can understand that Figure 5 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0085] The computer readable storage medium provided in the present application stores a computer program in some embodiments. When the computer program is executed by the processor, the steps of the power control method of the dual-node server based on the single baseboard management controller provided in any of the above embodiments can be implemented.

[0086] In the above-described embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0087] Those skilled in the art can understand that all or part of the processes in the above-mentioned method embodiments can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiments of the method. Any reference to memory, storage, database or other medium used in each embodiment provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink), DRAM (SLDRAM), memory bus (Rambus), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0088] Each technical feature of the above embodiments can be combined arbitrarily. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present application.

[0089] The above-described embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of the present application.

Claims

1. A power control method of a dual-node server based on a single baseboard management controller, the method comprising: The method is applied to a baseboard management controller; the dual-node server comprises a first node and a second node; a first virtual network interface and a second virtual network interface are created on a target network interface of the baseboard management controller, and the baseboard management controller is configured with a first network namespace and a second network namespace corresponding to the first node and the second node respectively; The first virtual network interface and the second virtual network interface are configured in the first network namespace and the second network namespace respectively; the method comprises: receiving, through the target network interface, a power control request directed to a target IP address; directing the power control request to a target virtual network interface binding the target IP address, and sending the power control request to a target network namespace in which the target virtual network interface is located through the target virtual network interface; in the target network namespace, determining a target node identifier and a target operation type related to the power control request, generating a power control instruction according to the target node identifier and the target operation type, and sending the power control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, so as to control the target node to perform a power control operation corresponding to the power control instruction.

2. The method of claim 1, wherein, Determining the target node identifier and the target operation type related to the power control request comprises: when the power control request belongs to an IPMI request, determining a node identifier corresponding to the target network namespace as the target node identifier, and determining a target operation type according to the request content of the power control request; when the power control request belongs to a Redfish request, determining a target node identifier according to the request path of the power control request, and determining a target operation type according to the request content of the power control request.

3. The method of claim 1, wherein, The baseboard management controller comprises a first group of general-purpose input / output ports assigned to the first node and a second group of general-purpose input / output ports assigned to the second node; each group of general-purpose input / output ports comprises a plurality of general-purpose input / output ports corresponding to different operation types; Generating a power control instruction according to the target node identifier and the target operation type comprises: determining a target general-purpose input / output port according to the target node identifier and the target operation type; generating a power control instruction through the target general-purpose input / output port.

4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: when the number of the power control requests to be processed is multiple, obtaining association information of each power control request, the association information comprising at least one of a timestamp, a node health state and a user role, determining priority information of each power control request according to the association information of each power control request, determining a processing order of each power control request according to the priority information of each power control request, and processing each power control request according to the processing order of each power control request.

5. The method of claim 4, wherein, The memory of the baseboard management controller comprises a first shared area and a second shared area; the first shared area is used to store the node state of a first node in a dual-node server, and power control instructions to be executed or being executed; the second shared area is used to store the node state of a second node in the dual-node server, and power control instructions to be executed or being executed; the first shared area and the second shared area each have a corresponding mutex lock; The power control instructions are sent to the target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, including: Detecting whether the mutex lock of the target shared area corresponding to the target node identifier is in an unlocked state; When the mutex lock of the target shared area is in the unlocked state, writing the power control instructions into the target shared area, setting the mutex lock of the target shared area to a locked state, and sending the power control instructions to the target node corresponding to the target node identifier through a data interface corresponding to the target node identifier; The method further comprises: After sending the power control instructions, setting the mutex lock of the target shared area to the unlocked state.

6. The method of claim 2, wherein, After the power control request belongs to a Redfish request, and the target node identifier is determined according to the request path of the power control request, and the target operation type is determined according to the request content of the power control request, the method further comprises: Detecting whether the target node identifier is a node identifier corresponding to the target network namespace; If not, generating internal control information according to the target node identifier and the target operation type, and forwarding the internal control information to other network namespaces through a Unix domain socket; when the target network namespace is a first network namespace, the other network namespaces are second network namespaces; when the target network namespace is the second network namespace, the other network namespaces are the first network namespaces.

7. The method of claim 4, wherein, The priority information is a weight value; when the weight values of any two power control requests are different, the processing order corresponding to the power control request with a higher weight value is earlier; when the weight values of any two power control requests are the same, the processing order corresponding to the power control request with an earlier timestamp is earlier.

8. A power control device for a dual-node server based on a single-board management controller, characterized in that, The device is applied to a baseboard management controller; the dual-node server comprises a first node and a second node; a first virtual network interface and a second virtual network interface are created on a target network interface of the baseboard management controller, and the baseboard management controller is configured with a first network namespace and a second network namespace corresponding to the first node and the second node respectively; The first virtual network interface and the second virtual network interface are configured in the first network namespace and the second network namespace respectively; the device comprises: A request receiving module configured to receive a power control request directed to a target IP address through a target network interface; A namespace determining module is configured to direct the power control request to a target virtual network interface that binds the target IP address, and send the power control request to a target network namespace in which the target virtual network interface is located through the target virtual network interface. A power control module is configured to determine a target node identifier and a target operation type related to the power control request in the target network namespace, generate a power control instruction according to the target node identifier and the target operation type, and send the power control instruction to a target node corresponding to the target node identifier through a data interface corresponding to the target node identifier, so as to control the target node to perform a power control operation corresponding to the power control instruction.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 7.

10. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Information processing method and device, equipment and medium

    CN116521416A

  • Port forwarding method and device, computer equipment and storage medium

    CN117749702A