CN109587005B - Connection detection method and device, computer equipment and readable storage medium - Google Patents

Connection detection method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN109587005B
CN109587005B CN201811597886.7A CN201811597886A CN109587005B CN 109587005 B CN109587005 B CN 109587005B CN 201811597886 A CN201811597886 A CN 201811597886A CN 109587005 B CN109587005 B CN 109587005B
Authority
CN
China
Prior art keywords
server
target
operating system
switch
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811597886.7A
Other languages
Chinese (zh)
Other versions
CN109587005A (en
Inventor
徐斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technical Service Co Ltd
Original Assignee
Huawei Technical Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technical Service Co Ltd filed Critical Huawei Technical Service Co Ltd
Priority to CN201811597886.7A priority Critical patent/CN109587005B/en
Publication of CN109587005A publication Critical patent/CN109587005A/en
Application granted granted Critical
Publication of CN109587005B publication Critical patent/CN109587005B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/14Arrangements for monitoring or testing data switching networks using software, i.e. software packages

Abstract

The application discloses a connection detection method, a connection detection device, computer equipment and a readable storage medium, and belongs to the technical field of inspection. According to the method, the target operating system loaded with the target program and the target protocol is mounted on the server, so that the server can automatically acquire the connection information of the server and the upper-connection switch and further acquire the connection information of the server and the upper-connection switch, the connection information of the server and the upper-connection switch does not need to be checked manually by plugging and unplugging optical fibers, the connection information of the server and the upper-connection switch can be acquired only by mounting the target operating system on the server, the checking time is saved, and the checking efficiency is improved.

Description

Connection detection method and device, computer equipment and readable storage medium
Technical Field
The present application relates to the field of detection technologies, and in particular, to a connection detection method and apparatus, a computer device, and a readable storage medium.
Background
In the hardware installation stage when the data center is newly built, each network card port of the bare computer server is respectively connected with the switch port of the upper-connection switch, so that the bare computer server can communicate with the upper-connection switch. If the connection between the bare metal server and the upper-link switch is wrong, various errors can be reported in the software installation and debugging stage, so that the software installation and debugging are failed. In order to avoid various errors in the software installation and debugging stage, the connection between the bare metal server and the uplink switch needs to be checked before the software installation and debugging stage.
Currently, checking the connection of bare metal servers to the upper-connected switch may be the following process: according to the design requirement, each network card port on the bare metal server is connected with a corresponding switch port, when one network card port is connected with one switch port through optical fibers, an indicator lamp of the switch port is lighted, but indicator lamps of switch ports which are not connected with the network card interface of the bare metal server are not lighted, when all network card ports on the bare metal server are connected with the switch ports, then the indicator lamp of the switch port connected with the network card port is lighted, one detector pulls out the optical fibers on one network card port of the bare metal server, according to the design requirement, the other detector observes whether the indicator lamp of the switch port corresponding to the network card port is turned off, when the indicator lamp of the switch port corresponding to the network card port is lighted, the connection between the network card port and the switch port is incorrect, when the indicator light of the switch port corresponding to the network card port is turned off, the connection between the network card port and the switch port is correct.
In a data center, a large number of bare computer servers are needed, each bare computer server may have a plurality of network card ports, and each upper-link switch may be connected to network card interfaces on the bare computer servers, so that the connection amount between the bare computer server and the upper-link access layer switch is large, and then, the connection between the bare computer server and the upper-link switch is checked through the above process, that is, two technicians check whether the connection between each network card port on the bare computer server and the upper-link switch port is correct by plugging optical fibers of each network card port, and the checking steps are cumbersome, so that a large amount of time is consumed, and the checking efficiency is low.
Disclosure of Invention
The embodiment of the application provides a connection detection method, a connection detection device, computer equipment and a readable storage medium, and can solve the problem of low efficiency when a manual inspection server is connected with an upper connection switch. The technical scheme is as follows:
in a first aspect, a method for connection detection is provided, where the method includes:
loading a target program and an installation package of a target protocol in a target operating system, wherein the target program is used for analyzing interactive information between a server and an upper-connection switch, and the target protocol is used for acquiring connection information between the server and the upper-connection switch;
mounting the target operating system on the server;
controlling the server to run the target operating system;
and acquiring the connection information of the server and the upper connection exchanger through the target operating system.
In one possible implementation, loading an installation package of a target program and a target protocol in a target operating system includes:
setting the server to be started from a read-only optical disc once through an intelligent platform management interface of the server, and mounting the target operating system on the server through an application programming interface provided by a mainboard management controller of the server;
or the like, or, alternatively,
and setting the server to be started at a single time from a pre-starting execution environment through an intelligent platform management interface of the server, and setting the pre-starting execution environment of the server, wherein the pre-starting execution environment is used for mounting the target operating system.
Based on the possible implementation modes, two modes of mounting the target operating system on the server are provided, wherein the first mode is directly mounting the target operating system on the server; the second mode is that the server is provided with a pre-starting execution environment, so that the server can automatically mount a target operating system, and the server can automatically acquire the connection information of the server and the upper connection switch through the two modes, thereby avoiding the manual work of checking the connection condition of the server and the upper connection switch through plugging and unplugging optical fibers on the server, saving the checking time and improving the checking efficiency.
In one possible implementation, obtaining the target operating system includes:
installing a software package carrying a link layer discovery protocol stack in a target operating system;
installing a target program in the target operating system;
setting the target program to start up and run automatically;
and opening serial port communication between the electronic equipment and the server by default.
In one possible implementation, the target program stores target information, and the target information includes switch port information, connection rate, and medium access control address.
Based on the two possible implementation manners, based on a software package of a link layer discovery protocol stack carried in a target operating system, a server can automatically acquire a link layer discovery protocol data unit carrying port information of an uplink switch connected with the server, so that a target program can acquire the port information of the uplink switch connected with the server from the link layer discovery protocol data unit, and the server can automatically acquire connection information of the server and the uplink switch.
In one possible implementation, the obtaining, by the target operating system, connection information of the server and the upper-level switch includes:
starting an SOL channel between the electronic equipment and the server through an intelligent platform management interface of the server;
receiving monitoring data sent by the server, wherein the monitoring data is used for indicating that the target file of the server stores the connection information of the server and the upper-connected switch;
and reading the connection information of the server and the upper connection switch from the target file according to the connection information of the server and the upper connection switch indicated in the monitoring data.
Based on the possible implementation manner, the SOL channel between the electronic device and the server is opened, so that the server can send monitoring data to the electronic device, and the electronic device can acquire the connection information between the server and the uplink switch from the target file indicated by the monitoring data.
In one possible implementation, the method further comprises:
when the server is found to be not powered on through the intelligent platform management interface of the server, the server is powered on;
and restarting the server when the server is powered on through the intelligent platform management interface of the server.
Based on the possible implementation manners, two starting manners of the server are provided, and when the server is started, the target operating system can acquire the connection condition of the server and the upper-connected switch based on the middle target protocol and the target program of the target operating system.
In a second aspect, a connection detection method is provided, which is applied to a server, and includes:
mounting a target operating system, wherein the target operating system is loaded with a target program and an installation package of a target protocol, the target program is used for analyzing interactive information between a server and an upper-connection switch, and the target protocol is used for acquiring connection information of the server and the upper-connection switch;
acquiring the connection information of the server and the upper connection switch through a target program in the target operating system, and storing the connection information of the server and the upper connection switch in a target file;
and sending monitoring data to the electronic equipment, wherein the monitoring data is used for indicating that the target file of the server stores the connection information of the server and the uplink switchboard.
In one possible implementation, the mounting the target operating system includes:
when the server is started from the read-only optical disc for a single time, the target operating system is mounted through an application programming interface provided by a mainboard management controller of the server;
or the like, or, alternatively,
when the server boots from the pre-boot execution environment, the target operating system is mounted in the pre-boot execution environment.
In one possible implementation manner, the obtaining, by a target program in the target operating system, connection information of the server and an uplink switch includes:
and acquiring connection information of the server and the upper-connection switch through target information and the target protocol stored in a target program, wherein the target information is interactive information between the server and the upper-connection switch analyzed based on the target protocol, and the target information comprises switch port information, connection rate and a media access control address.
In a third aspect, a data acquisition apparatus is provided for performing the data acquisition method. Specifically, the data storage device includes a functional module configured to execute the data obtaining method provided in the first aspect or any optional manner of the first aspect, where the aspect is an aspect corresponding to a connection detection method when the electronic device performs detection.
In a fourth aspect, a connection detection apparatus is provided for performing the above data acquisition method. Specifically, the data storage device includes a functional module configured to execute the connection detection method provided in the second aspect or any optional manner of the second aspect, where the above aspect is an aspect corresponding to a connection detection method when the server performs detection.
In a fifth aspect, a computer device is provided, which includes a processor and a memory, where at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement the operations performed by the connection detection method.
In a sixth aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operations performed by the connection detection method.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
the target operating system loaded with the target program and the target protocol is mounted on the server, so that the server can automatically acquire the connection information of the server and the upper connection switch and further acquire the connection information of the server and the upper connection switch, the connection information of the server and the upper connection switch can be checked without manually plugging and unplugging optical fibers, the connection information of the server and the upper connection switch can be acquired only by mounting the target operating system on the server, the checking time is saved, and the checking efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a connection detection method according to an embodiment of the present application;
fig. 4 is a flowchart of a connection detection method provided in an embodiment of the present application;
FIG. 5 is a structural diagram of a connection detection device according to an embodiment of the present disclosure;
fig. 6 is a structural device diagram of a connection detection device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
For the purpose of facilitating an understanding of the present disclosure, abbreviations and key terms appearing therein are defined as follows:
link Layer Discovery Protocol (LLDP): a vendor-neutral link layer protocol is used to broadcast information about the identity, capabilities, and neighbors of network devices.
Management Information Base (MIB): the MIB defines the data items that the managed device has to hold, the operations that are allowed to be performed on each data item and their meaning.
Configuration Management Database (CMDB): various configuration Information of equipment in an enterprise Information Technology (IT) architecture is stored and managed, the configuration Information is closely connected with all service support and service delivery processes, the operation of the processes is supported, the value of the configuration Information is exerted, and meanwhile, the accuracy of data is guaranteed by depending on the related processes.
Access layer switch (top of rack, TOR): generally a switch that is directly connected to a server.
Media access control address (MAC): the MAC address is used to uniquely identify a network card in the network.
Hardware management Interface (IPMI): an open standard hardware management interface specification defines a specific method for communication of an embedded management subsystem. IPMI information is communicated via a baseboard management controller (located on a hardware component of IPMI specification). Using low-level hardware intelligence management, rather than using an operating system for management, has two major advantages: first, this configuration allows out-of-band server management; second, the operating system does not have to be burdened with the task of transferring system state data.
Liveos (live operation system): a fully bootable computer installation, including an operating system, runs directly from a compact disk read-only memory (CD-ROM) or similar storage device into the computer's memory, rather than being loaded from a hard drive. LiveOS allows a user to run an operating system without installing or making any changes to the computer configuration. Optical discs may run on computers without secondary storage, such as hard drives, or damaged hard drives or file systems, allowing data recovery.
Motherboard management controller (BMC): a special embedded on the motherboard of the computer-usually a server microcontroller. The BMC manages the interface between system management software and platform hardware.
Preboot execution environment (PXE): work on the client/server; the support server downloads the image from a remote server over a network and thereby supports booting the operating system over the network.
Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application, and referring to fig. 1, the implementation environment includes an electronic device, a BMC switch, at least one server, and at least one uplink switch.
The electronic device is used for checking the connection condition of the server and the upper connection switch, and in a possible implementation manner, the electronic device can acquire the connection condition of the server and the upper connection switch by mounting the target operating system on the server.
The BMC switch is a switch connected with a BMC interface of the server, is provided with a plurality of switch ports, and can be connected with a local area network or a high-performance server or a workstation. In one possible implementation manner, the BMC switch serves as an intermediate device between the electronic device and at least one server, and is configured to forward a packet sent by the electronic device to the corresponding server, so as to implement communication between the electronic device and the server.
The upper connection switch is a switch directly connected with the server service management, the service and the storage plane, the upper connection switch is an access layer switch, and the access layer switch can be a TOR switch.
The TOR switch and the BMC switch are switches with two different purposes and have the common functions of the switches. A switch is a network device used for the forwarding of electrical (optical) signals. It may provide an exclusive electrical signal path for any two network nodes accessing the switch.
The BMC in the server is provided with an IPMI interface to realize communication between the electronic equipment and the server, and the server is a server without an operating system, namely a bare computer server.
Referring to fig. 2, a computer device 200 includes one or more processors 201 and one or more memories 202, where the one or more processors 201 store at least one instruction, and the at least one instruction is loaded and executed by the processors 201 to implement the methods provided by the method embodiments described below. Certainly, the computer device 200 may further have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input and output, and the computer device 200 may further include other components for implementing device functions, which are not described herein again.
In an exemplary embodiment, a computer-readable storage medium, such as a memory, is also provided that includes instructions executable by a processor in a terminal to perform the connection detection method in the embodiments described below. For example, the computer-readable storage medium may be a read-only memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The above is a description of an implementation environment of an electronic device checking connection between a server and an access stratum switch, and further, in order to embody a checking process, a specific embodiment is described herein, with reference to fig. 3, where fig. 3 is a flowchart of a connection detection method provided in an embodiment of the present application, and a method flow provided in an embodiment of the present application includes:
301. the electronic equipment loads a target program and an installation package of a target protocol in a target operating system, wherein the target program is used for analyzing interaction information between a server and an upper connection switch, and the target protocol is used for acquiring connection information of the server and the upper connection switch.
The target protocol may be an LLDP protocol, and for a device following the LLDP protocol, the device may organize information of its main capability, a management address, a device identifier, an interface identifier, and the like into different types/lengths/values (TLVs), encapsulate the different TLVs in a Link Layer Discovery Protocol Data Unit (LLDPDU), and send the TLVs to the device directly connected to itself, so that the device may store the information received in the LLDPDU in a standard MIB form, so as to allow a network management system to query and determine a communication status of a link.
The mutual information may be information mutually transmitted by the server and the upper connection switch based on a target protocol, and when the target protocol is an LLDP protocol, the mutual information is information carried in an LLDPDU. The target operating system may be LiveOS. In one possible implementation, this step 301 may be implemented by the following process shown as steps 301A-304D:
step 301A, the electronic device installs the software package carrying the link layer discovery protocol stack in the target operating system.
The link layer discovery protocol stack is an implementation of the LLDP protocol and may be used to instruct the server and the upper switch to follow the LLDP protocol, and the link layer discovery protocol stack may be invoked.
Step 301B, the electronic device installs the target program in the target operating system.
Step 301C, the electronic device sets the target program to start up and run automatically.
Step 301D, the electronic device defaults to open serial port communication with the server.
In this step 310D, the server may establish a communication connection with the electronic device after being started, for example, a target operating system in the server may transmit data to a remote electronic device through a serial port, where the target operating system in the server is as shown in step 305.
302. Through the intelligent platform management interface of the server, the electronic device sets the server to start from the read-only optical disc once.
In a possible embodiment, taking the electronic device as the setting server 1 as an example, the electronic device sends a setting instruction to the BMC intelligent platform management interface of the server 1 through the BMC switch, where the setting instruction includes an Internet Protocol (IP) address of the server 1, a BMC user name and password of the server 1, and a starting mode, and the starting mode is a single start in a read-only disc, so that the BMC of the server 1 can set the server 1 to start from the read-only disc at a single time according to the setting instruction.
303. And the electronic equipment mounts the target operating system on the server through an application programming interface provided by the mainboard management controller of the server.
In a possible implementation manner, taking the example that the electronic device mounts the target operating system on the server 1, the electronic device sends a mounting instruction to the BMC intelligent platform management interface of the server 1 through the BMC switch, where the mounting instruction includes an IP address of the server 1, a BMC user name and a password of the server 1, the target operating system, and a mounting identifier, and the mounting identifier is used to instruct the server 1 to mount the target operating system, so that the BMC of the server 1 can mount the target operating system according to the mounting instruction.
It should be noted that, the electronic device may also execute step 303 first and then execute step 302, and the specific execution sequence of steps 330 and 302 is not limited in this embodiment of the application.
304. The electronic device starts the server.
In a possible implementation manner, when the intelligent platform management interface of the server finds that the server is not powered on, the electronic device powers on the server to start the server; when the server is powered on through the intelligent platform management interface of the server, the electronic equipment restarts the server.
The process of starting the electronic device control server may be the following process: taking the example that the electronic device controls the server 1 to start, the electronic device sends a start instruction to the BMC intelligent platform management interface of the server 1 through the BMC switch, where the start instruction includes an IP address of the server 1, a BMC user name and a password of the server 1, and a start identifier, and the start identifier is used to instruct the server 1 to start, so that the BMC of the server 1 can power up the server 1 according to the start instruction.
The process of restarting the electronic device control server may be the following process: taking the electronic device control server 1 as an example for restarting, the electronic device BMC switch sends a restart instruction, the restart instruction includes an IP address of the server 1, a BMC user name and password of the server 1, and a restart identifier, and the restart identifier is used for indicating the server 1 to restart; based on the IP address of the server 1 in the received restart instruction, the BMC switch forwards the restart instruction to the server 1; according to the restart identifier in the restart instruction, an intelligent platform management interface in the server 1 issues a restart command to the BMC; after the BMC receives the restart command, the BMC controls the server 1 to power down first, and then controls the server 1 to power up.
305. And the server acquires the connection information of the server and the upper connection exchanger through a target program in the target operating system, and stores the connection information of the server and the upper connection exchanger in a target file.
In a possible implementation manner, through the target program and the target protocol, the server obtains connection information of the server and the upper switch, where the target program may store target information, where the target information is information generated based on the target protocol in the installation package, the target information may include switch port information, connection rate, media access control address, and the like, the target information may be stored in a TLV field, and the TLV field is used to store a MAC address, a connection rate, or switch port information, although the target information may also be other information, which is not specifically limited in this embodiment of the present application,
specifically, for example, when the network card port 100 of the server is connected to the switch port 200 of the upper switch, the target operating system is LiveOS, the target protocol is LLDP protocol, and the target information is switch port information, the LiveOS in the server starts to operate when the server is restarted, the LLDP protocol in the LiveOS indicates that the server and the upper switch both follow LLDP protocol, the server can obtain LLDP information sent by the upper switch through the switch port 200, the LLDP information is LLDPDU, the LLDPDU stores TLV carrying switch port information of the switch port 200, the target program in the LiveOS can analyze the switch port information of the switch port 200 stored in the TLV through the LLDP protocol, and then the connection information between the server and the upper switch may include switch port information of the switch port 200, a MAC address corresponding to the network card port 100, and high-speed serial computer expansion bus standard (peripheral component expansion bus, PCIe) number and slot number, the server may store the connection information in a target file, where the target file is used to store the connection information between each network card port on the server and the uplink switch, for example, store the switch port information of the switch port 200 and the MAC address, PCIe number, and slot number corresponding to the network card port 100 in the target file in an associated manner, and after the server stores the connection information between each network card interface and the switch interface in the target file, the target file stores the connection information between each network card port of the server and the uplink switch.
306. Through the intelligent platform management interface of the server, the electronic equipment opens an SOL channel between the electronic equipment and the server.
The mechanism (serial overlay, SOL) that redirects the input and output of the serial port of the managed system to the IP channel is an implementation manner of redirection function transmitted by a serial port controller on a motherboard based on IPMI command, and SOL redirects a local serial interface through an IPMI session, so that the server can output data to an electronic device through the redirected local serial interface.
This step 306 may be implemented by the following process:
when a target operating system in the server starts to run, serial port communication is opened based on defaults set in the target operating system by the electronic equipment, the electronic equipment can realize remote communication with the server, the target operating system issues a command for opening an SOL channel between the electronic equipment and the server to the BMC through an intelligent platform management interface, and after the SOL channel between the electronic equipment and the server is opened, the output normally fed back to the serial port by the target operating system can be redirected to the IP connection between the electronic equipment and the server, so that the electronic equipment can acquire the normal output and execution state of the target operating system, and the subsequent control of the electronic equipment to the server is facilitated.
It should be noted that, after the SOL channel between the server and the electronic device is opened, the electronic device sends an opening success response to the server through the SOL channel, where the opening success response is used to inform that the SOL channel of the electronic device has been successfully opened.
307. The server sends monitoring data to the electronic equipment, wherein the monitoring data are used for indicating that the target file of the server stores the connection information of the server and the upper connection exchanger.
In a possible implementation manner, each set of data in the target file is connection information between a network card port and a switch port of the server, and after a preset number of data are stored in the target file, the server sends monitoring data to the electronic device, where the monitoring data includes a storage address of the target file, a storage address corresponding to the preset number of data, and a storage identifier, and the storage identifier is used to indicate that the preset number of data are stored in the target file.
In a possible implementation manner, after all connection information of the server and the upper switch is stored in the target file, the server sends monitoring data to the electronic device, where the monitoring data includes a storage address and a storage identifier of the target file, and the storage identifier is used to indicate that the connection information of the server and the upper switch is stored in the target file.
308. The electronic device receives the monitoring data.
309. And reading the connection information of the server and the upper connection switch by the electronic equipment according to the connection information of the server and the upper connection switch indicated in the monitoring data.
When the electronic equipment is used for mounting a target operating system on the server and setting the starting of the server, the BMC user name and the password of the server are already sent to the server, and then, after the electronic equipment learns that the server is finished and the data of the upper-link switch is acquired and stored according to the received monitoring data, the electronic equipment can automatically log in the server, acquire the connection information of the server and the upper-link switch from the target file of the server and display the connection information of the server and the upper-link switch, so that a technician can judge whether the connection between the server and the upper-link switch is correct according to the displayed connection information of the server and the upper-link switch, and the condition that whether the connection between the server and the upper-link switch is correct or not is inquired manually can be avoided.
According to the embodiment of the application, the target operating system loaded with the target program and the target protocol is mounted on the server, so that the server can automatically acquire the connection information of the server and the upper connection switch, and further the electronic equipment can acquire the connection information of the server and the upper connection switch, the connection information of the server and the upper connection switch can be checked without manual work through plugging and unplugging optical fibers, the connection information of the server and the upper connection switch can be acquired only by mounting the target operating system on the server, the checking time is saved, and the checking efficiency is improved. And the communication between the electronic equipment and the servers can be realized through the BMC switch, so that the electronic equipment can check the connection condition of the servers and the upper connection switch by mounting the target operating system on the servers, the checking time is further shortened, and the checking efficiency is improved. And the link layer installed in the target operating system discovers the software package of the protocol stack, so that the server can automatically acquire the connection information between the server and the upper-connected switch, and the connection information between the server and the upper-connected switch can be acquired without performing excessive operation on the server. And by opening the SOL channel between the electronic equipment and the server, the server can send monitoring data to the electronic equipment, and according to the monitoring data, the electronic equipment can read the connection information between the server and the uplink switch from the server by remotely logging in the server.
In fig. 3, the electronic device mounts the target operating system through an application programming interface provided by a motherboard management controller of a server, in a possible implementation manner, the electronic device may set a PXE execution environment for the server, so that the server can mount the target operating system based on the PXE execution environment, referring to fig. 4, where fig. 4 is a flowchart of a connection detection method provided in an embodiment of the present application, and the method includes the steps of:
401. the electronic equipment loads a target program and an installation package of a target protocol in a target operating system, wherein the target program is used for analyzing interaction information between a server and an upper connection switch, and the target protocol is used for acquiring connection information of the server and the upper connection switch.
Wherein the target operating system may be LiveOS.
402. The electronic device sets the server to boot from the pre-boot execution environment a single time through the intelligent platform management interface of the server.
In a possible implementation manner, taking the electronic device as an example to set the server 1, the electronic device sends a first setting instruction to a BMC intelligent platform management interface of the server 1 through a BMC switch, where the first setting instruction includes an IP address of the server 1, a BMC user name and a password of the server 1, and a first starting manner, and the first starting manner is a single start from a pre-start execution environment, so that the BMC of the server 1 can set the server 1 to be single start from the pre-start execution environment according to the first setting instruction.
403. The electronic equipment sets a pre-starting execution environment of the server, and the pre-starting execution environment is used for mounting the target operating system.
In one possible implementation, the electronic device sets up a PXE execution environment in a two-layer environment in a server cluster, including setting a Dynamic Host Configuration Protocol (DHCP) server and a simple file transfer protocol (TFTP) server in the two-layer environment, and storing the target operating system in the two-layer environment.
404. The electronic device starts the server.
405. In a pre-boot execution environment, the server mounts a target operating system, the target operating system is loaded with a target program and an installation package of a target protocol, the target program is used for analyzing interaction information between the server and an upper-connection switch, and the target protocol is used for acquiring connection information between the server and the upper-connection switch.
When the server is restarted, the server enters a PXE flow, and specifically, the server requests an IP address and a storage address of a target operating system from a DHCP server; sending a target operating system acquisition request to a TFTP server according to the storage address of the target operating system acquired by the request, wherein the target operating system acquisition request carries the storage address of the target operating system; the TFTP server sends a target operating system to the server according to the target operating system acquisition request; and when the target operating system is received, the server automatically mounts the target operating system.
After the single board of the server is reset, according to the IP address of the server, the file required for PXE starting and the target operating system, the processor of the server starts the target operating system by running the file required for PXE starting.
406. And the server acquires the connection information of the server and the upper connection exchanger through a target program in the target operating system, and stores the connection information of the server and the upper connection exchanger in a target file.
407. Through the intelligent platform management interface of the server, the electronic equipment opens an SOL channel between the electronic equipment and the server.
408. The server sends monitoring data to the electronic equipment, wherein the monitoring data are used for indicating that the target file of the server stores the connection information of the server and the upper connection exchanger.
409. The electronic device receives the monitoring data.
410. And according to the connection information of the server and the upper connection switch indicated in the monitoring data, the electronic equipment reads the connection information of the server and the upper connection switch from the target file.
According to the embodiment of the application, the server is used for pre-starting the target operating system of the installation package loaded with the target program and the target protocol in the execution environment, so that the server can automatically acquire the connection information of the server and the upper connection switch, and further the electronic equipment can acquire the connection information of the server and the upper connection switch, the connection information of the server and the upper connection switch can be checked without manually plugging and unplugging the optical fiber, the target operating system is not required to be mounted on the server through the electronic equipment, the connection information of the server and the upper connection switch can be acquired only through the automatic target operating system mounted on the server, the checking time is saved, and the checking efficiency is improved. And the communication between the electronic equipment and the servers can be realized through the BMC switch, so that the electronic equipment can check the connection condition of the servers and the upper connection switch by mounting the target operating system on the servers, the checking time is further shortened, and the checking efficiency is improved. And the link layer installed in the target operating system discovers the software package of the protocol stack, so that the server can automatically acquire the connection information between the server and the upper-connected switch, and the connection information between the server and the upper-connected switch can be acquired without performing excessive operation on the server. And the SOL channel between the electronic equipment and the server is opened, so that the server can send monitoring data to the electronic equipment, and according to the monitoring data, the electronic equipment can read the connection information between the server and the uplink switch from the server by remotely logging in the server.
Fig. 5 is a structural device diagram of a connection detection device provided in an embodiment of the present application, and referring to fig. 5, the device includes:
a loading module 501, configured to execute step 301;
a mounting module 502 for executing the steps 302-403 and 402-303;
a control module 503 for executing the steps 304-305;
an obtaining module 504 is configured to perform step 306 and step 309.
Optionally, the mounting module 502 is configured to perform the steps 302-403 and 402-303.
Optionally, the loading module 501 is configured to:
installing a software package carrying a link layer discovery protocol stack in a target operating system;
installing a target program in the target operating system;
setting the target program to start up and run automatically;
and opening serial port communication between the electronic equipment and the server by default.
Optionally, the target program stores target information, where the target information includes switch port information, connection rate, and a media access control address.
The obtaining module is configured to perform the steps 306, 308, and 309.
Optionally, the apparatus further comprises:
the power-on module is used for powering on the server when the intelligent platform management interface of the server finds that the server is not powered on;
and the restarting module is used for restarting the server when the intelligent platform management interface of the server finds that the server is electrified.
Fig. 6 is a structural device diagram of a connection detection device according to an embodiment of the present application, and referring to fig. 6, the connection detection device is applied to a server, and the connection detection device includes:
a mounting module 601, configured to execute the step 405;
an obtaining module 602, configured to perform step 406;
a sending module 603, configured to execute step 408.
Optionally, the mounting module 601 is configured to:
when the server is started from the read-only optical disc for a single time, the target operating system is mounted through an application programming interface provided by a mainboard management controller of the server;
or the like, or, alternatively,
when the server boots from the pre-boot execution environment, the target operating system is mounted in the pre-boot execution environment.
Optionally, the obtaining module 603 is configured to:
and acquiring connection information of the server and the upper connection switch through target information and a target program in the target operating system, wherein the target information is interactive information between the server and the upper connection switch analyzed based on a target protocol, and the target information comprises switch port information, connection rate and a media access control address.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
It should be noted that: in the above embodiment, when the connection detection device performs connection detection, only the division of the functional modules is used as an example, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the connection detection apparatus and the connection detection method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (20)

1. A connection detection method applied to an electronic device, the method comprising:
loading a target program and an installation package of a target protocol in a target operating system, wherein the target program is used for analyzing interaction information between a server and an upper-connection switch, and the target protocol is used for acquiring connection information between the server and the upper-connection switch;
mounting the target operating system on the server;
controlling the server to run the target operating system;
and acquiring the connection information of the server and the upper connection switch through the target operating system.
2. The method of claim 1, wherein said mounting the target operating system on the server comprises:
setting the server to be started from a read-only optical disc once through an intelligent platform management interface of the server, and mounting the target operating system on the server through an application programming interface provided by a mainboard management controller of the server;
or the like, or, alternatively,
and setting the server to be started at a single time from a pre-starting execution environment through an intelligent platform management interface of the server, and setting the pre-starting execution environment of the server, wherein the pre-starting execution environment is used for mounting the target operating system.
3. The method of claim 1, wherein loading the target program and the installation package of the target protocol in the target operating system comprises:
installing a software package carrying a link layer discovery protocol stack in a target operating system;
installing a target program in the target operating system;
setting the target program to start up and automatically run;
and opening serial port communication between the electronic equipment and the server by default.
4. The method of claim 3, wherein the target program has target information stored therein, and wherein the target information comprises switch port information, connection rate, and media access control address.
5. The method of claim 1, wherein the obtaining, by the target operating system, connection information of the server and an upstream switch comprises:
starting an SOL channel between the electronic equipment and the server through an intelligent platform management interface of the server;
receiving monitoring data sent by the server, wherein the monitoring data is used for indicating that the target file of the server stores the connection information of the server and an upper connection switch;
and reading the connection information of the server and the upper connection switch from the target file according to the connection information of the server and the upper connection switch indicated in the monitoring data.
6. The method of claim 1, further comprising:
when the server is found to be not powered on through an intelligent platform management interface of the server, powering on the server;
and restarting the server when the server is powered on through the intelligent platform management interface of the server.
7. A connection detection method is applied to a server, and comprises the following steps:
mounting a target operating system, wherein the target operating system is loaded with a target program and an installation package of a target protocol, the target program is used for analyzing interaction information between a server and an upper switch, the target protocol is used for acquiring connection information between the server and the upper switch, and the target program and the installation package of the target protocol are loaded to the target operating system by first electronic equipment;
acquiring the connection information of the server and the upper connection switch through a target program in the target operating system, and storing the connection information of the server and the upper connection switch in a target file;
and sending monitoring data to the electronic equipment, wherein the monitoring data is used for indicating that the connection information of the server and the upper connection switch is stored in the target file of the server.
8. The method of claim 7, wherein mounting the target operating system comprises:
when the server is started from a read-only optical disc for a single time, the target operating system is mounted through an application programming interface provided by a mainboard management controller of the server;
or the like, or, alternatively,
and when the server is started from the pre-starting execution environment, mounting the target operating system in the pre-starting execution environment.
9. The method of claim 7, wherein the obtaining the connection information of the server and the upper switch by the target program in the target operating system comprises:
and acquiring connection information of the server and the upper connection switch through target information stored in a target program and the target protocol, wherein the target information is interactive information between the server and the upper connection switch analyzed based on the target protocol, and the target information comprises switch port information, connection rate and a media access control address.
10. A connection detecting apparatus applied to an electronic device, the apparatus comprising:
the system comprises a loading module, a target operating system and a target protocol module, wherein the loading module is used for loading a target program and an installation package of a target protocol in the target operating system, the target program is used for analyzing interaction information between a server and an upper-connected switch, and the target protocol is used for acquiring connection information between the server and the upper-connected switch;
the mounting module is used for mounting the target operating system on the server;
the control module is used for controlling the server to run the target operating system;
and the acquisition module is used for acquiring the connection information of the server and the upper connection switch through the target operating system.
11. The apparatus of claim 10, wherein the mounting module is configured to:
setting the server to be started from a read-only optical disc once through an intelligent platform management interface of the server, and mounting the target operating system on the server through an application programming interface provided by a mainboard management controller of the server;
or the like, or, alternatively,
and setting the server to be started at a single time from a pre-starting execution environment through an intelligent platform management interface of the server, and setting the pre-starting execution environment of the server, wherein the pre-starting execution environment is used for mounting the target operating system.
12. The apparatus of claim 10, wherein the loading module is configured to:
installing a software package carrying a link layer discovery protocol stack in a target operating system;
installing a target program in the target operating system;
setting the target program to start up and automatically run;
and opening serial port communication between the electronic equipment and the server by default.
13. The apparatus of claim 12, wherein the target program has target information stored therein, and wherein the target information comprises switch port information, connection rate, and medium access control address.
14. The apparatus of claim 10, wherein the obtaining module is configured to:
starting an SOL channel between the electronic equipment and the server through an intelligent platform management interface of the server;
receiving monitoring data sent by the server, wherein the monitoring data is used for indicating that the target file of the server stores the connection information of the server and an upper connection switch;
and reading the connection information of the server and the upper connection switch from the target file according to the connection information of the server and the upper connection switch indicated in the monitoring data.
15. The apparatus of claim 10, further comprising:
the power-on module is used for powering on the server when the intelligent platform management interface of the server finds that the server is not powered on;
and the restarting module is used for restarting the server when the intelligent platform management interface of the server finds that the server is electrified.
16. A connection detection apparatus, applied to a server, the apparatus comprising:
the system comprises a mounting module, a first electronic device and a second electronic device, wherein the mounting module is used for mounting a target operating system, the target operating system is loaded with a target program and an installation package of a target protocol, the target program is used for analyzing interaction information between a server and an upper switch, the target protocol is used for acquiring connection information between the server and the upper switch, and the target program and the installation package of the target protocol are loaded to the target operating system by the first electronic device;
the acquisition module is used for acquiring the connection information of the server and the upper connection switch through a target program in the target operating system and storing the connection information of the server and the upper connection switch in a target file;
and the sending module is used for sending monitoring data to the electronic equipment, wherein the monitoring data is used for indicating that the target file of the server stores the connection information of the server and the upper connection switch.
17. The apparatus of claim 16, wherein the mounting module is configured to:
when the server is started from a read-only optical disc for a single time, the target operating system is mounted through an application programming interface provided by a mainboard management controller of the server;
or the like, or, alternatively,
and when the server is started from the pre-starting execution environment, mounting the target operating system in the pre-starting execution environment.
18. The apparatus of claim 16, wherein the obtaining module is configured to:
and acquiring connection information of the server and the upper connection switch through target information stored in a target program and the target protocol, wherein the target information is interactive information between the server and the upper connection switch analyzed based on the target protocol, and the target information comprises switch port information, connection rate and a media access control address.
19. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to perform operations performed by the connection detection method of any one of claims 1 to 9.
20. A computer-readable storage medium having stored therein at least one instruction which is loaded and executed by a processor to perform operations performed by a connection detection method according to any one of claims 1 to 9.
CN201811597886.7A 2018-12-26 2018-12-26 Connection detection method and device, computer equipment and readable storage medium Active CN109587005B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811597886.7A CN109587005B (en) 2018-12-26 2018-12-26 Connection detection method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811597886.7A CN109587005B (en) 2018-12-26 2018-12-26 Connection detection method and device, computer equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN109587005A CN109587005A (en) 2019-04-05
CN109587005B true CN109587005B (en) 2020-11-06

Family

ID=65931820

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811597886.7A Active CN109587005B (en) 2018-12-26 2018-12-26 Connection detection method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN109587005B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110401561B (en) * 2019-06-26 2022-05-24 苏州浪潮智能科技有限公司 Server positioning method, system, equipment and computer readable storage medium
CN111245681A (en) * 2020-01-10 2020-06-05 华云数据有限公司 Method for obtaining interconnection information of server ports
CN111526044A (en) * 2020-04-13 2020-08-11 浪潮思科网络科技有限公司 Method, device and medium for discovering link between switch and server
CN111475177B (en) * 2020-04-14 2023-10-27 中国长城科技集团股份有限公司 Program writing method and device of server and terminal equipment
CN114006822A (en) * 2020-07-16 2022-02-01 中国移动通信有限公司研究院 Method and device for judging link between switch and server
CN113849354A (en) * 2021-08-26 2021-12-28 中兴通讯股份有限公司 Connection checking method, connection checking device, server and storage medium
CN115190044B (en) * 2022-06-28 2023-08-08 平安银行股份有限公司 Device connection state checking method, device and storage medium
CN115185759B (en) * 2022-09-05 2023-09-29 平安银行股份有限公司 Method, device and system for checking server wiring based on LLDP

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1595870A (en) * 2003-12-15 2005-03-16 浪潮电子信息产业股份有限公司 Method of remote parallel automatic installation of multiple types of operating systems via network
CN103297504B (en) * 2013-05-09 2016-05-11 浙江大学 The method of physics bare machine rapid deployment operating system in a kind of cloud data center
WO2015198574A1 (en) * 2014-06-23 2015-12-30 日本電気株式会社 Physical machine detection system, detection apparatus, detection method and detection program
CN106897061B (en) * 2017-02-21 2020-12-11 北京百度网讯科技有限公司 Operating system processing method and device based on pre-boot execution environment PXE
CN107995068B (en) * 2017-12-20 2020-04-07 北京百度网讯科技有限公司 Network port testing method, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN109587005A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
CN109587005B (en) Connection detection method and device, computer equipment and readable storage medium
US8997090B2 (en) Installing an operating system in a host system
CN108206847B (en) CDN management system, method and device
US8904160B2 (en) Electronic device which automatically sets up multiple operating systems for a test system by generating an emptied boot record status and loading a target operating system according to the emptied boot record status
US9182998B2 (en) Remote bios update in system having multiple computers
EP3495938B1 (en) Raid configuration
TW201500935A (en) System and method of controlling shutdown and booting of servers
US20070118654A1 (en) Method and apparatus for provisioning heterogeneous operating systems onto heterogeneous hardware systems
US20150178095A1 (en) Synchronous bmc configuration and operation within cluster of bmc
US8719390B2 (en) Server management apparatus and server management method
WO2017185954A1 (en) Method, host, and system for implementing usb device management
CN109254783A (en) A kind of server system installation method, device, equipment and readable storage medium storing program for executing
CN106980493B (en) Firmware management method and device
CN103024079A (en) Method for acquiring resource information of server, resource pool management system and server
CN110971689B (en) System installation method, device, system, equipment and storage medium
CN114024853A (en) Hardware information collection method and system for bare metal node and related components
CN113766041B (en) Method, device, equipment and storage medium for acquiring Media Access Control (MAC) address of first server
CN111352662B (en) Server starting sequence control method, system, terminal and storage medium
CN111209125B (en) Multi-process command line implementation method
CN111176893A (en) Computer remote control method, device, system and storage medium
CN113722211B (en) BMC debugging method, device, system and embedded equipment
CN110568946A (en) Port control method, device and medium
CN110955537B (en) Method and device for containing pipes by physical machine
CN111753309A (en) Display card switching method, server and storage medium
CN114050971B (en) Server configuration method, device, system, electronic equipment and storage medium

Legal Events

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