Server starting method and device, electronic equipment and storage medium

By establishing a multicast communication connection between the bare metal server and the storage server, the storage server sends the image once, and the bare metal server receives and mounts the virtual blocks. This solves the problem of access pressure and CPU resource consumption of the storage server during batch startup, improves the startup success rate, and simplifies the upgrade process.

CN121743263APending Publication Date: 2026-03-27NEW H3C BIG DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

When starting bare metal servers in batches, the storage server experiences high access pressure and CPU resource consumption. Network bandwidth bottlenecks lead to low startup success rates, and network transmission errors cause retransmissions, worsening network conditions.

Method used

By establishing a multicast communication connection between the bare metal server and the storage server, the storage server sends the first image at a time, the bare metal server receives and mounts the virtual block, and reads the system bootloader, which reduces the access pressure and CPU resource consumption of the storage server and improves the success rate of image acquisition.

Benefits of technology

It effectively reduces the access pressure and CPU resource consumption of storage servers, improves the batch startup success rate of bare metal servers, and simplifies the upgrade process of operating systems and software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121743263A_ABST
    Figure CN121743263A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of servers, and discloses a server starting method and device, electronic equipment and a storage medium, and the method comprises the steps: in response to a multicast connection establishment message sent by a storage server, establishing multicast communication connection between a bare metal server and the storage server; receiving a first mirror image sent by the storage server based on the multicast communication connection; mounting the first mirror image to a bare metal server, and generating a first virtual block corresponding to the first mirror image on the bare metal server; in response to reading the system boot bootstrap from the first virtual block, an operating system of the bare metal server is booted. Through the multicast communication connection, the storage server can carry out one-time sending, all bare metal servers started in batches can receive the first mirror image, the access pressure of the storage server can be reduced, CPU resources of the storage server can be saved, and the success rate of starting the bare metal servers in batches can be increased.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of servers, and in particular to a server starting method and device, electronic equipment and storage medium. BACKGROUND

[0002] A plurality of bare metal servers started in batches can be applied in fields such as sequencing, weather simulation, model reasoning, etc. At present, the cloud disk volume located on a storage server is usually mounted as a system disk of a bare metal server by using an Internet Small Computer System Interface (iSCSI) protocol to realize starting a plurality of bare metal servers in batches.

[0003] In the process of mounting the system disk, each bare metal server needs to establish a unicast connection with the storage server to obtain the cloud disk related files such as the first image on the storage server, which results in a large access Input / Output (I / O) pressure of the storage server and a large consumption of Central Processing Unit (CPU) resources, and the limited network bandwidth is also occupied by the bare metal servers. When the network bandwidth reaches a bottleneck, network transmission errors will trigger new retransmissions, which will further deteriorate the network and thus result in a low success rate of starting the bare metal servers in batches. SUMMARY

[0004] The present application provides a server starting method and device, electronic equipment and storage medium to solve the problem of a low success rate of starting bare metal servers in batches.

[0005] In a first aspect, the present application provides a server starting method, which comprises: creating a groupcast communication connection between a bare metal server and a storage server in response to a groupcast connection establishment message sent by the storage server; receiving a first image sent by the storage server based on the groupcast communication connection; mounting the first image to the bare metal server to generate a first virtual block corresponding to the first image on the bare metal server; and starting an operating system of the bare metal server in response to reading a system starting boot program from the first virtual block.

[0006] The server starting method provided by the embodiment can enable the bare metal servers to create multicast communication connections with the storage servers by responding to the multicast connection establishment messages sent by the storage servers. Based on the multicast communication connections, the bare metal servers can receive the first image sent by the storage servers, so that the first image can be received by all the bare metal servers started in batches through one sending of the storage server, and the bare metal servers do not need to separately access the storage server to obtain the first image, which can reduce the access pressure of the storage server, save the CPU resources of the storage server, and improve the success rate of the bare metal servers in obtaining the first image. After the bare metal servers obtain the first image, the bare metal servers can mount the first image and read the system starting program from the first virtual block obtained by the mounting to start the operating system of the bare metal servers, so that the success rate of starting the bare metal servers in batches can be improved.

[0007] In an optional implementation, the creating of the multicast communication connection between the bare metal server and the storage server in response to the multicast connection establishment message sent by the storage server comprises: if the multicast connection establishment message sent by the storage server is listened to, executing a multicast join command to join a multicast group of the multicast connection establishment message; and the joining of the bare metal server into the multicast group represents that the multicast communication connection between the storage server and the bare metal server is established.

[0008] The bare metal server can respond to the multicast connection establishment message sent by the storage server by executing the multicast join command, so that the multicast communication connection between the storage server and each bare metal server can be quickly established. Subsequently, the storage server can transmit the first image once by means of the multicast communication connection, and each bare metal server can receive the first image, so that the access pressure of the storage server can be further reduced and the CPU resources of the storage server can be saved.

[0009] In an optional implementation, the receiving of the first image sent by the storage server based on the multicast communication connection comprises: receiving a plurality of messages corresponding to the first image based on the multicast communication connection, the plurality of messages being sent by the storage server to a switch and forwarded to the bare metal server by the switch; and analyzing and assembling the plurality of messages to obtain the first image.

[0010] Through the multicast communication connection, the storage server can send the plurality of messages corresponding to the first image to the switch one by one and forward the plurality of messages to each bare metal server by the switch, so that the access pressure of the storage server can be unloaded in the network, and each bare metal server does not need to separately access the storage server, which can reduce the access pressure of the storage server and save the CPU resources of the storage server.

[0011] In an optional embodiment, the method further comprises: connecting a second image located on the storage server based on the unicast communication connection between the bare metal server and the storage server, the second image being created by the storage server based on the first image, the second image being used to store difference data corresponding to the first image; mounting the second image to the bare metal server, generating a second virtual block corresponding to the second image on the bare metal server, and configuring a mirror indication field of the second virtual block to indicate the first image; reading the first virtual block or the second virtual block based on the mirror indication field to obtain a system startup program; and starting an operating system of the bare metal server based on the system startup program.

[0012] The second image is created based on the first image and mounted to the bare metal server. In the process of starting the bare metal server, the second image can store difference data corresponding to the first image, so that the first image is not modified, and data involved in the process of starting the bare metal server that needs to be written is written into the second virtual block, such as separating the variable state (user data) from the immutable system (the first image), so that future upgrading of the operating system or software only needs to distribute a new, read-only first image, and the user data is still retained in the second image, so that the upgrading of the operating system or software becomes relatively simple.

[0013] In an optional embodiment, reading the first virtual block or the second virtual block based on the mirror indication field to obtain a system startup program comprises: reading the system startup program from the second virtual block; or if the system startup program is not read from the second virtual block, redirecting to the first virtual block based on the mirror indication field and reading the first virtual block to obtain the system startup program.

[0014] In the process of starting the bare metal server, the second virtual block can be used as an entry for reading and writing data, and the system startup program is read from the second virtual block. When the second image is initially created, the second image does not store valid business data, so there may be a situation that the system startup program cannot be successfully read when the system startup program is read from the second virtual block. In this case, the first virtual block can be redirected by means of the mirror indication field (backfile field) of the second virtual block, and the system startup program is read from the first virtual block, which can improve the success rate of reading the system startup program and further improve the success rate of batch starting the bare metal server.

[0015] In an alternative embodiment, the method further comprises: if a read instruction of the first data is received, obtaining a first logical address of the first data; if a first physical address corresponding to the first logical address exists, reading the first data from the second virtual block device based on the first physical address; and if the first physical address corresponding to the first logical address does not exist, redirecting to the first virtual block based on the mirror indication field and reading the first data from the first virtual block.

[0016] If the first data is modified data, the first data can be directly read from the second virtual block, which is the shortest path and has the lowest delay; if the first data is unmodified data, the first data is redirected to the first virtual block for reading. Since the first mirror corresponding to the first virtual block has been cached to the local memory, the reading speed is faster. Through the data reading strategy of the present application, the I / O request is intelligently directed to the path with the highest performance.

[0017] In an alternative embodiment, the method further comprises: if a write instruction of the second data is received, obtaining a second logical address of the second data; if a second physical address corresponding to the second logical address exists, writing the second data to the second virtual block based on the second physical address; and if the second physical address corresponding to the second logical address does not exist, writing the second data to the second virtual block based on a pre-configured copy-on-write strategy.

[0018] For the case where the second physical address corresponding to the second logical address exists, the second data is directly written to the second physical address, so that the second data can be quickly written to the second virtual block. For the case where the second physical address corresponding to the second logical address does not exist, the second data is written to the second virtual block based on the copy-on-write strategy, which realizes that the data in the first virtual block is read-only reference, and the second data such as business data and configuration modification generated during the running of the bare metal server is written to the second virtual block, which not only ensures the purity of the system mirror, but also avoids data loss after reboot.

[0019] In a second aspect, the present application provides a starting device of a server, which comprises: a creating module configured to create a multicast communication connection between a bare metal server and a storage server in response to a multicast connection establishment message sent by the storage server; a receiving module configured to receive a first mirror sent by the storage server based on the multicast communication connection; a first mounting module configured to mount the first mirror to the bare metal server and generate a first virtual block corresponding to the first mirror on the bare metal server; and a first starting module configured to start an operating system of the bare metal server in response to reading a system startup program from the first virtual block.

[0020] In a third aspect, the present application provides an electronic device, comprising a memory and a processor, which are connected to each other in communication, the memory stores computer instructions, and the processor executes the computer instructions to perform the starting method of the server according to the first aspect or any one of the corresponding embodiments thereof.

[0021] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions for making a computer execute the starting method of the server according to the first aspect or any one of the corresponding embodiments thereof.

[0022] In a fifth aspect, the present application provides a computer program product, which comprises computer instructions for making a computer execute the starting method of the server according to the first aspect or any one of the corresponding embodiments thereof. BRIEF DESCRIPTION OF DRAWINGS

[0023] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the drawings needed in the specific embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0024] Figure 1 is a schematic diagram of mounting a cloud disk volume for a bare metal server in the related art; Figure 2 is a schematic diagram of an application scenario according to an embodiment of the present application; Figure 3 is a first flowchart of the starting method of the server according to an embodiment of the present application; Figure 4 is a second flowchart of the starting method of the server according to an embodiment of the present application; Figure 5 is a third flowchart of the starting method of the server according to an embodiment of the present application; Figure 6 is a structural block diagram of the starting device of the server according to an embodiment of the present application; Figure 7 is a hardware structure schematic diagram of the electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0026] It can be understood that, before using the technical solutions disclosed in the embodiments of the present application, the type of personal information, the range of use, the scene of use and the like involved in the present application should be informed to the user and the authorization of the user should be obtained through appropriate means according to relevant laws and regulations.

[0027] The terms "first", "second" are only for descriptive purpose, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more than two, unless otherwise specifically limited.

[0028] The multiple bare metal servers in batch start can be applied in the fields of sequencing, weather simulation, model reasoning and the like. At present, the cloud disk volume on the storage server is usually mounted as the system disk of the bare metal server by using the Internet Small Computer System Interface (iSCSI) protocol to realize the batch start of multiple bare metal servers. The cloud disk volume on the storage server is the cloud disk volume created by the storage server for the bare metal server in response to the application instruction of the bare metal server, and the cloud disk volume is created based on the existing first image on the storage server.

[0029] As shown in FIG. 1, the storage server creates the cloud disk volume 1 for the bare metal server 1 and the cloud disk volume 2 for the bare metal server 2 based on the existing first image on the storage server in response to the application instructions of the bare metal server 1 and the bare metal server 2. Figure 1 The bare metal server 1 loads the cloud disk volume 1 through the unicast communication connection and mounts the cloud disk volume 1 as the system disk of the bare metal server 1 to realize the start of the operating system of the bare metal server 1. The bare metal server 2 loads the cloud disk volume 2 through the unicast communication connection and mounts the cloud disk volume 2 as the system disk of the bare metal server 2 to realize the start of the operating system of the bare metal server 2.

[0030] However, the scheme shown in the foregoing has some problems. For example, for the storage server, the cloud disk volumes corresponding to different bare metal servers are all generated based on the first image, that is, the same part of different cloud disk volumes is the first image, and the differential data of different cloud disk volumes is written through the copy-on-write (COW) technology. When reading the first image, the storage server can speed up reading through cache access, but has a higher requirement for the cache algorithm. If the parameters of the cache algorithm are not applicable, the same data will still be read from the hard disk of the storage server repeatedly, and the reading efficiency is low. When a large number of bare metal servers are started in batches, a large amount of volume input / output (I / O) is accumulated in a short time, causing a large access I / O pressure of the storage server.

[0031] In addition, because the Internet Protocol (IP) addresses of the bare metal servers are different, even if the storage server can read all the data blocks of the first image through caching, the storage server still needs to encapsulate different IP headers as response messages, which consumes a large amount of CPU of the storage server and is not efficient. Moreover, when the network bandwidth bottleneck is reached, not only will the limited network bandwidth be occupied by the bare metal servers, but also new retransmissions will be generated due to transmission errors, further deteriorating the network, and thus causing a low success rate of starting the bare metal servers in batches.

[0032] Therefore, in the present application, when a plurality of bare metal servers are started in batches, a multicast communication connection is established between the plurality of bare metal servers and the storage server. Through the multicast communication connection, the storage server sends the first image stored by the storage server and shared by the plurality of bare metal servers and used for starting the operating system of the bare metal servers to each bare metal server, so that the plurality of bare metal servers do not need to access the storage server individually to obtain the first image, the access pressure of the storage server can be reduced, the CPU resources of the storage server can be saved, and the success rate of the plurality of bare metal servers obtaining the first image can be improved, thereby the success rate of starting the plurality of bare metal servers in batches can be improved.

[0033] As an optional application scenario of the present application, as shown in Figure 2 The starting system of the server can include a plurality of bare metal servers, a network such as a switch, and a storage server. The plurality of bare metal servers and the storage server can establish a communication connection through the network. For example, the plurality of bare metal servers and the storage server can establish a multicast communication connection through the network, or can establish a unicast communication connection through the network.

[0034] The storage server is configured to store a first image shared by the plurality of bare metal servers and used to start an operating system of the bare metal servers. The storage server is further configured to distribute the first image shared by the plurality of bare metal servers and used to start the operating system of the bare metal servers to the plurality of bare metal servers through a multicast communication connection between the plurality of bare metal servers and the storage server. The bare metal server is a service form for high-performance computing by directly accessing physical hardware resources, and the architecture retains the performance advantages of traditional physical servers and integrates the elastic deployment capability of cloud services.

[0035] According to the embodiments of the present application, a server starting method is provided. It should be noted that the steps shown in the flowchart can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0036] In the present embodiment, a server starting method is provided, which can be used for bare metal servers, Figure 3 is a flowchart of the server starting method according to the embodiments of the present application, as Figure 3 shown, the flow includes the following steps: Step S301, in response to a multicast connection establishment message sent by the storage server, a multicast communication connection between the bare metal server and the storage server is created.

[0037] The storage server can be a server for storing the first image, but the storage server is not limited to be a single server, and can also be a distributed storage cluster. The present application does not make specific limitation here, as long as it can provide storage service for the first image.

[0038] The bare metal server is a service form for high-performance computing by directly accessing physical hardware resources, and the architecture retains the performance advantages of traditional physical servers and integrates the elastic deployment capability of cloud services.

[0039] The multicast connection establishment message can be a message initiated by the storage server to notify the bare metal server to join a specified multicast group. As a specific example, the storage server can execute the udp-sender command to send the multicast connection establishment message to the bare metal server. For example, the code corresponding to the udp-sender command can be udp-sender \--interfaceeth0 \--multicast \--mcast-address 239.192.0.1\--port 9000\--file / path / to / mirrorfile.img\--wait 60\--rate 100M.

[0040] After the storage server executes the udp-sender command, if all the bare metal servers have joined the multicast group, the storage server starts to transmit the first image as the sender of the multicast group. The condition for the storage server to determine whether all the bare metal servers have joined the multicast group can be that the storage server waits for a predetermined time, such as 60 seconds in the udp-sender command, and then starts to transmit the first image. The storage server can also count the total number of bare metal servers that respond to the udp-sender command, and if the total number reaches a predetermined value, the storage server can start to transmit the first image.

[0041] After the bare metal server listens to the multicast connection message sent by the storage server, the bare metal server can respond to the multicast connection message to join the multicast group initiated by the storage server. After the multicast communication connection between the storage server and the bare metal server is established, the storage server is the sender of the multicast group, and the bare metal server is the receiver of the multicast group.

[0042] At step S302, the first image sent by the storage server is received based on the multicast communication connection.

[0043] The first image can be a complete copy of an operating system disk that has been installed and configured and can be directly started. The first image internally contains a partitioned disk structure, a Grand Unified Bootloader (GRUB), a Linux kernel and an initrd file, and all necessary system libraries, configuration files and application programs.

[0044] After the bare metal server receives the first image sent by the storage server, the bare metal server can first store the first image in a memory area of the bare metal server, such as / dev / shm / .

[0045] At step S303, the first image is mounted to the bare metal server, and a first virtual block corresponding to the first image is generated on the bare metal server.

[0046] Here, the first image mirrorfile.img can be mounted to the bare metal server as a disk. For example, the bare metal server can mount the first image mirrorfile.img to the bare metal server by a command such as mount -o ro / dev / loop0 / dec / shm / mirrorfile.img, and generate a first virtual block corresponding to the first image on the bare metal server. At the same time, the first virtual block is configured as a read-only attribute, and subsequent data in the first image can only be read through the first virtual block, but the data in the first image cannot be modified, which can ensure the integrity of the data in the first image.

[0047] After the first virtual block corresponding to the first image is generated on the bare metal server, a disk symbol of the first virtual block on the bare metal server can be obtained, for example, the disk symbol of the first virtual block on the bare metal server can be dev / loop0.

[0048] Step S304, in response to reading the system startup bootloader from the first virtual block, starting the operating system of the bare metal server.

[0049] The system startup bootloader can be the GRUB program shown in the foregoing, and the GRUB program can be used to guide the startup of the operating system of the bare metal server. After the first virtual block is generated on the bare metal server, the first virtual block can be used as an entry for reading data in the first image, and the system startup bootloader can be obtained by reading the first virtual block. After the system startup bootloader is read, the system startup bootloader is used to gradually guide the bare metal server to successfully start the operating system corresponding to the first image, so that the bare metal server is started.

[0050] The server startup method provided in the embodiment can be used for a bare metal server, and the bare metal server establishes a multicast communication connection with a storage server in response to a multicast connection establishment message sent by the storage server. Based on the multicast communication connection, the bare metal server can receive a first image sent by the storage server, so that all bare metal servers to be started in batches can receive the first image by one sending of the storage server, and the bare metal server does not need to separately access the storage server to obtain the first image, which can reduce the access pressure of the storage server, save CPU resources of the storage server, and improve the success rate of the bare metal server to obtain the first image. After the bare metal server obtains the first image, the first image is mounted, and a system startup bootloader is read from a first virtual block obtained by mounting to start the operating system of the bare metal server, so that the success rate of starting the bare metal server in batches can be improved.

[0051] In the embodiment, a server startup method is provided, which can be used for a bare metal server, Figure 4 is a flowchart of the server startup method according to the embodiment of the application, as shown in the figure, the flowchart includes the following steps: Figure 4 The flowchart includes the following steps: Step S401, in response to a multicast connection establishment message sent by a storage server, creating a multicast communication connection between a bare metal server and the storage server.

[0052] Specifically, the above step S401 includes: In step S4011, if the multicast connection establishment message sent by the storage server is monitored, a multicast join command is executed to join the multicast group of the multicast connection establishment message. The bare metal server joining the multicast group indicates that the multicast communication connection between the storage server and the bare metal server is established.

[0053] The multicast join command can be a command for joining the multicast group initiated by the storage server. As a specific example, the multicast join command can be a udp-receiver command. For example, the code corresponding to the udp-receiver command can be udp-receiver\--interface eth0 \--multicast \--mcast-address 239.192.0.1 \--port9000\--file / drv / shm / mirrorfile.img.

[0054] The bare metal server responds to the multicast connection establishment message sent by the storage server by executing the multicast join command, so that the multicast communication connection between the storage server and each bare metal server can be quickly established. Subsequently, by means of the multicast communication connection, the storage server can transmit the first mirror image at a time, and each bare metal server can receive the first mirror image, further reducing the access pressure on the storage server and saving the CPU resources of the storage server.

[0055] In step S402, the first mirror image sent by the storage server is received based on the multicast communication connection.

[0056] Specifically, the above step S402 includes: In step S4021, a plurality of packets corresponding to the first mirror image are received based on the multicast communication connection, the plurality of packets being sent by the storage server to the switch and forwarded by the switch to the bare metal server.

[0057] The storage server can split the first mirror image into a plurality of mirror image blocks according to the data packet size of a network protocol such as the User Datagram Protocol (UDP), and encapsulate each mirror image block into a packet according to the encapsulation format of the network protocol to obtain a plurality of packets corresponding to the first mirror image.

[0058] Here, the storage server and each bare metal server can also be configured with a multicast IP address. For example, as shown in FIG. 2, the storage server and each bare metal server can be configured with a multicast IP address, and the multicast IP address of the storage server can be 239.192.0.1, and the multicast IP address of each bare metal server can be 239.192.0.2. Figure 2As shown, the multicast IP address of the storage server and the bare metal servers 1, 2 and 3 can be configured as 239.192.0.1 and the port as 9000. Meanwhile, the bare metal servers access the software-defined networking controller (SDN controller), and the SDN controller issues a multicast flow table to the switch, and the switch issues the multicast flow table to the forwarding chip inside the switch.

[0059] The storage server can send the multiple messages corresponding to the first image to the switch one by one, and the forwarding chip inside the switch determines the forwarding port and replicates the messages according to the multicast flow table, and then forwards the messages to each bare metal server through the forwarding port.

[0060] In step S4022, the multiple messages are parsed and assembled to obtain the first image.

[0061] After receiving the multiple messages corresponding to the first image, the bare metal server can parse and assemble the multiple messages according to the parsing and assembling methods corresponding to the network protocol such as the UDP protocol, so as to obtain the first image.

[0062] Through the multicast communication connection, the storage server can send the multiple messages corresponding to the first image to the switch one by one, and the switch forwards the messages to each bare metal server. In this way, the access pressure on the storage server can be unloaded in the network, and each bare metal server does not need to access the storage server individually, which can reduce the access pressure on the storage server and save the CPU resources of the storage server.

[0063] In step S403, the first image is mounted to the bare metal server, and a first virtual block corresponding to the first image is generated on the bare metal server. For details, please refer to Figure 3 The step S303 of the embodiment shown will not be repeated here.

[0064] In step S404, in response to reading the system startup bootloader from the first virtual block, the operating system of the bare metal server is started. For details, please refer to Figure 3 The step S304 of the embodiment shown will not be repeated here.

[0065] The server startup method provided in this embodiment involves each bare metal server, upon receiving a multicast connection establishment message from the storage server, joining the multicast group initiated by the storage server by executing a multicast join command, thereby establishing a multicast communication connection between the bare metal server and the storage server. Using this multicast communication connection, the storage server only needs to send multiple packets corresponding to the first image to the switch. The switch can then forward the packets to each bare metal server via replication. This offloads the access pressure on the storage server to the network, eliminating the need for each bare metal server to access the storage server individually, thus reducing the access pressure on the storage server and saving its CPU resources.

[0066] This embodiment provides a server startup method that can be used for bare metal servers. Figure 5 This is a flowchart of a server startup method according to an embodiment of the present invention, such as... Figure 5 As shown, the process includes the following steps: Step S501: In response to the multicast connection establishment message sent by the storage server, a multicast communication connection is established between the bare metal server and the storage server. For details, please refer to [link to relevant documentation]. Figure 3 Step S301 of the illustrated embodiment will not be described again here.

[0067] Step S502: Receive the first image sent by the storage server based on the multicast communication connection. See details below. Figure 3 Step S302 of the illustrated embodiment will not be described again here.

[0068] Step S503: Mount the first image to the bare metal server, and generate the first virtual block corresponding to the first image on the bare metal server. For details, please refer to [link to relevant documentation]. Figure 3 Step S303 of the illustrated embodiment will not be described again here.

[0069] Step S504: In response to reading the system boot loader from the first virtual block, the operating system of the bare metal server is started. For details, please refer to [link to relevant documentation]. Figure 3 Step S304 of the illustrated embodiment will not be described again here.

[0070] Step S505: Based on the unicast communication connection between the bare metal server and the storage server, a second image located on the storage server is connected. The second image is created by the storage server based on the first image and is used to store the difference data corresponding to the first image.

[0071] Bare metal servers have their own IP addresses, and storage servers also have their own IP addresses. For example... Figure 2As shown, the IP address of the bare metal server 1 can be 1.1.1.1, the IP address of the bare metal server 2 can be 1.1.1.2, and the IP address of the bare metal server 3 can be 1.1.1.3, and the IP address of the storage server can be 1.1.1.111. Therefore, a unicast communication connection can be established between the bare metal servers and the storage server through the IP addresses.

[0072] Here, the second image is created by the storage server based on the first image when the storage server receives the application instruction sent by the bare metal server. The application instruction can be an instruction indicating the storage server to create the second image. The second image can be a volume located on the storage server and has a certain storage space. However, no valid business data is stored in the second image created for the first time. At the same time, when the second image is created for the first time, the backfile field (i.e., the image indication field) of the second image is set to the first image, indicating that the back volume of the second image is the first image, that is, the second image is created based on the first image.

[0073] After establishing the unicast communication connection between the bare metal servers and the storage server, the bare metal server can connect to the second image located on the storage server to obtain the disk symbol corresponding to the second image, such as / dev / sdb.

[0074] In the process of starting the operating system of the bare metal server by using the system boot program in the first image, data writing is often involved. By creating the second image and writing the data involved in the process of starting the operating system of the bare metal server into the second image on the storage server, it can be achieved without modifying any data about the first image in the first virtual block, thereby starting the operating system of the bare metal server, and further achieving the start of the bare metal server.

[0075] In step S506, the second image is mounted to the bare metal server, and a second virtual block corresponding to the second image is generated on the bare metal server, and the image indication field of the second virtual block is configured to indicate the first image.

[0076] Here, the second image can be mounted to the bare metal server as a disk. For example, the bare metal server can mount the second image to the bare metal server by a command such as mount -o / dev / sdb, and generate a second virtual block corresponding to the second image on the bare metal server.

[0077] The backfile field of the second virtual block is configured as the first mirror file mirrorfile.img, so as to represent the back-end mirror of the second virtual block as the first mirror. In the process of starting the operating system of the bare metal server, the second virtual block can be used as an entry to start reading the system startup bootloader. As described above, the second mirror does not store valid business data when it is initially created, so the system startup bootloader cannot be successfully read from the second virtual block. Therefore, the backfile field can be used to redirect to the first virtual block, and the system startup bootloader can be obtained by reading the first virtual block.

[0078] As a specific example, the bare metal server can use the iscsi initial tool to connect and mount the second mirror of the storage server 1.1.1.111 through unicast communication connection. After mounting, the disk symbol is / dev / sdb. Specifically, the bare metal server can execute a command such as iscsiadm -m node -T iqn.vol1 -p 1.1.1.111:3260 –login to connect the second mirror located in the storage server 1.1.1.111.

[0079] In step S507, the first virtual block or the second virtual block is read based on the mirror indication field to obtain the system startup bootloader.

[0080] As a specific example, the system startup bootloader can be obtained by reading the first virtual block. Of course, the system startup bootloader can also be obtained by reading the second virtual block. Since the second virtual block is configured with the mirror indication field (backfile field), after the system startup bootloader is not read from the second virtual block, the backfile field can be used for redirection, thereby improving the success rate of reading the system startup bootloader.

[0081] Specifically, step S507 includes: In step S5071, the system startup bootloader is read from the second virtual block.

[0082] As described above, after the second virtual block is mounted and generated on the bare metal server, in the process of starting the bare metal server, the second virtual block can be used as an entry for data reading and writing, and the system startup bootloader can be read from the second virtual block.

[0083] Specifically, step S507 further includes: In step S5072, if the system startup bootloader is not read from the second virtual block, the first virtual block is redirected based on the mirror indication field, and the system startup bootloader is obtained by reading the first virtual block.

[0084] As shown in the foregoing, the second mirror image is not stored with valid business data at the initial creation, and therefore, when reading the system startup bootloader from the second virtual block, there may be a situation that the system startup bootloader cannot be successfully read. In this case, the system startup bootloader can be redirected to the first virtual block and read from the first virtual block by means of the mirror image indication field, i.e., the backfile field, of the second virtual block, so as to improve the reading success rate of the system startup bootloader and further improve the batch startup success rate of the bare metal server.

[0085] In step S508, the operating system of the bare metal server is started based on the system startup bootloader. For details, refer to Figure 3 The step S304 of the embodiment shown in the foregoing will not be repeated here.

[0086] In some optional embodiments, the method further includes: In step a1, if the write instruction of the second data is received, the second logical address of the second data is acquired.

[0087] In step a2, if the second physical address corresponding to the second logical address exists, the second data is written into the second virtual block based on the second physical address.

[0088] In step a3, if the second physical address corresponding to the second logical address does not exist, the second data is written into the second virtual block based on the pre-configured copy-on-write strategy.

[0089] Here, after the second logical address of the second data is acquired, the metadata mapping table corresponding to the second virtual block can be acquired first. The metadata mapping table of the second virtual block is used to record the mapping relationship between the logical address and the physical address of the data stored in the second virtual block. Therefore, the second logical address can be used to query the metadata mapping table of the second virtual block to determine whether the second physical address for the second data exists in the metadata mapping table of the second virtual block.

[0090] If the second physical address of the second data can be obtained, it indicates that the second data is not written into the second virtual block for the first time, which is equivalent to modifying the data previously written into the second virtual block by using the second data, and therefore, the second data can be written into the second virtual block by means of the second physical address. If the second physical address of the second data cannot be obtained, it indicates that the second data is written into the second virtual block for the first time, and therefore, the second data can be written into the second virtual block based on the copy-on-write strategy.

[0091] The specific process of writing the second data into the second virtual block based on the copy-on-write strategy can be: finding the whole page data related to the second data from the first virtual block, copying and storing the whole page data to the second virtual block, and then writing the second data into the whole page data in the second virtual block.

[0092] In addition, after the second data is written into the second virtual block, a mapping relationship between the storage physical address corresponding to the second data and the second logical address of the second data can be generated based on the storage physical address of the second data in the second virtual block and the second logical address of the second data, and the mapping relationship is updated into the metadata mapping table of the second virtual block to obtain an updated metadata mapping table. Subsequently, the storage physical address of the second data can be queried based on the updated metadata mapping table and the second logical address corresponding to the second data, so as to realize reading of the second data from the second virtual block.

[0093] For the case that the second logical address corresponds to the second physical address, the second data is directly written into the second physical address, so that the second data can be quickly written into the second virtual block. For the case that the second logical address does not correspond to the second physical address, the second data is written into the second virtual block based on the copy-on-write strategy, so that the data in the first virtual block is taken as a read-only reference, and the second data such as business data and configuration modification generated during the running of the bare metal server is written into the second virtual block, which not only ensures the purity of the system image, but also avoids data loss after rebooting.

[0094] In some optional embodiments, the method further comprises: Step b1, if the read instruction of the first data is received, the first logical address of the first data is obtained.

[0095] Step b2, if the first logical address corresponds to the first physical address, the first data is read from the second virtual block device based on the first physical address.

[0096] Step b3, if the first logical address does not correspond to the first physical address, the first virtual block is redirected based on the image indication field, and the first data is read from the first virtual block.

[0097] Here, after the first logical address of the first data is obtained, the metadata mapping table of the second virtual block can be queried by using the first logical address. If the first physical address of the first data can be obtained, it indicates that the first data is stored in the second virtual block, which is equivalent to that the first data is modified data, and therefore the first data can be read from the second virtual block by using the first physical address. If the first physical address of the first data cannot be obtained, it indicates that the first data is read from the second virtual block for the first time and the first data is not stored in the second virtual block, which is equivalent to that the first data is unmodified data, and therefore the first data can be read from the first virtual block by using the image indication field such as the backfile field.

[0098] If the first data is modified data, it can be directly read from the second virtual block, the path is the shortest and the delay is the lowest; if the first data is unmodified data, it is redirected to the first virtual block for reading. Since the first virtual block corresponds to the first image which has been cached to the local memory, the reading speed is faster. Through the data reading strategy of the present application, the I / O request is intelligently directed to the highest performance path.

[0099] The server starting method provided by the embodiment creates a second image based on the first image and mounts the second image to the bare metal server. In the process of starting the bare metal server, the second image can store the differential data corresponding to the first image, so that the first image is not modified, and the data that needs to be written in the process of starting the bare metal server is ingeniously written into the second virtual block, such as the variable state (user data) and the immutable system (first image) are separated, so that in the future, the operating system or software upgrade only needs to distribute a new, read-only first image, and the user data is still retained in the second image, so that the operating system or software upgrade becomes relatively simple.

[0100] As a specific application embodiment of the present application, as shown in Figure 2 The bare metal servers such as bare metal server 1, bare metal server 2 and bare metal server 3 can send application instructions to the storage server, and the storage server creates a second image 1 for the bare metal server 1, a second image 2 for the bare metal server 2 and a second image 3 for the bare metal server 3 based on the first image in response to the application instructions sent by the bare metal server 1, the bare metal server 2 and the bare metal server 3.

[0101] The storage server can send a multicast connection establishment message to each bare metal server through a network, and each bare metal server responds to the multicast connection establishment message to join the multicast group initiated by the storage server, thereby receiving the first image sent by the storage server based on the multicast communication connection. Each bare metal server mounts the received first image and generates a first virtual block corresponding to the first image; each bare metal server connects the second image located on the storage server through a unicast communication connection between the storage server and the bare metal server, and mounts the second image on the bare metal server to generate a second virtual block.

[0102] For each bare metal server mounted with the first virtual block and the second virtual block, the system startup program is read from the second virtual block as an entrance, and if the system startup program is not read from the second virtual block, the system startup program is read from the first virtual block based on the backfile field of the second virtual block, and the operating system of the bare metal server mounted with the first virtual block and the second virtual block is started.

[0103] Through the server starting method, when starting a plurality of bare metal servers in batches, the storage server sends a message corresponding to the first image once through a multicast communication connection, the switch replicates and distributes the message corresponding to the first image to each bare metal server, so that each bare metal server receives the first image, thereby greatly reducing the access IO to the storage server and the network transmission message, and improving the transmission efficiency of the first image.

[0104] Through the server starting method, the differentiated data of the bare metal server is stored in the second image, that is, written from the second virtual block corresponding to the second image, the data amount written in the starting process is small, the pressure on the storage server and the network service is small, and the success rate of starting the bare metal server in batches can be improved.

[0105] In the embodiment, a server starting device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.

[0106] The embodiment provides a server starting device, as shown in the accompanying drawings, comprising: Figure 6 The creating module 601 is configured to create a multicast communication connection between the bare metal server and the storage server in response to a multicast connection establishment message sent by the storage server.

[0107] The receiving module 602 is configured to receive the first image sent by the storage server based on the multicast communication connection.

[0108] The first mounting module 603 is configured to mount the first image to the bare metal server, and generate a first virtual block corresponding to the first image on the bare metal server.

[0109] The first starting module 604 is configured to start the operating system of the bare metal server in response to reading a system startup boot program from the first virtual block.

[0110] In some optional embodiments, the creating module 601 is further configured to execute a multicast join command to join a multicast group corresponding to the multicast connection establishment message if the multicast connection establishment message sent by the storage server is listened to, and the bare metal server joining the multicast group represents that the multicast communication connection between the storage server and the bare metal server is established.

[0111] ​In some optional embodiments, the receiving module 602 is further configured to receive, based on the multicast communication connection, a plurality of packets corresponding to the first image, the plurality of packets being sent by the storage server to the switch and forwarded by the switch to the bare-metal server; and parse and assemble the plurality of packets to obtain the first image.

[0112] In some optional embodiments, the apparatus further includes: The connecting module is configured to connect, based on a unicast communication connection between the bare-metal server and the storage server, a second image located on the storage server, the second image being created by the storage server based on the first image, and the second image being used to store difference data corresponding to the first image.

[0113] The second mounting module is configured to mount the second image to the bare-metal server, and generate a second virtual block corresponding to the second image on the bare-metal server, wherein an image indication field of the second virtual block is configured to indicate the first image.

[0114] The first reading module is configured to read the first virtual block or the second virtual block based on the image indication field to obtain the system startup bootloader.

[0115] The second starting module is configured to start an operating system of the bare-metal server based on the system startup bootloader.

[0116] In some optional embodiments, the first reading module is further configured to read the system startup bootloader from the second virtual block; or, if the system startup bootloader is not read from the second virtual block, redirect to the first virtual block based on the image indication field, and read the system startup bootloader from the first virtual block.

[0117] In some optional embodiments, the apparatus further includes: The first obtaining module is configured to, if a read instruction of the first data is received, obtain a first logical address of the first data.

[0118] The second reading module is configured to, if a first physical address corresponding to the first logical address exists, read the first data from the second virtual block device based on the first physical address.

[0119] The third reading module is configured to, if the first physical address corresponding to the first logical address does not exist, redirect to the first virtual block based on the image indication field, and read the first data from the first virtual block.

[0120] In some optional embodiments, the apparatus further includes: The second obtaining module is configured to, if a write instruction of the second data is received, obtain a second logical address of the second data.

[0121] The first writing module is configured to write the second data into the second virtual block based on the second physical address if the second physical address corresponding to the second logical address exists.

[0122] The second writing module is configured to write the second data into the second virtual block based on a pre-configured copy-on-write strategy if the second physical address corresponding to the second logical address does not exist.

[0123] The server starting device provided by the embodiments of the present application can execute the server starting method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method. The further function description of the above-mentioned various modules and units is the same as that of the corresponding embodiments, and will not be repeated here.

[0124] Figure 7 A structural schematic diagram of an electronic device provided by an embodiment of the present application.

[0125] The following will be specifically described with reference to Figure 7 which shows a structural schematic diagram of an electronic device suitable for implementing the electronic device in the embodiments of the present application. The electronic device can include a processor (such as a central processor, a graphics processor, etc.) 701, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 702 or programs loaded from a storage 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device are also stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0126] Generally, the following devices can be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device with various devices is shown, but it should be understood that it is not required to implement or have all the shown devices, and more or fewer devices can be alternatively implemented or had.

[0127] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present application. For example, embodiments of the present application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for carrying out the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication device 709, or installed from the memory 708, or installed from the ROM 702. When the computer program is executed by the processor 701, the above-mentioned functions defined in the start-up method of the server of embodiments of the present application are performed.

[0128] Figure 7 The electronic device shown is merely an example and should not impose any limitation on the functions and use range of embodiments of the present application.

[0129] Embodiments of the present application also provide a computer-readable storage medium, the above-mentioned method according to embodiments of the present application can be implemented in hardware, firmware, or as computer code recordable on a storage medium, or as computer code originally stored in a remote storage medium or non-transitory machine-readable storage medium and to be stored in a local storage medium and downloaded through a network, so that the method described herein can be processed by such software stored on a storage medium using a general-purpose computer, a special-purpose processor, or programmable or special-purpose hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk or a solid state disk, etc.; further, the storage medium can also include a combination of the above-mentioned types of memories. It can be understood that the computer, processor, microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code, which, when accessed and executed by the computer, processor or hardware, implements the start-up method of the server illustrated in the above embodiments.

[0130] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be invoked or provided. Those skilled in the art should understand that the form of computer program instructions in computer-readable medium includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer executes the corresponding compiled program after compiling the instructions, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0131] While embodiments of the application have been described in connection with the preferred embodiments of the various figures, those of ordinary skill in the art will appreciate that various modifications and variations of the preferred embodiments can be employed without departing from the spirit and scope of the application.

Claims

1. A method for starting a server, characterized in that, The method includes: In response to a multicast connection establishment message sent by the storage server, a multicast communication connection is established between the bare metal server and the storage server; Based on the multicast communication connection, receive the first image sent by the storage server; The first image is mounted to the bare metal server, and a first virtual block corresponding to the first image is generated on the bare metal server. In response to reading the system boot loader from the first virtual block, the operating system of the bare metal server is started.

2. The method according to claim 1, characterized in that, The step of creating a multicast communication connection between the bare metal server and the storage server in response to a multicast connection establishment message sent by the storage server includes: If the multicast connection establishment message sent by the storage server is detected, the multicast join command is executed to join the multicast group of the multicast connection establishment message; The fact that the bare metal server joins the multicast group signifies that the storage server and the bare metal server have established the multicast communication connection.

3. The method according to claim 1, characterized in that, The step of receiving the first image sent by the storage server based on the multicast communication connection includes: Based on the multicast communication connection, multiple packets corresponding to the first image are received. These multiple packets are sent by the storage server to the switch, and the switch forwards them to the bare metal server. The multiple messages are parsed and assembled to obtain the first image.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Based on the unicast communication connection between the bare metal server and the storage server, a second mirror located on the storage server is connected. The second mirror is created by the storage server based on the first mirror and is used to store the difference data corresponding to the first mirror. The second image is mounted to the bare metal server, and a second virtual block corresponding to the second image is generated on the bare metal server. The image indication field of the second virtual block is configured to indicate the first image. Based on the image indication field, the system bootloader is obtained by reading the first virtual block or the second virtual block; The operating system of the bare metal server is started based on the system bootloader.

5. The method according to claim 4, characterized in that, The step of reading the first virtual block or the second virtual block based on the image indication field to obtain the system bootloader includes: Read the system boot loader from the second virtual block; or, If the system bootloader is not read from the second virtual block, the system is redirected to the first virtual block based on the image indication field, and the system bootloader is obtained by reading the first virtual block.

6. The method according to claim 4, characterized in that, The method further includes: If a read instruction for the first data is received, then the first logical address of the first data is obtained; If a first physical address corresponding to the first logical address exists, then the first data is read from the second virtual block device based on the first physical address; If the first physical address corresponding to the first logical address does not exist, then the system redirects to the first virtual block based on the mirror indication field and reads the first data from the first virtual block.

7. The method according to claim 4, characterized in that, The method further includes: If a write instruction for the second data is received, then the second logical address of the second data is obtained; If a second physical address exists corresponding to the second logical address, then the second data is written to the second virtual block based on the second physical address; If the second physical address corresponding to the second logical address does not exist, the second data is written to the second virtual block based on the pre-configured copy-on-write strategy.

8. A server startup device, characterized in that, The device includes: A creation module is used to create a multicast communication connection between the bare metal server and the storage server in response to a multicast connection establishment message sent by the storage server. A receiving module is configured to receive the first image sent by the storage server based on the multicast communication connection; The first mounting module is used to mount the first image to the bare metal server and generate a first virtual block corresponding to the first image on the bare metal server; The first boot module is used to boot the operating system of the bare metal server in response to reading the system boot loader from the first virtual block.

9. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the server startup method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the server startup method according to any one of claims 1 to 7.