[go: up one dir, main page]

CN114756290B - Operating system installation method, device and readable storage medium - Google Patents

Operating system installation method, device and readable storage medium Download PDF

Info

Publication number
CN114756290B
CN114756290B CN202210476591.4A CN202210476591A CN114756290B CN 114756290 B CN114756290 B CN 114756290B CN 202210476591 A CN202210476591 A CN 202210476591A CN 114756290 B CN114756290 B CN 114756290B
Authority
CN
China
Prior art keywords
operating system
installation
server
target operating
file
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
CN202210476591.4A
Other languages
Chinese (zh)
Other versions
CN114756290A (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.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210476591.4A priority Critical patent/CN114756290B/en
Publication of CN114756290A publication Critical patent/CN114756290A/en
Application granted granted Critical
Publication of CN114756290B publication Critical patent/CN114756290B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 method for installing an operating system, which comprises the following steps: acquiring configuration information of a server to be installed, and formulating a configuration strategy according to the configuration information; formulating a virtual mirror structure based on the configuration policy and a target operating system; and installing an operating system for the server to be installed through the virtual mirror image structure body. According to the operating system installation method provided by the invention, different installation images can be set for different server configurations, the server configuration information is automatically collected, the full-automatic operation images are automatically formulated according to the target operating system, and the automatic and batch synchronous installation of the operating systems to a plurality of servers is realized. The operation and maintenance efficiency of the data center is greatly improved. The workload of operation and maintenance personnel in a noisy machine room environment is reduced.

Description

一种操作系统安装方法、设备及可读存储介质Operating system installation method, device and readable storage medium

技术领域technical field

本发明属于计算机领域,具体涉及一种操作系统安装方法、设备及可读存储介质。The invention belongs to the field of computers, and in particular relates to an operating system installation method, equipment and a readable storage medium.

背景技术Background technique

本发明主要应用服务器的带外网络下的操作系统的自动安装,在仅有带外网络运维的情况下,本发明可自动识别服务器相关配置,自动完成服务器raid配置、加载相关raid卡/网卡驱动完成系统的自动安装,并为安装完成的系统打上对应驱动。极大提升了大批量自动化的服务器运维的效率。The present invention mainly applies to the automatic installation of the operating system under the out-of-band network of the server. In the case of only out-of-band network operation and maintenance, the present invention can automatically identify the relevant configuration of the server, automatically complete the server raid configuration, and load the relevant raid card/network card The driver completes the automatic installation of the system, and marks the corresponding driver for the installed system. It greatly improves the efficiency of mass automated server operation and maintenance.

当前服务器运维上架,大多采用的是带内网络的pxe镜像分发的方式进行批量系统安装。但是如果带内网络不通或者不能使用的情况下,就无法进行批量安装,只能单台的进行系统部署安装。而且一些操作系统(例如windows系列操作系统)支持的raid卡驱动较少,安装过程中需要手动选择对应raid卡或者网卡驱动进行驱动的加载,该过程耗时费力。At present, server operation and maintenance is put on the shelf, and most of them use the pxe image distribution method of the in-band network for batch system installation. However, if the in-band network is blocked or unavailable, batch installation cannot be performed, and system deployment and installation can only be performed on a single unit. Moreover, some operating systems (for example, Windows series operating systems) support fewer raid card drivers. During the installation process, it is necessary to manually select the corresponding raid card or network card driver to load the driver. This process is time-consuming and laborious.

发明内容Contents of the invention

为解决以上问题,本发明提出一种操作系统安装的方法,包括:In order to solve the above problems, the present invention proposes a method for operating system installation, including:

获取待安装服务器的配置信息,根据所述配置信息制定配置策略;Obtain the configuration information of the server to be installed, and formulate a configuration strategy according to the configuration information;

基于所述配置策略和目标操作系统制定虚拟镜像结构体;Developing a virtual image structure based on the configuration strategy and the target operating system;

通过所述虚拟镜像结构体为所述待安装服务器安装操作系统。An operating system is installed for the server to be installed through the virtual image structure.

在本发明的一些实施方式中,获取待安装服务器的配置信息包括:In some embodiments of the present invention, obtaining the configuration information of the server to be installed includes:

通过内存操作系统获取待安装服务器的配置信息。Obtain the configuration information of the server to be installed through the memory operating system.

在本发明的一些实施方式中,获取待安装服务器的配置信息,根据所述配置信息制定配置策略包括:In some implementations of the present invention, obtaining the configuration information of the server to be installed, and formulating a configuration strategy according to the configuration information includes:

获取待安装服务器的存储结构,判断所述存储结构是否支持对目标操作系统免驱安装;Obtaining the storage structure of the server to be installed, and judging whether the storage structure supports drive-free installation of the target operating system;

响应于所述存储结构不支持对目标操作系统免驱安装,按照所述目标操作系统的安装要求配置所述存储结构,以及将所述存储结构的驱动信息添加到所述配置策略。In response to the storage structure not supporting drive-free installation of the target operating system, configuring the storage structure according to the installation requirements of the target operating system, and adding the driver information of the storage structure to the configuration policy.

在本发明的一些实施方式中,基于所述配置策略和目标操作系统制定虚拟镜像结构体包括:In some embodiments of the present invention, formulating a virtual image structure based on the configuration strategy and the target operating system includes:

基于所述配置策略和目标操作系统制定所述目标操作系统的安装引导程序信息,并将所述安装引导程序信息添加到虚拟镜像结构体中。Developing the installation guide program information of the target operating system based on the configuration policy and the target operating system, and adding the installation guide program information to the virtual image structure.

在本发明的一些实施方式中,基于所述配置策略和目标操作系统制定虚拟镜像结构体包括:In some embodiments of the present invention, formulating a virtual image structure based on the configuration strategy and the target operating system includes:

根据目标操作系统创建应答文件模板,基于所述配置策略与所述应答文件模板生成对应的应答文件信息,并将所述应答文件信息添加到虚拟镜像结构体中。Create an answer file template according to the target operating system, generate answer file information corresponding to the answer file template based on the configuration policy, and add the answer file information to the virtual image structure.

在本发明的一些实施方式中,通过所述虚拟镜像结构体为所述待安装服务器安装操作系统包括:In some embodiments of the present invention, installing an operating system for the server to be installed through the virtual image structure includes:

根据所述虚拟镜像结构体生成目标操作系统镜像文件,并将所述目标操作系统镜像文件发送到安装设备,通过所述安装设备将所述目标操作系统镜像文件安装到所述待安装服务器上。Generate a target operating system image file according to the virtual image structure, and send the target operating system image file to an installation device, and install the target operating system image file on the server to be installed through the installation device.

在本发明的一些实施方式中,通过所述虚拟镜像结构体为所述待安装服务器安装操作系统包括:In some embodiments of the present invention, installing an operating system for the server to be installed through the virtual image structure includes:

获取所述虚拟镜像结构体中对应的目标操作系统安装文件,并将所述目标操作系统安装文件发送到安装设备;Obtain the corresponding target operating system installation file in the virtual image structure, and send the target operating system installation file to the installation device;

通过所述安装设备向所述待安装服务器提供虚拟光驱,providing a virtual optical drive to the server to be installed through the installation device,

通过所述虚拟光驱将所述目标操作系统安装文件加载到所述待安装服务器上,以安装所述目标操作系统。The target operating system installation file is loaded onto the server to be installed through the virtual optical drive, so as to install the target operating system.

在本发明的一些实施方式中,通过所述虚拟镜像结构体为所述待安装服务器安装操作系统包括:In some embodiments of the present invention, installing an operating system for the server to be installed through the virtual image structure includes:

将所述虚拟镜像结构体发送到安装设备,并通过所述安装设备获取所述虚拟镜像结构体中对应的目标操作系统安装文件;Send the virtual image structure to an installation device, and obtain the corresponding target operating system installation file in the virtual image structure through the installation device;

通过所述安装设备向所述待安装服务器提供虚拟光驱,providing a virtual optical drive to the server to be installed through the installation device,

通过所述虚拟光驱将所述目标操作系统安装文件加载到所述待安装服务器上,以安装所述目标操作系统。The target operating system installation file is loaded onto the server to be installed through the virtual optical drive, so as to install the target operating system.

本发明的另一方面还提出一种计算机设备,包括:Another aspect of the present invention also proposes a computer device, comprising:

至少一个处理器;以及at least one processor; and

存储器,所述存储器存储有可在所述处理器上运行的计算机指令,所述指令由所述处理器执行时实现上述实施方式中任意一项所述方法的步骤。A memory, where the memory stores computer instructions that can run on the processor, and when the instructions are executed by the processor, the steps of any one of the methods described in the foregoing implementation manners are implemented.

本发明的再一方面还提出一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述实施方式中任意一项所述方法的步骤。Another aspect of the present invention also proposes a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the methods described in the above-mentioned implementation modes are implemented .

通过本发明提供的一种操作系统安装方法,可针对不同的服务器配置设定不同的安装镜像,自动收集服务器配置信息,自动根据目标操作系统制定全自动化的操作镜像并实现自动化、批量化对多个服务器同步安装操作系统。极大地提高数据中心的运维效率。减轻运维人员在嘈杂的机房环境的工作量。Through the operating system installation method provided by the present invention, different installation images can be set for different server configurations, server configuration information can be automatically collected, fully automated operation images can be automatically formulated according to the target operating system, and automation and batch-to-many can be realized. Install the operating system on each server simultaneously. Greatly improve the operation and maintenance efficiency of the data center. Reduce the workload of operation and maintenance personnel in a noisy computer room environment.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明实施例提供的一种操作系统安装方法的实施例流程图;FIG. 1 is a flow chart of an embodiment of an operating system installation method provided by an embodiment of the present invention;

图2为本发明实施例提供的一种计算机设备的结构图;FIG. 2 is a structural diagram of a computer device provided by an embodiment of the present invention;

图3为本发明实施例提供的一种计算机可读存储介质的结构示意图。FIG. 3 is a schematic structural diagram of a computer-readable storage medium provided by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the embodiments of the present invention will be further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

如图1所示,本发明提出一种操作系统安装的方法,其特征在于,包括:As shown in Figure 1, the present invention proposes a kind of method for operating system installation, it is characterized in that, comprises:

步骤S1、获取待安装服务器的配置信息,根据所述配置信息制定配置策略;Step S1, obtaining the configuration information of the server to be installed, and formulating a configuration strategy according to the configuration information;

步骤S2、基于所述配置策略和目标操作系统制定虚拟镜像结构体;Step S2, formulating a virtual image structure based on the configuration strategy and the target operating system;

步骤S3、通过所述虚拟镜像结构体为所述待安装服务器安装操作系统。Step S3, installing an operating system for the server to be installed through the virtual image structure.

在本发明的实施例中,步骤S1中,待安装服务器是指需要安装操作系统的服务器主机,即物理机,配置信息是指服务器的CPU、内存、硬盘结构等与服务器正常运行息息相关的配置信息。获取待安装服务器的配置信息可以通过多种途径,例如从相应的管理系统获取待安装服务器具体型号、CPU、内存、硬盘或者是RAID卡(Redundant Arrays ofIndependent Disks,独立磁盘阵列)等硬件配置信息;根据所述配置信息制定配置策略是指通过收集到的CPU、内存、硬盘或者是RAID卡、网卡等硬件的型号信息确定安装对应操作系统时的安装方式或配置策略。配置策略是指能够在该待安装服务器上正常完成目标操作系统安装的安装步骤或者是可以在待安装服务器上安装对应操作系统的方案,是指安装目标操作系统的整体安装引导程序的执行过程。针对不同的待安装服务器以及不同的目标操作系统会有不同的配置策略。In the embodiment of the present invention, in step S1, the server to be installed refers to the server host that needs to install the operating system, that is, the physical machine, and the configuration information refers to the server's CPU, memory, hard disk structure, etc. configuration information that is closely related to the normal operation of the server . The configuration information of the server to be installed can be obtained through various means, such as obtaining the specific model, CPU, memory, hard disk or RAID card (Redundant Arrays of Independent Disks, independent disk array) and other hardware configuration information of the server to be installed from the corresponding management system; Formulating a configuration strategy based on the configuration information refers to determining the installation method or configuration strategy when installing the corresponding operating system through the collected model information of hardware such as CPU, memory, hard disk, or RAID card and network card. The configuration strategy refers to the installation steps that can normally complete the installation of the target operating system on the server to be installed or the solution that can install the corresponding operating system on the server to be installed, and refers to the execution process of the overall installation guide program for installing the target operating system. There are different configuration strategies for different servers to be installed and different target operating systems.

具体地,操作系统是管理计算机上各个硬件,为对应的应用程序提供硬件服务的管理系统,对一台服务器或计算机设备安装操作系统其实质是对服务器或计算机设备安装管理系统。因此需要获取待安装服务器的CPU、硬盘、RAID卡、网卡、主板信息等,进一步分析目标操作系统是否可直接支持在该待安装服务器上直接运行,即管理待安装服务器的硬件。例如,如果待安装服务器是ARM平台的服务器,在安装Linux操作系统时,需要根据ARMCPU的型号对Linux系统内核进行编译,否则会出现Linux内核无法运行的情况;例如,Windows7系统因不携带Intel 7代以上酷睿主板的驱动而在安装过程中导致系统无法安装等情况。Specifically, the operating system is a management system that manages various hardware on the computer and provides hardware services for corresponding application programs. The essence of installing an operating system on a server or computer equipment is to install a management system on the server or computer equipment. Therefore, it is necessary to obtain the CPU, hard disk, RAID card, network card, motherboard information, etc. of the server to be installed, and further analyze whether the target operating system can directly support the direct operation of the server to be installed, that is, manage the hardware of the server to be installed. For example, if the server to be installed is an ARM platform server, when installing the Linux operating system, the Linux system kernel needs to be compiled according to the model of the ARM CPU, otherwise the Linux kernel cannot run; for example, the Windows7 system does not carry the Intel 7 The driver of the above-generation Core motherboard may cause the system to fail to install during the installation process.

因此,在本发明的一些实施例中,本发明中需要获取待安装服务器的硬盘配置信息,并根据硬件配置信息制定对应的配置策略。根据待安装服务器的硬件配置制定对应的目标操作系统的安装方案,包括安装引导程序的执行过程,以及安装引导程序所需要的对应的硬件的驱动。Therefore, in some embodiments of the present invention, the present invention needs to acquire hard disk configuration information of the server to be installed, and formulate corresponding configuration policies according to the hardware configuration information. According to the hardware configuration of the server to be installed, the corresponding target operating system installation plan is formulated, including the execution process of installing the boot program, and the corresponding hardware driver required for installing the boot program.

在本发明的一些实施例中,待安装服务器也可以是虚拟化平台的提供的虚拟机,例如VMware Workstation、Virtual Box、Virtual PC等工具创建的虚拟机。与物理机相比,虚拟机服务器的某些硬件是由虚拟机软件提供的,因此对于虚拟化平台,只需要从对应的虚拟机软件系统获得对应的虚拟机配置信息即可。In some embodiments of the present invention, the server to be installed may also be a virtual machine provided by a virtualization platform, such as a virtual machine created by tools such as VMware Workstation, Virtual Box, and Virtual PC. Compared with the physical machine, some hardware of the virtual machine server is provided by the virtual machine software, so for the virtualization platform, it is only necessary to obtain the corresponding virtual machine configuration information from the corresponding virtual machine software system.

在步骤S2中,虚拟镜像结构体是本发明提出的用于指导一类硬件配置的服务器和对应的目标操作系统安装的结构体。需要说明的是,在实际中,计算机上的操作系统的安装可以通过系统镜像的方式进行安装,系统镜像通常采用.iso文件存储格式(光盘镜像文件格式),在用于安装操作系统时,通过光驱读取光盘上的数据加载到计算机实现安装对应的操作系统。而本发明提出的虚拟镜像结构体,并不是动辄几个GB大小的系统镜像,即本发明的虚拟镜像并不是格式为.iso的镜像文件,而是一个基于待安装服务器的硬件配置信息和目标操作系统的数据结构体,内容包括三类:操作系统文件信息(目标操作系统的版本信息,操作系统文件地址)、安装引导程序信息(在系统安装过程中的安装引导程序)、驱动信息(根据待安装服务器硬件配置信息以及目标操作系统确定的在安装过程中需要的对应硬件的驱动程序信息)。In step S2, the virtual image structure is a structure proposed by the present invention for guiding the installation of a type of hardware configuration server and the corresponding target operating system. It should be noted that, in practice, the installation of the operating system on the computer can be done by means of a system image. The system image usually adopts the .iso file storage format (CD image file format). The optical drive reads the data on the optical disc and loads it into the computer to realize the installation of the corresponding operating system. However, the virtual image structure proposed by the present invention is not a system image with a size of several GB at every turn, that is, the virtual image of the present invention is not an image file in the format of .iso, but a hardware configuration information and target image based on the server to be installed. The data structure of the operating system includes three categories: operating system file information (version information of the target operating system, operating system file address), installation boot program information (installation boot program during system installation), driver information (according to The hardware configuration information of the server to be installed and the driver information of the corresponding hardware required in the installation process determined by the target operating system).

在本实施例中,根据步骤S1中的配置策略确定在该待安装服务器上安装目标操作系统时是否需要加载对应的驱动程序,如果需要驱动程序,则将对应的驱动程序信息添加到虚拟镜像结构体中的驱动信息部分,如果需要在操作系统安装过程中设置一些安装选项,则将对应的设置程序的配置参数添加到安装引导程序信息部分,以及将目标操作系统信息添加到虚拟镜像结构体的操作系统文件信息部分。In this embodiment, according to the configuration strategy in step S1, it is determined whether the corresponding driver program needs to be loaded when the target operating system is installed on the server to be installed, and if the driver program is required, the corresponding driver program information is added to the virtual image structure If you need to set some installation options during the operating system installation process, add the configuration parameters of the corresponding setting program to the installation boot program information part, and add the target operating system information to the virtual image structure. OS file information section.

进一步,在本发明的一些实施例中,将安装目标操作系统时加载的驱动程序的文件地址以及对应的MD5值添加到所述虚拟镜像结构体的驱动信息部分;将对应的安装引导程序文件和配置文件的文件地址以及对应的MD5值添加到虚拟镜像结构体对应的安装引导程序信息部分;将目标操作系统的操作系统文件地址以及对应的MD5值添加到虚拟镜像结构体的操作系统文件信息部分。Further, in some embodiments of the present invention, the file address of the driver loaded when installing the target operating system and the corresponding MD5 value are added to the driver information part of the virtual image structure; the corresponding installation boot program file and The file address of the configuration file and the corresponding MD5 value are added to the installation boot program information part corresponding to the virtual image structure; the operating system file address of the target operating system and the corresponding MD5 value are added to the operating system file information part of the virtual image structure .

在步骤S3中,将虚拟镜像结构体中对应部分的内容发送到待安装服务器上并执行安装引导程序安装虚拟镜像结构体中的操作系统文件。即按照.iso文件格式,将虚拟镜像结构体中的对应的安装引导程序文件和配置文件、驱动程序文件、操作系统文件发送到待安装服务器上加载安装引导程序文件执行目标操作系统的安装。In step S3, the content of the corresponding part in the virtual image structure is sent to the server to be installed and the installation boot program is executed to install the operating system files in the virtual image structure. That is, according to the .iso file format, the corresponding installation boot program file, configuration file, driver program file, and operating system file in the virtual image structure are sent to the server to be installed to load the installation boot program file to execute the installation of the target operating system.

在本发明的一些实施方式中,获取待安装服务器的配置信息包括:In some embodiments of the present invention, obtaining the configuration information of the server to be installed includes:

通过内存操作系统获取待安装服务器的配置信息。Obtain the configuration information of the server to be installed through the memory operating system.

在本实施例中,在获取待安装服务器的配置信息时采用内存操作系统的方式进行获取。例如以LiveCD的方式获取,具体地通过带外的BMC(Baseboard ManagementController.基板管理控制器)将包含查询服务器硬件配置程序的LiveCD发送到待安装服务器,LiveCD镜像在加载到内存后运行查询服务器硬件配置程序获取待安装服务器的CPU型号、内存、硬盘或RAID卡型号、网卡型号、挂载的PCIE设备等信息以及启动方式(UEFI/MBR)。将获取到的硬件配置信息通过BMC反馈。进一步,在收到BMC反馈的待安装服务器硬件配置信息后便可根据配置信息制定配置策略。In this embodiment, the configuration information of the server to be installed is acquired by means of an in-memory operating system. For example, to obtain it in the form of LiveCD, specifically, send the LiveCD containing the query server hardware configuration program to the server to be installed through the out-of-band BMC (Baseboard Management Controller). After the LiveCD image is loaded into the memory, run the query server hardware configuration The program obtains information such as the CPU model, memory, hard disk or RAID card model, network card model, mounted PCIE device, and startup mode (UEFI/MBR) of the server to be installed. Feedback the obtained hardware configuration information through BMC. Further, after receiving the hardware configuration information of the server to be installed fed back by the BMC, a configuration strategy can be formulated according to the configuration information.

在本发明的一些实施方式中,获取待安装服务器的配置信息,根据所述配置信息制定配置策略包括:In some implementations of the present invention, obtaining the configuration information of the server to be installed, and formulating a configuration strategy according to the configuration information includes:

获取待安装服务器的存储结构,判断所述存储结构是否支持对目标操作系统免驱安装;Obtaining the storage structure of the server to be installed, and judging whether the storage structure supports drive-free installation of the target operating system;

响应于所述存储结构不支持对目标操作系统免驱安装,按照所述目标操作系统的安装要求配置所述存储结构,以及将所述存储结构的驱动信息添加到所述配置策略。In response to the storage structure not supporting drive-free installation of the target operating system, configuring the storage structure according to the installation requirements of the target operating system, and adding the driver information of the storage structure to the configuration policy.

在本实施例中,还需要对待安装服务器的存储结构进行判断,存储结构是指待安装服务器上的存储设备(硬盘)连接方式,大致可分两种,一种是通过RAID卡将多个硬盘组建RAID的方式,另一种是将硬盘直接连接在服务器主板上。第一种方式需要安装引导程序对RIAD卡的支持,即如果目标操作系统不支持,则进入安装引导程序对应的步骤时会因无法选择对应的磁盘导致无法安装。因此需要获取安装服务器的存储结构并判断安装引导程序是否可以免驱动使用待安装服务器上的存储设备安装操作系统。如果服务器上的存储结构不被安装引导程序支持,则需要将对应的驱动程序信息添加到配置策略,进一步在根据配置策略生成虚拟镜像结构体时将驱动信息添加到虚拟镜像结构体中。In this embodiment, it is also necessary to judge the storage structure of the server to be installed. The storage structure refers to the connection mode of the storage device (hard disk) on the server to be installed, which can be roughly divided into two types. The other way to form a RAID is to directly connect the hard disk to the server motherboard. The first method requires the installation of the bootloader to support the RIAD card. That is, if the target operating system does not support it, the installation will fail because the corresponding disk cannot be selected when entering the corresponding step of installing the bootloader. Therefore, it is necessary to obtain the storage structure of the installation server and determine whether the installation boot program can use the storage device on the server to be installed to install the operating system without a driver. If the storage structure on the server is not supported by the installation boot program, you need to add the corresponding driver information to the configuration policy, and further add the driver information to the virtual mirror structure when generating the virtual mirror structure according to the configuration policy.

另外,不被安装引导程序支持的存储结构主要是所使用的RAID卡不被安装引导程序支持,又因为在服务器未安装系统时,RIAD卡没有任何配置,因此需要根据需要指定待安装服务器的RAID模式以及分配对应的磁盘空间用于存储数据和/或安装目标操作系统。In addition, the storage structure not supported by the installation boot program is mainly because the RAID card used is not supported by the installation boot program, and because the RIAD card does not have any configuration when the system is not installed on the server, it is necessary to specify the RAID of the server to be installed as needed mode and allocate the corresponding disk space for storing data and/or installing the target operating system.

在本发明的一些实施方式中,基于所述配置策略和目标操作系统制定虚拟镜像结构体包括:In some embodiments of the present invention, formulating a virtual image structure based on the configuration strategy and the target operating system includes:

基于所述配置策略和目标操作系统制定所述目标操作系统的安装引导程序信息,并将所述安装引导程序信息添加到虚拟镜像结构体中。Developing the installation guide program information of the target operating system based on the configuration policy and the target operating system, and adding the installation guide program information to the virtual image structure.

在本实施例中,如果根据待安装服务器的硬件配置情况制定的配置策略包含对应硬件的驱动相关信息,则说明目标操作系统的安装引导程序不支持待安装服务器的相关硬件,需要将相关硬件的驱动程序添加到安装引导程序。In this embodiment, if the configuration policy formulated according to the hardware configuration of the server to be installed includes the driver-related information of the corresponding hardware, it means that the installation boot program of the target operating system does not support the relevant hardware of the server to be installed, and the relevant hardware's Drivers are added to the installation bootloader.

具体地,以Windows操作系统为例,Windows操作系统在安装时需要使用Windows镜像内boot.vim文件,boot.vim文件实质上是微软提供的一个内存操作系统的镜像文件,文件大约200MB包含在Windows安装时所需要的文件。因此,在一般情况下,如果待安装服务器上的某硬件配置,不被微软的安装引导程序支持,需要将该硬件的驱动添加到安装引导程序中,即boot.vim文件中然后重新生成包含该驱动的boot.vim文件。Specifically, taking the Windows operating system as an example, the Windows operating system needs to use the boot.vim file in the Windows image when installing the Windows operating system. The boot.vim file is essentially an image file of a memory operating system provided by Microsoft. The file is about 200MB included in the Windows Files required for installation. Therefore, in general, if a hardware configuration on the server to be installed is not supported by Microsoft's installation boot program, you need to add the hardware driver to the installation boot program, that is, the boot.vim file and then regenerate the Driven boot.vim file.

在本发明的一些实施例中,在基于所述配置策略和目标操作系统制定所述目标操作系统的安装引导程序信息时,是现将原始boot.vim解压,然后将驱动文件存放到解压后的用于存放自定义程序的目录下,再将包含该驱动文件的解压后的boot文件夹重新封装成boot.vim文件。进一步将重新生成的boot.vim的文件地址和相关信息(该boot.vim文件所包含的驱动信息、可用于引导安装的操作系统的版本信息,以及重新封装后的文件的MD5值等)添加到虚拟镜像结构体中。In some embodiments of the present invention, when formulating the installation guide program information of the target operating system based on the configuration strategy and the target operating system, the original boot.vim is now decompressed, and then the driver file is stored in the decompressed In the directory for storing custom programs, repackage the decompressed boot folder containing the driver file into a boot.vim file. Further add the file address and related information of the regenerated boot.vim (the driver information contained in the boot.vim file, the version information of the operating system that can be used to boot and install, and the MD5 value of the repackaged file, etc.) to In the virtual image structure.

在本发明的一些实施例中,不再直接将驱动添加到boot.vim中,而是根据boot.vim文件的内容进行分块。即将boot.vim文件在以二进制读取的时候尽心区分,即区分出哪些是Windows安装引导程序(内存操作系统)的镜像文件区域,哪些是可以由用户自定义存放驱动程序的数据区域。进一步将上述安装引导程序的区域和可以由用户自定义存放驱动的区域的数据地址范围添加到虚拟镜像结构体中。In some embodiments of the present invention, the driver is no longer directly added to the boot.vim, but is divided into blocks according to the contents of the boot.vim file. The boot.vim file is carefully distinguished when it is read in binary, that is, to distinguish which is the image file area of the Windows installation boot program (memory operating system), and which is the data area that can be customized by the user to store the driver. Further add the data address range of the above-mentioned area where the boot program is installed and the area where the driver can be customized by the user to store the driver into the virtual image structure.

具体地,假如boot.vim文件的原始大小为200MB,待安装服务器所需要的驱动程序为30MB,如果将该驱动添加到boot.vim中时,是直接将该驱动程序直接以追加的方式写入到boot.vim中,则在虚拟镜像结构体中,将boot.vim和对应的驱动信息和地址按照前后顺序进行保存,表示安装引导程序和驱动程序在boot.vim镜像数据中是以连续的方式保存。如果在boot.vim中是在第190MB的数据范围内开始存放驱动程序,最后10MB数据时boot.vim的其他数据,则需要将该驱动程序的嵌入数据的地址范围添加到虚拟镜像结构体中,可理解为0-190MB是boot.vim的原始数据的第一部分,然后是30MB的驱动程序,最后的10MB是boot.vim原始数据的另一部分。上述只是便于理解的举例,详细配置规则可参考微软提供的关于boot.vim的格式参考文档《Windows Image File Format》。Specifically, if the original size of the boot.vim file is 200MB, and the driver required by the server to be installed is 30MB, if the driver is added to boot.vim, the driver is directly written in the form of an append In boot.vim, in the virtual mirror structure, boot.vim and the corresponding driver information and addresses are saved in sequence, indicating that the boot program and driver are installed in a continuous manner in the boot.vim mirror data save. If the driver is stored in the 190MB data range in boot.vim, and the last 10MB data is other data in boot.vim, you need to add the address range of the embedded data of the driver to the virtual image structure. It can be understood that 0-190MB is the first part of the original data of boot.vim, then the driver of 30MB, and the last 10MB is another part of the original data of boot.vim. The above are just examples for easy understanding. For detailed configuration rules, please refer to the format reference document "Windows Image File Format" about boot.vim provided by Microsoft.

优选地,在本发明的一些实施例中,不再将安装引导程序以boot.vim的封装形式考虑,而是将其解压成(按照《Windows Image File Format》格式规范)多个文件或文件目录,并将各个文件(一个或多个目录下的所有文件作为一个整体看待)地址和对应的校验信息即MD5值添加到对应虚拟镜像结构体中。在需要向其中添加对应的驱动程序时,则直接将驱动程序的文件地址和MD5按照解压后的文件关系添加到虚拟镜像结构体的对应位置。即整个安装程序部分在整个虚拟镜像结构体中是以上述实施例中封装对应驱动后的boot.vim的解压后的目录结构出现,即不再对根据不同的驱动程序对boot.vim(指安装引导程序的整体部分)进行封装成文件,而是在虚拟镜像结构体中“封装”一个关于安装引导程序的结构体(虚拟镜像结构体的一部分)。可见地,当待安装服务器的硬件配置不同或者所要安装的操作系统不同时,只需将虚拟镜像结构体中对应的驱动程序的地址以及MD5值或者是操作系统镜像地址和MD5值进行更新即可。无需再根据不同的硬件条件而封装或生成多个boot.vim文件既耗时又浪费存储空间的方式进行安装引导程序的定制。Preferably, in some embodiments of the present invention, the installation boot program is no longer considered in the packaging form of boot.vim, but it is decompressed into (according to the "Windows Image File Format" format specification) multiple files or file directories , and add the address of each file (all files under one or more directories as a whole) and the corresponding verification information, that is, the MD5 value, to the corresponding virtual image structure. When it is necessary to add a corresponding driver therein, the file address and MD5 of the driver are directly added to the corresponding position of the virtual image structure according to the decompressed file relationship. That is to say, the entire installer part appears in the directory structure after decompression of the boot.vim after encapsulating the corresponding driver in the above-mentioned embodiment in the entire virtual mirror structure, that is, no longer pair boot.vim (referring to the installation) according to different drivers. The integral part of the boot program) is packaged into a file, but a structure (a part of the virtual mirror structure) about installing the boot program is "encapsulated" in the virtual mirror structure. It can be seen that when the hardware configuration of the server to be installed is different or the operating system to be installed is different, it is only necessary to update the address and MD5 value of the corresponding driver in the virtual image structure or the address and MD5 value of the operating system image. . There is no need to package or generate multiple boot.vim files according to different hardware conditions, which is time-consuming and wastes storage space to customize the installation boot program.

在本发明的一些实施方式中,基于所述配置策略和目标操作系统制定虚拟镜像结构体包括:In some embodiments of the present invention, formulating a virtual image structure based on the configuration strategy and the target operating system includes:

根据目标操作系统创建应答文件模板,基于所述配置策略与所述应答文件模板生成对应的应答文件信息,并将所述应答文件信息添加到虚拟镜像结构体中。Create an answer file template according to the target operating system, generate answer file information corresponding to the answer file template based on the configuration policy, and add the answer file information to the virtual image structure.

在本实施例中,应答文件是指导安装引导程序安装操作系统的配置文件,应答文件模板是根据不同的操作系统的安装方式的通用模板,不同类型操作系统具有不同的应答文件模板,例如Windows操作系统和Linux系统因引导程序安装方式不同而具有不同的安装模板,即不同的安装引导程序对应不同的应答文件模板。In this embodiment, the answer file is a configuration file that guides the installation boot program to install the operating system, and the answer file template is a general template according to the installation mode of different operating systems. Different types of operating systems have different answer file templates, such as Windows operation The system and the Linux system have different installation templates due to different bootloader installation methods, that is, different installation bootloaders correspond to different answer file templates.

进一步,在确定对待安装服务器要安装的操作系统后,将安装引导程序需要额外添加的处理项按照安装顺序配置到应答文件模板中,并将配置好的应答文件模板作为待安装服务器安装目标操作系统的应答文件,并将应答文件的内容以字符串的方式读取并添加到虚拟镜像结构体中。在安装引导程序安装目标操作系统时通过应答文件上的配置步骤加载相应的可执行程序或执行相应的操作。Further, after determining the operating system to be installed on the server to be installed, configure the additional processing items required to install the boot program into the answer file template in the order of installation, and use the configured answer file template as the target operating system for the server to be installed The answer file, and read the content of the answer file as a character string and add it to the virtual image structure. When the boot program is installed to install the target operating system, the corresponding executable program is loaded or the corresponding operation is performed through the configuration steps on the answer file.

在本发明的一些实施例中,以Windows系统为例,假如此次对待安装服务器安装操作系统需要加载RAID卡驱动程序,则需要将安装的RAID卡驱动文件信息添加到Autounattend.xml中。在一些情况下,如果安装引导程序在安装目标操作系统时需要芯片组驱动支持,则同样需要将芯片组驱动支持写入到Autounattend.xml。当涉及多个硬件设备的驱动安装时需要根据硬件设备的依赖关系将驱动安装顺序添加到Autounattend.xml中。最后将Autounattend.xml读取并加载到虚拟镜像结构体中。In some embodiments of the present invention, taking the Windows system as an example, if the operating system of the server to be installed needs to load the RAID card driver, the installed RAID card driver file information needs to be added to Autounattend.xml. In some cases, if the installation bootloader needs chipset driver support when installing the target operating system, it is also necessary to write the chipset driver support to Autounattend.xml. When the driver installation of multiple hardware devices is involved, it is necessary to add the driver installation sequence to Autounattend.xml according to the dependencies of the hardware devices. Finally, Autounattend.xml is read and loaded into the virtual image structure.

在本发明的一些实施例中,应答文件的创建同样以非文件的形式完成,即在虚拟镜像结构体中安装引导程序参数项,安装引导程序参数项共分为两个部分,第一部分是安装引导程序安装目标操作系统时的驱动选项,即在安装引导程序(内存操作系统)启动后需要挂载的驱动程序的信息有哪些,以及在驱动程序挂载后可安装目标操作系统时对目标操作系统的操作选项,即安装的操作系统版本、目标操作系统的安装磁盘位置、是否对磁盘进行格式化等配置参数项。In some embodiments of the present invention, the creation of the answer file is also completed in the form of a non-file, that is, the bootloader parameter item is installed in the virtual image structure, and the installation bootloader parameter item is divided into two parts. The first part is the installation The driver options when the boot program installs the target operating system, that is, what information about the driver that needs to be mounted after the boot program (memory operating system) starts, and the target operation when the target operating system can be installed after the driver is mounted The operating options of the system, that is, the installed operating system version, the installation disk location of the target operating system, whether to format the disk, and other configuration parameters.

另外,第二部分则包括操作系统在安装引导程序安装完成后(即将镜像中的操作系统复制到磁盘并配置好开机引导之后)从磁盘加载目标操作系统时所要加载的驱动程序或者一些软件配置项。例如对服务器所有的硬件设备的驱动安装选项(需要说明的是,此时的驱动安装区别于之前的安装引导程序的驱动安装,安装引导程序是简化的内存操作系统,在安装目标操作系统时需要一些驱动程序,并且这些驱动程序是加载到内存中的,并未存在磁盘上,因此掉电后安装的驱动程序便消失了),在目标操作系统从磁盘上启动后自动安装相应的驱动程序以完善目标操作系统的运行环境。In addition, the second part includes the driver or some software configuration items to be loaded when the operating system loads the target operating system from the disk after the installation of the boot program is completed (that is, after the operating system in the image is copied to the disk and configured for booting). . For example, the driver installation options for all hardware devices of the server (it should be noted that the driver installation at this time is different from the previous installation of the boot program. The installation boot program is a simplified memory operating system, which needs to be Some drivers, and these drivers are loaded into the memory, and do not exist on the disk, so the installed drivers will disappear after power failure), after the target operating system is started from the disk, the corresponding driver is automatically installed to Improve the operating environment of the target operating system.

在本实施例中,根据需要可以在虚拟镜像结构体中配置上述两部分的参数选项,在需要生成应答文件时,按照应答文件模板将虚拟镜像结构体中的安装引导程序参数项中的参数添加大应答文件模板以生成对应的应答文件。In this embodiment, the parameter options of the above two parts can be configured in the virtual image structure as required, and when an answer file needs to be generated, add the parameters in the installation boot program parameter item in the virtual image structure according to the answer file template Large answer file template to generate a corresponding answer file.

虚拟镜像结构体中的安装引导程序参数项在需要时可通过程序修改或者从一些配置文件中直接导入,方便工作人员批量化导入。The installation guide program parameter items in the virtual image structure can be modified through the program or directly imported from some configuration files when needed, which is convenient for the staff to import in batches.

在本发明的一些实施方式中,通过所述虚拟镜像结构体为所述待安装服务器安装操作系统包括:In some embodiments of the present invention, installing an operating system for the server to be installed through the virtual image structure includes:

根据所述虚拟镜像结构体生成目标操作系统镜像文件,并将所述目标操作系统镜像文件发送到安装设备,通过所述安装设备将所述目标操作系统镜像文件安装到所述待安装服务器上。Generate a target operating system image file according to the virtual image structure, and send the target operating system image file to an installation device, and install the target operating system image file on the server to be installed through the installation device.

在本实施例中,如果选择以系统镜像文件的方式安装,可以根据虚拟镜像结构体中的信息生成.iso格式的目标操作系统镜像文件。虚拟镜像结构中包含了目标操作系统安装所需要的:安装引导程序(内存操作修通)、安装引导程序需要的相关驱动、目标操作系统镜像文件、以及应答文件。因此根据虚拟镜像结构体中的上述信息中的文件地址获取对应的文件并按照ISO镜像格式要求生成适配待安装服务器硬件配置的.ios镜像文件。In this embodiment, if the system image file is selected for installation, the target operating system image file in .iso format can be generated according to the information in the virtual image structure. The virtual image structure includes what is required for the installation of the target operating system: the installation boot program (memory operation repair), the relevant drivers required for the installation of the boot program, the target operating system image file, and the answer file. Therefore, according to the file address in the above information in the virtual image structure, the corresponding file is obtained and an .ios image file adapted to the hardware configuration of the server to be installed is generated according to the requirements of the ISO image format.

进一步将.iso镜像文件发送到安装设备,安装设备是指可以将.iso文件作为计算机系统安装结构的设备,例如,如果是光盘为介质,即将系统镜像文件烧录到光盘中,需要以光驱作为安装设备安装目标操作系统。另外如果是以虚拟光驱提供的设备,例如将U盘的虚拟成虚拟光驱的方式安装,则只需将生成的.iso镜像文件拷贝到U盘中。Further send the .iso image file to the installation device. The installation device refers to the device that can use the .iso file as the installation structure of the computer system. For example, if the CD is used as the medium, the system image file will be burned to the CD. The mount device installs the target operating system. In addition, if it is a device provided by a virtual CD-ROM drive, for example, the U disk is virtualized into a virtual CD-ROM drive, you only need to copy the generated .iso image file to the U disk.

优选地,对于服务器领域来说,可以使用BMC来实现对待安装服务器的虚拟光驱来安装目标操作系统的.iso镜像文件。Preferably, for the server field, the BMC can be used to implement the .iso image file of the target operating system installed on the virtual optical drive of the server to be installed.

在本发明的一些实施方式中,通过所述虚拟镜像结构体为所述待安装服务器安装操作系统包括:In some embodiments of the present invention, installing an operating system for the server to be installed through the virtual image structure includes:

获取所述虚拟镜像结构体中对应的目标操作系统安装文件,并将所述目标操作系统安装文件发送到安装设备;Obtain the corresponding target operating system installation file in the virtual image structure, and send the target operating system installation file to the installation device;

通过所述安装设备向所述待安装服务器提供虚拟光驱,providing a virtual optical drive to the server to be installed through the installation device,

通过所述虚拟光驱将所述目标操作系统安装文件加载到所述待安装服务器上,以安装所述目标操作系统。The target operating system installation file is loaded onto the server to be installed through the virtual optical drive, so as to install the target operating system.

在本实施例中,在通过虚拟镜像结构体为所述待安装服务器安装操作系统时,可根据虚拟镜像结构体按照.iso格式规范基于虚拟镜像结构中的数据发送到按照设备。In this embodiment, when the operating system is installed for the server to be installed through the virtual image structure, data in the virtual image structure may be sent to the device according to the .iso format specification based on the virtual image structure.

需要说明的是,如果是以PC机(执行本发明程序的计算机设备)的串口线与待安装服务器相连,并通过PC机提供虚拟光驱,则PC机根据虚拟镜像结构体中的对应的地址获取安装引导程序文件、驱动文件、系统镜像文件以及应答文件,并按照.iso格式规范向虚拟光驱提供数据,安装目标操作系统。It should be noted that if the serial port line of the PC (the computer equipment that executes the program of the present invention) is connected to the server to be installed, and the virtual CD-ROM drive is provided through the PC, the PC obtains the corresponding address according to the virtual image structure. Install the boot program file, driver file, system image file and answer file, and provide data to the virtual CD-ROM according to the .iso format specification, and install the target operating system.

在本发明的一些实施例中,如果安装设备是BMC,且是通过PC机以网络访问待安装服务器的BMC,并由BMC提供虚拟光驱的方式,即带外安装的方式安装目标操作系统时,PC机在获取虚拟镜像结构中的上述文件后,按照.iso文件格式规范向BMC发送数据流,BMC接收到数据后则将数据按接收顺序发送到有BMC提供给待安装服务器的虚拟光驱以此模拟正常的光驱读取.iso镜像文件的方式安装目标操作系统。而无需生成对应的.iso格式的镜像文件。In some embodiments of the present invention, if the installation device is a BMC, and the BMC of the server to be installed is accessed through the network through a PC, and the BMC provides a virtual CD-ROM drive, that is, when the target operating system is installed in an out-of-band installation mode, After the PC obtains the above files in the virtual image structure, it sends the data stream to the BMC according to the .iso file format specification. After receiving the data, the BMC sends the data to the virtual CD-ROM provided by the BMC to the server to be installed in order of receipt. Install the target operating system by simulating a normal CD-ROM to read the .iso image file. There is no need to generate the corresponding image file in .iso format.

在本发明的一些实施方式中,通过所述虚拟镜像结构体为所述待安装服务器安装操作系统包括:In some embodiments of the present invention, installing an operating system for the server to be installed through the virtual image structure includes:

将所述虚拟镜像结构体发送到安装设备,并通过所述安装设备获取所述虚拟镜像结构体中对应的目标操作系统安装文件;Send the virtual image structure to an installation device, and obtain the corresponding target operating system installation file in the virtual image structure through the installation device;

通过所述安装设备向所述待安装服务器提供虚拟光驱,providing a virtual optical drive to the server to be installed through the installation device,

通过所述虚拟光驱将所述目标操作系统安装文件加载到所述待安装服务器上,以安装所述目标操作系统。The target operating system installation file is loaded onto the server to be installed through the virtual optical drive, so as to install the target operating system.

优选地,在本实施例中,在数据中心为服务器集群安装对应的操作系统时,可优先选择以BMC作为安装设备安装目标操作系统。可将虚拟镜像结构体发送到BMC上相应的以实现的客户端程序,由客户端程序解析虚拟镜像结构体中的安装引导程序(内存操作修通)文件地址、安装引导程序需要的相关驱动的地址、目标操作系统镜像文件地址,根据上述文件地址下载对应的文件,在下载到对应的文件之后按照虚拟镜像结构体中对应的MD5值进行校验,校验通过后则在BMC端按照.iso格式规范,将上述文件以二进制的方式提供给已在服务器上建立的虚拟光驱,通过虚拟光驱运行安装引导程序。Preferably, in this embodiment, when the corresponding operating system is installed for the server cluster in the data center, the BMC may be preferentially selected as the installation device to install the target operating system. The virtual image structure can be sent to the corresponding client program implemented on the BMC, and the client program can analyze the address of the installation boot program (memory operation repair) file in the virtual image structure and the relevant drivers required for the installation of the boot program. address, the address of the image file of the target operating system, download the corresponding file according to the above file address, and verify it according to the corresponding MD5 value in the virtual image structure after downloading the corresponding file. After the verification is passed, follow the .iso The format is standardized, and the above-mentioned files are provided in binary form to the virtual CD-ROM drive that has been established on the server, and the installation boot program is run through the virtual CD-ROM drive.

另外,对于数据中心来说,上述文件可以借助数据中心的安全机制进行校验,即安装引导程序(内存操作系统)、安装引导程序需要的相关驱动、目标操作系统镜像文件有数据中心的软件库保存,并将保存地址更新到虚拟镜像结构体中,BMC在收到虚拟镜像结构体后直接从软件库下载文件,并按照.iso文件格式规范的数据顺序向虚拟光驱提供文镜像数据。In addition, for the data center, the above-mentioned files can be verified with the help of the security mechanism of the data center, that is, the installation of the boot program (in-memory operating system), the related drivers required for the installation of the boot program, and the target operating system image file with the software library of the data center Save and update the saving address to the virtual image structure. After receiving the virtual image structure, the BMC directly downloads the files from the software library, and provides the file image data to the virtual CD-ROM drive in accordance with the data order of the .iso file format specification.

进一步,当数据中心存在大量的服务器安装操作系统时,通过将虚拟镜像结构体发送到BMC,由BMC从数据中心的软件库获取对应部分的镜像数据,充分借助数据中心的软件网络快速并行地实现对大量服务器的批量安装。并且在同时通过BMC的网络获取镜像数据时,基于网络缓存可以实现安装镜像文件数据的批量分发。相比于由单个节点生成镜像并发送到BMC的方式来说效率的提升是显而易见的。Furthermore, when there are a large number of servers in the data center to install the operating system, by sending the virtual image structure to the BMC, the BMC obtains the corresponding part of the image data from the software library of the data center, and fully utilizes the software network of the data center to realize fast and parallel Batch installation to a large number of servers. And when the image data is obtained through the BMC network at the same time, the batch distribution of the installation image file data can be realized based on the network cache. Compared with the way that a single node generates an image and sends it to the BMC, the efficiency improvement is obvious.

需要说明的是,本发明提出的虚拟镜像结构体可根据不同的编程语言以不同的形式存在,在相应的程序执行时存在与内存中,在需要对虚拟镜像结构体保存时,可将虚拟镜像结构体以二进制数据的方式保存到数据库中,或者根据虚拟镜像结构体的数据结构形式导出成xml格式文件的方式持久化,需要时加载到相应的程序中。It should be noted that the virtual mirror structure proposed by the present invention can exist in different forms according to different programming languages, and exist in the memory when the corresponding program is executed. When the virtual mirror structure needs to be saved, the virtual mirror can be The structure is stored in the database in the form of binary data, or persisted in the form of an XML format file exported according to the data structure of the virtual mirror structure, and loaded into the corresponding program when needed.

另外,虚拟镜像结构体中的驱动可以是CPU芯片组驱动,PCIE设备驱动、外部串口设备驱动、硬盘RIAD卡驱动。In addition, the driver in the virtual image structure may be a CPU chipset driver, a PCIE device driver, an external serial port device driver, or a hard disk RIAD card driver.

通过本发明提供的一种操作系统安装方法,可针对不同的服务器配置设定不同的安装镜像,自动收集服务器配置信息,自动根据目标操作系统制定全自动化的操作镜像并实现自动化、批量化对多个服务器同步安装操作系统。极大地提高数据中心的运维效率。减轻运维人员在嘈杂的机房环境的工作量。Through the operating system installation method provided by the present invention, different installation images can be set for different server configurations, server configuration information can be automatically collected, fully automated operation images can be automatically formulated according to the target operating system, and automation and batch-to-many can be realized. Install the operating system on each server simultaneously. Greatly improve the operation and maintenance efficiency of the data center. Reduce the workload of operation and maintenance personnel in a noisy computer room environment.

如图2所示,本发明的另一方面还提出一种计算机设备,包括:As shown in Figure 2, another aspect of the present invention also proposes a computer device, including:

至少一个处理器21;以及at least one processor 21; and

存储器22,所述存储器22存储有可在所述处理器21上运行的计算机指令23,所述指令23由所述处理器21执行时实现上述实施方式中任意一项所述方法的步骤。A memory 22, the memory 22 stores computer instructions 23 that can run on the processor 21, and when the instructions 23 are executed by the processor 21, the steps of any one of the methods described in the foregoing embodiments are implemented.

如图3所示,本发明的再一方面还提出一种计算机可读存储介质401,所述计算机可读存储介质401存储有计算机程序402,所述计算机程序402被处理器执行时实现上述实施方式中任意一项所述方法的步骤。As shown in FIG. 3, another aspect of the present invention also proposes a computer-readable storage medium 401, the computer-readable storage medium 401 stores a computer program 402, and when the computer program 402 is executed by a processor, the above implementation The steps of any one of the methods described in the method.

以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。The above are the exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications can be made without departing from the scope of the disclosed embodiments of the present invention defined in the claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in an individual form, they may also be understood as a plurality unless explicitly limited to a singular number.

应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。It should be understood that, as used herein, the singular form "a" and "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.

上述本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments disclosed in the above-mentioned embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.

本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.

所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上所述的本发明实施例的不同方面的许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is exemplary only, and is not intended to imply that the scope (including claims) disclosed by the embodiments of the present invention is limited to these examples; under the idea of the embodiments of the present invention , technical features in the above embodiments or in different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as described above, which are not provided in details for the sake of brevity. Therefore, within the spirit and principle of the embodiments of the present invention, any omissions, modifications, equivalent replacements, improvements, etc., shall be included in the protection scope of the embodiments of the present invention.

Claims (10)

1. An operating system installation method, comprising:
acquiring configuration information of a server to be installed, and formulating a configuration strategy according to the configuration information;
formulating a virtual mirror structure based on the configuration policy and a target operating system, the virtual mirror structure comprising: operating system file information, installation bootstrap information, drive information, wherein:
the operating system file information includes: version information of the target operating system, operating system file address;
the installation guide program information comprises an installation guide program in the system installation process;
the driving information comprises the hardware configuration information of the server to be installed and the driving program information of the corresponding hardware required in the installation process determined by the target operating system;
and installing an operating system for the server to be installed through the virtual mirror image structure body.
2. The method of claim 1, wherein the obtaining configuration information of the server to be installed comprises:
and acquiring configuration information of the server to be installed through the memory operating system.
3. The method of claim 1, wherein the obtaining configuration information of the server to be installed, and formulating a configuration policy according to the configuration information comprises:
acquiring a storage structure of a server to be installed, and judging whether the storage structure supports drive-free installation of a target operating system;
and in response to the storage structure not supporting drive-free installation of the target operating system, configuring the storage structure according to the installation requirement of the target operating system, and adding the drive information of the storage structure to the configuration policy.
4. The method of claim 1, wherein the formulating a virtual image structure based on the configuration policy and a target operating system comprises:
and formulating installation bootstrap information of the target operating system based on the configuration strategy and the target operating system, and adding the installation bootstrap information into a virtual mirror structure body.
5. The method of claim 1, wherein the formulating a virtual image structure based on the configuration policy and a target operating system comprises:
and creating a response file template according to the target operating system, generating corresponding response file information based on the configuration strategy and the response file template, and adding the response file information into the virtual mirror structure body.
6. The method of claim 1, wherein the installing an operating system for the server to be installed through the virtual mirror structure comprises:
and generating a target operating system image file according to the virtual image structure body, sending the target operating system image file to installation equipment, and installing the target operating system image file on the server to be installed through the installation equipment.
7. The method of claim 1, wherein the installing an operating system for the server to be installed through the virtual mirror structure comprises:
acquiring a corresponding target operating system installation file in the virtual mirror image structure body, and sending the target operating system installation file to an installation device;
providing a virtual drive to the server to be installed through the installation device,
and loading the target operating system installation file to the server to be installed through the virtual CD-ROM so as to install the target operating system.
8. The method of claim 1, wherein the installing an operating system for the server to be installed through the virtual mirror structure comprises:
the virtual mirror image structure body is sent to installation equipment, and a corresponding target operating system installation file in the virtual mirror image structure body is obtained through the installation equipment;
providing a virtual drive to the server to be installed through the installation device,
and loading the target operating system installation file to the server to be installed through the virtual CD-ROM so as to install the target operating system.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, which when executed by the processor, perform the steps of the method of any one of claims 1-8.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method of any one of claims 1-8.
CN202210476591.4A 2022-04-30 2022-04-30 Operating system installation method, device and readable storage medium Active CN114756290B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210476591.4A CN114756290B (en) 2022-04-30 2022-04-30 Operating system installation method, device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210476591.4A CN114756290B (en) 2022-04-30 2022-04-30 Operating system installation method, device and readable storage medium

Publications (2)

Publication Number Publication Date
CN114756290A CN114756290A (en) 2022-07-15
CN114756290B true CN114756290B (en) 2023-08-25

Family

ID=82333189

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210476591.4A Active CN114756290B (en) 2022-04-30 2022-04-30 Operating system installation method, device and readable storage medium

Country Status (1)

Country Link
CN (1) CN114756290B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115061701B (en) * 2022-08-16 2022-11-25 新华三信息技术有限公司 Out-of-band installation method and device for server
CN116301942A (en) * 2023-03-21 2023-06-23 苏州浪潮智能科技有限公司 A kind of recycling method, device, computer equipment and storage medium
CN116149759B (en) * 2023-04-20 2023-07-14 深圳市吉方工控有限公司 UEFI (unified extensible firmware interface) drive unloading method and device, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110090705A (en) * 2010-02-04 2011-08-10 (주) 샘아이티 High Availability System with Virtual Device Mapping Structure
WO2016165472A1 (en) * 2015-07-13 2016-10-20 中兴通讯股份有限公司 Method and device for creating virtual machine
CN107291486A (en) * 2016-04-11 2017-10-24 紫光华山信息技术有限公司 The installation method and device of a kind of operating system
CN110908770A (en) * 2019-11-05 2020-03-24 安超云软件有限公司 Operation and creation method of virtual machine, virtual machine and virtual machine management platform
CN113641413A (en) * 2021-08-25 2021-11-12 Oppo广东移动通信有限公司 Target model loading and updating method and apparatus, readable medium and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110090705A (en) * 2010-02-04 2011-08-10 (주) 샘아이티 High Availability System with Virtual Device Mapping Structure
WO2016165472A1 (en) * 2015-07-13 2016-10-20 中兴通讯股份有限公司 Method and device for creating virtual machine
CN107291486A (en) * 2016-04-11 2017-10-24 紫光华山信息技术有限公司 The installation method and device of a kind of operating system
CN110908770A (en) * 2019-11-05 2020-03-24 安超云软件有限公司 Operation and creation method of virtual machine, virtual machine and virtual machine management platform
CN113641413A (en) * 2021-08-25 2021-11-12 Oppo广东移动通信有限公司 Target model loading and updating method and apparatus, readable medium and electronic device

Also Published As

Publication number Publication date
CN114756290A (en) 2022-07-15

Similar Documents

Publication Publication Date Title
CN114756290B (en) Operating system installation method, device and readable storage medium
US9940330B2 (en) System and method for converting a physical disk to a virtual disk
US8417796B2 (en) System and method for transferring a computing environment between computers of dissimilar configurations
US6993649B2 (en) Method of altering a computer operating system to boot and run from protected media
JP6089064B2 (en) Method, computer system and memory device for updating software components
CN115136114A (en) Firmware update patch
US20030233534A1 (en) Enhanced computer start-up methods
CN102207896A (en) Virtual machine crash file generation techniques
CN102402446A (en) Application software installation method and application software installation device
US6308326B1 (en) Run-time modules for dynamically adjusting computer operation
CN110780942A (en) System starting method and device, node equipment and computer readable storage medium
US20160306617A1 (en) Methods of updating firmware components, computer systems and memory apparatus
CN111679889A (en) A kind of virtual machine conversion and migration method and system
CN103106086B (en) Operating system disposal route and system
US20100043006A1 (en) Systems and methods for a configurable deployment platform with virtualization of processing resource specific persistent settings
US10613846B2 (en) Binary restoration in a container orchestration system
CN115509590B (en) Continuous deployment method and computer equipment
CN117609009A (en) Test methods, servers, management equipment and test systems
US11573782B2 (en) Self updating agent
CN115291925A (en) A BMC upgrade method, system, device and storage medium
JP6099106B2 (en) Method, computer system, and memory device for providing at least one data carrier
CN112130868B (en) Filling method, system, equipment and medium of system
CN111949278B (en) A method, system, terminal and storage medium for automatically installing MCS system
US20240036896A1 (en) Generating installation images based upon dpu-specific capabilities
WO2025092223A1 (en) Cloud firmware generation method, hypervisor boot method, electronic device, and medium

Legal Events

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

Address after: 215000 Building 9, No.1 guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Patentee after: Suzhou Yuannao Intelligent Technology Co.,Ltd.

Country or region after: China

Address before: 215000 Building 9, No.1 guanpu Road, Guoxiang street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Patentee before: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before: China