A bare metal device on-ramp admission method, device, apparatus and storage medium

CN122933412APending Publication Date: 2026-10-16HANGZHOU WULIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611260836.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-19
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

然而相关技术中人工录入MAC地址不可靠,同一交换机并发探测相互影响以及未经验证裸金属设备进入设备池等,导致裸金属设备上架不准确且效率低

Benefits of technology

[0016] As can be seen, the bare metal device racking access method provided in this application binds the power wiring information and network wiring information of the same bare metal device to be racked, associating and binding the power port and switch port, thus solving the problem of disconnected power wiring and network wiring, and the inability to verify that they correspond to the same device. By sequentially performing power-off, MAC table clearing, and power-on operations, and waiting a preset time after power-on before reading the switch port MAC address, historical residual MAC table entries in the switch can be cleared, avoiding misidentification caused by historical records and data from other devices. Access verification is performed on the read MAC address, probe task status, and wiring relationship occupancy status. After the access verification is passed, a bare metal device record is automatically generated and written with preset information, replacing manual MAC address entry and eliminating manual entry errors. This enables automated, highly reliable, and efficient racking access for bare metal devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122933412A_ABST
    Figure CN122933412A_ABST
Patent Text Reader

Abstract

The application discloses a bare metal device on-rack admission method and device, equipment and storage medium, relates to the technical field of bare metal device management, and includes the following steps: receiving power connection information and network connection information of a bare metal device to be on-racked; saving the power connection information and the network connection information, and creating a detection task; obtaining a switch dimension mutual exclusion lock according to a switch device identifier in the detection task; if the switch dimension mutual exclusion lock is obtained, performing a preset operation on a power port; the preset operation at least includes a power-off operation and a power-on operation; after the power port is powered off, cleaning a MAC table; after the power port is powered on, reading a switch MAC table and screening a MAC address corresponding to a switch port after waiting for a preset time; performing admission verification; if the admission verification is passed, creating a bare metal device record, and writing preset information of the bare metal device to be on-racked into the bare metal device record. The method can improve the accuracy and efficiency of the bare metal device on-rack.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of bare metal equipment management technology, and in particular to a method, apparatus, device and storage medium for bare metal equipment rack access. Background Technology

[0002] Bare metal devices refer to physical devices that do not have a pre-installed virtualization layer, do not run a virtual machine operating system, and directly deliver complete physical hardware resources to the user. In related technologies, bare metal device installation typically relies on manual operation. Field personnel connect the bare metal device's power cord to the designated power supply port and the network cable to the designated switch port, then manually record the MAC address, switch port, and physical location. However, manual MAC address entry in these technologies is unreliable, concurrent probes on the same switch can interfere with each other, and unverified bare metal devices can enter the device pool, leading to inaccurate and inefficient bare metal device installation.

[0003] Therefore, how to solve the above-mentioned technical defects has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, device, and storage medium for bare metal device rack access, which can improve the accuracy and efficiency of bare metal device rack access.

[0005] To address the aforementioned technical problems, this application provides a method for rack access approval of bare metal equipment, comprising: Receive power connection information and network connection information of the bare metal device to be racked; the power connection information includes the power supply device and power port connected to the bare metal device to be racked; the network connection information includes the switch device and switch port connected to the bare metal device to be racked. Save the power connection information and network connection information, and create a detection task; Obtain a switch-dimensional mutex lock based on the switch device identifier in the detection task; if no switch-dimensional mutex lock is obtained, it indicates that a detection task is already being executed for the same switch device; if a switch-dimensional mutex lock is obtained, it indicates that no detection task is being executed for the same switch device. If a switch-level mutex lock is acquired, a preset operation is performed on the power port; the preset operation includes at least a power-off operation and a power-on operation; the power-off operation and the power-on operation are performed sequentially. After power is turned off at the power port, clear the MAC table; After the power port is powered on, the switch MAC table is read and the MAC address corresponding to the switch port is filtered after a preset time is waited. The MAC address, probe task status, and wiring relationship occupancy status are subject to access verification. If the access verification passes, a bare metal device record is created, and the preset information of the bare metal device to be racked is written into the bare metal device record.

[0006] In some embodiments, the method further includes the following steps before saving the power connection information and network connection information: The power connection information and the network connection information are verified. The verification of the power connection information and the network connection information includes at least: whether the power supply device and the switch device exist; whether the power port is within a preset range and whether the format of the switch port meets the requirements; whether the power port and / or the switch port are occupied; and whether the power port and / or the switch port are duplicated in the current batch. If the power connection information and the network connection information pass the verification, then the power connection information and the network connection information are saved.

[0007] In some embodiments, before obtaining the switch-dimensional mutex lock based on the switch device identifier in the detection task, the method further includes: The detection task is verified; the verification of the detection task includes at least whether the power connection information and the network connection information have been detected, and whether the power connection information and the network connection information have been associated with the bare metal device. If the verification passes, the probe task is saved as a pending task and pushed into the asynchronous task queue. The switch dimension mutex lock is obtained according to the switch device identifier in the probe task.

[0008] In some embodiments, it also includes: If a detection task is canceled, fails, or times out during the detection process, a log entry will be created.

[0009] In some embodiments, it also includes: If the access verification passes, the power connection information and the network connection information will be updated to indicate that the detection has been completed.

[0010] In some embodiments, the admission verification of the MAC address, probe task status, and wiring relationship occupancy status includes: Verify whether the MAC address is unique, verify whether the detection task is still in progress, verify whether the power connection information and the network connection information exist, and verify whether the power connection information and the network connection information are associated with the bare metal device. If the MAC address is unique, the detection task is still in progress, the power connection information and the network connection information exist, and the power connection information and the network connection information are not associated with bare metal devices, then the access verification passes.

[0011] In some embodiments, it also includes: If the access verification fails, the reason for the failure is recorded and the bare metal equipment to be put into storage is refused.

[0012] To address the aforementioned technical problems, this application also provides a bare metal equipment rack access device, comprising: The receiving unit is used to receive power connection information and network connection information of the bare metal device to be racked; the power connection information includes the power supply device and power port connected to the bare metal device to be racked; the network connection information includes the switch device and switch port connected to the bare metal device to be racked. A storage unit is used to store the power connection information and network connection information, and to create a detection task; The acquisition unit is used to acquire a switch-dimensional mutex lock based on the switch device identifier in the detection task; if no switch-dimensional mutex lock is acquired, it indicates that a detection task is already being executed for the same switch device; if a switch-dimensional mutex lock is acquired, it indicates that no detection task is being executed for the same switch device. An execution unit is configured to perform a preset operation on the power port if a switch-level mutex lock is acquired; the preset operation includes at least a power-off operation and a power-on operation; the power-off operation and the power-on operation are executed sequentially. A cleaning unit is used to clean the MAC table after the power port is powered off; The reading unit is used to read the switch MAC table and filter the MAC address corresponding to the switch port after the power port is powered on and after waiting for a preset time. An access verification unit is used to perform access verification on the MAC address, probe task status, and wiring relationship occupancy status. A creation unit is used to create a bare metal device record if the access verification passes, and to write the preset information of the bare metal device to be racked into the bare metal device record.

[0013] To address the aforementioned technical problems, this application also provides an electronic device, comprising: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the bare metal device rack access method as described above.

[0014] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the bare metal device rack access method described above.

[0015] The bare metal device rack access method provided in this application includes: receiving power connection information and network connection information of the bare metal device to be racked; the power connection information includes the power supply device and power port connected to the bare metal device to be racked; the network connection information includes the switch device and switch port connected to the bare metal device to be racked; saving the power connection information and network connection information, and creating a probe task; obtaining a switch-dimensional mutex lock based on the switch device identifier in the probe task; if no switch-dimensional mutex lock is obtained, it indicates that a probe task is already being executed for the same switch device; if a switch-dimensional mutex lock is obtained, it indicates that a probe task is already being executed for the same switch device. No probe tasks are being executed on the switch device. If a switch-level mutex lock is acquired, a preset operation is performed on the power port. The preset operation includes at least a power-off operation and a power-on operation. The power-off operation and the power-on operation are executed sequentially. After the power port is powered off, the MAC table is cleared. After the power port is powered on, the switch MAC table is read and the MAC address corresponding to the switch port is filtered after a preset waiting time. The MAC address, probe task status, and wiring relationship occupancy status are subject to access verification. If the access verification passes, a bare metal device record is created, and the preset information of the bare metal device to be racked is written into the bare metal device record.

[0016] As can be seen, the bare metal device racking access method provided in this application binds the power wiring information and network wiring information of the same bare metal device to be racked, associating and binding the power port and switch port, thus solving the problem of disconnected power wiring and network wiring, and the inability to verify that they correspond to the same device. By sequentially performing power-off, MAC table clearing, and power-on operations, and waiting a preset time after power-on before reading the switch port MAC address, historical residual MAC table entries in the switch can be cleared, avoiding misidentification caused by historical records and data from other devices. Access verification is performed on the read MAC address, probe task status, and wiring relationship occupancy status. After the access verification is passed, a bare metal device record is automatically generated and written with preset information, replacing manual MAC address entry and eliminating manual entry errors. This enables automated, highly reliable, and efficient racking access for bare metal devices.

[0017] The bare metal equipment rack access device, equipment, and computer-readable storage medium provided in this application all have the aforementioned technical effects. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A schematic flowchart illustrating a bare metal device rack access method provided in an embodiment of this application; Figure 2 A schematic diagram of a bare metal equipment rack access system provided in an embodiment of this application; Figure 3 A flowchart illustrating the creation of a wiring relationship pre-verification and detection task provided in an embodiment of this application; Figure 4 A flowchart illustrating the power and network collaborative detection execution process provided in this application embodiment; Figure 5 A flowchart for the detection result admission verification and bare metal equipment placement process provided in this application embodiment; Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0020] The core of this application is to provide a method, apparatus, device, and storage medium for bare metal device rack access, which can improve the accuracy and efficiency of bare metal device rack access.

[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a bare metal device rack access method provided in an embodiment of this application. (Refer to...) Figure 1 As shown, the method includes: S101: Receive power connection information and network connection information of the bare metal device to be racked; the power connection information includes the power supply device and power port connected to the bare metal device to be racked; the network connection information includes the switch device and switch port connected to the bare metal device to be racked.

[0023] The power and network wiring information for the bare metal equipment to be racked can be added manually (e.g., by on-site personnel). The power wiring information includes the power supply devices and power ports connected to the bare metal equipment; the network wiring information includes the switch devices and switch ports connected to the bare metal equipment. The manually added power and network wiring information is then retrieved. The power and network wiring information can be collectively referred to as wiring relationships.

[0024] S102: Save the power connection information and network connection information, and create a detection task.

[0025] In some embodiments, the method further includes the following steps before saving the power connection information and network connection information: The power connection information and the network connection information are verified. The verification of the power connection information and the network connection information includes at least: whether the power supply device and the switch device exist; whether the power port is within a preset range and whether the format of the switch port meets the requirements; whether the power port and / or the switch port are occupied; and whether the power port and / or the switch port are duplicated in the current batch. If the power connection information and the network connection information pass the verification, then the power connection information and the network connection information are saved.

[0026] If the power supply device and the switch device exist, the power port is within the preset range and the format of the switch port meets the requirements, neither the power port nor the switch port is occupied, and neither the power port nor the switch port is duplicated within the current batch, then the power wiring information and network wiring information verification is considered successful. Under the premise that the power wiring information and network wiring information verification is successful, the power wiring information and network wiring information are saved. Specifically, for batch-added wiring relationships, checking for duplicate power ports and switch ports within the current batch is to prevent multiple bare metal devices to be racked in the same batch from declaring the use of the same power port or switch port. If any one of these verifications fails, the power wiring information and network wiring information do not need to be saved. For example, if both the power port and the switch port are occupied, the power wiring information and network wiring information verification is considered failed.

[0027] S103: Obtain a switch-dimensional mutex lock based on the switch device identifier in the detection task; if no switch-dimensional mutex lock is obtained, it indicates that a detection task is already being executed for the same switch device; if a switch-dimensional mutex lock is obtained, it indicates that no detection task is being executed for the same switch device.

[0028] S104: If a switch-level mutex lock is acquired, a preset operation is performed on the power port; the preset operation includes at least a power-off operation and a power-on operation; the power-off operation and the power-on operation are performed sequentially.

[0029] In some embodiments, before obtaining the switch-dimensional mutex lock based on the switch device identifier in the detection task, the method further includes: The detection task is verified; the verification of the detection task includes at least whether the power connection information and the network connection information have been detected, and whether the power connection information and the network connection information have been associated with the bare metal device. If the verification passes, the probe task is saved as a pending task and pushed into the asynchronous task queue. The switch dimension mutex lock is obtained according to the switch device identifier in the probe task.

[0030] Once the wiring relationship verification passes (i.e., the power wiring information and the network wiring information pass verification), the wiring relationship is saved and set to a pending detection state. A detection task is initiated based on one or more pending detection wiring relationships. The system verifies whether the wiring relationship has been detected and whether it is associated with a bare metal device. It also verifies whether there are any unfinished detection tasks. If the wiring relationship has not been detected and is not associated with a bare metal device, the verification is considered successful. The verified detection task is saved as pending execution and pushed into the asynchronous task queue. The background scheduler scans for pending detection tasks and assigns them to the detection executor for processing. The detection executor acquires a switch-level mutex lock based on the switch device identifier in the detection task. If acquisition fails, it means that a detection task is already being executed under the same switch, and the current task awaits subsequent scheduling. After successfully acquiring the switch-level mutex lock, a preset operation is performed on the power port connected to the bare metal device to be racked.

[0031] S105: After the power port is powered off, clear the MAC table; S106: After the power port is powered on, the switch MAC table is read and the MAC address corresponding to the switch port is filtered after a preset time is waited.

[0032] Power off the power port connected to the bare metal device to be racked, and poll to confirm that the bare metal device is in a power-off state. Clean up the MAC table of the switch device to which the bare metal device is connected, or the MAC table related to the switch port to which the bare metal device is connected, in order to reduce the impact of historical MAC tables on the detection results.

[0033] Power on the power port connected to the bare metal device to be racked, and poll to confirm successful power-on of the device. Wait for a preset time to allow the switch to complete port MAC address learning. Read the switch's MAC table and filter the MAC address corresponding to the switch port as the result of this probe.

[0034] S107: Perform an access verification on the MAC address, probe task status, and wiring relationship occupancy status; S108: If the access verification passes, a bare metal device record is created, and the preset information of the bare metal device to be racked is written into the bare metal device record.

[0035] Access verification is performed on the MAC address, probe task status, and wiring relationship occupancy status. If the access verification passes, a bare metal device record is created, and the preset information of the bare metal device to be racked is written into the bare metal device record, thereby completing the racking access. The preset information may include MAC address, wiring relationship, edge area, physical location, initial management status, and basic fields required for subsequent scheduling.

[0036] In some embodiments, the admission verification of the MAC address, probe task status, and wiring relationship occupancy status includes: Verify whether the MAC address is unique, verify whether the detection task is still in progress, verify whether the power connection information and the network connection information exist, and verify whether the power connection information and the network connection information are associated with the bare metal device. If the MAC address is unique, the detection task is still in progress, the power connection information and the network connection information exist, and the power connection information and the network connection information are not associated with bare metal devices, then the access verification passes.

[0037] The system verifies whether the MAC address is unique, whether the probe task is still in progress, whether the power connection information and the network connection information exist, and whether the power connection information and the network connection information are associated with a bare metal device. If the MAC address is unique, the probe task is still in progress, the power connection information and the network connection information exist, and the power connection information and the network connection information are not associated with a bare metal device, then the access verification passes, a bare metal device record is created, and the preset information of the bare metal device to be racked is written into the bare metal device record.

[0038] In some embodiments, it also includes: If the access verification passes, the power connection information and the network connection information will be updated to indicate that the detection has been completed.

[0039] In some embodiments, it also includes: If the access verification fails, the reason for the failure is recorded and the bare metal equipment to be put into storage is refused.

[0040] In some embodiments, it also includes: If a detection task is canceled, fails, or times out during the detection process, a log entry will be created.

[0041] If a detection task is canceled, fails, or times out during the detection process, the detection task status is updated (the detection task can be marked as failed and the reason for failure is recorded), a log is logged, and on-site personnel are allowed to correct the wiring or equipment status before re-initiating the detection. Detection failures include power control failure, MAC table cleanup failure, failure to read the switch's MAC table, MAC address already existing, or wiring already in use.

[0042] The bare metal equipment rack access method provided in the above embodiments of this application can be implemented by a bare metal equipment rack access system. (Refer to...) Figure 2 As shown, the system includes a wiring relationship management layer, a probe task control layer, a collaborative probe execution layer, and an access verification and database entry layer. The wiring relationship management layer establishes the binding relationship between power ports and switch ports and performs port occupancy pre-verification during the data entry phase. The probe task control layer generates asynchronous probe tasks based on wiring relationships and manages task queues, task cancellation, timeouts, and logs. The collaborative probe execution layer forms a controlled probe window based on power control and switch control. The access verification and database entry layer verifies the probe results for task status, MAC uniqueness, and whether the wiring is unoccupied; upon successful verification, a bare metal device is created.

[0043] In one specific implementation, the system may include a wiring relationship modeling module, a port occupancy and batch duplication pre-verification module, a probe task generation and asynchronous scheduling module, a switch-level concurrent isolation module, a power status closed-loop control module, a switch port detection module, a probe result admission verification module, a bare metal device generation and wiring status linkage module, and a log, cancellation, and timeout compensation module.

[0044] The wiring relationship modeling module is used to record the power wiring information and network wiring information of the bare metal equipment to be racked. Power wiring information includes at least the power supply device identifier and power port identifier; network wiring information includes at least the switch device identifier and switch port identifier. The system binds the power wiring information and network wiring information into a wiring relationship to be probed, so that subsequent probes can clearly identify which power port to control and which switch port to read.

[0045] The port occupancy and batch duplication pre-verification module verifies the validity of power supply equipment, switch equipment, and port formats before saving wiring relationships. It also queries historical valid wiring records to determine if the same power supply port or the same switch port is already in use. For wiring relationships added in batches, the system also performs port duplication checks within the current batch to prevent multiple bare metal devices to be racked in the same batch from declaring the use of the same port.

[0046] The probe task generation and asynchronous scheduling module is used to create probe tasks based on one or more wiring relationships to be probed. It determines whether the wiring relationship has been probed, whether it has been associated with bare metal equipment, and whether there are any ongoing probe tasks. After verification, the probe task is saved as a pending task and enters the scheduling queue for asynchronous execution by the background executor.

[0047] The switch-level concurrency isolation module is used to control the mutual exclusion of probe tasks at the switch device level. Probe tasks under the same switch execute serially during the critical stages of clearing the MAC table, powering on the control power port, waiting for MAC address learning, and reading the MAC address. Probe tasks under different switches can execute in parallel. The switch-level concurrency isolation module prevents multiple probe tasks under the same switch from mutually clearing MAC tables or reading MAC entries generated by other devices.

[0048] The power status closed-loop control module performs power-off, status confirmation, power-on, and status confirmation on the power ports specified in the wiring relationship. Power-off prevents the device under test from continuing to generate network table entries before clearing the MAC table. Power-on triggers the switch to relearn the device's MAC address. The power status closed-loop control module can be combined with soft shutdown, forced power-off, status polling, retry, and timeout control to improve the reliability of power operation in edge fields.

[0049] The switch port detection module is used to clear the switch's MAC table after the bare metal device to be racked is powered off, read the port speed and initialize the port access mode after the bare metal device is powered on, and read the MAC address of the switch port connected to the bare metal device after waiting for a preset time. By first checking the switch's MAC table, then controlling the power-on of the bare metal device, and then reading the MAC address of the switch port connected to the bare metal device, the switch port detection module can reduce the influence of historical MAC table entries on the detection results.

[0050] The detection result admission verification module performs multiple verifications before the detection results are written to the resource management system. Verification includes checking whether the detection task is still in progress, whether the detected MAC address is empty, whether the MAC address is already occupied by other bare metal devices, whether wiring records exist, and whether wiring records are associated with other bare metal devices. Only after all verifications pass can the process of adding the bare metal device to the database be allowed.

[0051] The bare metal device generation and wiring status linkage module is used to create bare metal device records based on the detection results, writing in the MAC address, wiring relationship, edge area, physical location, initial management status, and basic fields required for subsequent scheduling. After the bare metal device is successfully created, the system updates the corresponding wiring relationship to a "detection completed" or "associated" status, ensuring consistency between the wiring record and the device asset.

[0052] The logging, cancellation, and timeout compensation modules are used to record key events in the probe task lifecycle, including task creation, task startup, power failure, MAC table cleanup, device power-on, MAC address reading, result saving, failure reason, task cancellation, and timeout handling. These modules make the edge field deployment process traceable, reviewable, and retryable.

[0053] The wiring relationship uniquely identifies the binding relationship between the power and network wiring of a bare metal device to be racked. This identifier can be generated by the system or represented by the primary key of the wiring record. Subsequent detection tasks, detection results, and bare metal devices are all associated with this identifier.

[0054] A unique key for a power port can be generated by combining the power device identifier and the power port identifier. The system uses this unique key to determine whether a power port is already occupied by a valid wiring relationship, thus preventing two bare metal devices to be racked from using the same power port.

[0055] A unique key for a switch port can be generated by combining the switch device identifier and the switch port identifier. The system uses this unique key to determine whether a switch port is already occupied by a valid connection, thus preventing the same switch port from being registered repeatedly.

[0056] The probe task status should include at least four states: pending, in progress, successful, failed, canceled, and timed out. When saving probe results, it should be verified that the task is still in progress to prevent canceled or timed-out tasks from continuing to write results.

[0057] Switch concurrent locks are implemented at the switch device identifier level. The lock's validity period should cover critical phases such as power-off, MAC table cleanup, power-on, port initialization, MAC learning wait, MAC reading, and result saving. This lock can be implemented using distributed caching, database locks, message queue serialization, or other mutual exclusion mechanisms.

[0058] Power control retry parameters can include the number of power-off retries, the number of power-on retries, the status query interval, and the maximum waiting time. For situations such as soft shutdown failure, repeated shutdown limitations, or failure to update the device status in a timely manner, the system can employ forced power-off, delayed retries, or failure exit strategies.

[0059] The scope of MAC table cleanup can be configured to clean up the entire switch, ports, or VLANs, depending on the switch's capabilities. In one implementation, to reduce implementation complexity, the system can clean up the switch's MAC table under the protection of a mutual exclusion lock on the same switch; in another implementation, only the relevant MAC table entries of the switch ports connected to the bare metal devices to be racked can be cleaned to minimize the impact on other ports.

[0060] The MAC learning wait time is used to wait for the network card to initialize and the switch to learn the MAC address after the target device is powered on. This time can be configured according to the device startup speed, network card initialization time, switch learning speed, and the on-site network environment.

[0061] The access uniqueness constraints include: the same MAC address cannot correspond to multiple bare metal devices; the same wiring relationship cannot be associated with multiple bare metal devices; and the same power port and the same switch port cannot be occupied by multiple valid wiring relationships. These constraints can be implemented through database unique indexes, business verification, or a combination of both.

[0062] refer to Figures 3 to 5 As shown, the following describes a specific implementation method: On-site personnel add the wiring relationships for the bare metal equipment to be racked. The wiring relationships include the power supply equipment and power ports connected to the bare metal equipment to be racked, as well as the connected switch equipment and switch ports.

[0063] The system verifies the presence of power supply and switch equipment, and checks whether the range of power ports and the format of switch ports meet the requirements.

[0064] The system queries historical wiring records based on power supply device port combinations and switch device port combinations, and performs duplicate checks within the current batch; if a port is already in use or is duplicated within the current batch, it refuses to save it.

[0065] After the wiring relationship is verified, the system saves the wiring relationship and sets it to the detection state.

[0066] Users initiate a probe task based on one or more wiring relationships to be probed. The system verifies whether the wiring relationship has been probed, whether it has been associated with bare metal devices, and whether there are any unfinished probe tasks.

[0067] The system saves the verified probe tasks as pending tasks and pushes them into the asynchronous task queue. The background scheduler scans the pending tasks and hands them over to the probe executor for processing.

[0068] The probe executor acquires a switch-level mutex lock based on the switch device identifier in the task. If acquisition fails, it means that a probe task is already being executed on the same switch, and the current task awaits subsequent scheduling.

[0069] After acquiring the switch-level mutex lock, the system controls the power port connected to the bare metal device to be racked to disconnect from the power supply, and polls to confirm that the device is in a power-off state.

[0070] The system cleans up the MAC table of the switch to which the bare metal device to be installed is connected, or the MAC table entries related to the port of the switch to which the bare metal device to be installed is connected, in order to reduce the impact of historical MAC table entries on the detection results.

[0071] The system controls the target power port to power on and polls to confirm that the device has been successfully powered on.

[0072] The system reads the target switch port speed, initializes the port access mode if necessary, and waits for a preset time to allow the switch to complete port MAC address learning.

[0073] The system reads the MAC address corresponding to the switch port connected to the bare metal device to be racked, and submits this MAC address as the result of this probe to the device management side.

[0074] The equipment management side verifies the task status, MAC address uniqueness, wiring record existence, and whether the wiring is not associated with bare metal equipment.

[0075] After successful verification, the system creates bare metal device resources and updates the wiring relationship to a status of "detected and associated"; if any verification fails, the reason for the failure is recorded and the data is rejected.

[0076] The probe actuator releases the switch dimension lock and, according to the policy, performs a power-off or restores the preset power state after the probe is completed.

[0077] If the probe is canceled, fails, or times out during the process, the system updates the task status, logs the information, and allows on-site personnel to correct the wiring or equipment status before re-initiating the probe.

[0078] For example, a new bare metal device is added to an edge node. Field personnel record that this device is connected to port 3 of power supply device P and port 10 of switch S. Before saving the wiring relationship, the system verifies that P-3 and S-10 are not occupied by other valid connections. Then, the user initiates a probe task. The system acquires the mutex lock of switch S, controls P-3 to power off, clears the MAC table of switch S, and then controls P-3 to power on again. After the switch has completed learning, the system reads the MAC address M on port S-10. If M is not used by any existing bare metal device, and this wiring relationship is not associated with any other bare metal device, the system creates a new bare metal device and updates the wiring relationship to indicate that the probe is complete.

[0079] In summary, the bare metal device racking access method provided in this application binds the power wiring information and network wiring information of the same bare metal device to be racked, associating and binding the power port and switch port, thus solving the problem of disconnected power wiring and network wiring, and the inability to verify that they correspond to the same device. By sequentially performing power-off, MAC table clearing, and power-on operations, and waiting a preset time after power-on before reading the switch port MAC address, historical residual MAC table entries in the switch can be cleared, avoiding misidentification caused by historical records and data from other devices. Access verification is performed on the read MAC address, probe task status, and wiring relationship occupancy status. After the access verification is passed, a bare metal device record is automatically generated and written with preset information, replacing manual MAC address entry and eliminating manual entry errors. This achieves automated, highly reliable, and efficient racking access for bare metal devices.

[0080] This application also provides a bare metal equipment rack access device, which is described below and can be referred to in conjunction with the method described above. Please refer to... Figure 6 , Figure 6 This is a schematic diagram of a bare metal equipment rack access device provided in an embodiment of this application, combined with... Figure 6 As shown, the device includes: The receiving unit is used to receive power connection information and network connection information of the bare metal device to be racked; the power connection information includes the power supply device and power port connected to the bare metal device to be racked; the network connection information includes the switch device and switch port connected to the bare metal device to be racked. A storage unit is used to store the power connection information and network connection information, and to create a detection task; The acquisition unit is used to acquire a switch-dimensional mutex lock based on the switch device identifier in the detection task; if no switch-dimensional mutex lock is acquired, it indicates that a detection task is already being executed for the same switch device; if a switch-dimensional mutex lock is acquired, it indicates that no detection task is being executed for the same switch device. An execution unit is configured to perform a preset operation on the power port if a switch-level mutex lock is acquired; the preset operation includes at least a power-off operation and a power-on operation; the power-off operation and the power-on operation are executed sequentially. A cleaning unit is used to clean the MAC table after the power port is powered off; The reading unit is used to read the switch MAC table and filter the MAC address corresponding to the switch port after the power port is powered on and after waiting for a preset time. An access verification unit is used to perform access verification on the MAC address, probe task status, and wiring relationship occupancy status. A creation unit is used to create a bare metal device record if the access verification passes, and to write the preset information of the bare metal device to be racked into the bare metal device record.

[0081] In some embodiments, it also includes: A wiring relationship verification unit is used to verify the power wiring information and the network wiring information. The verification of the power wiring information and the network wiring information includes at least: whether the power supply device and the switch device exist; whether the power port is within a preset range and whether the format of the switch port meets the requirements; whether the power port and / or the switch port has been occupied; and whether the power port and / or the switch port is duplicated in the current batch. If the power connection information and the network connection information pass the verification, the storage unit saves the power connection information and the network connection information.

[0082] In some embodiments, it also includes: The detection task verification unit is used to verify the detection task; the content of the verification of the detection task includes at least whether the power connection information and the network connection information have been detected, and whether the power connection information and the network connection information have been associated with the bare metal device. The state saving unit is used to save the probe task as a pending execution state and push it into the asynchronous task queue if the verification passes. The acquisition unit obtains the switch dimension mutex lock according to the switch device identifier in the probe task.

[0083] In some embodiments, it also includes: The first recording unit is used to record logs if a detection task is canceled, fails, or times out during the detection process.

[0084] In some embodiments, it also includes: An update unit is used to update the power connection information and the network connection information to indicate that detection has been completed if the access verification passes.

[0085] In some embodiments, the admission verification unit is used for: Verify whether the MAC address is unique, verify whether the detection task is still in progress, verify whether the power connection information and the network connection information exist, and verify whether the power connection information and the network connection information are associated with the bare metal device. If the MAC address is unique, the detection task is still in progress, the power connection information and the network connection information exist, and the power connection information and the network connection information are not associated with bare metal devices, then the access verification passes.

[0086] In some embodiments, it also includes: The second recording unit is used to record the reason for the failure of the access verification and refuse to put the bare metal equipment to be racked into the warehouse if the access verification fails.

[0087] This application also provides an electronic device, referenced... Figure 6 As shown, the device includes a memory 1 and a processor 2.

[0088] Memory 1 is used to store computer programs; Processor 2 is used to execute computer programs to perform the following steps: Receive power connection information and network connection information of the bare metal device to be racked; the power connection information includes the power supply and power port connected to the bare metal device to be racked; the network connection information includes the switch and switch port connected to the bare metal device to be racked; save the power connection information and network connection information, and create a probe task; acquire a switch-dimensional mutex lock based on the switch device identifier in the probe task; if no switch-dimensional mutex lock is acquired, it indicates that a probe task is already being executed for the same switch device; if a switch-dimensional mutex lock is acquired, it indicates that no probe task is being executed for the same switch device. During execution; if a switch-level mutex lock is acquired, a preset operation is performed on the power port; the preset operation includes at least a power-off operation and a power-on operation; the power-off operation and the power-on operation are performed sequentially; after the power port is powered off, the MAC table is cleared; after the power port is powered on, the switch MAC table is read after a preset time and the MAC address corresponding to the switch port is filtered; the MAC address, probe task status, and wiring relationship occupancy status are subject to access verification; if the access verification passes, a bare metal device record is created, and the preset information of the bare metal device to be racked is written into the bare metal device record.

[0089] For a description of the equipment provided in this application, please refer to the above method embodiments; further details will not be provided here.

[0090] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the following steps: Receive power connection information and network connection information of the bare metal device to be racked; the power connection information includes the power supply and power port connected to the bare metal device to be racked; the network connection information includes the switch and switch port connected to the bare metal device to be racked; save the power connection information and network connection information, and create a probe task; acquire a switch-dimensional mutex lock based on the switch device identifier in the probe task; if no switch-dimensional mutex lock is acquired, it indicates that a probe task is already being executed for the same switch device; if a switch-dimensional mutex lock is acquired, it indicates that no probe task is being executed for the same switch device. During execution; if a switch-level mutex lock is acquired, a preset operation is performed on the power port; the preset operation includes at least a power-off operation and a power-on operation; the power-off operation and the power-on operation are performed sequentially; after the power port is powered off, the MAC table is cleared; after the power port is powered on, the switch MAC table is read after a preset time and the MAC address corresponding to the switch port is filtered; the MAC address, probe task status, and wiring relationship occupancy status are subject to access verification; if the access verification passes, a bare metal device record is created, and the preset information of the bare metal device to be racked is written into the bare metal device record.

[0091] The computer-readable storage medium may include 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.

[0092] For a description of the computer-readable storage medium provided in this application, please refer to the above method embodiments; further details will not be repeated here.

[0093] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatuses, devices, and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant details can be found in the method section.

[0094] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0095] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0096] The foregoing has provided a detailed description of the bare metal device rack access method, apparatus, equipment, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A method for granting rack access to bare metal equipment, characterized in that, include: Receive power connection information and network connection information of the bare metal device to be racked; the power connection information includes the power supply device and power port connected to the bare metal device to be racked; the network connection information includes the switch device and switch port connected to the bare metal device to be racked. Save the power connection information and network connection information, and create a detection task; Obtain a switch-dimensional mutex lock based on the switch device identifier in the detection task; if no switch-dimensional mutex lock is obtained, it indicates that a detection task is already being executed for the same switch device; if a switch-dimensional mutex lock is obtained, it indicates that no detection task is being executed for the same switch device. If a switch-level mutex lock is acquired, a preset operation is performed on the power port; the preset operation includes at least a power-off operation and a power-on operation; the power-off operation and the power-on operation are performed sequentially. After power is turned off at the power port, clear the MAC table; After the power port is powered on, the switch MAC table is read and the MAC address corresponding to the switch port is filtered after a preset time is waited. The MAC address, probe task status, and wiring relationship occupancy status are subject to access verification. If the access verification passes, a bare metal device record is created, and the preset information of the bare metal device to be racked is written into the bare metal device record.

2. The bare metal equipment rack access method according to claim 1, characterized in that, Before saving the power connection information and network connection information, the following steps are also included: The power connection information and the network connection information are verified. The verification of the power connection information and the network connection information includes at least: whether the power supply device and the switch device exist; whether the power port is within a preset range and whether the format of the switch port meets the requirements; whether the power port and / or the switch port are occupied; and whether the power port and / or the switch port are duplicated in the current batch. If the power connection information and the network connection information pass the verification, then the power connection information and the network connection information are saved.

3. The bare metal equipment rack access method according to claim 1, characterized in that, Before obtaining the switch-dimensional mutex lock based on the switch device identifier in the detection task, the following steps are also included: The detection task is verified; the verification of the detection task includes at least whether the power connection information and the network connection information have been detected, and whether the power connection information and the network connection information have been associated with the bare metal device. If the verification passes, the probe task is saved as a pending task and pushed into the asynchronous task queue. The switch dimension mutex lock is obtained according to the switch device identifier in the probe task.

4. The bare metal equipment rack access method according to claim 1, characterized in that, The access verification for the MAC address, probe task status, and wiring relationship occupancy status includes: Verify whether the MAC address is unique, verify whether the detection task is still in progress, verify whether the power connection information and the network connection information exist, and verify whether the power connection information and the network connection information are associated with the bare metal device. If the MAC address is unique, the detection task is still in progress, the power connection information and the network connection information exist, and the power connection information and the network connection information are not associated with bare metal devices, then the access verification passes.

5. The method for rack access of bare metal equipment according to claim 1, characterized in that, Also includes: If a detection task is canceled, fails, or times out during the detection process, a log entry will be created.

6. The bare metal equipment rack access method according to claim 1, characterized in that, Also includes: If the access verification passes, the power connection information and the network connection information will be updated to indicate that the detection has been completed.

7. The bare metal equipment rack access method according to claim 1, characterized in that, Also includes: If the access verification fails, the reason for the failure is recorded and the bare metal equipment to be put into storage is refused.

8. A bare metal equipment rack access device, characterized in that, include: The receiving unit is used to receive power connection information and network connection information of the bare metal device to be racked; the power connection information includes the power supply device and power port connected to the bare metal device to be racked; the network connection information includes the switch device and switch port connected to the bare metal device to be racked. A storage unit is used to store the power connection information and network connection information, and to create a detection task; The acquisition unit is used to acquire a switch-dimensional mutex lock based on the switch device identifier in the detection task; if no switch-dimensional mutex lock is acquired, it indicates that a detection task is already being executed for the same switch device; if a switch-dimensional mutex lock is acquired, it indicates that no detection task is being executed for the same switch device. An execution unit is configured to perform a preset operation on the power port if a switch-level mutex lock is acquired; the preset operation includes at least a power-off operation and a power-on operation; the power-off operation and the power-on operation are executed sequentially. A cleaning unit is used to clean the MAC table after the power port is powered off; The reading unit is used to read the switch MAC table and filter the MAC address corresponding to the switch port after the power port is powered on and after waiting for a preset time. An access verification unit is used to perform access verification on the MAC address, probe task status, and wiring relationship occupancy status. A creation unit is used to create a bare metal device record if the access verification passes, and to write the preset information of the bare metal device to be racked into the bare metal device record.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the bare metal device rack access method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the bare metal device rack access method as described in any one of claims 1 to 7.