Server remote construction method and system
The boot machine remote control server to start PXE boot and initialize the network, which solves the problems of inefficient and inconsistent configuration of server installation operating systems in the existing technology, and realizes efficient and accurate server construction, saving hardware costs and resources.
Patent Information
- Application Number
- CN202510147906.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-02-11
AI Technical Summary
The prior art is inefficient when installing the operating system on the server and is prone to inconsistent configuration problems, resulting in hardware costs and waste of resources.
The PXE boot and initialize the network through the boot machine remotely controls the server to be built. After the network connection and boot method are successfully verified, the server is cleaned and configured remotely, and a boot compressed package is generated to remotely install the operating system.
It improves the efficiency and accuracy of server construction, reduces manual operations and human errors, saves hardware costs and resources, and is suitable for large-scale server construction.
Smart Images

Figure CN119621088B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and system for remotely building a server. Background Art
[0002] With the development of economy and the progress of science and technology, saving hardware cost and resources and shortening time cost have become inevitable and social consensus. At present, manual installation is usually adopted when installing operating system for server. In the manual installation process, it is necessary to rely on physical media to store and read the installation software of operating system, which has the problems of low installation efficiency and waste of physical media resources. At the same time, since each server has its own operating system installed, there is a risk of inconsistent operating system configuration due to human negligence. Summary of the invention
[0003] In view of this, an object of the present invention is to provide a method and system for remotely setting up a server, which can improve the efficiency and accuracy of server setting up.
[0004] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0005] In a first aspect, the present invention provides a server remote construction method, which is applied to a server remote construction system, wherein the server remote construction system includes a guide machine and at least one server to be constructed; the method includes:
[0006] The boot machine remotely controls the server to be built so that the server to be built starts PXE booting and initializes the network;
[0007] After the boot machine successfully verifies the network connection and boot mode of the server to be built, remotely cleans and configures the server to be built;
[0008] After the configuration of the server to be built is completed, the boot machine generates a boot compression package and remotely restarts the server to be built;
[0009] The server to be built obtains the boot compression package from the boot machine through PXE booting, and the boot machine remotely controls the server to be built to install the operating system based on the boot compression package;
[0010] After the installation of the operating system is completed, the server to be installed reports the installation result to the boot machine.
[0011] In an optional implementation manner, the boot machine remotely controls the server to be built so that the server to be built starts PXE booting and initializes the network, including:
[0012] The boot machine remotely logs into the server to be built, and starts the PXE boot of the server to be built;
[0013] The boot machine downloads the original boot file and allocates a temporary IP address and a temporary gateway to the server to be built through the TFTP service, so that the server to be built initializes the network according to the temporary IP address and the temporary gateway;
[0014] The boot machine creates a network configuration file corresponding to the server to be built according to the temporary IP address and the temporary gateway.
[0015] In an optional implementation manner, the original boot file includes a DHCP configuration file; the allocating a temporary IP address and a temporary gateway to the server to be built through the TFTP service includes:
[0016] The boot machine allocates the temporary IP address to the server to be built according to the PXE network segment recorded in the DHCP configuration file;
[0017] The boot machine determines the PXE gateway recorded in the DHCP configuration file as the temporary gateway of the server to be built;
[0018] The boot machine sends the temporary IP address and the temporary gateway to the server to be built through the TFTP service.
[0019] In an optional implementation manner, after the boot machine successfully verifies the network connection and boot mode of the server to be built, before remotely cleaning and configuring the server to be built, the process further includes:
[0020] The boot machine downloads and executes a startup file; the startup file is used to boot and start the operating system of the server to be built;
[0021] The guiding machine verifies whether the temporary gateway and the temporary IP address of the server to be built are interoperable;
[0022] When the temporary gateway and the temporary IP address of the server to be built are not interoperable, the boot machine interrupts the installation process of the server to be built;
[0023] When the temporary gateway and the temporary IP address of the server to be built are interoperable, the boot machine verifies the PXE boot mode corresponding to the server to be built;
[0024] If the boot mode is BIOS, the boot machine interrupts the installation process of the server to be built;
[0025] If the boot mode is UEFI, the boot machine determines that the verification is successful.
[0026] In an optional implementation manner, the remote cleaning and configuration of the server to be built includes:
[0027] The guiding machine remotely cleans up the original configuration of the server to be built, and receives the temporary IP address and MAC information reported by the server to be built;
[0028] If the temporary IP address and the MAC information are invalid, the boot machine interrupts the installation process of the server to be built;
[0029] If the temporary IP address and the MAC information are valid, the boot machine remotely creates a RAID configuration of the system disk corresponding to the server to be built.
[0030] In an optional implementation, the boot machine generates a boot compression package, including:
[0031] The boot machine generates a boot compression package according to the boot parameter configuration file, KS file, minimum system installation file, TFTP service IP address and system image file in the original boot file.
[0032] In an optional implementation, the server to be built obtains the boot compression package from the boot machine through PXE booting, and the boot machine remotely controls the server to be built to install an operating system based on the boot compression package, including:
[0033] After the server to be built is restarted successfully, the server to be built obtains the boot compressed package from the boot machine;
[0034] The boot machine accesses the corresponding network configuration file based on the MAC information of the server to be built, and obtains the temporary IP address corresponding to the server to be built;
[0035] The guiding machine remotely controls the server to be built to update the temporary IP address, SN and MAC information corresponding to the server to be built into the KS file;
[0036] The boot machine controls the server to be built to run the minimum system installation file, so that the server to be built enters the minimum system, and remotely controls the server to be built to install the operating system according to the boot parameter configuration file, the system image file and the updated KS file.
[0037] In an optional implementation, the boot parameter configuration file records PXE configuration data; and the remotely controlling the server to be built to install the operating system according to the boot parameter configuration file, the system image file and the updated KS file includes:
[0038] The boot machine remotely controls the server to be built to configure a fixed IP address and a fixed gateway, and updates the fixed IP address and the fixed gateway to the PXE configuration data;
[0039] The guiding machine re-establishes a network connection with the server to be built according to the fixed IP address and the fixed gateway;
[0040] The boot machine remotely controls the server to be built to create a system disk partition, a data disk partition and a mount directory;
[0041] The boot machine remotely controls the server to be built to load the system image file according to the updated KS file and starts to install the operating system.
[0042] In an optional implementation manner, after the installation of the operating system is completed, the server to be installed reports the installation result to the boot machine, including:
[0043] When the operating system installation fails, the failed execution result, failed steps, failure reason and rollback prompt are reported to the boot machine as the installation result; if the user chooses to roll back according to the rollback prompt, the boot machine remotely controls the server to be installed to clear the configuration and restart;
[0044] When the operating system is successfully installed, the successful execution result is reported to the boot machine as the installation result.
[0045] In a second aspect, the present invention provides a server remote construction system, the server remote construction system comprising a guide machine and at least one server to be constructed;
[0046] The boot machine is used to remotely control the server to be built, so that the server to be built starts PXE booting and initializes the network;
[0047] The boot machine is used to remotely clean and configure the server to be built after verifying the network connection and boot method of the server to be built are successful;
[0048] After the configuration of the server to be built is completed, the boot machine is used to generate a boot compression package and remotely restart the server to be built;
[0049] The server to be built is used to obtain the boot compression package from the boot machine through PXE booting, and the boot machine is used to remotely control the server to be built to install an operating system based on the boot compression package;
[0050] After the installation of the operating system is completed, the server to be built is used to report the installation result to the boot machine.
[0051] Compared with the prior art, the server remote construction method and system provided by the embodiment of the present invention, the boot machine remotely controls the server to be built to start PXE boot and initialize the network, and verifies whether the network connection and boot method are successful. After the verification is passed, the boot machine remotely cleans and configures the server to be built. After the configuration is completed, the boot machine generates a boot compression package and remotely restarts the server to be built. The server to be built obtains the boot compression package from the boot machine through PXE boot, and the boot machine remotely controls the server to be built to install the operating system based on the compression package, and performs subsequent operations according to the installation results returned by the server to be built.
[0052] It can be seen that the present invention remotely builds a server through the network, automatically generates a boot compression package without the need for physical media, and installs an operating system based on the boot compression package, which can save hardware costs and resources and facilitate centralized management of servers. The automated and network-remote server construction method effectively reduces the workload and human errors of manual operations, improves the efficiency and accuracy of server construction, is suitable for large-scale server construction, and can assemble multiple servers at the same time.
[0053] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0055] Figure 1 A schematic diagram of a flow chart of a server remote building method provided by an embodiment of the present invention is shown.
[0056] Figure 2 A schematic diagram of a configuration of a guidance method provided by an embodiment of the present invention is shown.
[0057] Figure 3 Another flow chart of the server remote construction method provided in an embodiment of the present invention is shown.
[0058] Figure 4 Another flow chart of the server remote construction method provided in an embodiment of the present invention is shown.
[0059] Figure 5 A block diagram of a server remote construction system provided by an embodiment of the present invention is shown.
[0060] Icons: 400-Server remote setup system; 401-Boot machine; 402-Server to be setup. DETAILED DESCRIPTION
[0061] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0062] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0063] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0064] With the advent of the big data era, the number of servers that need to be installed and deployed has increased from the initial few to tens of thousands. If each server is installed manually, it will consume a lot of manpower and time costs.
[0065] Based on this, the server remote construction method and system provided by the embodiment of the present invention remotely constructs the server through the network, automatically generates a boot compression package without the need for physical media, and installs the operating system based on the boot compression package, which can save hardware costs and resources and facilitate centralized management of the server. The automated and network-remote server construction method effectively reduces the workload and human errors of manual operations, improves the efficiency and accuracy of server construction, is suitable for large-scale server construction, and can assemble multiple servers at the same time.
[0066] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0067] Please refer to Figure 1 , Figure 1 A flow chart of a server remote construction method provided by an embodiment of the present invention is shown. The method is applied to a server remote construction system, and the server remote construction system includes a guide machine and at least one server to be constructed. The method includes the following steps:
[0068] Step S100: the boot machine remotely controls the server to be built, so that the server to be built starts PXE booting and initializes the network.
[0069] In the embodiment of the present invention, before remotely building a server, the guide machine and the server to be built need to prepare the building environment according to the following preset conditions:
[0070] 1) Make sure the server to be built is powered on, that is, before starting to build and deploy, make sure the server to be built is powered on.
[0071] 2) Turn off the firewall of the server to be built to ensure that the remote server construction process is not affected by the firewall.
[0072] 3) Ensure that the network card of the server to be built supports the Preboot eXecutionEnvironment (PXE) protocol and the motherboard of the server to be built supports network booting.
[0073] 4) Establish a binding relationship between the boot machine, the server to be built, and the cluster to ensure that the boot machine can remotely build the servers in the cluster. The cluster includes at least one server to be built.
[0074] 5) According to the network planning of the management network, business network and storage network, allocate an IP address pool for the boot machine, and obtain the PXE gateway and PXE network segment. The PXE network segment used to configure the network for the server to be built needs to be in the same network segment as the boot machine. For example, configure two 10GE electrical ports to form a management network, two network ports to form a business network, and two network ports to form a storage network to achieve three-network separation.
[0075] 6) Generate a DHCP configuration file based on the IP address pool, PXE gateway, and PXE network segment of the boot machine. Assume that the DHCP configuration file contains the deploy_server_ip (IP address of the boot machine), deploy_server_subnet_cidr (network segment where the IP address of the boot machine is located), deploy_server_gateway (gateway of the boot machine), pxe_subnets (PXE network segment), and pxe_subnet_gateway (PXE gateway) parameters.
[0076] 7) Start the Trivial File Transfer Protocol (TFTP) service and Dynamic Host Configuration Protocol (DHCP) service on the boot machine to transfer data and allocate a temporary IP address for the server to be built.
[0077] 8) The boot machine scans the servers in the cluster and selects the server to be built.
[0078] 9) Log in to the baseboard management controller of the server to be built and modify the startup item configuration of the Basic Input / Output System (BIOS) so that the server to be built can be started from the network through network boot. Figure 2 For example, the startup mode (ie, boot mode) of BIOS is set to Unified Extensible Firmware Interface (UEFI for short).
[0079] After the environment preparation is completed, the server remote construction enters the first stage of the construction process, and the boot machine remotely controls the server to be built to start PXE boot and initialize network configuration.
[0080] Step S110, after the boot machine successfully verifies the network connection and boot method of the server to be built, it remotely cleans and configures the server to be built.
[0081] Step S120: After the configuration of the server to be built is completed, the boot machine generates a boot compression package and remotely restarts the server to be built.
[0082] In the embodiment of the present invention, the boot machine verifies the network connection and boot mode of the server to be built. If the verification is successful, the boot machine remotely cleans and configures the server to be built. The server to be built reports the configured PXE status to the boot machine. After receiving the PXE status, the boot machine generates the boot compression package required for the second-stage building process and remotely performs a restart operation on the server to be built.
[0083] Step S130: The server to be built obtains a boot compression package from a boot machine through PXE booting, and the boot machine remotely controls the server to be built to install an operating system based on the boot compression package.
[0084] Step S140: After the operating system installation is completed, the server to be installed reports the installation result to the boot machine.
[0085] In the embodiment of the present invention, after the server to be built is restarted, the server remote construction enters the second stage construction process, and the server to be built obtains the boot compressed package on the boot machine to the local (for example, PXELinux.cfg) through PXE boot. The boot machine remotely installs the operating system for the server to be built according to the boot compressed package. After the installation of the operating system of the server to be built is completed, the server to be built sends the installation result to the boot machine so that the boot machine performs subsequent operations based on the installation result.
[0086] In summary, in the server remote construction method provided by the embodiment of the present invention, the boot machine remotely controls the server to be built to start PXE boot and initialize the network, and verifies whether the network connection and boot method are successful. After the verification is passed, the boot machine remotely cleans and configures the server to be built. After the configuration is completed, the boot machine generates a boot compression package and remotely restarts the server to be built. The server to be built obtains the boot compression package from the boot machine through PXE boot, and the boot machine remotely controls the server to be built to install the operating system based on the compression package, and performs subsequent operations according to the installation results returned by the server to be built.
[0087] It can be seen that the present invention remotely builds a server through the network, automatically generates a boot compression package without the need for physical media, and installs an operating system based on the boot compression package, which can save hardware costs and resources and facilitate centralized management of servers. The automated and network-remote server construction method effectively reduces the workload and human errors of manual operations, improves the efficiency and accuracy of server construction, is suitable for large-scale server construction, and can assemble multiple servers at the same time.
[0088] Optionally, the following is a possible implementation method for how to start PXE boot and initialize the network. Figure 3 , Figure 1 The sub-steps of step S100 may include:
[0089] Step S101, the boot machine remotely logs into the server to be built, and starts the PXE boot of the server to be built.
[0090] Step S102, the boot machine downloads the original boot file, and allocates a temporary IP address and a temporary gateway to the server to be built through the TFTP service, so that the server to be built initializes the network according to the temporary IP address and the temporary gateway.
[0091] Step S103, the boot machine creates a network configuration file corresponding to the server to be built according to the temporary IP address and the temporary gateway.
[0092] In the embodiment of the present invention, when the boot machine remotely builds the server to be built, first, the boot machine remotely logs in to the server to be built, sets the PXE boot as the preferred startup item, and starts the PXE boot of the server to be built. Then, the boot machine downloads the original boot file, allocates a temporary IP address and a temporary gateway to the server to be built according to the original boot file, and sends the temporary IP address and the temporary gateway to the server to be built through the TFTP service, so that the server to be built configures the network according to the temporary IP address and the temporary gateway (that is, initializes the network).
[0093] After the server to be built has completed the network initialization, the server to be built reports the MAC address, temporary IP address and temporary gateway to the boot machine, and the boot machine creates a network configuration file for each MAC address to ensure that the server to be built can smoothly perform the subsequent operating system installation process in the temporary network environment. Among them, the network configuration file records the temporary IP address and temporary gateway of the server to be built corresponding to the MAC address.
[0094] Optionally, in actual application, the original boot file includes a DHCP configuration file. Regarding how to allocate a temporary IP address and a temporary gateway, a possible implementation is provided below. Figure 3 The sub-steps of step S102 may include:
[0095] The boot machine allocates a temporary IP address to the server to be built according to the PXE network segment recorded in the DHCP configuration file; the boot machine determines the PXE gateway recorded in the DHCP configuration file as the temporary gateway of the server to be built; the boot machine sends the temporary IP address and temporary gateway to the server to be built through the TFTP service.
[0096] In an embodiment of the present invention, the boot machine obtains a DHCP configuration file from the original boot file, obtains an IP address from the PXE network segment (e.g., pxe_subnets) recorded in the DHCP configuration file as the temporary IP address of the server to be set up, determines the PXE gateway (e.g., pxe_subnet_gateway) as the temporary gateway of the server to be set up, and sends the temporary IP address and the temporary gateway to the server to be set up through the TGTP service.
[0097] The server to be built initializes the network connection according to the received temporary IP address and temporary gateway to ensure smooth booting of the remote server through PXE, realize diskless startup and remote installation of the operating system.
[0098] Optionally, in actual applications, the following provides a possible implementation method for how to verify the network connection and boot method of the server to be built. Please refer to Figure 4 ,exist Figure 1Before step S110, the method further comprises the following steps:
[0099] Step S200, the boot machine downloads and executes a startup file; the startup file is used to boot and start the operating system of the server to be built.
[0100] In the embodiment of the present invention, the boot machine downloads the startup file from the public warehouse, executes the startup file, and starts remotely controlling the server to be built to install the operating system.
[0101] Step S210, the guiding machine verifies whether the temporary gateway and temporary IP address of the server to be set up are interoperable.
[0102] In the embodiment of the present invention, the guide machine uses the ping command to test the connectivity with the temporary IP address of the server to be built. If a response is received from the server to be built, it means that the network is connected. The guide machine remotely controls the server to be built and uses the ping command to test the connectivity of the temporary gateway. If the temporary gateway is reachable, it means that the server to be built has correctly configured the gateway and can access the guide machine.
[0103] When the temporary gateway and the temporary IP address of the server to be set up are not interoperable, step S220 is executed. When the temporary gateway and the temporary IP address of the server to be set up are interoperable, step S230 is executed.
[0104] Step S220, the boot machine interrupts the installation process of the server to be built.
[0105] Step S230, the boot machine verifies the PXE boot mode corresponding to the server to be built.
[0106] In an embodiment of the present invention, when the temporary gateway and temporary IP address of the server to be installed are not interoperable, the boot machine interrupts the installation process of the server to be installed, prompts an installation error, exits the installation system, and restarts the server to be installed. When the temporary gateway and temporary IP address of the server to be installed are interoperable, the boot machine obtains the boot mode of the PXE boot corresponding to the server to be installed. The boot mode may be configured as BIOS or UEFI.
[0107] Step S240: If the boot mode is BIOS, the boot machine interrupts the installation process of the server to be installed.
[0108] Step S250: If the boot mode is UEFI, the boot machine determines that the verification is successful.
[0109] In an embodiment of the present invention, when the boot mode is BIOS, the boot machine interrupts the installation process of the server to be built, prompts an installation error, exits the installation system, and restarts the server to be installed. When the boot mode is UEFI, it is determined that the boot machine successfully verifies the network connection and boot mode of the server to be built, thereby ensuring that the server to be built can correctly and safely complete the verification of the network configuration and boot mode, thereby avoiding installation failures due to network configuration errors or incompatible boot modes, and ensuring the smooth progress of remote server construction.
[0110] Optionally, a possible implementation method is provided below for how to clean up and configure the server to be built. Figure 1 The sub-steps of step S110 may include:
[0111] The boot machine remotely cleans up the original configuration of the server to be built, and receives the temporary IP address and MAC information reported by the server to be built; if the temporary IP address and MAC information are invalid, the boot machine interrupts the installation process of the server to be built; if the temporary IP address and MAC information are valid, the boot machine remotely creates the RAID configuration of the system disk corresponding to the server to be built.
[0112] In the embodiment of the present invention, after the boot machine verifies that the network connection and boot mode of the server to be built are successful, the boot machine remotely cleans up the original configuration of the server to be built, and the original configuration includes disk partitions, RAID configuration, etc. After cleaning up the original configuration, the server to be built reports the MAC information and the configured temporary IP address to the boot machine, and the boot machine determines whether the received MAC information and temporary IP address are valid. If they are invalid, the boot machine interrupts the installation process of the server to be built, prompts an installation error, exits the installation system, and restarts the server to be installed.
[0113] If it is valid, the boot machine will remotely log in to the server to be built and create the RAID configuration of the system disk corresponding to the server to be built. This ensures that before starting a new installation process, the original configuration is cleared and the validity of key network information is verified, thereby ensuring the accuracy of subsequent RAID configuration and the reliability of the installation process, and avoiding problems with operating system installation due to invalid configuration.
[0114] Optionally, a possible implementation method for generating a boot compression package is provided below. Figure 1 The sub-steps of step S120 may include:
[0115] The boot machine generates a boot compression package according to the boot parameter configuration file, KS file, minimum system installation file, TFTP service IP address and system image file in the original boot file.
[0116] In the embodiment of the present invention, the boot parameter configuration file is related to the boot mode. When the boot mode is BIOS, the name of the boot parameter configuration file is default. When the boot mode is UEFI, the name of the boot parameter configuration file is grub.cfg. Among them, the KS file is a Kickstart file, which is used to boot the machine to remotely build the server to be built, that is, to automatically configure the server to be built.
[0117] The boot machine obtains the boot parameter configuration file grub.cfg, KS file, minimum system installation file, TFTP service IP address and system image file from the original boot file to generate the boot compressed package required for the second-stage build process. By preparing the configuration file and installation file in advance, it is ensured that the boot compressed package can contain all the necessary components of the second-stage build process, so as to quickly and accurately complete the system initialization and installation during the remote build process, and improve the efficiency and success rate of automated deployment of servers.
[0118] Alternatively, the following provides a possible implementation method for how to use the boot compressed package to install the operating system. Figure 3 , Figure 1 The sub-steps of step S130 may include:
[0119] Step S131, after the server to be built is restarted successfully, the server to be built obtains the boot compressed package from the boot machine.
[0120] Step S132, the boot machine accesses the corresponding network configuration file based on the MAC information of the server to be set up, and obtains the temporary IP address corresponding to the server to be set up.
[0121] In an embodiment of the present invention, after the server to be built is successfully restarted, it obtains the boot compression package from the boot machine through PXE boot, and sends its own MAC information to the boot machine. The boot machine obtains the corresponding network configuration file of the server to be built according to the MAC address in the MAC information, and sends the network configuration file to the server to be built.
[0122] Step S133, the guiding machine remotely controls the server to be built to update the temporary IP address, SN and MAC information corresponding to the server to be built into the KS file.
[0123] In an embodiment of the present invention, the boot machine remotely accesses the server to be built, obtains the serial number (SN) and MAC information of the server to be built, updates the temporary IP address, SN and MAC information to the KS file, and obtains the KS file carrying the information of the server to be built, that is, the rendered KS file.
[0124] Step S134, the boot machine controls the server to be built to run the minimum system installation file, so that the server to be built enters the minimum system, and remotely controls the server to be built to install the operating system according to the boot parameter configuration file, the system image file and the updated KS file.
[0125] In an embodiment of the present invention, the boot machine controls the server to be built to run the minimum system installation file, the server to be built enters the minimum system, and installs the operating system for the server to be built within the minimum system based on the boot parameter configuration file, the system image file and the updated KS file, thereby realizing efficient installation of the operating system according to the preset configuration file, and further realizing automated and non-interventional server deployment.
[0126] Optionally, in actual application, the boot parameter configuration file records PXE configuration data. Regarding how to install the operating system using the boot parameter configuration file, the system image file and the updated KS file, a possible implementation is provided below. Figure 3 The sub-steps of step S134 may include:
[0127] The boot machine remotely controls the server to be built to configure a fixed IP address and a fixed gateway, and updates the fixed IP address and the fixed gateway to the PXE configuration data; the boot machine re-establishes the network connection with the server to be built according to the fixed IP address and the fixed gateway; the boot machine remotely controls the server to be built to create a system disk partition, a data disk partition and a mount directory; the boot machine remotely controls the server to be built to load the system image file according to the updated KS file and start installing the operating system.
[0128] In the embodiment of the present invention, when the server to be built enters the minimum system, the fixed IP address and fixed gateway of the server to be built are configured through the web page of the boot machine, and the IP address and gateway in the PXE configuration data are updated to the fixed IP address and fixed gateway. Among them, the fixed IP address includes the fixed IP address of the management network, the fixed IP address of the service network and the fixed IP address of the storage network.
[0129] The boot machine remotely controls the server to be built and rebuilds the initialization network based on the fixed IP address and fixed gateway configuration. After the reinitialized network connection is interoperable, the boot machine remotely logs in to the server to be built, creates a system disk partition, a data disk partition and a mount directory for the server to be built, and loads the system image file based on the installation logic recorded in the rendered KS file, and starts to install the operating system for the server to be built.
[0130] It can be seen that after ensuring the stability of the network configuration of the server to be built, the embodiment of the present invention can remotely create the partition and mount directory of the server to be built, and correctly load the system image file to install the operating system, thereby realizing efficient automated construction and deployment.
[0131] Optionally, in actual application, the boot parameter configuration file records PXE configuration data. Regarding how to install the operating system using the boot parameter configuration file, the system image file and the updated KS file, a possible implementation is provided below. Figure 1 The sub-steps of step S140 may include:
[0132] When the operating system installation fails, the failed execution result, failed steps, failure reason and rollback prompt are reported to the boot machine as the installation result; if the user chooses to roll back according to the rollback prompt, the boot machine remotely controls the server to be built to clear the configuration and restart; when the operating system is installed successfully, the successful execution result is reported to the boot machine as the installation result.
[0133] In an embodiment of the present invention, after the operating system installation is completed, the server to be installed generates an installation result according to the execution result of the operating system installation. When the execution result indicates that the operating system installation failed, the installation result is generated according to the execution result, the failure step, the failure reason and the fallback prompt, and reported to the boot machine. When the execution result indicates that the standard operating system is successfully installed, the execution result is reported to the boot machine as the installation result. For example, the installation result is generated by running a POST script, and the installation result is reported to the boot machine.
[0134] After receiving the installation result, if the execution result is that the operating system installation fails, the boot machine will prompt the user through a visual interface whether to roll back. If the user chooses not to roll back, the boot machine will exit the installation system. If the user chooses to roll back, the boot machine will remotely control the server to be built to clear the configuration and restart, and exit the installation system.
[0135] It can be seen that the embodiment of the present invention ensures that the problem can be located in time and effective recovery can be performed when the installation fails through detailed error information and fallback mechanism, and the installation status can be confirmed after the installation is successful, thereby improving the reliability and user experience of remote server deployment.
[0136] Based on the same inventive concept, the basic principles and technical effects of the server remote construction system provided by the embodiment of the present invention are the same as those of the above embodiment. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiment. A possible implementation method is provided below.
[0137] Please refer to Figure 5 , Figure 5 A block diagram of a server remote construction system 400 provided in an embodiment of the present invention. The server remote construction system 400 includes a guide machine 401 and at least one server 402 to be constructed.
[0138] The boot machine 401 is used to remotely control the server 402 to be built, so that the server 402 to be built starts PXE booting and initializes the network;
[0139] The boot machine 401 is used to verify the network connection and boot method of the server 402 to be built, and then remotely clean up and configure the server 402 to be built;
[0140] After the configuration of the server 402 to be built is completed, the boot machine 401 is used to generate a boot compression package and remotely restart the server 402 to be built;
[0141] The server to be built 402 is used to obtain a boot compression package from the boot machine 401 through PXE booting, and the boot machine 401 is used to remotely control the server to be built 402 to install an operating system based on the boot compression package;
[0142] After the operating system installation is completed, the server to be installed 402 is used to report the installation result to the boot machine 401.
[0143] In summary, the server remote construction system provided by the embodiment of the present invention remotely constructs the server through the network, automatically generates a boot compression package without the need for physical media, and installs the operating system based on the boot compression package, which can save hardware costs and resources and facilitate centralized management of the server. The automated and network-remote server construction method effectively reduces the workload and human errors of manual operations, improves the efficiency and accuracy of server construction, is suitable for large-scale server construction, and can assemble multiple servers at the same time.
[0144] In several embodiments provided by the present invention, it should be understood that the disclosed system and method can also be implemented in other ways. The system embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0145] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0146] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0147] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for remotely building a server, characterized in that: Applied to a server remote construction system, the server remote construction system includes a guide machine and at least one server to be constructed; the method includes: The boot machine remotely controls the server to be built so that the server to be built starts PXE booting and initializes the network; After the boot machine successfully verifies the network connection and boot mode of the server to be built, remotely cleans and configures the server to be built; After the configuration of the server to be built is completed, the boot machine generates a boot compression package according to the boot parameter configuration file, KS file, minimum system installation file, TFTP service IP address and system image file in the original boot file, and remotely restarts the server to be built; the boot parameter configuration file records the PXE configuration data; After the server to be built is restarted successfully, the server to be built obtains the boot compressed package from the boot machine; The boot machine accesses the corresponding network configuration file based on the MAC information of the server to be built, and obtains the temporary IP address corresponding to the server to be built; The guiding machine remotely controls the server to be built to update the temporary IP address, SN and MAC information corresponding to the server to be built into the KS file; The boot machine controls the server to be built to run the minimum system installation file, so that the server to be built enters the minimum system, and the boot machine remotely controls the server to be built to configure a fixed IP address and a fixed gateway, and updates the fixed IP address and the fixed gateway to the PXE configuration data; The guiding machine re-establishes a network connection with the server to be built according to the fixed IP address and the fixed gateway; The boot machine remotely controls the server to be built to create a system disk partition, a data disk partition and a mount directory; The boot machine remotely controls the server to be built to load the system image file according to the updated KS file and start installing the operating system; After the installation of the operating system is completed, the server to be installed reports the installation result to the boot machine.
2. The server remote construction method according to claim 1, characterized in that: The boot machine remotely controls the server to be built so that the server to be built starts PXE booting and initializes the network, including: The boot machine remotely logs into the server to be built, and starts the PXE boot of the server to be built; The boot machine downloads the original boot file and allocates a temporary IP address and a temporary gateway to the server to be built through the TFTP service, so that the server to be built initializes the network according to the temporary IP address and the temporary gateway; The boot machine creates a network configuration file corresponding to the server to be built according to the temporary IP address and the temporary gateway.
3. The server remote construction method according to claim 2, characterized in that: The original boot file includes a DHCP configuration file; the allocation of a temporary IP address and a temporary gateway to the server to be built through the TFTP service includes: The boot machine allocates the temporary IP address to the server to be built according to the PXE network segment recorded in the DHCP configuration file; The boot machine determines the PXE gateway recorded in the DHCP configuration file as the temporary gateway of the server to be built; The boot machine sends the temporary IP address and the temporary gateway to the server to be built through the TFTP service.
4. The server remote construction method according to claim 2, characterized in that: After the boot machine verifies that the network connection and boot mode of the server to be built are successful, before remotely cleaning and configuring the server to be built, the method further includes: The boot machine downloads and executes a startup file; the startup file is used to boot and start the operating system of the server to be built; The guiding machine verifies whether the temporary gateway and the temporary IP address of the server to be built are interoperable; When the temporary gateway and the temporary IP address of the server to be built are not interoperable, the boot machine interrupts the installation process of the server to be built; When the temporary gateway and the temporary IP address of the server to be built are interoperable, the boot machine verifies the PXE boot mode corresponding to the server to be built; If the boot mode is BIOS, the boot machine interrupts the installation process of the server to be built; If the boot mode is UEFI, the boot machine determines that the verification is successful.
5. The server remote construction method according to claim 1, characterized in that: The remote cleaning and configuration of the server to be built includes: The guiding machine remotely cleans up the original configuration of the server to be built, and receives the temporary IP address and MAC information reported by the server to be built; If the temporary IP address and the MAC information are invalid, the boot machine interrupts the installation process of the server to be built; If the temporary IP address and the MAC information are valid, the boot machine remotely creates a RAID configuration of the system disk corresponding to the server to be built.
6. The server remote construction method according to claim 1, characterized in that: After the installation of the operating system is completed, the server to be installed reports the installation result to the boot machine, including: When the operating system installation fails, the failed execution result, failed steps, failure reason and rollback prompt are reported to the boot machine as the installation result; if the user chooses to roll back according to the rollback prompt, the boot machine remotely controls the server to be installed to clear the configuration and restart; When the operating system is successfully installed, the successful execution result is reported to the boot machine as the installation result.
7. A server remote construction system, characterized in that: The server remote construction system includes a guiding machine and at least one server to be constructed; The boot machine is used to remotely control the server to be built, so that the server to be built starts PXE booting and initializes the network; The boot machine is used to verify the network connection and boot method of the server to be built, and then remotely clean up and configure the server to be built; After the configuration of the server to be built is completed, the boot machine is used to generate a boot compression package according to the boot parameter configuration file, KS file, minimum system installation file, TFTP service IP address and system image file in the original boot file, and remotely restart the server to be built; the boot parameter configuration file records the PXE configuration data; After the server to be built is restarted successfully, the server to be built is used to obtain the boot compressed package from the boot machine; The boot machine is used to access the corresponding network configuration file based on the MAC information of the server to be built, and obtain the temporary IP address corresponding to the server to be built; The guiding machine is used to remotely control the server to be built to update the temporary IP address, SN and MAC information corresponding to the server to be built into the KS file; The boot machine is used to control the server to be built to run the minimum system installation file, so that the server to be built enters the minimum system, and the boot machine is used to remotely control the server to be built to configure a fixed IP address and a fixed gateway, and update the fixed IP address and the fixed gateway to the PXE configuration data; The boot machine is used to re-establish a network connection with the server to be built according to the fixed IP address and the fixed gateway; The boot machine is used to remotely control the server to be built to create a system disk partition, a data disk partition and a mount directory; The boot machine is used to remotely control the server to be built to load the system image file according to the updated KS file and start installing the operating system; After the installation of the operating system is completed, the server to be installed is used to report the installation result to the boot machine.
Citation Information
Patent Citations
Installation method and relative devices of business packet
CN102726025A
Configuration method of PXE server under Kylin V4 operating system
CN110399144A