CN117850885A - Operating system installation configuration method and device, PXE server and storage medium - Google Patents

Operating system installation configuration method and device, PXE server and storage medium Download PDF

Info

Publication number
CN117850885A
CN117850885A CN202311664443.6A CN202311664443A CN117850885A CN 117850885 A CN117850885 A CN 117850885A CN 202311664443 A CN202311664443 A CN 202311664443A CN 117850885 A CN117850885 A CN 117850885A
Authority
CN
China
Prior art keywords
hard disk
silk
screen number
disk
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.)
Pending
Application number
CN202311664443.6A
Other languages
Chinese (zh)
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.)
China Great Wall Technology Group Co ltd
Original Assignee
China Great Wall Technology Group 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 China Great Wall Technology Group Co ltd filed Critical China Great Wall Technology Group Co ltd
Priority to CN202311664443.6A priority Critical patent/CN117850885A/en
Publication of CN117850885A publication Critical patent/CN117850885A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides an operating system installation configuration method, an operating system installation configuration device, a PXE server and a storage medium, and relates to the technical field of operating systems, wherein the method comprises the following steps: the method comprises the steps that a PXE server obtains an executable file of disk symbol mapping, and generates a hard disk silk-screen number configuration file and an automatic response file, wherein the executable file of disk symbol mapping is used for establishing a mapping relation between disk symbols and silk-screen numbers of all hard disks on a PXE client when being executed; the hard disk silk-screen number configuration file is used for indicating a target silk-screen number, wherein the target silk-screen number represents the silk-screen number of a hard disk of an operating system installed on the PXE client; and the automatic response file is used for running the disk symbol mapping executable file when being executed by the PXE client, acquiring a target silk-screen number indicated by the hard disk silk-screen number configuration file, and installing an operating system on the hard disk indicated by the disk symbol corresponding to the target silk-screen number. The technical scheme provided by the application can improve the flexibility of the installation of the operating system.

Description

Operating system installation configuration method and device, PXE server and storage medium
Technical Field
The present disclosure relates to the technical field of operating systems, and in particular, to an operating system installation configuration method and apparatus, a PXE server, and a storage medium.
Background
When the factory production server or the server operates and maintains, the operating system is required to be installed, and the Pre-start execution environment (Pre-boot Execution Environment, PXE) technology is used for pushing the operating system mirror image to the server in a local area network, so that the automatic remote installation of the operating system is realized.
In installing an operating system using PXE technology, the operating system may specifically be installed on a hard disk of a certain drive name in a server, for example, on a hard disk of the drive name sdb. However, this mounting is not flexible enough.
Disclosure of Invention
In view of this, the present application provides an operating system installation configuration method, apparatus, PXE server, and storage medium for improving flexibility of operating system installation.
In order to achieve the above object, in a first aspect, an embodiment of the present application provides an operating system installation configuration method, including:
the method comprises the steps of obtaining an executable file of the disk symbol mapping, wherein the executable file of the disk symbol mapping is used for establishing a mapping relation between the disk symbol and a silk screen number of each hard disk on a PXE client when being executed;
generating a hard disk silk-screen number configuration file, wherein the hard disk silk-screen number configuration file is used for indicating a target silk-screen number, and the target silk-screen number represents the silk-screen number of a hard disk of the PXE client side for installing an operating system;
And generating an automatic response file, wherein the automatic response file is used for running the drive letter mapping executable file when being executed by the PXE client, acquiring a target silk-screen number indicated by the hard disk silk-screen number configuration file, and installing an operating system on a hard disk indicated by a drive letter corresponding to the target silk-screen number.
In a possible implementation manner of the first aspect, the method further includes:
a PXE service is started, the PXE service comprising: DHCP service, TFTP service, and FTP service;
and responding to the request of the PXE client, and sending the drive letter mapping executable file, the hard disk screen printing number configuration file and the automatic response file to the PXE client.
In a possible implementation manner of the first aspect, the establishing a mapping relationship between an identifier and a silk-screen number of each hard disk on the PXE client includes:
obtaining the drive letter of each hard disk on the PXE client, and determining a first corresponding relation between the drive letter of each hard disk and the logic position number;
determining a second corresponding relation between a hard disk screen printing number and a logic position number of the PXE client according to the backboard type of the PXE client;
and establishing a mapping relation between the hard disk screen printing number of the PXE client and the drive letter according to the first corresponding relation and the second corresponding relation.
In a possible implementation manner of the first aspect, the determining a first correspondence between the drive letter and the logical location number of each hard disk includes:
under the condition that the PXE client comprises first hard disks, searching corresponding hard disk serial numbers according to the drive letters of the first hard disks; the first hard disk comprises a hard disk of the SAS and/or SATA type;
acquiring the corresponding relation between the logical position number of each first hard disk and the serial number of the hard disk;
and establishing a corresponding relation between the disk symbol and the logic position number of each first hard disk.
In a possible implementation manner of the first aspect, the determining a first correspondence between the drive letter and the logical location number of each hard disk includes:
and under the condition that the PXE client comprises a second hard disk, searching a logic position number corresponding to the drive letter of each second hard disk, and establishing a corresponding relation between the drive letter of each second hard disk and the logic position number, wherein the second hard disk comprises NVME and/or RAID type hard disks.
In a possible implementation manner of the first aspect, the auto-answer file is further configured to instruct the PXE client to install the operating system on a hard disk of a preset disk drive if the target silk-screen number does not have a corresponding disk drive.
In a possible implementation manner of the first aspect, the automatic response file includes a first execution instruction, a second execution instruction and a third execution instruction, where the first execution instruction is used to configure the disk symbol mapping executable file, the second execution instruction is used to obtain a target silk-screen number in the hard disk silk-screen number configuration file, and the third execution instruction is used to install an operating system on a hard disk indicated by a disk symbol corresponding to the target silk-screen number.
In a second aspect, an embodiment of the present application provides an operating system installation configuration apparatus, including: the device comprises an acquisition module and a generation module;
the acquisition module is used for: the method comprises the steps of obtaining an executable file of disk symbol mapping, wherein the executable file of disk symbol mapping is used for establishing a mapping relation between disk symbols and silk-screen numbers of all hard disks on a PXE client when being executed;
the generating module is used for: generating a hard disk silk-screen number configuration file, wherein the hard disk silk-screen number configuration file is used for indicating a target silk-screen number, and the target silk-screen number represents the silk-screen number of a hard disk of the PXE client side for installing an operating system;
the generating module is further configured to: and generating an automatic response file, wherein the automatic response file is used for running the drive letter mapping executable file when being executed by the PXE client, acquiring a target silk-screen number indicated by the hard disk silk-screen number configuration file, and installing an operating system on a hard disk indicated by a drive letter corresponding to the target silk-screen number.
In a possible implementation manner of the second aspect, the apparatus further includes: a starting module and a communication module;
the starting module is used for: a PXE service is started, the PXE service comprising: DHCP service, TFTP service, and FTP service;
the communication module is used for: and responding to the request of the PXE client, and sending the drive letter mapping executable file, the hard disk screen printing number configuration file and the automatic response file to the PXE client.
In a possible implementation manner of the second aspect, the establishing a mapping relationship between an identifier and a silk screen number of each hard disk on the PXE client includes:
obtaining the drive letter of each hard disk on the PXE client;
determining a first corresponding relation between the drive letter and the logic position number of each hard disk according to the drive letter of each hard disk on the PXE client; determining a second corresponding relation between a hard disk screen printing number and a logic position number of the PXE client according to the backboard type of the PXE client; and establishing a mapping relation between the hard disk screen printing number of the PXE client and the drive letter according to the first corresponding relation and the second corresponding relation.
In a possible implementation manner of the second aspect, the determining a first correspondence between the identifier and the logical location number of each hard disk includes:
Under the condition that the PXE client comprises first hard disks, searching corresponding hard disk serial numbers according to the drive letters of the first hard disks; the first hard disk comprises a hard disk of the SAS and/or SATA type;
acquiring the corresponding relation between the logical position number of each first hard disk and the serial number of the hard disk;
and establishing a corresponding relation between the disk symbol and the logic position number of each first hard disk.
In a possible implementation manner of the second aspect, the determining a first correspondence between the identifier and the logical location number of each hard disk includes:
and under the condition that the PXE client comprises a second hard disk, searching a logic position number corresponding to the drive letter of each second hard disk, and establishing a corresponding relation between the drive letter of each second hard disk and the logic position number, wherein the second hard disk comprises NVME and/or RAID type hard disks.
In a possible implementation manner of the second aspect, the auto-answer file is further configured to instruct the PXE client to install the operating system on a hard disk of a preset disk drive if the target silk-screen number does not have a corresponding disk drive.
In a third aspect, an embodiment of the present application provides a PXE server, including: a memory and a processor, the memory for storing a computer program; the processor is configured to perform the method of the first aspect or any implementation of the first aspect when the computer program is invoked.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of the first aspect or any implementation of the first aspect.
According to the operating system installation configuration method, the PXE server can acquire the disk symbol mapping executable file and generate the hard disk silk-screen number configuration file and the automatic response file, wherein the disk symbol mapping executable file is used for establishing a mapping relation between disk symbols and silk-screen numbers of all hard disks on the PXE client when being executed; the hard disk silk-screen number configuration file is used for indicating a target silk-screen number, wherein the target silk-screen number represents the silk-screen number of a hard disk of an operating system installed on the PXE client; and the automatic response file is used for running the disk symbol mapping executable file when being executed by the PXE client, acquiring a target silk-screen number indicated by the hard disk silk-screen number configuration file, and installing an operating system on the hard disk indicated by the disk symbol corresponding to the target silk-screen number. Therefore, when the PXE technology is adopted to install the operating system, the PXE client can run the disk symbol mapping executable file according to the automatic response file after obtaining the disk symbol mapping executable file, the hard disk silk-screen number configuration file and the automatic response file, and obtain the target silk-screen number indicated by the hard disk silk-screen number configuration file, and install the operating system on the hard disk indicated by the disk symbol corresponding to the target silk-screen number, so that the flexibility of installing the operating system can be improved.
Drawings
Fig. 1 is a flow chart of an operating system installation configuration method provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of establishing a mapping relationship between an identifier and a silk screen number of each hard disk of a PXE client according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an installation configuration device of an operating system according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a PXE server according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the accompanying drawings in the embodiments of the present application. The terminology used in the description of the embodiments of the application is for the purpose of describing particular embodiments of the application only and is not intended to be limiting of the application. The following embodiments may be combined with each other, and some embodiments may not be repeated for the same or similar concepts or processes.
The PXE technology is a network boot technology developed by Intel corporation, works in a Client/Server (Client/Server) mode, allows a PXE Client to download a boot image from a PXE Server through a network, and loads an operating system installation package, thereby realizing batch installation of an operating system.
The PXE technology can only install an operating system to one hard disk of a specific disk drive (also referred to as a drive name), e.g., drive name sdb, while the slot location of the hard disk of each PXE client drive name sdb is unknown and the location on each PXE client slot is different. When an operating system is installed on a specified silk-screen number hard disk, the rest hard disks can only be pulled out, the specified silk-screen number hard disk is reserved or the specified silk-screen number hard disk is installed singly in a manual mode, and the flexibility of the two installation modes is poor, so that the operation and maintenance efficiency of operation and maintenance personnel is affected.
In view of this, the embodiments of the present application provide an operating system installation configuration method, which can implement that an operating system is installed on a hard disk indicated by a disk symbol corresponding to a silk-screen number specified by an operation and maintenance person, so as to improve flexibility of operating system installation.
The present application is further described below with reference to the drawings and embodiments.
In particular performing an operating system installation configuration, it may be implemented according to the method shown in FIG. 1. Fig. 1 is a flowchart of a method for operating system installation configuration according to an embodiment of the present application, as shown in fig. 1, where the method may include the following steps:
step S110, an executable file of the disk symbol mapping is obtained, and the executable file of the disk symbol mapping is used for establishing a mapping relation between the disk symbol and the silk screen number of each hard disk on the PXE client when being executed.
The PXE client may be a physical server, a notebook computer, or other electronic device that may install an operating system. For ease of description, the following will take a PXE client as an example of a physical server.
A plurality of hard disk slots are arranged on a hard disk backboard of the PXE client, the hard disk is inserted into the hard disk slots, and each hard disk slot is provided with a hard disk slot silk screen number and a logic position number (or called a physical slot number or a logic slot number).
The disk symbol mapping executable file can be a script file written by an operation and maintenance personnel and capable of running on the PXE client, and when the file is executed, a mapping relation between the disk symbol of each hard disk on the PXE client and a hard disk slot silk screen number (hereinafter referred to as a hard disk silk screen number) of the backboard can be established. The disc symbol mapping executable file and the automatic response file may be stored in the same working directory, or may be stored in other working directories according to a system requirement, for example, a system file of an operating system, which is not particularly limited in this application.
Specifically, when the PXE client runs the disk-symbol mapping executable file, the mapping relationship between the disk symbol and the silk-screen number of each hard disk may be established by a method as shown in fig. 2, and the method may include the following steps:
step S210, obtaining the disk symbols of all the hard disks on the PXE client, and determining a first corresponding relation between the disk symbols of all the hard disks and the logic position numbers.
The PXE client may include a plurality of PXE clients, and for convenience of description, the embodiments of the present application are illustrated with one PXE client. After the PXE client runs the executable file, the hard disk information of the PXE client may be read, for example, through a hard disk view command lsblk. For example, the hard disk drive name plugged onto the PXE client may be obtained by a lsblk-dno name command. After the hard disk drive name is obtained, the hard disk drive name may be stored, the storage form may be a plurality of groups or a Hash table, and the storage location may be a memory, which is not particularly limited in this application.
In some scenarios, the hard disk plugged by the PXE client includes only one type, taking the hard disk type as a SATA hard disk as an example, and the types of the hard disk identifier names obtained through the hard disk viewing command are the same, for example, sda, sdb. In this case, the serial number of each hard disk can be obtained from the hard disk drive name. Wherein the hard disk serial number is a unique identifier of the hard disk and can be used to identify a particular hard disk device.
In other scenarios, the hard disk drive of the PXE client includes multiple types, such as SAS, SATA, and NVME, where the corresponding serial number may be obtained according to each hard disk drive name of the different types.
Specifically, when the PXE client includes the first hard disks, the corresponding hard disk serial numbers may be searched first according to the disk symbols of each first hard disk. In some embodiments, the first hard disk may comprise a SAS and/or SATA type hard disk. Illustratively, the find command may be: smartctl-i/dev/[ disk name ] |grep-i "serial Number".
After the serial numbers of the hard disks of various types are obtained, the serial numbers of the hard disks and the corresponding drive letter names can be correspondingly stored, so that the relation between the drive letter names of the hard disks and the serial numbers of the hard disks is determined, the storage mode can be a hash table or a map (map) table, and the storage position can be a memory.
And acquiring the corresponding relation between the logical position number of each first hard disk and the serial number of the hard disk besides acquiring the serial number of each type of hard disk in the first hard disk. For example, the corresponding relationship between the serial number of each first hard disk and the logical location number may be obtained through a barcali command, where the barcali command may be: the stop/call/earl/sall show all j|grep-E "EID|SN".
After the relationship between the hard disk drive letter name and the hard disk serial number of each first hard disk and the corresponding relationship between the hard disk serial number and the logic position number are obtained, the corresponding relationship between the hard disk drive letter and the logic position number of each first hard disk can be established accordingly.
And under the condition that the PXE client comprises the second hard disks, searching the logical position numbers corresponding to the disk symbols of the second hard disks, and establishing the corresponding relation between the disk symbols of the second hard disks and the logical position numbers. The second hard disk may comprise an NVME type hard disk. By way of example, commands may be used: find/sys/device/-name to obtain the correspondence between the hard disk drive name and the logical location number of the NVME type.
In some embodiments, the second hard disk may also comprise a disk-group RAID type hard disk. For RAID type hard disks, a storage command may be used to obtain the correspondence between RAID drive names and corresponding logical location numbers. Illustratively, the store li command may be: the stop/call/vall show all j|grep-E "EID|OSdrive Name".
Step S220, determining a second corresponding relation between the hard disk silk-screen number and the logic position number of the PXE client according to the backboard type of the PXE client.
The backboard types of different PXE clients may include a plurality of types, such as an 8-disc backboard, a 24-disc backboard, a 12-disc backboard, etc., and the corresponding relationship between the hard disk silk-screen numbers and the hard disk logical numbers of the backboard of the PXE client of different manufacturers is different. When determining the second correspondence between the hard disk screen number and the logical position number, the back plate type of the PXE client may be obtained first. The backplane type may be obtained by a baseboard management controller (Baseboard Management Controller, BMC) using IPMI platform management tools. Specifically, the acquisition command may be: ipmitool raw [ data ], wherein [ data ] is a communication code for IPMI communication with BMC.
And besides the back plate type of the PXE client, the corresponding relation between the hard disk silk-screen number and the logic position number of the inserted hard disk can be obtained. The corresponding relationship between the hard disk silk-screen number and the logical position number of the inserted hard disk can be stored in the PXE server in advance and obtained when the PXE client requests the configuration file. The correspondence between the hard disk screen printing number and the logical position number of the inserted hard disk may be provided by the manufacturer or may be collected by an operation and maintenance person, which is not particularly limited in this application. According to the relation among the backboard type, the hard disk screen printing number and the logic position number of the inserted hard disk, a second corresponding relation between the hard disk screen printing number and the logic position number of the PXE client can be established.
And according to the first corresponding relation and the second corresponding relation, a mapping relation between the hard disk screen printing number and the drive letter of the PXE client can be established. Thus, the PXE client can acquire the drive letter name corresponding to the target silk-screen number of the installed operating system.
And step S120, generating a hard disk silk-screen number configuration file, wherein the hard disk silk-screen number configuration file is used for indicating a target silk-screen number, and the target silk-screen number represents the silk-screen number of the hard disk of the PXE client side for installing an operating system.
When the target silk-screen number for installing the operating system is obtained, the target silk-screen number can be input by operation and maintenance personnel according to the needs, so that the flexibility of installing the operating system can be improved. After the target silk-screen number is obtained, a hard disk silk-screen number configuration file can be generated according to the target silk-screen number, and the target silk-screen number is indicated through the file.
Of course, the target silk-screen number may also be pre-stored in the PXE server in the form of a hard disk silk-screen number configuration file.
In an alternative embodiment, the PXE service may be started after the hard disk drive number configuration file is generated, the PXE service may include a start dynamic host configuration protocol (Dynamic Host Configuration Protocol, DHCP) service, a start simple file transfer protocol (Trivial File Transfer Protocol, TFTP) service, and a start file transfer protocol (File Transfer Protocol, FTP) service, the DHCP service may be used to dynamically assign an IP address to the PXE client, the TFTP service may be used to transfer system start files, and the FTP service may be used to provide download services of operating system files. The DHCP service, TFTP service, and FTP service may be integrated on a PXE server, or a plurality of servers, such as a DHCP server, a TFTP server, and an FTP server, may be configured according to service types, and for ease of understanding, the following description will be given by taking, as an example, configuration of each service on one PXE server.
In actual operation, the time of starting the PXE service may also be selected according to actual needs, which is not particularly limited in the present application.
It is to be understood that the PXE services initiated by the present application include, but are not limited to, DHCP services, TFTP services, and FTP services described above, and may also include Apache services, for example. In addition, the embodiments of the present application are exemplified by the file transfer service through the FTP service, and in some embodiments, the file transfer service may also be implemented through the HTTP service or the NFS service.
And 130, generating an automatic response file, wherein the automatic response file is used for running the drive letter mapping executable file when being executed by the PXE client, acquiring a target silk-screen number indicated by the hard disk silk-screen number configuration file, and installing an operating system on a hard disk indicated by the drive letter corresponding to the target silk-screen number.
When the PXE client installs the operating system through the bootstrap program, it is cumbersome to manually operate the operation and maintenance personnel because various settings, such as an administrator account, a system language setting, etc., need to be performed. In embodiments of the present application, these settings may be used to generate an automated response document (or referred to as an unattended installation document) that may be used to automatically install an operating system. The file can be loaded by one key during system installation, so that the PXE client can be automatically set during installation of an operating system, complicated manual operation is omitted, and the working efficiency of operation and maintenance personnel can be improved.
Taking an automatic response tool as a Kickstart as an example, in the process of installing the Kickstart, the Kickstart can record various parameters and operation commands configured by operation and maintenance personnel and generate an automatic response file. In the case that the PXE client has parameters to be filled in and configuration files to be loaded in the installation process of the operating system, the installer will first find whether the appropriate parameters exist in the auto-answer file, and if so, use the parameters. According to the method and the device for the automatic response file configuration, the command of the executable file for the disk symbol mapping can be configured in the automatic response file, the command of the target silk-screen number indicated by the hard disk silk-screen number configuration file is obtained, so that the PXE client can run the disk symbol mapping executable file under the instruction of the automatic response file when the operating system is installed, the mapping relation between the disk symbol of each hard disk on the PXE client and the silk-screen number is obtained, the target silk-screen number indicated by the hard disk silk-screen number configuration file is obtained, and the corresponding disk symbol name is obtained according to the target silk-screen number.
When the file transfer service is FTP, the generated automatic response file may be stored under var/FTP/directory, and when the file transfer service is HTTP, the generated automatic response file may be stored under var/www/html/directory. It will be appreciated that the storage path of the auto-answer file may also be selected according to actual needs.
Considering that the PXE client is usually installed on the first hard disk of the PXE client when the operating system is installed, the auto-answer file may also be used to instruct the PXE client to modify sda in the ignoredisk-only-use=sda statement of the auto-answer file to the name of the disk corresponding to the target silk-screen number when the operating system is installed, so that the PXE client may install the operating system on the hard disk indicated by the disk corresponding to the target silk-screen number.
In an alternative implementation manner, when the operating system is installed, the PXE client side is further configured to instruct the PXE client side to install the operating system on the hard disk of the preset disk symbol when the corresponding disk symbol is not found according to the target silk-screen number indicated by the hard disk silk-screen number configuration file. The preset disc symbol may be set by an operation and maintenance personnel according to actual needs, and may be the same as sda in the ignoredisk-only-use=sda statement, or may be different, which is not particularly limited in the embodiment of the present application.
Of course, the target silk-screen number in the hard disk silk-screen number configuration file may also include a plurality of target silk-screen numbers, for example, the target silk-screen number may include a first target silk-screen number and a second target silk-screen number, when the PXE client obtains the target silk-screen number indicated by the hard disk silk-screen number configuration file, the PXE client obtains the first target silk-screen number by default, stores the first target silk-screen number into a temporary variable, and when the PXE client runs a disk symbol mapping executable file to establish a mapping relationship between the disk symbol and the silk-screen number of each hard disk, the variable is transferred, so that the PXE client can obtain a disk symbol name corresponding to the first target silk-screen number, and stores the disk symbol name into the temporary variable. The sda in the ignoredisk-only-use=sda statement is then modified to the value of the temporary variable (the disk name corresponding to the first target silk-screen number).
Under the condition that the corresponding disk character does not exist in the first target silk-screen number, a second target silk-screen number indicated by the hard disk silk-screen number configuration file can be obtained, the second target silk-screen number is stored to a temporary variable, under the condition that the corresponding disk character exists in the second target silk-screen number, the sda in the ignoredik-only-use=sda statement is modified to be the value of the temporary variable (the disk character name corresponding to the second target silk-screen number), and therefore the PXE client can install an operating system on the hard disk indicated by the disk character corresponding to the second target silk-screen number.
In an alternative implementation, the PXE client does not modify the ignoredisk-only-use=sda statement of the auto-answer file in the absence of a corresponding drive letter for the target silk-screen number, so that the PXE client can install the operating system on the default drive letter.
After the configuration is completed, the PXE client can be started, and the PXE client can automatically find the DHCP service related to the PXE server, and the DHCP service can respond to the broadcast request of the PXE client, allocate an IP address to the PXE client, and inform the PXE client of the addresses of the boot program and related configuration files, for example, inform the storage path of the boot program under the TFTP service/var/lib/tftpboot/work directory. The TFTP service prepares a Linux kernel, initializes an image file (or called a Linux boot loading module), a boot program, and the like, and may transmit the boot program and the Linux kernel to the PXE client in response to a request for the PXE client to acquire the boot file after receiving the request. The PXE client may load a boot program with a Linux kernel and associated configuration files into memory for managing the installation of the operating system at the PXE client.
After the PXE client obtains the bootstrap program, the bootstrap program can be run, the bootstrap installation flow is entered, and a request for obtaining an operating system installation package, an executable file of the disk symbol mapping, a configuration file of the hard disk screen printing number, an automatic response file and the like is initiated to the FTP service of the PXE server. The FTP service may send an operating system installation package, an logout mapping executable file, a hard disk silk-screen number configuration file, and an auto-answer file to the PXE client in response to an acquisition request from the PXE client.
After the PXE client acquires the system installation package, the disk symbol mapping executable file, the hard disk silk-screen number configuration file and the automatic response file, the automatic response file is executed to start installing the operating system, and the operating system is installed on the hard disk indicated by the disk symbol corresponding to the target silk-screen number through the first execution instruction, the second execution instruction and the third execution instruction in the automatic response file to execute the installation operation. The first execution instruction is used for configuring an executable file of the disk symbol mapping, comprises loading and running of the executable file of the disk symbol mapping, and is used for establishing a mapping relation between the disk symbol of each hard disk and the silk screen number; the second execution instruction is used for acquiring a target silk-screen number in the hard disk silk-screen number configuration file, and modifying the sda in the ignoredisk-only-use=sda statement of the disk symbol in the automatic response file into a disk symbol name corresponding to the target silk-screen number; and the third execution instruction is used for installing the operating system on the hard disk indicated by the disk symbol corresponding to the target silk screen number.
The embodiment of the present application is exemplified by taking an automatic response tool as a kirkstart, and of course, the automatic response tool may also be other tools, such as Cobbler, which is not described herein.
Those skilled in the art will appreciate that the above embodiments are exemplary and not intended to limit the present application. The order of execution of one or more of the above steps may be modified, if possible, or may be combined selectively to yield one or more other embodiments. Those skilled in the art can select any combination from the above steps according to the need, and all the steps do not depart from the spirit of the scheme of the present application.
The method for installing and configuring the operating system provided by the embodiment of the application comprises the following steps: and acquiring an executable file of the disk symbol mapping, wherein the executable file of the disk symbol mapping is used for establishing a mapping relation between the disk symbol and the silk screen number of each hard disk on the PXE client when being executed. And generating a hard disk silk-screen number configuration file, wherein the hard disk silk-screen number configuration file is used for indicating a target silk-screen number which represents the silk-screen number of a hard disk of the PXE client side for installing an operating system. And generating an automatic response file, wherein the automatic response file is used for running the disk symbol mapping executable file when being executed by the PXE client, acquiring a target silk-screen number indicated by the hard disk silk-screen number configuration file, and installing an operating system on a hard disk indicated by a disk symbol corresponding to the target silk-screen number. According to the embodiment, when the PXE technology is adopted to install the operating system, the PXE client can run the drive letter mapping executable file according to the automatic response file after obtaining the drive letter mapping executable file, the hard disk silk-screen number configuration file and the automatic response file, and obtain the target silk-screen number indicated by the hard disk silk-screen number configuration file, and install the operating system on the hard disk indicated by the drive letter corresponding to the target silk-screen number, so that the flexibility of installing the operating system can be improved.
Based on the same inventive concept, as an implementation of the above method, the embodiment of the present application provides an operating system installation configuration device, where the embodiment of the device corresponds to the embodiment of the foregoing method, for convenience of reading, the embodiment of the present application does not describe details in the embodiment of the foregoing method one by one, but it should be clear that the device in the embodiment can correspondingly implement all the details in the embodiment of the foregoing method.
Fig. 3 is a schematic structural diagram of an installation configuration device of an operating system according to an embodiment of the present application, and as shown in fig. 3, the device provided in this embodiment may include: an acquisition module 110 and a generation module 120;
the acquisition module 110 is configured to: the method comprises the steps of obtaining an executable file of disk character mapping, wherein the executable file of disk character mapping is used for establishing a mapping relation between disk characters and silk-screen numbers of all hard disks on a PXE client when the executable file of disk character mapping is executed;
the generating module 120 is configured to: generating a hard disk silk-screen number configuration file, wherein the hard disk silk-screen number configuration file is used for indicating a target silk-screen number which represents the silk-screen number of a hard disk of an installation operating system of a PXE client;
the generating module 120 is further configured to: and generating an automatic response file, wherein the automatic response file is used for running the disk symbol mapping executable file when being executed by the PXE client, acquiring a target silk-screen number indicated by the hard disk silk-screen number configuration file, and installing an operating system on a hard disk indicated by a disk symbol corresponding to the target silk-screen number.
As an alternative implementation manner of the embodiment of the present application, the apparatus further includes a starting module 130 and a communication module 140;
the starting module 130 is configured to: the PXE service is started, and the PXE service comprises: DHCP service, TFTP service, and FTP service;
the communication module 140 is configured to: and in response to the request of the PXE client, sending an executable file of the disk character mapping, a configuration file of the hard disk screen printing number and an automatic response file to the PXE client.
As an optional implementation manner of the embodiment of the present application, establishing a mapping relationship between an identifier and a silk-screen number of each hard disk on the PXE client includes:
obtaining the drive letter of each hard disk on the PXE client;
determining a first corresponding relation between the drive letter and the logic position number of each hard disk according to the drive letter of each hard disk on the PXE client; determining a second corresponding relation between a hard disk screen printing number and a logic position number of the PXE client according to the backboard type of the PXE client; and establishing a mapping relation between the hard disk silk-screen number and the drive letter of the PXE client according to the first corresponding relation and the second corresponding relation.
As an optional implementation manner of the embodiment of the present application, determining a first correspondence between an identifier and a logical location number of each hard disk includes:
Under the condition that the PXE client comprises first hard disks, searching corresponding hard disk serial numbers according to the disk symbols of the first hard disks; the first hard disk comprises a hard disk of the SAS and/or SATA type;
obtaining the corresponding relation between the logic position number of each first hard disk and the serial number of the hard disk;
and establishing a corresponding relation between the disk symbol and the logic position number of each first hard disk.
As an optional implementation manner of the embodiment of the present application, determining a first correspondence between an identifier and a logical location number of each hard disk includes:
and under the condition that the PXE client comprises second hard disks, searching logical position numbers corresponding to the disk symbols of the second hard disks, and establishing a corresponding relation between the disk symbols of the second hard disks and the logical position numbers, wherein the second hard disks comprise NVME and/or RAID type hard disks.
As an optional implementation manner of the embodiment of the present application, the auto-answer file is further used to instruct the PXE client to install the operating system on the hard disk of the preset disk drive when the corresponding disk drive does not exist in the target silk-screen number.
The operating system installation configuration device provided in this embodiment may execute the above method embodiment, and its implementation principle and technical effects are similar, and will not be described herein.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Based on the same inventive concept, the embodiment of the application also provides a PXE server. Fig. 4 is a schematic structural diagram of a PXE server provided in an embodiment of the present application, as shown in fig. 4, where the PXE server provided in the embodiment may include: a memory 210 and a processor 220, the memory 210 for storing a computer program; the processor 220 is configured to perform the method described in the method embodiments above when the computer program is invoked.
The PXE server provided in this embodiment may execute the above method embodiment, and its implementation principle is similar to that of the technical effect, and will not be described herein again.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method described in the above method embodiment.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy Disk, hard Disk, or magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), or the like.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium may include: ROM or random access memory RAM, magnetic or optical disk, etc.
The naming or numbering of the steps in the present application does not mean that the steps in the method flow must be executed according to the time/logic sequence indicated by the naming or numbering, and the execution sequence of the steps in the flow that are named or numbered may be changed according to the technical purpose to be achieved, so long as the same or similar technical effects can be achieved.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/device and method may be implemented in other manners. For example, the apparatus/device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
In the description of the present application, unless otherwise indicated, "/" means that the associated object is an "or" relationship, e.g., a/B may represent a or B; the term "and/or" in this application is merely an association relation describing an association object, and means that three kinds of relations may exist, for example, a and/or B may mean: there are three cases, a alone, a and B together, and B alone, wherein a, B may be singular or plural.
Also, in the description of the present application, unless otherwise indicated, "a plurality" means two or more than two. "at least one of the following" or similar expressions thereof, means any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method for operating system installation configuration, the method comprising:
the method comprises the steps of obtaining an executable file of the disk symbol mapping, wherein the executable file of the disk symbol mapping is used for establishing a mapping relation between the disk symbol and a silk screen number of each hard disk on a PXE client when being executed;
generating a hard disk silk-screen number configuration file, wherein the hard disk silk-screen number configuration file is used for indicating a target silk-screen number, and the target silk-screen number represents the silk-screen number of a hard disk of the PXE client side for installing an operating system;
and generating an automatic response file, wherein the automatic response file is used for running the drive letter mapping executable file when being executed by the PXE client, acquiring a target silk-screen number indicated by the hard disk silk-screen number configuration file, and installing an operating system on a hard disk indicated by a drive letter corresponding to the target silk-screen number.
2. The method according to claim 1, wherein the method further comprises:
a PXE service is started, the PXE service comprising: DHCP service, TFTP service, and FTP service;
and responding to the request of the PXE client, and sending the drive letter mapping executable file, the hard disk screen printing number configuration file and the automatic response file to the PXE client.
3. The method as recited in claim 1, wherein the establishing a mapping relationship between the drive letter and the silk-screen number of each hard disk on the PXE client comprises:
obtaining the drive letter of each hard disk on the PXE client, and determining a first corresponding relation between the drive letter of each hard disk and the logic position number;
determining a second corresponding relation between a hard disk screen printing number and a logic position number of the PXE client according to the backboard type of the PXE client;
and establishing a mapping relation between the hard disk screen printing number of the PXE client and the drive letter according to the first corresponding relation and the second corresponding relation.
4. A method according to claim 3, wherein said determining a first correspondence between the drive letter and the logical location number of each of the hard disks comprises:
under the condition that the PXE client comprises first hard disks, searching corresponding hard disk serial numbers according to the drive letters of the first hard disks; the first hard disk comprises a hard disk of the SAS and/or SATA type;
Acquiring the corresponding relation between the logical position number of each first hard disk and the serial number of the hard disk;
and establishing a corresponding relation between the disk symbol and the logic position number of each first hard disk.
5. A method according to claim 3, wherein said determining a first correspondence between the drive letter and the logical location number of each of the hard disks comprises:
and under the condition that the PXE client comprises a second hard disk, searching a logic position number corresponding to the drive letter of each second hard disk, and establishing a corresponding relation between the drive letter of each second hard disk and the logic position number, wherein the second hard disk comprises NVME and/or RAID type hard disks.
6. The method as recited in claim 1, wherein the auto-answer file is further used to instruct the PXE client to install the operating system on a hard disk of a preset disk drive if the target silk-screen number does not have a corresponding disk drive.
7. The method according to any one of claims 1 to 6, wherein the automatic response file includes a first execution instruction, a second execution instruction and a third execution instruction, the first execution instruction is used for configuring the disk drive mapping executable file, the second execution instruction is used for obtaining a target silk-screen number in the hard disk silk-screen number configuration file, and the third execution instruction is used for installing an operating system on a hard disk indicated by a disk drive corresponding to the target silk-screen number.
8. An operating system installation configuration apparatus, comprising: the device comprises an acquisition module and a generation module;
the acquisition module is used for: the method comprises the steps of obtaining an executable file of the disk symbol mapping, wherein the executable file of the disk symbol mapping is used for establishing a mapping relation between the disk symbol and a silk screen number of each hard disk on a PXE client when being executed;
the generating module is used for: generating a hard disk silk-screen number configuration file, wherein the hard disk silk-screen number configuration file is used for indicating a target silk-screen number, and the target silk-screen number represents the silk-screen number of a hard disk of the PXE client side for installing an operating system;
the generating module is further configured to: and generating an automatic response file, wherein the automatic response file is used for running the drive letter mapping executable file when being executed by the PXE client, acquiring a target silk-screen number indicated by the hard disk silk-screen number configuration file, and installing an operating system on a hard disk indicated by a drive letter corresponding to the target silk-screen number.
9. A PXE server, comprising: a memory and a processor, the memory for storing a computer program; the processor is configured to perform the method of any of claims 1-7 when the computer program is invoked.
10. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any of claims 1-7.
CN202311664443.6A 2023-12-04 2023-12-04 Operating system installation configuration method and device, PXE server and storage medium Pending CN117850885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311664443.6A CN117850885A (en) 2023-12-04 2023-12-04 Operating system installation configuration method and device, PXE server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311664443.6A CN117850885A (en) 2023-12-04 2023-12-04 Operating system installation configuration method and device, PXE server and storage medium

Publications (1)

Publication Number Publication Date
CN117850885A true CN117850885A (en) 2024-04-09

Family

ID=90529988

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311664443.6A Pending CN117850885A (en) 2023-12-04 2023-12-04 Operating system installation configuration method and device, PXE server and storage medium

Country Status (1)

Country Link
CN (1) CN117850885A (en)

Similar Documents

Publication Publication Date Title
US7363514B1 (en) Storage area network(SAN) booting method
US8997090B2 (en) Installing an operating system in a host system
US9465625B2 (en) Provisioning of operating environments on a server in a networked environment
RU2421785C2 (en) Automated control of device drivers
US6487608B2 (en) Method for automatically configuring network interface card and capable of randomizing a media access controller address of the network interface card
CN106911729B (en) Remote installation method of operating system suitable for domestic processor
EP3495938B1 (en) Raid configuration
US20140129819A1 (en) Cloud cluster system and boot deployment method for the same
CN109587005B (en) Connection detection method and device, computer equipment and readable storage medium
CN103744695A (en) Method and system for operating system remote installation on basis of PXE
US10372463B1 (en) Provisioning a computerized device with an operating system
CN113741914B (en) Operating system installation mechanism
CN111475172A (en) Bare machine deployment method and device
CN111857956A (en) Virtual machine starting method and equipment
CN112968929A (en) Server management method and system
CN111061496A (en) PXE installation method and device for Linux operating system
CN111078305A (en) Information acquisition method and device, server and information management system
CN113448598A (en) Component upgrading method and device and server
CN115333933B (en) Automatic management method, medium and equipment for servers on machine room
CN117850885A (en) Operating system installation configuration method and device, PXE server and storage medium
CN111459507B (en) Linux OS filling method and device based on hard disk drive name
US20050132084A1 (en) Method and apparatus for providing server local SMBIOS table through out-of-band communication
CN114443148A (en) Method for starting disk by centralized management server and server
CN111324384B (en) Device and method for selecting starting image file according to device message in pre-execution environment
JP5073171B2 (en) Network boot system, client terminal activation method, and management server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication