Bare-metal deployment method, apparatus, equipment, and media based on three-layer network
By introducing a three-tier network structure into the bare metal service deployment system, and using DHCP and switches to generate cross-segment routes and IP addresses, the problem of traditional two-tier networks limiting cluster size is solved, cross-collision domain communication is realized, and the scale of bare metal clusters and the ability to support ultra-large clusters are improved.
Patent Information
- Application Number
- CN202311704697.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-12
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-12-12
AI Technical Summary
Traditional two-layer networks limit the size of bare metal clusters, resulting in a limited cluster size that cannot support ultra-large-scale deployment scenarios.
By introducing a three-tier network structure into the bare metal service deployment system, and utilizing Dynamic Host Configuration Protocol (DHCP) and switches, cross-network segment routes and IP addresses are generated, enabling cross-collision domain communication of bare metal servers and improving cluster size.
It enables communication across multiple collision domains, enhances the scalability of bare metal clusters, reduces maintenance costs and resource overhead, and supports ultra-large cluster scenarios.
Smart Images

Figure CN117811909B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software development technology, and in particular to a bare metal deployment method, apparatus, computer equipment, and storage medium based on a three-tier network. Background Technology
[0002] In traditional bare metal application scenarios, bare metal components are typically deployed within the same Layer 2 network, communicating with each other through this network. Layer 2 networks can achieve communication using only MAC addressing, but this is only suitable for applications within the same collision domain. Due to the inherent limitations of Layer 2 networks, a single cluster can only support a maximum of around 10,000 server nodes, thus restricting the scalability of bare metal clusters. Therefore, improving the scalability of bare metal clusters has become a pressing issue. Summary of the Invention
[0003] This application provides a bare metal deployment method, apparatus, computer equipment, and storage medium based on a three-layer network to improve the scale of bare metal clusters.
[0004] In a first aspect, this application provides a bare-metal deployment method based on a three-layer network, the method comprising:
[0005] Upon receiving the deployment instruction for the bare metal service, the system initiates the first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system.
[0006] The first DHCP request is received by the uplink switch, and the response result of the first DHCP request is obtained by the DHCP server.
[0007] Based on the bare metal server and the response result, configure the IP address and cross-network segment routing;
[0008] Based on the IP address, cross-network segment routing, and the image file address in the response result, the image file is requested from the image server, and the image file is installed to complete the bare metal deployment.
[0009] Furthermore, before initiating the first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system upon receiving the bare metal service deployment instruction, the process further includes:
[0010] Based on the aggregation switch, uplink switch, DHCP server, and bare metal server, a bare metal service deployment system based on a three-tier network structure is generated.
[0011] Furthermore, the aggregation switch is used to enable communication between the uplink switch, the DHCP server, and the bare metal server.
[0012] Further, the step of receiving the first DHCP request based on the uplink switch and obtaining the response result of the first DHCP request based on the DHCP server includes:
[0013] Based on the uplink switch receiving the first DHCP request, and adding the target gateway address to the first DHCP request, a second DHCP request is obtained;
[0014] Based on the second DHCP request, obtain a usable IP address to be used;
[0015] Based on the image file address and the IP address to be used, generate the response result of the first DHCP request;
[0016] The DHCP server returns the response result of the first DHCP request to the bare metal server.
[0017] Further, obtaining an available IP address based on the second DHCP request includes:
[0018] Based on the uplink switch, the second DHCP request is forwarded to the DHCP server;
[0019] Based on the DHCP server parsing the second DHCP request, the target gateway address is obtained, and the database is queried to see if there is an address pool corresponding to the target gateway address;
[0020] When an address pool corresponding to the target gateway address exists, the IP address to be used is obtained from the address pool.
[0021] Furthermore, after querying the database to see if an address pool corresponding to the target gateway address exists, the process further includes:
[0022] If the database does not contain an address pool corresponding to the target gateway address, obtain the configuration file;
[0023] Based on the configuration file, obtain the total classless inter-domain route (cidr) and the address segment division length corresponding to the target deployment network;
[0024] Based on the total CIDR and the partition length, an address pool corresponding to the target gateway address is obtained, so that the IP address to be used can be obtained from the address pool.
[0025] Further, obtaining the address pool corresponding to the target gateway address based on the total CIDR and the partition length includes:
[0026] Based on the partition length, the total CIDR is divided into at least one sub-address segment;
[0027] The last sub-address segment in at least one of the sub-address segments is used as the address pool corresponding to the target gateway address, and the correspondence between the target gateway address and the last sub-address segment in the sub-address segments is stored in the database.
[0028] Secondly, this application also provides a bare metal deployment device based on a three-layer network, the device comprising:
[0029] The first DHCP request initiation module is used to initiate a first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system when a deployment instruction for the bare metal service is received.
[0030] The response result acquisition module is used to receive the first DHCP request based on the uplink switch and obtain the response result of the first DHCP request based on the DHCP server;
[0031] The configuration module is used to configure the IP address and cross-network segment routing based on the bare metal server and the response result;
[0032] The image file installation module is used to request an image file from the image server based on the IP address, cross-network segment routing, and the image file address in the response result, and to install the image file to complete the bare metal deployment.
[0033] Thirdly, this application also provides a computer device, the computer device including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the bare metal deployment method based on a three-layer network as described above.
[0034] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the bare metal deployment method based on a three-layer network as described above.
[0035] This application discloses a bare metal deployment method, apparatus, computer equipment, and storage medium based on a three-tier network. Upon receiving a bare metal service deployment instruction, the system initiates a first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system. The system receives the first DHCP request via an uplink switch and obtains the response result from the DHCP server. Based on the bare metal server and the response result, it configures IP addresses and cross-network segment routes. Based on the IP addresses, cross-network segment routes, and the image file address in the response result, it requests an image file from an image server and installs the image file to complete the bare metal deployment. The bare metal service deployment system of this application is based on a three-tier network. By making the bare metal deployment network three-tiered, the three-tier network requires cross-network segment communication via IP routing, thus enabling communication across multiple collision domains. This improves the large-scale cluster support capability at the network level, solving the problem of limited bare metal cluster size and significantly increasing the size of bare metal servers, enhancing support capabilities in ultra-large cluster scenarios. On the other hand, customized DHCP enables bare metal cross-collision domain communication in ultra-large clusters; only one DHCP service needs to be used in a cluster, reducing maintenance costs and resource overhead. Attached Figure Description
[0036] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a schematic flowchart of a first embodiment of a bare metal deployment method based on a three-layer network provided by the embodiments of this application;
[0038] Figure 2 This is a flowchart illustrating a bare metal deployment method based on a three-layer network, provided in an embodiment of this application.
[0039] Figure 3 This is a bare metal three-layer network architecture diagram of a bare metal deployment method based on a three-layer network provided in an embodiment of this application;
[0040] Figure 4 This is a schematic flowchart of a second embodiment of a bare metal deployment method based on a three-layer network provided in this application;
[0041] Figure 5 This application provides an embodiment of a bare metal deployment method based on a three-tier network, including a DHCP service initialization process.
[0042] Figure 6 A schematic block diagram of a bare metal deployment device based on a three-layer network provided for embodiments of this application;
[0043] Figure 7 A schematic block diagram of the structure of a computer device provided for an embodiment of this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0045] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0046] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0047] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0048] This application provides a method, apparatus, computer device, and storage medium for bare metal deployment based on a three-tier network. The bare metal deployment method based on a three-tier network can be applied to servers, deploying bare metal services through a three-tier network structure, thereby increasing the scale of the bare metal cluster. The server can be a standalone server or a server cluster.
[0049] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0050] Please see Figure 1 , Figure 1This is a schematic flowchart illustrating a bare metal deployment method based on a three-tier network, provided in an embodiment of this application. This bare metal deployment method based on a three-tier network can be applied to servers to deploy bare metal services through a three-tier network structure, thereby increasing the scalability of bare metal clusters.
[0051] like Figure 1 As shown, the bare metal deployment method based on a three-layer network specifically includes steps S101 to S104.
[0052] S101. Upon receiving the deployment instruction for the bare metal service, initiate the first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system.
[0053] In specific embodiments, such as Figure 2 As shown, when a bare metal server initiates a DHCP request through port 67, the request will have the gateway address added to it when it passes through the uplink leaf, and the request will be forwarded to the DHCP service address.
[0054] Furthermore, before initiating the first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system upon receiving the bare metal service deployment instruction, the process further includes: generating a bare metal service deployment system based on a three-tier network structure, based on the aggregation switch, uplink switch, DHCP server, and the bare metal server.
[0055] Furthermore, the aggregation switch is used to enable communication between the uplink switch, the DHCP server, and the bare metal server.
[0056] In one embodiment, such as Figure 3 As shown, the deployment system architecture for bare metal services is roughly as follows:
[0057] 1. Each leaf is connected to a set of switches, and each switch is connected to a corresponding bare metal server.
[0058] 2. Machines in different leaves need to communicate through a convergence switch.
[0059] 3. Each leaf switch is configured with a corresponding gateway address that has already opened a set of deployment network IPs, such as 192.168.64.0 / 26. At the same time, the corresponding DHCP (Dynamic Host Configuration Protocol) server addresses are configured on the switches, such as 192.168.0.1 and 192.168.0.2.
[0060] In one embodiment, a group of bare metal servers is placed under a single leaf, with bare metal servers within the same leaf belonging to the same Layer 2 network. Then, bare metal servers from different leaves are grouped into a Layer 3 network. This Layer 3 network scheme addresses the issue that bare metal servers cannot support large-scale application scenarios.
[0061] S102. Receive the first DHCP request based on the uplink switch, and obtain the response result of the first DHCP request based on the DHCP server;
[0062] In one embodiment, after receiving a request, the uplink switch first modifies the corresponding request packet by adding the target gateway address. Then, it forwards the request to the corresponding DHCP server according to the switch's configuration.
[0063] In one embodiment, such as Figure 2 As shown, when the DHCP server receives the first DHCP request, it parses the DHCP packet to obtain the corresponding gateway address. Simultaneously, it queries the database to check if the relay IP for the corresponding gateway address exists in the corresponding IP address pool. If it does, it retrieves the available IP address from the pool. After obtaining the IP address, it adds the corresponding gateway address to the routing information in the DHCP return result, along with the mirror path to be returned. Finally, it returns the response result of the first DHCP request to the bare metal server.
[0064] S103. Based on the bare metal server and the response result, configure the IP address and cross-network segment routing;
[0065] In one embodiment, after receiving the response to the first DHCP request, the bare metal server configures the IP address and cross-network segment routing.
[0066] In a specific embodiment, when the switch connected to the bare metal server receives the DHCP return result, it forwards the corresponding request to port 68 of the bare metal server. After receiving the DHCP return result, the bare metal server configures its IP address and configures cross-network segment routing.
[0067] S104. Based on the IP address, cross-network segment routing, and the image file address in the response result, request the image file from the image server and install the image file to complete the bare metal deployment.
[0068] In one embodiment, the image file is requested using the image file address returned by the first DHCP request, thus completing the bare metal deployment initialization process.
[0069] Please see Figure 4 , Figure 4This is a schematic flowchart illustrating a bare metal deployment method based on a three-tier network, provided in an embodiment of this application. This bare metal deployment method based on a three-tier network can be applied to servers to deploy bare metal services through a three-tier network structure, thereby increasing the scalability of bare metal clusters.
[0070] like Figure 4 As shown, the bare metal deployment method based on a three-layer network specifically includes steps S201 to S204.
[0071] S201. Based on the uplink switch receiving the first DHCP request, and adding the target gateway address to the first DHCP request, a second DHCP request is obtained;
[0072] S202. Based on the second DHCP request, obtain an available IP address to be used;
[0073] Further, obtaining an available IP address based on the second DHCP request includes: forwarding the second DHCP request to a DHCP server via the uplink switch; parsing the second DHCP request on the DHCP server to obtain the target gateway address, and querying the database to see if an address pool corresponding to the target gateway address exists; and if an address pool corresponding to the target gateway address exists, obtaining the IP address to be used from the address pool.
[0074] Furthermore, after querying the database to see if an address pool corresponding to the target gateway address exists, the process further includes: when no address pool corresponding to the target gateway address exists in the database, obtaining a configuration file; based on the configuration file, obtaining the total classless inter-domain route (CIDR) and the segment length of the address range corresponding to the target deployment network; and based on the total CIDR and the segment length, obtaining the address pool corresponding to the target gateway address, so as to obtain the IP address to be used from the address pool.
[0075] Further, obtaining the address pool corresponding to the target gateway address based on the total CIDR and the partition length includes: dividing the total CIDR into at least one sub-address segment based on the partition length; using the last sub-address segment among the at least one sub-address segment as the address pool corresponding to the target gateway address; and storing the correspondence between the target gateway address and the last sub-address segment among the sub-address segments in the database.
[0076] In one embodiment, such as Figure 5As shown, the process checks if the database contains IP address pool information corresponding to the target gateway. If it does, the service starts directly; otherwise, it initializes the IP pool, retrieves the configuration file, obtains the deployment network IP CIDR (e.g., 192.168.0.0 / 18), and the required segment length (e.g., 26 bits). Based on the configured total CIDR and address segment length, the IP address pool can be split into pools like 192.168.0.0 / 26 and 192.168.0.63 / 26, etc. The last segment is then set as the relay IP (i.e., the address pool corresponding to the target gateway address), for example, 192.168.0.62. The remaining available IPs are stored in the database as an allocable IP address pool.
[0077] S203. Based on the image file address and the IP address to be used, generate the response result of the first DHCP request;
[0078] S204. The response result of the first DHCP request is returned to the bare metal server based on the DHCP server.
[0079] In one embodiment, when DHCP receives a second DHCP request, it parses the DHCP packet to obtain the corresponding gateway address. Simultaneously, it queries the database to check if the relay IP for the corresponding gateway address exists in the corresponding IP address pool. If it does, it retrieves the available IP address from the pool. After obtaining the IP address, it adds the corresponding gateway address to the routing information in the DHCP response result, along with the mirror path to be returned. Finally, it returns the corresponding DHCP request result to the bare metal server.
[0080] In a specific embodiment, after the bare metal server receives the first DHCP request, the connected switch modifies the corresponding request packet, adds the trunk gateway address (i.e., the target gateway address) to the first DHCP request, generates a second DHCP request, and queries the DHCP service configuration address configured on the switch to forward the DHCP request to port 67 of the corresponding DHCP server.
[0081] In one embodiment, when the DHCP service receives a second DHCP request, it parses the corresponding request packet to obtain the corresponding relay gateway address, queries the database to see if there is a pool of IP addresses corresponding to the gateway, and retrieves a suitable IP address from the corresponding IP address pool.
[0082] If the network fails at a certain time, the corresponding relay gateway will be configured with cross-network segment routing. The IP address and image file address will be encapsulated into a DHCP request return packet and then returned via port 67.
[0083] In one embodiment, when the switch connected to the bare metal server receives the DHCP return result, it forwards the corresponding request to port 68 of the bare metal server.
[0084] In one embodiment, after the bare metal server receives the DHCP return result, it configures the IP address and configures cross-network segment routing.
[0085] Please see Figure 6 , Figure 6 This application provides a schematic block diagram of a bare metal deployment apparatus based on a three-tier network, which is used to execute the aforementioned bare metal deployment method based on a three-tier network. The bare metal deployment apparatus based on a three-tier network can be configured on a server.
[0086] like Figure 6 As shown, the bare metal deployment device 300 based on a three-layer network includes:
[0087] The first DHCP request initiation module 301 is used to initiate a first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system when it receives the deployment instruction of the bare metal service.
[0088] The response result acquisition module 302 is used to receive the first DHCP request based on the uplink switch and obtain the response result of the first DHCP request based on the DHCP server.
[0089] Configuration module 303 is used to configure IP address and cross-network segment routing based on the bare metal server and the response result;
[0090] The image file installation module 304 is used to request an image file from the image server based on the IP address, cross-network segment routing, and the image file address in the response result, and to install the image file to complete the bare metal deployment.
[0091] Furthermore, the bare metal deployment device 300 based on a three-layer network also includes:
[0092] The bare metal service deployment system generation module is used to generate a bare metal service deployment system based on a three-tier network structure, based on the aggregation switch, uplink switch, DHCP server, and the bare metal server.
[0093] Furthermore, the aggregation switch is used to enable communication between the uplink switch, the DHCP server, and the bare metal server.
[0094] Furthermore, the response result obtaining module 302 includes:
[0095] The second DHCP request acquisition submodule is used to receive the first DHCP request based on the uplink switch, and add the target gateway address to the first DHCP request to obtain the second DHCP request.
[0096] The submodule for obtaining the IP address to be used is used to obtain the available IP address to be used based on the second DHCP request;
[0097] The response result generation submodule is used to generate the response result of the first DHCP request based on the image file address and the IP address to be used;
[0098] The response result return submodule is used to return the response result of the first DHCP request to the bare metal server based on the DHCP server.
[0099] Furthermore, the submodule for obtaining the IP address to be used includes:
[0100] The second DHCP request forwarding unit is used to forward the second DHCP request to the DHCP server based on the uplink switch;
[0101] The address pool query unit is used to parse the second DHCP request based on the DHCP server, obtain the target gateway address, and query the database to see if there is an address pool corresponding to the target gateway address.
[0102] The unit for obtaining the IP address to be used is used to obtain the IP address to be used from the address pool when the address pool corresponding to the target gateway address exists.
[0103] Furthermore, after the submodule for obtaining the IP address to be used, it also includes:
[0104] The configuration file acquisition unit is used to acquire the configuration file when the database does not contain an address pool corresponding to the target gateway address;
[0105] The partition length acquisition unit is used to acquire the total classless inter-domain route (CIDR) and the partition length of the address segment corresponding to the target deployment network based on the configuration file.
[0106] The address pool acquisition unit is used to obtain the address pool corresponding to the target gateway address based on the total CIDR and the partition length, so as to obtain the IP address to be used from the address pool.
[0107] Furthermore, the address pool acquisition unit includes:
[0108] A sub-unit is used to divide the total CIDR into at least one sub-address segment based on the division length;
[0109] The address pool determination unit is used to select the last sub-address segment among at least one of the sub-address segments as the address pool corresponding to the target gateway address, and to store the correspondence between the target gateway address and the last sub-address segment among the sub-address segments in the database.
[0110] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described apparatus and modules can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0111] The aforementioned device can be implemented as a computer program, which can be used in, for example... Figure 7 It runs on the computer device shown.
[0112] Please see Figure 7 , Figure 7 This is a schematic block diagram illustrating the structure of a computer device according to an embodiment of this application. The computer device may be a server.
[0113] See Figure 7 The computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0114] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any bare-metal deployment method based on a three-layer network.
[0115] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0116] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When executed by a processor, the computer program enables the processor to perform any bare-metal deployment method based on a three-layer network.
[0117] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0118] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0119] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps:
[0120] Upon receiving the deployment instruction for the bare metal service, the system initiates the first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system.
[0121] The first DHCP request is received by the uplink switch, and the response result of the first DHCP request is obtained by the DHCP server.
[0122] Based on the bare metal server and the response result, configure the IP address and cross-network segment routing;
[0123] Based on the IP address, cross-network segment routing, and the image file address in the response result, the image file is requested from the image server, and the image file is installed to complete the bare metal deployment.
[0124] In one embodiment, before the processor initiates a first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system upon receiving a deployment instruction for the bare metal service, it is further configured to:
[0125] Based on the aggregation switch, uplink switch, DHCP server, and bare metal server, a bare metal service deployment system based on a three-tier network structure is generated.
[0126] In one embodiment, the aggregation switch is used to enable communication between the uplink switch, the DHCP server, and the bare metal server.
[0127] In one embodiment, when the processor receives the first DHCP request based on the uplink switch and obtains the response result of the first DHCP request based on the DHCP server, it is configured to:
[0128] Based on the uplink switch receiving the first DHCP request, and adding the target gateway address to the first DHCP request, a second DHCP request is obtained;
[0129] Based on the second DHCP request, obtain a usable IP address to be used;
[0130] Based on the image file address and the IP address to be used, generate the response result of the first DHCP request;
[0131] The DHCP server returns the response result of the first DHCP request to the bare metal server.
[0132] In one embodiment, when the processor obtains an available IP address based on the second DHCP request, it is configured to:
[0133] Based on the uplink switch, the second DHCP request is forwarded to the DHCP server;
[0134] Based on the DHCP server parsing the second DHCP request, the target gateway address is obtained, and the database is queried to see if there is an address pool corresponding to the target gateway address;
[0135] When an address pool corresponding to the target gateway address exists, the IP address to be used is obtained from the address pool.
[0136] In one embodiment, after querying the database to see if an address pool corresponding to the target gateway address exists, the processor is further configured to:
[0137] If the database does not contain an address pool corresponding to the target gateway address, obtain the configuration file;
[0138] Based on the configuration file, obtain the total classless inter-domain route (cidr) and the address segment division length corresponding to the target deployment network;
[0139] Based on the total CIDR and the partition length, an address pool corresponding to the target gateway address is obtained, so that the IP address to be used can be obtained from the address pool.
[0140] In one embodiment, when the processor obtains the address pool corresponding to the target gateway address based on the total CIDR and the partition length, it is configured to:
[0141] Based on the partition length, the total CIDR is divided into at least one sub-address segment;
[0142] The last sub-address segment in at least one of the sub-address segments is used as the address pool corresponding to the target gateway address, and the correspondence between the target gateway address and the last sub-address segment in the sub-address segments is stored in the database.
[0143] The embodiments of this application also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, and the processor executing the program instructions to implement any of the bare metal deployment methods based on a three-layer network provided in the embodiments of this application.
[0144] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0145] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A bare-metal deployment method based on a three-layer network, characterized in that, include: Upon receiving the deployment instruction for the bare metal service, the system initiates the first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system. The first DHCP request is received by the uplink switch, and the response result of the first DHCP request is obtained by the DHCP server. Based on the bare metal server and the response result, configure the IP address and cross-network segment routing; Based on the IP address, cross-network segment routing, and the image file address in the response result, request the image file from the image server and install the image file to complete the bare metal deployment; The step of receiving the first DHCP request based on the uplink switch and obtaining the response result of the first DHCP request based on the DHCP server includes: Based on the uplink switch receiving the first DHCP request, and adding the target gateway address to the first DHCP request, a second DHCP request is obtained; Based on the second DHCP request, obtain a usable IP address to be used; Based on the image file address and the IP address to be used, generate the response result of the first DHCP request; The DHCP server returns the response result of the first DHCP request to the bare metal server. The step of obtaining a usable IP address based on the second DHCP request includes: Based on the uplink switch, the second DHCP request is forwarded to the DHCP server; Based on the DHCP server parsing the second DHCP request, the target gateway address is obtained, and the database is queried to see if there is an address pool corresponding to the target gateway address; When an address pool corresponding to the target gateway address exists, the IP address to be used is obtained from the address pool.
2. The bare metal deployment method based on a three-layer network according to claim 1, characterized in that, Before initiating the first Dynamic Host Configuration Protocol (DHCP) request on the bare metal server in the bare metal service deployment system upon receiving the deployment instruction for the bare metal service, the process further includes: Based on the aggregation switch, uplink switch, DHCP server, and bare metal server, a bare metal service deployment system based on a three-tier network structure is generated.
3. The bare metal deployment method based on a three-layer network according to claim 2, characterized in that, The aggregation switch is used to enable communication between the uplink switch, the DHCP server, and the bare metal server.
4. The bare metal deployment method based on a three-layer network according to claim 1, characterized in that, After querying the database to see if an address pool corresponding to the target gateway address exists, the process further includes: If the database does not contain an address pool corresponding to the target gateway address, obtain the configuration file; Based on the configuration file, obtain the total classless inter-domain route (cidr) and the address segment division length corresponding to the target deployment network; Based on the total CIDR and the partition length, an address pool corresponding to the target gateway address is obtained, so that the IP address to be used can be obtained from the address pool.
5. The bare metal deployment method based on a three-layer network according to claim 4, characterized in that, The step of obtaining the address pool corresponding to the target gateway address based on the total CIDR and the partition length includes: Based on the partition length, the total CIDR is divided into at least one sub-address segment; The last sub-address segment in at least one of the sub-address segments is used as the address pool corresponding to the target gateway address, and the correspondence between the target gateway address and the last sub-address segment in the sub-address segments is stored in the database.
6. A bare metal deployment device based on a three-layer network, characterized in that, include: The first DHCP request initiation module is used to initiate a first Dynamic Host Configuration Protocol (DHCP) request based on the bare metal server in the bare metal service deployment system when a deployment instruction for the bare metal service is received. The response result acquisition module is used to receive the first DHCP request based on the uplink switch and obtain the response result of the first DHCP request based on the DHCP server; The configuration module is used to configure the IP address and cross-network segment routing based on the bare metal server and the response result; The image file installation module is used to request an image file from the image server based on the IP address, cross-network segment routing, and the image file address in the response result, and to install the image file to complete the bare metal deployment. Furthermore, the response result acquisition module includes: The second DHCP request acquisition submodule is used to receive the first DHCP request based on the uplink switch, and add the target gateway address to the first DHCP request to obtain the second DHCP request. The submodule for obtaining the IP address to be used is used to obtain the available IP address to be used based on the second DHCP request; The response result generation submodule is used to generate the response result of the first DHCP request based on the image file address and the IP address to be used; The response result return submodule is used to return the response result of the first DHCP request to the bare metal server based on the DHCP server; Furthermore, the submodule for obtaining the IP address to be used includes: The second DHCP request forwarding unit is used to forward the second DHCP request to the DHCP server based on the uplink switch; The address pool query unit is used to parse the second DHCP request based on the DHCP server, obtain the target gateway address, and query the database to see if there is an address pool corresponding to the target gateway address. The unit for obtaining the IP address to be used is used to obtain the IP address to be used from the address pool when the address pool corresponding to the target gateway address exists.
7. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the bare metal deployment method based on a three-tiered network as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the bare metal deployment method based on a three-tiered network as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Server system installation method and device, system, storage medium and equipment
CN107229492A