CN113867746B - Bare metal server deployment method - Google Patents

Bare metal server deployment method Download PDF

Info

Publication number
CN113867746B
CN113867746B CN202111471821.XA CN202111471821A CN113867746B CN 113867746 B CN113867746 B CN 113867746B CN 202111471821 A CN202111471821 A CN 202111471821A CN 113867746 B CN113867746 B CN 113867746B
Authority
CN
China
Prior art keywords
server
bare metal
file
metal server
disk
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111471821.XA
Other languages
Chinese (zh)
Other versions
CN113867746A (en
Inventor
种鑫
程行峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Youyun Technology Co ltd
Original Assignee
Hangzhou Youyun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Youyun Technology Co ltd filed Critical Hangzhou Youyun Technology Co ltd
Priority to CN202111471821.XA priority Critical patent/CN113867746B/en
Publication of CN113867746A publication Critical patent/CN113867746A/en
Application granted granted Critical
Publication of CN113867746B publication Critical patent/CN113867746B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a bare metal server deployment method, which comprises the following steps: loading a customized preloading system on a bare metal server through a PXE network; the preloading system is operated on the memory of the bare metal server, a first custom script is executed, and the file server is mounted according to the kernel starting parameters; executing a second custom script stored on the file server, formatting the disk according to the kernel starting parameter, and completing a customizing task; and (5) copying the system image file of the specified operating system on the file server to a local disk through dd to finish the automatic deployment of the operating system of the bare metal server. The method of the invention can install any operating system and any version on the bare metal server and can realize any service logic in the deployment process, thereby realizing the high-efficiency automatic deployment of the bare metal server and greatly reducing the operation and maintenance difficulty and cost.

Description

Bare metal server deployment method
Technical Field
The invention relates to the field of servers, in particular to a bare metal server deployment method.
Background
With the continuous growth of internet technology, the number of servers is also increasing, and IT operation and maintenance become important components in IT service connotation. From the development of a few initial servers to a huge data center, the requirements of technology, business, management and the like cannot be met by people alone, and the factors for reducing the IT service cost, such as standardization, automation, architecture optimization, process optimization and the like, are more and more emphasized by people. How to automate batch deployment and installation of a stable system is the first step in achieving automation.
PXE, a pre-boot execution environment, is a way to boot. Such protocols are generally composed of two parts, one being the server side and one being the client side. In short, an "installation source" can be created in this way, and installation of the system can be realized as long as the "source" can be found when the system is installed. Before unattended installation is realized, some services must be built to realize establishment of an installation source, such as DHCP, TFTP and the like. The PXE client downloads the starting file to the local through the network and then starts to install automatically, and the process does not need any operation of people.
The conventional PXE-based method for realizing automatic system installation is a PXE + KickStart method, and comprises the following steps: 1) sending a DHCP request; 2) the DHCP server allocates IP to the client and provides information of a TFTP server and PXE configuration files; 3) requesting a PXE configuration file; 4) sending a PXE configuration file; 5) request system files and a KickStart configuration file; 6) and acquiring a system file and a KickStart configuration file and installing an operating system. However, this method has the following drawbacks:
1) the kiskstart method only supports limited operating system release versions, such as centros, reddat, and Ubuntu, and supports other operating systems, and is difficult to support a user-defined system.
2) Different systems and different versions of the KickStart configuration files have different operation and maintenance costs.
3) The KickStart mode has a fixed flow, and is difficult to combine with a business flow, such as formatting a hard disk, specifying a hard disk loading system, obtaining detailed progress information of system installation, and the like.
Disclosure of Invention
Based on the above background, the invention provides a bare metal server deployment method, which can install any operating system and any version, and can realize any service logic in the deployment process, thereby realizing efficient and automatic deployment of the bare metal server, and greatly reducing the operation and maintenance difficulty and cost. The specific implementation scheme is as follows:
a bare metal server deployment method comprises the following steps:
loading a customized preloading system on a bare metal server through a PXE network;
the preloading system is operated on the memory of the bare metal server, a first custom script is executed, and the file server is mounted according to the kernel starting parameters;
executing a second custom script stored on the file server, formatting the disk according to the kernel starting parameter, and completing a customizing task;
and (5) copying the system image file of the specified operating system on the file server to a local disk through dd to finish the automatic deployment of the operating system of the bare metal server.
Further, loading a customized preloading system on the bare metal server through the PXE network specifically includes:
starting a DHCP service, and opening the filename and next-server configuration of a specified bare metal server in a DHCP configuration file, wherein the filename is a PXE configuration file of the specified bare metal, and the next-server is a TFTP server;
and starting the bare metal server, loading in a PXE mode, detecting to obtain a PXE configuration file, and acquiring a preloading system from the TFTP server and guiding to install.
Further, the preloading system is generated based on the open source linux and at least comprises a kernel file vmlinux and a root file system initrd.
Further, the root file system initrd.img is configured with the following functional modules:
the first self-defined script is automatically executed after the preloading system is started;
the drive module is used for pre-loading the network card of the system identification bare metal server and the hard disk device;
and configuring a preset custom program module based on the service requirement.
Further, the preset custom program module configured based on the service requirement includes the following modules:
an ifconfig module for configuring ip;
an fdisk, lsblk or mkfs. xfs module for operating a disk;
mount.nfs module for mounting file system of file server;
dd module for mirror copy.
Further, the operation of the preloading system on the memory of the bare metal server is realized by the following steps: the kernel start parameter specifying the PXE configuration file is popped during the pre-mount phase of the system.
Further, the customized task is configured by the user according to the service requirement based on the second custom script.
Optionally, the customization task includes one or more of the following: specifying a system disk, formatting a data disk, returning a system deployment progress or exchanging information with a service server.
Further, the system image file is generated based on the following mode:
and locally installing any operating system through other bare metal servers or virtual machines, adding a custom program and configuration into the system after the installation is started, and then exporting the system disk from the bare metal server through dd or directly exporting the system disk from the virtual machine to obtain the system image file.
Further, the system image file and the second custom script are stored in any network-accessible file server in the local area network, the file server supports the NFS, and the system image file and the second custom script are accessible through the NFS.
The invention has the following beneficial technical effects:
1) the bare metal server deployment standardization is realized through the preloading system, differences among operating systems and versions are shielded, processes are unified, and management is unified.
2) The bare metal server deployment customization is realized through the preloading system, and more service scenes are realized through the customized script.
3) And the management of the bare metal mirror image file is unified, and if a user has virtual machine service, a group of mirror image files can be used for perfectly supporting the virtual machine and the bare metal.
4) The bare metal mirror image can be customized to function at will and is not limited by the source mirror image.
Drawings
Fig. 1 is a schematic flowchart of an embodiment of a bare metal server deployment method according to the present invention.
Fig. 2 is a schematic data interaction diagram of an embodiment of a bare metal server deployment method according to the present invention.
Detailed Description
For a further understanding of the invention, reference will now be made to the preferred embodiments of the invention by way of example, and it is to be understood that the description is intended to further illustrate features and advantages of the invention, and not to limit the scope of the claims.
Referring to fig. 1, an embodiment of the present invention provides a bare metal server deployment method, including the following steps:
loading a customized preloading system on a bare metal server through a PXE network;
the preloading system is operated on the memory of the bare metal server, a first custom script is executed, and the file server is mounted according to the kernel starting parameters;
executing a second custom script stored on the file server, formatting the disk according to the kernel starting parameter, and completing a customizing task;
and (5) copying the system image file of the specified operating system on the file server to a local disk through dd to finish the automatic deployment of the operating system of the bare metal server.
The above method is described in further detail with reference to fig. 2 and the specific examples.
In an illustrated embodiment, loading a customized preloading system on a bare metal server through a PXE network specifically includes the following processes:
firstly, starting a DHCP service, and opening filename and next-server configuration of a specified bare metal server in a DHCP configuration file, wherein the filename is a PXE configuration file of the specified bare metal, and the next-server is a TFTP server;
and then starting the bare metal server, loading in a PXE mode, detecting to obtain a PXE configuration file, and acquiring a preloading system from the TFTP server and guiding to install.
In one illustrative embodiment, the preloading system is generated based on open source linux, and at least comprises a kernel file vmlinux and a root file system initrd. The root file system initrd.img is configured with the following functional modules:
the first self-defined script is automatically executed after the preloading system is started;
the drive module is used for pre-loading the network card of the system identification bare metal server and the hard disk device;
and configuring a preset custom program module based on the service requirement.
In a preferred embodiment, the preset custom program module configured based on the service requirement includes the following modules: an ifconfig module for configuring ip; an fdisk, lsblk or mkfs. xfs module for operating a disk; mount.nfs module for mounting file system of file server; dd module for mirror copy.
In the scheme of the invention, as the preloading system only reserves linux basic components, the size is about 10-50M (the specific size is determined by service requirements), the rapid loading through a network and the running in the memory are ensured.
In an illustrative embodiment, by specifying the kernel start parameter of the PXE configuration file to specify that the pre-loading system jumps out during the pre-mount phase, it is ensured that the pre-loading system runs only on the bare metal server memory, and does not mount a hard disk. And simultaneously, more kernel starting parameters can be customized in the PXE configuration file for self-defining services.
And then, executing the first custom script packaged in the preloading system, and performing the following processes:
and the first custom script sets the IP address of the network card according to the kernel starting parameter in the/proc/cmdlene to complete network configuration.
And the first custom script mounts the file server according to the kernel starting parameter in the/proc/cmdlene so as to obtain the second custom script and the target system image file. And executing the second custom script on the file server after the mounting is successful.
In the scheme of the invention, the first custom script is packaged in the preloading system, the second custom script is stored in the file server, and more customized functions can be completed in the second custom script, so that frequent updating of the preloading system is avoided.
Meanwhile, the first and second custom scripts can interact with a service server in the local area network in various modes such as curl, exec and custom programs, so that more service functions are realized.
In one illustrative embodiment, the customization task is configured by the user based on the second custom script according to business needs to meet different needs of the user.
In some illustrative examples, the second custom script may be configured to select a system disk according to kernel startup parameters in the/proc/cmdline and format the system disk.
In some illustrative examples, the second custom script may be configured to select an image file according to kernel boot parameters in/proc/cmdline, and then copy the image file to a system disk via dd.
In some illustrative examples, the second custom script may be configured to transmit back the system deployment progress in the system case sub-process, notify the service server that the system is installed, and then the service server closes the PXE related configuration of the bare metal server at the DHCP end.
In some illustrative examples, the second custom script can be configured to perform a restart operation. And (4) starting the bare metal server, wherein the PXE does not detect the PXE configuration at the moment, loading the PXE configuration by using a local disk, and successfully starting to complete the deployment process.
In one illustrative embodiment, the system image file and the second custom script are stored on any network-reachable file server within the local area network. The file server is configured to support NFS, and the system image file and the second custom script are accessible through the NFS.
The essence of the image file is a system disk copy of the bare metal server or virtual machine that has already been running. Any operating system can be locally installed through other bare metal servers or virtual machines, after installation and starting, a user-defined program and configuration are added into the system, and then the system disk is exported through dd on the bare metal server or directly exported on the virtual machine, so that a system image file can be obtained.
The above description of the embodiments is only intended to facilitate the understanding of the method of the invention and its core idea. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (8)

1. A bare metal server deployment method is characterized by comprising the following steps:
loading a customized preloading system on a bare metal server through a PXE network;
the preloading system is operated on the memory of the bare metal server, a first custom script is executed, and the file server is mounted according to the kernel starting parameters;
executing a second custom script stored on the file server, formatting a disk according to the kernel startup parameters, and completing a customization task, wherein the customization task is configured by a user based on the second custom script according to service requirements, and comprises one or more of the following steps: appointing a system disk, a formatted data disk, and returning a system deployment progress or exchanging information with a service server;
and (5) copying the system image file of the specified operating system on the file server to a local disk through dd to finish the automatic deployment of the operating system of the bare metal server.
2. The bare metal server deployment method of claim 1, wherein loading the customized preload system on the bare metal server through the PXE network specifically comprises:
starting a DHCP service, and opening the filename and next-server configuration of a specified bare metal server in a DHCP configuration file, wherein the filename is a PXE configuration file of the specified bare metal, and the next-server is a TFTP server;
and starting the bare metal server, loading in a PXE mode, detecting to obtain a PXE configuration file, and acquiring a preloading system from the TFTP server and guiding to install.
3. A bare metal server deployment method according to claim 1, wherein the preloading system is generated based on open source linux, and comprises at least kernel file vmlinux and root file system initrd.
4. A bare metal server deployment method according to claim 3, wherein the root file system initrd.img is configured with the following functional modules:
the first self-defined script is automatically executed after the preloading system is started;
the drive module is used for pre-loading the network card of the system identification bare metal server and the hard disk device;
and configuring a preset custom program module based on the service requirement.
5. A bare metal server deployment method as claimed in claim 4, wherein the preset custom program modules configured based on service requirements include the following:
an ifconfig module for configuring ip;
an fdisk, lsblk or mkfs. xfs module for operating a disk;
mount.nfs module for mounting file system of file server;
dd module for mirror copy.
6. The bare metal server deployment method of claim 1, wherein running the preload system on a bare metal server memory is implemented by: the kernel start parameter specifying the PXE configuration file is popped during the pre-mount phase of the system.
7. The bare metal server deployment method of claim 1, wherein the system image file is generated based on:
and locally installing any operating system through other bare metal servers or virtual machines, adding a custom program and configuration into the system after the installation is started, and then exporting a system disk from the other bare metal servers through dd, or directly exporting the system disk from the virtual machine to obtain the system image file.
8. The bare metal server deployment method of claim 7, wherein the system image file and the second custom script are stored on any network-reachable file server within the local area network, wherein the file server supports NFS, and wherein the system image file and the second custom script are accessible through NFS.
CN202111471821.XA 2021-12-06 2021-12-06 Bare metal server deployment method Active CN113867746B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111471821.XA CN113867746B (en) 2021-12-06 2021-12-06 Bare metal server deployment method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111471821.XA CN113867746B (en) 2021-12-06 2021-12-06 Bare metal server deployment method

Publications (2)

Publication Number Publication Date
CN113867746A CN113867746A (en) 2021-12-31
CN113867746B true CN113867746B (en) 2022-04-01

Family

ID=78985892

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111471821.XA Active CN113867746B (en) 2021-12-06 2021-12-06 Bare metal server deployment method

Country Status (1)

Country Link
CN (1) CN113867746B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783117B (en) * 2019-01-18 2023-01-10 中国人民解放军国防科技大学 Mirror image file making and starting method of diskless system
CN111901177B (en) * 2020-08-06 2022-08-30 鹏城实验室 Bare metal server network configuration method, system and related equipment
CN112291096B (en) * 2020-10-30 2023-09-05 北京思特奇信息技术股份有限公司 Configuration method and device of bare metal server
CN113064602A (en) * 2021-03-08 2021-07-02 山东英信计算机技术有限公司 Method, system and medium for filling operation system based on NFS

Also Published As

Publication number Publication date
CN113867746A (en) 2021-12-31

Similar Documents

Publication Publication Date Title
US11237811B2 (en) Software installation onto a client using existing resources
EP2696532A2 (en) Method, server and system for starting application
CN110908753B (en) Intelligent fusion cloud desktop server, client and system
CN104639378A (en) Automatic server deployment method based on PXE (pre-boot execution environment)
CN102073513B (en) Method, device and system for installing operating system
CN111475172B (en) Bare metal deployment method and device
CN101788917A (en) Deployment method of utility software and the system thereof
CN101344852A (en) Method, device and system for allocating WINDOWS enterprise edition operating system
JP2002196945A (en) Upgrading system and method of device driver
CN112130917A (en) Remote loading system mirroring method
CN111427624A (en) Method, device and system for batch automatic deployment and configuration of servers
CN104636159B (en) The method and apparatus that software in virtual machine is upgraded
CN107220085B (en) Method for automatically upgrading RAID card firmware
CN112214227A (en) Edge server mirror image customization and deployment system and method
CN112948008B (en) Method for managing physical bare machine based on Ironic
CN114115917A (en) Operating system installation method and device
CN113867746B (en) Bare metal server deployment method
CN112486508B (en) Deployment method of operating system, server and computer storage medium
CN115756746A (en) Method and system for manufacturing operating system mirror image based on libvirt
CN111008043A (en) Server starting method of cloud platform and terminal
JP2000020316A (en) Automatic environment setting method of preinstalled application and storage medium
CN112463173B (en) Method, device and medium for remotely installing customized web application by bare metal server
CN106648808A (en) OpenPower architecture server system automatic installation method
CN113076114A (en) Method for upgrading system in environment without network and peripheral based on USB
CN114265628B (en) Operating system deployment method, device, electronic equipment, storage medium and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 310000 room 611-612, Zhuoxin building, No. 3820, South Ring Road, Puyan street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Youyun Technology Co.,Ltd.

Country or region after: China

Address before: 310000 room 611-612, Zhuoxin building, No. 3820, South Ring Road, Puyan street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou Youyun Technology Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address