CN111966384A - System updating method, device, equipment and computer readable storage medium - Google Patents

System updating method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN111966384A
CN111966384A CN202011126702.6A CN202011126702A CN111966384A CN 111966384 A CN111966384 A CN 111966384A CN 202011126702 A CN202011126702 A CN 202011126702A CN 111966384 A CN111966384 A CN 111966384A
Authority
CN
China
Prior art keywords
image
physical machine
target
file
mirror image
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.)
Granted
Application number
CN202011126702.6A
Other languages
Chinese (zh)
Other versions
CN111966384B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011126702.6A priority Critical patent/CN111966384B/en
Publication of CN111966384A publication Critical patent/CN111966384A/en
Application granted granted Critical
Publication of CN111966384B publication Critical patent/CN111966384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The application provides a system updating method, a system updating device, equipment and a computer readable storage medium, and relates to the technical field of cloud. The method comprises the following steps: synchronizing the initial system image stored on the storage device of the supervisor to a local storage device of the physical machine in response to a synchronization request for the initial system image; sending a configuration instruction to a physical machine; the configuration instruction is used for indicating the physical machine to configure the initial system mirror image on the local storage device to obtain a target system mirror image; responding to an updating request aiming at the target system image, and sending a system updating instruction to the physical machine; and the system updating instruction is used for indicating the physical machine to acquire the target system image so as to complete system updating. By the system updating method, time consumed by system updating can be reduced, and system updating efficiency is improved.

Description

System updating method, device, equipment and computer readable storage medium
Technical Field
The present application relates to system updating technologies, and in particular, to a system updating method, apparatus, device, and computer readable storage medium.
Background
The diskless system is a network transmission technology, the electronic equipment using the diskless system does not use a hard disk of the electronic equipment to obtain a starting system, but obtains a mirror image of the starting system through a specified server of a network, and realizes system loading and operation through a memory of the electronic equipment, so that the working efficiency can be improved, the resource sharing is realized, and the operation and maintenance cost and the management cost are reduced.
For a diskless physical machine cluster, in the process of system update of a large number of physical machines in the cluster, the related art needs to download images in a designated server or a management machine at the same time, and configure the images after downloading the images and loading the images into a memory of the related art, so as to complete the system update. Network congestion can be caused in the system updating process of the related technology, the configuration process can occupy the working time of a physical machine, time consumption is too long, and the system updating efficiency is low.
Disclosure of Invention
The embodiment of the application provides a system updating method, a device, equipment and a computer readable storage medium, which can improve the system updating efficiency.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the present application provides a system updating method, including: synchronizing the initial system image stored on the storage device of the supervisor to a local storage device of the physical machine in response to a synchronization request for the initial system image; sending a configuration instruction to a physical machine; the configuration instruction is used for indicating the physical machine to configure the initial system mirror image on the local storage device to obtain a target system mirror image; responding to an updating request aiming at the target system image, and sending a system updating instruction to the physical machine; and the system updating instruction is used for indicating the physical machine to acquire the target system image so as to complete system updating.
In some embodiments of the present application, prior to synchronizing the initial system image to the local storage device of the physical machine, the method further comprises: receiving a generation request for an initial system image; responding to the generation request, and processing the mirror image source file according to the mirror image definition data to obtain an initial system mirror image; sending the initial system image to a storage device of a management machine; generating a state label corresponding to the initial system mirror image; the state tag is used for determining the storage position of the initial system image; the synchronizing the initial system image to the local storage device of the physical machine includes: and synchronizing the initial system image to local storage devices of a plurality of physical machines in the physical machine cluster in batches according to the state labels.
In some embodiments of the present application, the processing the mirror source file according to the mirror definition data to obtain the initial system mirror includes: acquiring a mirror image source file and mirror image definition data; creating a file system for the initial system image according to the file system structure in the image definition data; according to configuration data in the mirror image definition data, performing configuration processing on the file system; and generating an initial system image according to the file system subjected to the configuration processing.
In some embodiments of the present application, the configuring the file system according to the configuration data in the image definition data includes at least one of: acquiring target software from a software package in a mirror image source file according to a software list in the mirror image definition data, and installing the target software; acquiring a target driver from a driver package in a mirror image source file according to a driver list in the mirror image definition data, and loading the target driver; generating a target configuration script according to the basic configuration script in the mirror image definition data; and the target configuration script is used for indicating the physical machine to configure the initial system mirror image according to the target configuration script so as to obtain the target system mirror image.
In some embodiments of the present application, after receiving the generation request for the initial system image, the method further comprises: responding to the generation request, and generating a system starting file corresponding to the target system image; the system starting file comprises a kernel and a target starting mirror image file; the generating of the system boot file corresponding to the target system image includes: extracting a kernel and starting a mirror image file from the mirror image source file; decompressing the starting mirror image file; inserting the mirror image loading script into the decompressed starting mirror image file, and compressing to obtain a target starting mirror image file; the mirror image loading script is used for obtaining a mirror image of the target system and mounting the mirror image to the memory.
In some embodiments of the present application, the method further comprises: and sending the kernel and the target starting image file to the physical machine so that the physical machine loads the kernel and the target starting image file and executes the image loading script in the target starting image file.
The embodiment of the present application provides a system updating method, including: receiving a system updating instruction sent by a management machine; responding to a system updating instruction, and receiving a system starting file sent by a management machine; acquiring a target system mirror image in local storage equipment of a physical machine based on a system starting file; the target system mirror image is generated after the physical machine configures the initial system mirror image on the management machine on the local storage device; and finishing system updating according to the target system mirror image.
In some embodiments of the present application, the system boot file includes a kernel and a target boot image file; the acquiring a target system image in a local storage device of a physical machine based on a system boot file includes: loading a kernel and a target starting image file, and executing an image loading script in the target starting image file; and acquiring the target system image in the local storage device through the image loading script.
In some embodiments of the present application, said completing the system update according to the target system image includes: and decompressing the target system mirror image through the mirror image loading script, and mounting the decompressed target system mirror image into the memory through the kernel switching tool so as to complete system updating.
The embodiment of the application provides a system updating device, and the device comprises: the synchronization module is used for responding to a synchronization request aiming at the initial system mirror image, and synchronizing the initial system mirror image stored on the storage equipment of the management machine to the local storage equipment of the physical machine; the first sending module is used for sending the configuration instruction to the physical machine; the configuration instruction is used for indicating the physical machine to configure the initial system mirror image on the local storage device to obtain a target system mirror image; the second sending module is used for responding to an updating request aiming at the target system mirror image and sending a system updating instruction to the physical machine; and the system updating instruction is used for indicating the physical machine to acquire the target system image so as to complete system updating.
The embodiment of the application provides a system updating device, and the device comprises: the first receiving module is used for receiving a system updating instruction sent by the management machine; the second receiving module is used for responding to the system updating instruction and receiving the system starting file sent by the management machine; the acquisition module is used for acquiring a target system mirror image from the local storage equipment of the physical machine based on the system starting file; the target system mirror image is generated after the physical machine configures the initial system mirror image on the management machine on the local storage device; and the updating module is used for finishing system updating according to the target system mirror image.
An embodiment of the present application provides a system update apparatus, including: a memory for storing executable instructions; and the processor is used for realizing the system updating method provided by the embodiment of the application when the processor executes the executable instructions stored in the memory.
The embodiment of the present application provides a computer-readable storage medium, which stores executable instructions for causing a processor to implement the system updating method provided by the embodiment of the present application when the processor executes the executable instructions.
The embodiment of the application has the following beneficial effects:
according to the embodiment of the application, the initial system image is synchronized to the local storage device of the physical machine before the system is updated, and compared with a scheme that the system image is downloaded from the management machine to each physical machine after a batch updating instruction is received in the related technology, the network congestion situation during the simultaneous image downloading can be avoided; meanwhile, the initial system image is configured in the local disk of the physical machine to obtain the configured target system image, and in the process of updating the physical machine, the system is directly updated based on the configured target system image.
Drawings
Fig. 1 is an alternative architecture diagram of a distributed system provided by an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a system update apparatus provided in an embodiment of the present application;
FIG. 3 is a schematic flow chart of an alternative system updating method according to an embodiment of the present application;
FIG. 4 is a schematic flow chart illustrating an alternative method for updating a system according to an embodiment of the present disclosure;
FIG. 5 is a schematic flow chart illustrating an alternative method for updating a system according to an embodiment of the present disclosure;
FIG. 6 is a schematic flow chart illustrating an alternative method for updating a system according to an embodiment of the present disclosure;
FIG. 7 is an alternative flow chart of a system update method according to an embodiment of the present application;
FIG. 8 is a schematic flow chart of an alternative system updating method according to an embodiment of the present application;
FIG. 9 is a schematic flow chart illustrating an alternative method for updating a system according to an embodiment of the present application;
FIG. 10 is an alternative architectural diagram of a distributed system provided by embodiments of the present application;
FIG. 11 is a schematic flow chart diagram illustrating an alternative image generation method according to an embodiment of the present disclosure;
FIG. 12 is a schematic flow chart illustrating an alternative mirror synchronization configuration method according to an embodiment of the present application;
fig. 13 is an alternative flowchart of a system updating method according to an embodiment of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, the terms "first \ second \ third" are used merely for distinguishing similar objects and do not represent specific ordering for the objects, and it is understood that "first \ second \ third" may be interchanged with specific order or sequence where permitted so that the embodiments of the present application described in the present embodiment can be implemented in an order other than that shown or described in the present embodiment.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
(1) Diskless node (Diskless physical machine, Diskless physical machine node): the operating system is a physical machine loaded in memory for the entire operating system.
(2) A management machine: and a master control node of the physical machine cluster.
(3) Kexec method: kernel execution, a mechanism for Linux kernels, allows a new Kernel to be launched from a currently running Kernel. Kexec skips the boot load phase and hardware initialization phase performed by the system firmware (BIOS or UEFI), directly loads the new kernel into main memory and immediately starts execution.
(4) Initrd: the internal memory is taken as a disk to mount, then init in the RAM (internal memory) is found to execute, an initial root file system is mounted in the system before the actual root file system is available, and the initial root file system and the kernel are loaded together as a part of a kernel boot process.
(5) Dynamic Host Configuration Protocol (DHCP): the main function is to manage and distribute IP addresses in a centralized manner, so that the host in the network environment can dynamically obtain IP addresses, Gateway addresses, DNS server addresses and the like.
(6) Simple File Transfer Protocol (TFTP): is a simple file transfer protocol used between a client and a server in the TCP/IP protocol suite.
(7) DNS: the domain name system (service) protocol is a kind of distributed network directory service, mainly used for the interconversion of domain name and IP address.
(8) PXE: a Preboot Execution Environment (Preboot Execution Environment) provides a mechanism for booting a computer using a network interface that allows booting of the computer independent of a local data storage device. The object is achieved by using network protocols such as DHCP, TFTP, etc. and the concept of globally unique identifiers, universal network driver interfaces, universally unique identification codes, etc. and by extending preset APIs to physical machine firmware.
(9) A root: a system call of linux can change a root directory which can be seen by a process, a sandbox is created similarly, the process runs in the sandbox, and whether the process runs normally or not does not affect other processes of the machine.
(10) Rsync: the tool can realize full-volume and incremental (differential backup) local or remote data synchronous backup.
Referring to fig. 1, fig. 1 is an alternative architecture diagram of a distributed system 100 provided in this embodiment of the present application, in order to implement supporting a system update application, a physical machine 400 is connected to a management machine 200 through a network 300, where the network 300 may be a wide area network or a local area network, or a combination of the two, and the physical machine 400 may be a physical machine cluster, where the physical machine cluster includes a large number of physical machines, and the physical machine 400-1 and the physical machine 400-2 are exemplarily shown in the diagram. Fig. 1 further shows that the hypervisor 200 may be a hypervisor cluster, where the hypervisor cluster includes hypervisors 200-1 to 200-3, and similarly, the hypervisors 200-1 to 200-3 may be physical machines or virtual machines constructed by using virtualization technologies (such as container technology and virtual machine technology), which is not limited in this embodiment of the present disclosure, and of course, a single hypervisor may also be used to provide services in this embodiment.
In some embodiments of the present application, after receiving a synchronization request for an initial system image sent by an administrator, a hypervisor synchronizes the initial system image stored on a storage device of the hypervisor to a local storage device of a physical machine; sending a configuration instruction to a physical machine; the configuration instruction is used for indicating the physical machine to configure the initial system image on the local storage device to obtain the target system image. The method comprises the steps that after a manager receives an update request aiming at a target system mirror image sent by an administrator, a system update instruction is sent to a physical machine; and the system updating instruction is used for indicating the physical machine to acquire the target system image so as to complete system updating.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a system update apparatus 500 provided in an embodiment of the present application, where the system update apparatus 500 shown in fig. 2 includes: at least one processor 510, memory 550, at least one network interface 520, and a user interface 530. The various components in system update apparatus 500 are coupled together by a bus system 540. It is understood that the bus system 540 is used to enable communications among the components. The bus system 540 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 540 in fig. 2.
The Processor 510 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 530 includes one or more output devices 531 enabling presentation of media content, including one or more speakers and/or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components to facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The memory 550 may comprise volatile memory or nonvolatile memory, and may also comprise both volatile and nonvolatile memory. The non-volatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The memory 550 described in embodiments herein is intended to comprise any suitable type of memory. Memory 550 optionally includes one or more storage devices physically located remote from processor 510.
In some embodiments of the present application, memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 551 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a network communication module 552 for communicating to other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
a display module 553 for enabling presentation of information (e.g., a user interface for operating peripherals and displaying content and information) via one or more output devices 531 (e.g., a display screen, speakers, etc.) associated with the user interface 530;
an input processing module 554 to detect one or more user inputs or interactions from one of the one or more input devices 532 and to translate the detected inputs or interactions.
In some embodiments of the present application, the system updating apparatus provided in the embodiments of the present application may be implemented by a combination of hardware and software, and for example, the system updating apparatus provided in the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the system updating method provided in the embodiments of the present application.
The embodiments of the present application may be implemented by means of Cloud Technology (Cloud Technology), which refers to a hosting Technology for unifying series resources such as hardware, software, and network in a wide area network or a local area network to implement data calculation, storage, processing, and sharing.
The cloud technology is based on the general names of network technology, information technology, integration technology, management platform technology, application technology and the like applied in the cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of technical network systems require a large amount of computing, storage resources, such as web portals of educational systems.
As an example, the management machine 200 may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform. The physical machine 400 and the management machine 200 may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited thereto.
In some embodiments of the present application, the system updating apparatus provided in this embodiment of the present application may be implemented in software, and fig. 2 shows a system updating apparatus 555 stored in a memory 550, which may be software in the form of programs and plug-ins, and when the system updating device 500 is a management machine, the system updating apparatus includes the following software modules: the system comprises a synchronization module, a first sending module and a second sending module; when the system updating apparatus 500 is a physical machine, the following software modules are included: the device comprises a first receiving module, a second receiving module, an obtaining module and an updating module. These modules are logical and thus may be combined or further split according to the functionality implemented.
The functions of the respective modules will be explained below.
In other embodiments, the apparatus provided in the embodiments of the present Application may be implemented in hardware, and for example, the apparatus provided in the embodiments of the present Application may be a processor in the form of a hardware decoding processor, which is programmed to execute the system updating method provided in the embodiments of the present Application, for example, the processor in the form of the hardware decoding processor may be one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
In this embodiment of the present application, a system updating method provided by the embodiment of the present application will be described with a management machine as an execution subject.
Referring to fig. 3, fig. 3 is an alternative flowchart of a system updating method provided in the embodiment of the present application, and will be described with reference to the steps shown in fig. 3.
In step 301, an initial system image stored on a storage device of a hypervisor is synchronized to a local storage device of a physical machine in response to a synchronization request for the initial system image.
In some embodiments of the present application, the hypervisor may receive, via the interactive device, a synchronization request for the initial system image sent by an administrator, the synchronization request requesting that the initial system image be synchronized from the storage device of the hypervisor to the local storage device of the physical machine.
The physical machine is any one diskless physical machine node in a diskless physical machine cluster, and in the starting and working processes of the physical machine, the running operating system is located in the memory of the physical machine. The local storage device of the physical machine is a local disk located in the physical machine, and the local storage device includes, but is not limited to, various SSD (Solid State Drive) Disks, NVME (Non-Volatile Memory) Disks, Flash (Flash Memory) Disks, RAID (Redundant Arrays of Independent Disks), USB (Universal Serial Bus), and the like.
The management machine is a control device in the diskless physical machine cluster, and is configured to generate the initial system image, and store the generated initial system image to a storage device corresponding to the management machine, where the storage device of the management machine may be a storage-type physical machine, may also be various storage nodes in cloud computing, and may be a local disk shared by the management machine. The Storage device of the physical machine includes, but is not limited to, various NFSs (Network File System), GPFS (General Parallel File System), HDFS (Hadoop Distributed File System), SAN (Storage Area Network), NAS (Network Attached Storage), and the like.
In some embodiments of the present application, an rsync method may be employed to synchronize an initial system image stored on a storage device of a hypervisor to a local storage device of a physical machine.
In some embodiments of the present application, the synchronization request is used to synchronize the initial image file to a plurality of physical machines in the physical machine cluster, and the hypervisor, after receiving the synchronization request, determines whether a synchronization condition is satisfied, and if the synchronization condition is satisfied, completes a synchronization process of the initial system image from the storage device of the hypervisor to the local storage device of the physical machine. Wherein the synchronization condition includes at least one of: the working load of the physical machine is lower than a preset load threshold value; and the channel quality quantized value of a communication channel between the storage device of the management machine and the local storage device of the physical machine reaches a preset channel threshold value.
And under the condition that the synchronization condition includes that the work load of the physical machine is lower than a preset load threshold, after receiving the synchronization request, the management machine acquires the work load of each physical machine in the physical machine cluster, puts the synchronization tasks corresponding to the physical machines with the work loads lower than the load threshold into an execution queue, executes the synchronization tasks in the execution queue in parallel, puts the synchronization tasks corresponding to the physical machines with the work loads not lower than the load threshold into a waiting queue, monitors the work loads of the physical machines corresponding to the synchronization tasks in the waiting queue in real time, and puts the synchronization tasks corresponding to the physical machines with the work loads lower than the load threshold into the execution queue.
In the case where the synchronization condition includes that a channel quality quantization value of a communication channel between the storage device of the supervisor machine and the local storage device of the physical machine reaches a preset channel threshold value, after receiving the synchronization request, the management machine acquires channel quality quantization values of communication channels between the storage device of the management machine and the local storage devices of the physical machines in the physical machine cluster, puts synchronization tasks corresponding to the physical machines reaching a preset channel threshold value into an execution queue, executing the synchronous tasks in the execution queue in parallel, putting the synchronous tasks corresponding to the physical machines of which the channel quality quantization values do not reach the preset channel threshold value into a waiting queue, and monitoring the channel quality quantized value corresponding to each synchronous task in the waiting queue in real time, and putting the synchronous tasks corresponding to the physical machines of which the channel quality quantized values reach the preset channel threshold value into an execution queue.
In some embodiments of the present application, the synchronization request further carries a time limit for instructing the supervisor to complete the synchronization task for each physical machine in the cluster of physical machines within the time limit.
It should be noted that, in the process of synchronizing the initial system image from the storage device of the hypervisor to the local storage device of the physical machine in step 301, the operating state of the physical machine is not affected.
In step 302, sending a configuration command to a physical machine; the configuration instruction is used for indicating the physical machine to configure the initial system image on the local storage device to obtain the target system image.
In some embodiments of the present application, after synchronizing the initial system image to the current storage device of the physical machine, a configuration process of the initial system image needs to be completed in the local storage device to obtain the target system image.
Wherein, the physical machine can use a root mode to run the configuration script in the initial system image of the local storage device. The configuration script is used for configuring at least one application program in the initial system image, for example, modifying a configuration file of the application program, adding a corresponding operation account, and the like.
In some embodiments of the present application, the configuration script may be located in the initial system image, and after the physical machine receives the configuration instruction, the configuration script is obtained from the initial system image, and an application program in the initial system image is configured based on the configuration script to obtain the target system image; the configuration script may be located in a storage device of the hypervisor, the configuration script has a corresponding relationship with the initial image file, after the physical machine receives the configuration instruction, the configuration script corresponding to the initial image file may be acquired in the storage device of the hypervisor, and the application program in the initial system image is configured based on the configuration script to obtain the target system image.
In some embodiments of the present application, after configuration is completed, that is, after the target system image is obtained, the physical machine may send a configuration completion message to the management machine, and the management machine may determine a configuration progress of the image in the local storage device through the configuration completion message and display the configuration progress to an administrator. When the physical machine cluster includes a plurality of physical machines that require the initial system image and that need to be configured to obtain the target system image, the management machine may determine the overall configuration progress in the physical machine cluster according to the number of the physical machines that need to be configured and the number of the received configuration completion messages, so that the administrator sends an update request for the target system image according to the configuration progress.
It should be noted that, in the process of configuring the initial system image in the local storage device of the physical machine in step 302, since the physical machine runs the current operating system through the memory and works, and the configuration process is in the local storage device, the working state of the physical machine is not affected.
In step 303, in response to an update request for the target system image, sending a system update instruction to the physical machine; and the system updating instruction is used for indicating the physical machine to acquire the target system image so as to complete system updating.
In some embodiments of the present application, after receiving an update request for the target system image sent by an administrator, the administrator may send a system update instruction to a corresponding physical machine, and after receiving the update request, the physical machine may detect whether an initial system image in the local storage device completes a configuration process. And under the condition that the initial system image in the local storage device is configured as the target system image, directly acquiring the target system image, and loading the target system image into the memory to complete system updating. After the physical machine is mounted to the memory, the physical machine also starts at least one application program configured in the target system image, so that the physical machine enters a corresponding working state.
In some embodiments of the present application, after the hypervisor receives the update request and sends a system update instruction to the physical machine, the physical machine may establish a communication connection with the hypervisor. The physical machine may establish a communication connection with the hypervisor under a Preboot Execution Environment (PXE), and receive a system start file issued by the hypervisor through a network protocol service.
In some embodiments of the present application, after receiving an update request sent by an administrator for the target system image, there may be a plurality of physical machines that need to perform system update, where at least one physical machine does not complete the configuration process of the initial system image, and the physical machine that does not complete the configuration process may acquire the target system image after completing the configuration process to complete the system update.
In some embodiments of the present application, the management machine receives a configuration completion message sent by each physical machine that needs to be updated, and may not receive the configuration completion message of at least one physical machine after receiving the update request sent by the administrator. At this time, a system update instruction may be sent to the physical machine that has sent the configuration completion message, so that the corresponding physical machine completes system update; and simultaneously, monitoring the configuration progress of other physical machines, and sending a system updating instruction to the physical machine after receiving configuration completion messages sent by the other physical machines.
As can be seen from the above exemplary implementation of fig. 3 in the embodiment of the present application, before performing system update, an initial system image is synchronized into a local storage device of a physical machine, and compared with a scheme in the related art that a system image is downloaded from a management machine to each physical machine after receiving a batch update instruction, a network congestion situation when the images are downloaded at the same time can be avoided, by synchronizing the initial system image to the local storage device of the physical machine first, the image download time in the system update process can be saved, time consumption in the system update process is reduced, and system update efficiency is improved; meanwhile, the initial system image is configured in the local disk of the physical machine to obtain the configured target system image, and in the process of updating the physical machine, the system is directly updated based on the configured target system image.
Referring to fig. 4, fig. 4 is an optional flowchart of a system updating method provided in this embodiment of the present application, based on fig. 3, step 401 to step 404 are further included before step 301 in fig. 3, and step 301 may be updated to step 405, which will be described with reference to the step shown in fig. 4.
In step 401, a generation request for an initial system image is received.
In some embodiments of the present application, a plurality of physical machines of different service types exist in a physical machine cluster where the hypervisor is located, and for the physical machines of different service types, corresponding operating systems may be different, and versions of the operating systems may also be different. Therefore, the generation request for the initial system image may be a system image generation request for all the physical machines in the physical machine cluster, or may be a system image generation request for only some physical machines in the physical machine cluster.
In step 402, in response to the generation request, the image source file is processed according to the image definition data to obtain an initial system image.
In some embodiments of the present application, the image definition data may determine a file system structure, a software list, a driver list, a configuration script, and a status tag for the initial system image. The software package and the driver package in the mirror image source file can be screened through the mirror image definition data, the structure of the file system is changed, the configuration file is modified, the self-definition of the initial system mirror image is further realized, and the initial system mirror image meeting the requirements is generated.
In step 403, the initial system image is sent to the storage device of the hypervisor.
In some embodiments of the present application, after the initial system image is generated, the initial system image may be stored in a storage device of the hypervisor.
In step 404, a state tag corresponding to the initial system image is generated; the status tag is used to determine the storage location of the initial system image.
In some embodiments of the present application, after the initial system image is stored in the storage device of the management machine, a corresponding status tag is generated according to a location of the initial image file in the storage device of the management machine. The status label includes the version, MD5 value, and status of the initial system image in addition to the location of the initial image file in the storage device of the hypervisor.
In step 405, in response to a synchronization request for the initial system image, bulk synchronizing the initial system image to local storage devices of a plurality of physical machines in the physical machine cluster according to the status tags.
In some embodiments of the present application, for a large number of physical machines in the physical machine cluster, the number of physical machines that need to be switched to the target system is also large, and therefore, when a synchronization request for the initial system image is received, the initial system image needs to be synchronized into local storage devices of the multiple physical machines. At this time, the storage location of the initial system image needs to be determined according to the status tag corresponding to the initial system image, and the initial system image is synchronized to the local storage devices of the multiple physical machines in batch according to the storage location.
As can be seen from the foregoing exemplary implementation of fig. 4 in the embodiment of the present application, a customized initial image file may be generated for a physical machine in the embodiment of the present application, and due to the customization of the initial system image, a subsequent configuration process of the physical machine on the initial system image may be reduced, so that the computing pressure of the physical machine is reduced, the configuration time is also reduced, and the system update efficiency is further improved.
Referring to fig. 5, fig. 5 is an alternative flowchart of a system updating method provided in the embodiment of the present application, based on fig. 4, step 402 in fig. 4 may be updated to step 501 to step 504, which will be described with reference to the steps shown in fig. 5.
In step 501, the image source file and image definition data are obtained in response to a generation request.
In some embodiments of the present application, the image source file is an image file of an original system provided by an operating system vendor, and includes a software package, a driver package, a kernel, a system boot image, a description file, and the like. The software package is a set of a plurality of pieces of software pre-installed in the mirror image source file by an operating system manufacturer; the driver package is a set of a plurality of drivers pre-installed in the image source file by an operating system manufacturer; the description file is a plurality of information files carried in the operating system: such as pxe or grub file samples, mirrored version information, etc.
In some embodiments of the present application, the image definition data may be a data structure containing various customization information, which may include file system structures, software lists, driver lists, configuration scripts, status tags, and the like.
In step 502, a file system is created for the initial system image according to the file system structure in the image definition data.
In step 503, the file system is configured according to the configuration data in the image definition data.
In some embodiments of the present application, the step of configuring the file system according to the configuration data in the image definition data may be implemented by one of the following steps: in step 5031, the target software is obtained in a software package in the image source file according to the software list in the image definition data, and the target software is installed. In step 5032, the target driver is obtained from the driver package in the mirror source file according to the driver list in the mirror definition data, and the target driver is loaded. In step 5033, a target configuration script is generated according to the basic configuration script in the mirror definition data; and the target configuration script is used for indicating the physical machine to configure the initial system mirror image according to the target configuration script so as to obtain the target system mirror image.
In step 504, an initial system image is generated from the file system undergoing the configuration process.
In some embodiments of the present application, the file system subjected to the configuration process may be compressed by a compression tool, so as to obtain the initial system image.
Wherein the compression tool may be a lzma format compression tool to generate an initial system image in the lzma format. For example, the compression process may be implemented by: "find. | cpio-c-o | xz-9- -format = lzma > diskless-root.
As can be seen from the above exemplary implementation of fig. 5 in the embodiment of the present application, a customized initial system image may be generated according to an image source file and image definition data, and compared with an original system in an original image source file, the customized initial system image generated in the present application reduces the size of the initial system image as much as possible on the premise that a physical machine realizes a specific function, reduces the data amount in the synchronization process of the initial system image, and improves synchronization efficiency.
Referring to fig. 6, fig. 6 is an optional flowchart of the system updating method according to the embodiment of the present application, and based on fig. 4 and fig. 5, taking fig. 4 as an example, after step 401, step 601 is further included, and after step 303, step 602 is further included, which will be described with reference to the steps shown in fig. 6.
In step 601, in response to the generation request, generating a system boot file corresponding to the target system image; the system boot file comprises a kernel and a target boot image file.
In some embodiments of the present application, the generating of the system boot file corresponding to the target system image may be implemented in the following manner: in step 6011, extracting a kernel and starting an image file from the image source file; decompressing the starting mirror image file; inserting the mirror image loading script into the decompressed starting mirror image file, and compressing to obtain a target starting mirror image file; the mirror image loading script is used for obtaining a mirror image of the target system and mounting the mirror image to the memory.
The target boot image file can indicate the physical machine to call the image loading script in the process of being loaded by the physical machine relative to the boot image file in the image source file, and the corresponding target system image is obtained in the local storage device through the image loading script.
In step 602, the kernel and the target boot image file are sent to the physical machine, so that the physical machine loads the kernel and the target boot image file, and executes the image loading script in the target boot image file.
In some embodiments of the present application, after the hypervisor establishes a communication connection with the physical machine under a Preboot Execution Environment (PXE), the system boot file generated in step 601 may be sent to the physical machine, that is, the kernel and the target boot image file are sent to the physical machine.
After receiving the kernel and the target boot image file, the physical machine may load the kernel first and load the target boot image file. During the process of loading the target boot image file, an initialized init script is run, and the init script can call the image loading script.
As can be seen from the foregoing exemplary implementation of fig. 6 in the embodiment of the present application, a customized target boot image may be generated in the embodiment of the present application, and through the target boot image, in the process of starting a physical machine, a corresponding image loading script may be directly executed by loading the target boot image, and a corresponding target system image may be directly obtained in a local storage device, so that the system update efficiency is improved.
In this application embodiment, a system updating method provided by the embodiment of the present application will be described with a physical machine as an execution subject.
Referring to fig. 7, fig. 7 is an alternative flowchart of a system updating method provided in the embodiment of the present application, which will be described with reference to the steps shown in fig. 7.
In step 701, a system update instruction sent by the management machine is received.
In some embodiments of the present application, before the physical machine receives the system update instruction sent by the hypervisor, the required target system image is already stored in the local storage device of the physical machine, and the target system image has already completed the configuration process.
In step 702, a system boot file sent by the management machine is received in response to a system update instruction.
In some embodiments of the present application, the physical machine may establish a communication connection with the supervisor machine in accordance with the system update instructions. The physical machine may establish a communication connection with the hypervisor under a Preboot Execution Environment (PXE), and receive a system start file issued by the hypervisor through a network protocol service. The network service protocol includes, but is not limited to, a simple file transfer protocol (TFTP), a Dynamic Host Configuration Protocol (DHCP), a hypertext transfer protocol (HTTP), and a DNS (domain name system service protocol).
In some embodiments of the present application, the physical machine may receive a dynamic network protocol address assigned by the supervisor according to the DHCP service; the physical machine can also receive a system starting file issued by the management machine through TFTP service or HTTP service.
In step 703, based on the system boot file, a target system image is obtained in the local storage device of the physical machine; the target system image is generated by the physical machine after the initial system image on the management machine is configured on the local storage device.
In some embodiments of the present application, the system boot file contains a script that obtains an image of the target system. After the physical machine acquires the system starting file, the system starting file is loaded, and the script for acquiring the target system image is executed, so that the target system image is acquired in the local storage device. According to the above embodiments, the target system image is generated by the physical machine after configuring the initial system image on the management machine on the local storage device.
In step 704, the system update is completed according to the target system image.
In some embodiments of the present application, after the physical machine acquires the target system image, the physical machine may be restarted and enter a corresponding target system based on the target system image. At this point, the physical machine has completed the handoff process from the original system to the target system.
In some embodiments of the present application, after the physical machine enters the target system, the physical machine also starts an application program configured in the image of the target system, and after the application program is started, the physical machine enters an operating state.
As can be seen from the above exemplary implementation of fig. 7 in the embodiment of the present application, a needed target system image is stored in the local storage device of a physical machine in advance, and compared with a scheme in the related art that a system image is downloaded from a management machine to each physical machine at the same time after receiving a batch update instruction, a network congestion situation when the images are downloaded at the same time can be avoided, by synchronizing an initial system image to the local storage device of the physical machine first, the image download time in the system update process can be saved, the time consumption in the system update process is reduced, and the system update efficiency is improved; meanwhile, the physical machine in the embodiment of the application directly updates the system based on the configured target system image, and compared with a scheme that configuration is performed after the physical machine loads the initial system image in the related art, the time for configuring the initial system image in the system updating process can be saved, time consumed in the system updating process is reduced, and the system updating efficiency is improved.
Referring to fig. 8, fig. 8 is an optional flowchart of a system updating method provided in this embodiment of the application, based on fig. 7, step 703 in fig. 7 may be updated to step 801 to step 802, and step 704 may be updated to step 803, which will be described with reference to the steps shown in fig. 8.
In step 801, the kernel in the system boot file and the target boot image file are loaded and the image loading script in the target boot image file is executed.
In some embodiments of the present application, the system boot file includes a kernel and a target boot image file. As known from the above embodiments, the kernel is a kernel in the image source file, and the target boot image file has the image loading script inserted therein. The image loading script is used for indicating the physical machine to acquire a corresponding target system image in the local storage device.
In some embodiments of the present application, the physical machine may load the kernel first, and load the target boot image. During the process of loading the target boot image file, an initialized init script is run, and the init script can call the image loading script.
In step 802, a target system image is obtained in a local storage device via an image load script.
In some embodiments of the present application, during the process of executing the image loading script, the physical machine may obtain the target system image in the local storage device according to the instruction of the image loading script. The mirror image loading script can carry a label of the target system mirror image, and the physical machine can search the matched system mirror image in the storage device according to the label to serve as the target system mirror image in the process of executing the mirror image loading script. The image loading script may further instruct the physical machine to obtain the latest system image in the current storage device as the target system image.
In step 803, the target system image is decompressed through the image loading script, and the decompressed target system image is mounted in the memory through the kernel switching tool, so as to complete system updating.
In some embodiments of the present application, the image loading script is further configured to instruct the physical machine to decompress the target system image, and directly mount the decompressed target system image in the memory through the kernel switching tool, where at this time, the update process of the physical machine from the original system to the target system is completed. The kernel switching tool can be a Kexec tool, a boot loading stage and a hardware initialization stage executed by system firmware (BIOS or UEFI) can be skipped through the Kexec tool, a new kernel is directly loaded to the main memory and immediately started to be executed, and therefore hardware restart of a physical machine is avoided, time consumed by updating the system is reduced, and updating efficiency of the system is improved.
As can be seen from the foregoing exemplary implementation of fig. 8 in the embodiment of the present application, the decompressed target system image is mounted in the memory through the kernel switching tool in the embodiment of the present application, so that the hardware restart of the physical machine is avoided, the time consumption for updating the system is reduced, and the update efficiency of the system is improved.
Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
Referring to fig. 9, fig. 9 is an alternative flowchart of a system updating method according to an embodiment of the present application, which will be described with reference to the steps shown in fig. 9.
In step 901, the hypervisor initiates a process to update the operating system. The management machine can respond to an update operation request of an administrator and initiate a system update process to each physical machine in the physical machine cluster.
In steps 902 and 903, the physical machine enters a PXE boot process, and the hypervisor establishes a connection with the physical machine through services such as DHCP/TFTP/DNS.
In step 904 and step 905, the supervisor prepares a kernel (kernel) and a boot image file (initrd) and sends them to the physical machine, and the physical machine receives the kernel and boot image file and runs. The kernel and the boot image file are in the system image file of the operating system manufacturer, and kernel and initrd can be obtained by directly decompressing the system image file.
In step 906, the management machine makes a target system image (disk image) and compresses the target system image to obtain a target system image compression package.
In step 907, the physical machine obtains the target system image compression packet from the supervisor.
In step 908, the physical machine decompresses the target system image compressed packet.
In step 909, the physical machine switches to the target system image. The physical machine can load the target system image into the memory of the physical machine to complete the switching of the system.
In step 910, the management machine prepares configuration scripts and files corresponding to the physical machine.
In step 911, the physical machine obtains the configuration script and file from the supervisor.
In step 912, the physical machine runs the configuration script to complete the configuration of its target system.
In step 913, the physical machine starts the application. After the application program is started, the physical machine can continue to execute the corresponding function, and the system updating process corresponding to the target system image is completed.
The system updating process of a large number of physical machines in the physical machine cluster can be completed through the system updating method.
The applicant finds in research that there are some technical problems in the above system updating process:
(1) in a large-scale physical machine cluster (a cluster with more than 5000 physical machines) using diskless physical machine nodes, the starting speed of the whole cluster (including all diskless physical machine nodes) is slow, all the nodes need to download operating system images (2G-10G) from a manager or a server storing an operating system at the same time, and the network bandwidth is the bottleneck of starting.
(2) After the operating system image is loaded on each physical machine node, application program configuration needs to be executed, because the diskless physical machine node is stateless, configuration needs to be performed on the application program of the diskless physical machine node, and the process takes 5-10 minutes. The roles of the diskless physical machine nodes are different, and the corresponding configurations are also different, for example: the system comprises a storage node, a computing node and a network node, wherein each node may comprise a master node, a service node and a slave node, and the configuration of each functional diskless physical machine node is different.
The embodiment of the application provides a distributed architecture system consisting of a Diskless (Diskless) image generation module, an image synchronous configuration module and an image loading module, so as to accelerate the update of an operating system of a large-scale Diskless physical machine cluster. Wherein:
the Diskless mirror image generation module runs on the management machine and is used for generating a new Diskless mirror image and storing the mirror image into shared storage; and customizing the Initrd (starting an image file), and putting an inlet script of the image loading module into the Initrd.
And the mirror image synchronization configuration module is used for receiving remote batch mirror image synchronization and configuration operation initiated by an administrator at the administrator, finding a specific mirror image in the shared storage at each Diskless node, synchronizing the mirror image to a local disk of the Diskless node (such as an Rsync method), and starting and configuring a new mirror image by using a Kexec method (such as a chroma).
A mirror loading module: the method comprises the steps that the customized Initrd is included, when a Diskless node (physical machine) needs to update images, a batch network-slave cluster restarting is initiated from a management node, each physical machine loads the Initrd, an image loading module is operated, the module directly starts a configured operating system image from a local disk by using a Kexec method, and the operating system of the whole physical machine cluster is rapidly updated.
In some embodiments of the present application, please refer to fig. 10, where fig. 10 is an alternative architecture diagram of a distributed system provided by the embodiments of the present application. The distributed system 1000 includes a management machine 1001, at least one shared storage 1002 (storage device of the management machine), and N physical machines 1003 (physical machine 1 and physical machine N are shown in the figure), where each physical machine 1003 includes a local disk 1004 and a memory system 1005.
The management machine 1001 is a master control node of the whole physical machine cluster, is a DNS server, a DHCP server, and a TFTP server of the whole cluster, and may initiate instructions of batch operations to all the physical machines 1003 in the cluster.
The shared storage 1002 may be a storage type physical machine, may also be various storage nodes in cloud computing, and may also be a disk shared by the management machine 1001. Shared storage 1002 stores a number of images, such as images of different OSs or different customizations corresponding to the same OS; the same mirror may be selected for different nodes, or different mirrors may be selected. The shared storage 1002 may correspond to each physical machine 1003 one-to-one, or may be directly opposite to all the physical machines 1003, each physical machine 1003 may use the shared storage at the same time, and the shared storage 1002 and the physical machines 1003 are connected through a network.
Each physical machine 1003 has a local disk 1004 installed to store the operating system image that needs to be updated. When a new image is required to be generated, an administrator initiates an initial system image making process and an image synchronization configuration process in the administrator 1001, and the generated new initial system image is synchronized to the local disk 1004 of each physical machine 1003, so that the working state of the physical machine 1003 is not affected by the process.
In the process of system update, the management machine 1001 generates an initial system image, synchronizes the initial system image to the at least one shared storage 1002, and the physical machine 1003 acquires the initial system image from the shared storage 1002 and stores the initial system image in the local disk 1004, and configures the initial system image in the local disk 1004 to obtain a configured target system image. When the physical machine 1003 needs to perform system update, the physical machine 1003 acquires the target system image from the local disk 1004 and loads the target system image to the memory system 1005, and at this time, since the target system image has already been configured, after loading the target system image to the memory, the physical machine 1003 has already completed system update.
In some embodiments of the present application, please refer to fig. 11, and fig. 11 is an optional flowchart of the image generation method provided in the embodiments of the present application. The description will be made in conjunction with the steps shown in fig. 11.
In step 1101, the hypervisor initiates the process of generating the initial system image based on the image source file and the image definition data, and performs step 1107 and step 1102 in parallel.
The mirror image source file comprises a software package, a kernel, a starting mirror image file, a description file and the like; the initial system image includes a file system structure, a software list, a driver list, a base configuration script, and a state tag.
In step 1102, the hypervisor creates a file system in the image.
Based on the created file system, the hypervisor installs the software package in step 1103.
In step 1104, the supervisor loads the driver.
In step 1105, the hypervisor compresses the packages to form the initial system image.
In some embodiments of the present application, the hypervisor creates a file system according to a file system structure in a root manner, obtains a software package from an operating system source file according to a software package list for installation, loads a driver according to a driver table, and modifies a configuration and executes a configuration script according to a basic configuration script. And (5) compressing and packaging to finish the manufacture of the initial system image.
In step 1106, the hypervisor places the initial system image in shared storage (the hypervisor's storage device).
In step 1107, the hypervisor decompresses the boot image file. The hypervisor can acquire the kernel and the system boot image in the image source file.
In step 1108, the hypervisor adds an image loading script to the init script in the decompressed boot image file.
In step 1109, the hypervisor obtains a target boot image file for the boot image file added with the image loading script.
After both step 1106 and step 1109 are complete, step 1110 is performed to update the state tags in the image definition data.
As can be seen from the above exemplary implementation of fig. 11 in the embodiment of the present application, the customized initial system image and the target boot image file meeting the requirements can be generated according to the image definition data, so that the subsequent configuration time of the image can be reduced, and the overall system update efficiency of the physical machine cluster is improved.
In some embodiments of the present application, please refer to fig. 12, and fig. 12 is an alternative flowchart of a mirror synchronization configuration method provided in the embodiments of the present application. The description will be made in conjunction with the steps shown in fig. 12.
In step 1201, the hypervisor initiates a batch synchronization of the initial system image.
In step 1202, the hypervisor finds the location in the shared storage of the image with the correct state tag in the image definition data.
In step 1203, the hypervisor finds the corresponding mirror in the shared storage
In step 1204, the hypervisor deletes the old image of the physical machine's local disk.
In step 1205, the hypervisor synchronizes the new image to the local disk.
In step 1206, the hypervisor executes the configuration script, configuring the image, on the local disk.
In some embodiments of the present application, please refer to fig. 13, and fig. 13 is an alternative flowchart of a system updating method according to an embodiment of the present application. The description will be made in conjunction with the steps shown in fig. 13.
In step 1301, the supervisor initiates an update operating system process.
In step 1302 and step 1303, the physical machine enters a PXE boot process, and the hypervisor establishes a connection with the physical machine through services such as DHCP/TFTP/DNS.
In step 1304 and step 1305, the hypervisor sends the kernel and the generated target boot image file, which are obtained from the image source file in fig. 11, to the physical machine, and the physical machine receives and runs the kernel and the target boot image file.
In step 1306, during the process of running the target boot image file, the hypervisor loads the target system image from the local disk into the memory through the image loading script in the target boot image file.
In step 1307, the supervisor launches the application. After the application program is started, the physical machine can continue to execute the corresponding function, and the system updating process corresponding to the target system image is completed.
By the system updating method provided by the embodiment of the application, the initial system image can be generated in advance and stored in the storage device of the management machine, the initial system image in the storage device of the management machine is synchronized to the local disk and configured, instead of downloading the initial system image and then configuring each time, the time for downloading the operating system each time and the time for continuously configuring the operating system in the memory each time are saved. In the application, in the mirror image generation process and the mirror image synchronous configuration process, the physical machine is in a normal production state, and the two processes do not influence the working state of the physical machine.
By the system updating method provided by the embodiment of the application, the process of synchronizing the initial system mirror image in the storage device of the management machine to the local disk of the physical machine can be executed in the idle state of the physical machine and the network, so that the starting bottleneck brought by the fact that all the physical machines download the operating system mirror images at the same time and occupy the network bandwidth in the prior art is avoided. And in the application, the Kexec method is used for directly starting the configured target system image from the local disk, the soft starting process is very fast, and the process does not need to execute hardware restarting.
Continuing with the exemplary structure of the system updating apparatus 555 provided by the embodiment of the present application implemented as a software module, in some embodiments of the present application, as shown in fig. 2, in the case that the system updating device 500 is a management machine, the software module stored in the system updating apparatus 555 of the memory 550 may include:
the synchronization module is used for responding to a synchronization request aiming at the initial system mirror image, and synchronizing the initial system mirror image stored on the storage equipment of the management machine to the local storage equipment of the physical machine;
the first sending module is used for sending the configuration instruction to the physical machine; the configuration instruction is used for indicating the physical machine to configure the initial system mirror image on the local storage device to obtain a target system mirror image;
the second sending module is used for responding to an updating request aiming at the target system mirror image and sending a system updating instruction to the physical machine; and the system updating instruction is used for indicating the physical machine to acquire the target system image so as to complete system updating.
In some embodiments of the present application, the system update apparatus 555 further includes a generation module for receiving a generation request for the initial system image; responding to the generation request, and processing the mirror image source file according to the mirror image definition data to obtain an initial system mirror image; sending the initial system image to a storage device of a management machine; generating a state label corresponding to the initial system mirror image; the status tag is used to determine the storage location of the initial system image.
In some embodiments of the present application, the first sending module is further configured to bulk synchronize the initial system image to local storage devices of a plurality of physical machines in the physical machine cluster according to the status tag.
In some embodiments of the present application, the generation module is further configured to obtain a mirror source file and mirror definition data; creating a file system for the initial system image according to the file system structure in the image definition data; according to configuration data in the mirror image definition data, performing configuration processing on the file system; and generating an initial system image according to the file system subjected to the configuration processing.
In some embodiments of the present application, the configuring the file system according to the configuration data in the image definition data includes at least one of: acquiring target software from a software package in a mirror image source file according to a software list in the mirror image definition data, and installing the target software; acquiring a target driver from a driver package in a mirror image source file according to a driver list in the mirror image definition data, and loading the target driver; generating a target configuration script according to the basic configuration script in the mirror image definition data; and the target configuration script is used for indicating the physical machine to configure the initial system mirror image according to the target configuration script so as to obtain the target system mirror image.
In some embodiments of the present application, the generating module is further configured to generate a system boot file corresponding to the target system image in response to the generation request; the system boot file comprises a kernel and a target boot image file.
In some embodiments of the present application, the generating module is further configured to extract a kernel and a boot image file from the image source file; decompressing the starting mirror image file; inserting the mirror image loading script into the decompressed starting mirror image file, and compressing to obtain a target starting mirror image file; the mirror image loading script is used for obtaining a mirror image of the target system and mounting the mirror image to the memory.
In some embodiments of the present application, the second sending module is further configured to send the kernel and the target boot image file to the physical machine, so that the physical machine loads the kernel and the target boot image file, and executes the image loading script in the target boot image file.
In some embodiments of the present application, as shown in fig. 2, in the case that the system updating apparatus 500 is a physical machine, the software modules stored in the system updating device 555 of the memory 550 may include:
the first receiving module is used for receiving a system updating instruction sent by the management machine;
the second receiving module is used for responding to the system updating instruction and receiving the system starting file sent by the management machine;
the acquisition module is used for acquiring a target system mirror image from the local storage equipment of the physical machine based on the system starting file; the target system mirror image is generated after the physical machine configures the initial system mirror image on the management machine on the local storage device;
and the updating module is used for finishing system updating according to the target system mirror image.
In some embodiments of the present application, the obtaining module is further configured to load a kernel and a target boot image file, and execute an image loading script in the target boot image file; and acquiring the target system image in the local storage device through the image loading script.
In some embodiments of the present application, the update module is further configured to decompress the target system image through the image loading script, and mount the decompressed target system image to the memory through the kernel switching tool, so as to complete system update.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of the embodiment of the present application.
Embodiments of the present application provide a computer-readable storage medium storing executable instructions, which when executed by a processor, will cause the processor to perform the method provided by embodiments of the present application, for example, the method as illustrated in fig. 3 to 9 and fig. 11 to 13.
In some embodiments of the present application, the computer readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments of the application, the executable instructions may be in the form of a program, software module, script, or code, written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In summary, the following technical effects can be achieved through the embodiments of the present application:
(1) according to the embodiment of the application, the initial system image is synchronized to the local storage device of the physical machine before the system is updated, and compared with a scheme that the system image is downloaded from the management machine to each physical machine after a batch updating instruction is received in the related technology, the network congestion situation during the simultaneous image downloading can be avoided; meanwhile, the initial system image is configured in the local disk of the physical machine to obtain the configured target system image, and in the process of updating the physical machine, the system is directly updated based on the configured target system image.
(2) The method and the device for generating the customized initial image file for the physical machine can generate the customized initial image file for the physical machine, and can reduce the subsequent configuration process of the physical machine on the initial system image due to the customized initial system image, so that the calculation pressure of the physical machine is reduced, the time consumed by configuration is also reduced, and the system updating efficiency is further improved.
(3) Compared with an original system in an original mirror image source file, the customized initial system mirror image generated by the method reduces the size of the initial system mirror image as much as possible on the premise of meeting the requirement of a physical machine for realizing a specific function, reduces the data amount in the synchronization process of the initial system mirror image and improves the synchronization efficiency.
(4) According to the method and the device, the customized target starting mirror image can be generated, the corresponding mirror image loading script can be directly executed by loading the target starting mirror image in the starting process of the physical machine through the target starting mirror image, the corresponding target system mirror image can be directly obtained from the local storage device, and the system updating efficiency is improved.
(5) According to the method and the device, the needed target system image is stored in the local storage equipment of the physical machine in advance, and compared with a scheme that the system image is downloaded from the management machine to each physical machine simultaneously after receiving batch updating instructions in the related technology, the network congestion situation during simultaneous image downloading can be avoided, the scheme that the initial system image is synchronized to the local storage equipment of the physical machine firstly can save image downloading time in the system updating process, time consumption in the system updating process is reduced, and the system updating efficiency is improved; meanwhile, the physical machine in the embodiment of the application directly updates the system based on the configured target system image, and compared with a scheme that configuration is performed after the physical machine loads the initial system image in the related art, the time for configuring the initial system image in the system updating process can be saved, time consumed in the system updating process is reduced, and the system updating efficiency is improved.
(6) According to the embodiment of the application, the decompressed target system mirror image is mounted in the memory through the kernel switching tool, the hardware restart of a physical machine is avoided, the time consumption for updating the system is reduced, and the updating efficiency of the system is improved.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (10)

1. A system updating method is applied to a management machine and comprises the following steps:
synchronizing an initial system image stored on a storage device of the hypervisor to a local storage device of a physical machine in response to a synchronization request for the initial system image;
sending a configuration instruction to the physical machine; the configuration instruction is used for indicating the physical machine to configure the initial system mirror image on the local storage device to obtain a target system mirror image;
sending a system update instruction to the physical machine in response to an update request for the target system image; and the system updating instruction is used for indicating the physical machine to acquire the target system image so as to complete system updating.
2. The method of claim 1, wherein prior to synchronizing the initial system image to the local storage device of the physical machine, the method further comprises:
receiving a generation request for the initial system image;
responding to the generation request, and processing the mirror image source file according to the mirror image definition data to obtain an initial system mirror image;
sending the initial system image to a storage device of the management machine;
generating a state label corresponding to the initial system mirror image; the state tag is used for determining the storage position of the initial system image;
the synchronizing the initial system image to the local storage device of the physical machine includes:
and synchronizing the initial system images to local storage devices of a plurality of physical machines in a physical machine cluster in batches according to the state labels.
3. The method of claim 2, wherein processing the image source file according to the image definition data to obtain the initial system image comprises:
acquiring the mirror image source file and the mirror image definition data;
creating a file system for the initial system image according to a file system structure in the image definition data;
according to configuration data in the mirror image definition data, performing configuration processing on the file system;
and generating the initial system mirror image according to the file system subjected to the configuration processing.
4. The method according to claim 3, wherein the configuring the file system according to the configuration data in the image definition data comprises at least one of:
acquiring target software from a software package in the mirror image source file according to the software list in the mirror image definition data, and installing the target software;
acquiring a target driver from a driver package in the mirror image source file according to a driver list in the mirror image definition data, and loading the target driver;
generating a target configuration script according to the basic configuration script in the mirror image definition data; and the target configuration script is used for indicating the physical machine to configure the initial system mirror image according to the target configuration script to obtain the target system mirror image.
5. The method of claim 2, wherein after receiving the generation request for the initial system image, the method further comprises:
responding to the generation request, and generating a system boot file corresponding to the target system image; the system boot file comprises a kernel and a target boot image file;
the generating of the system boot file corresponding to the target system image includes:
extracting the kernel and the boot image file from the image source file; decompressing the boot image file; inserting a mirror image loading script into the decompressed starting mirror image file, and compressing to obtain the target starting mirror image file; and the mirror image loading script is used for acquiring the mirror image of the target system and mounting the mirror image to the memory.
6. The method of claim 5, further comprising:
and sending the kernel and the target starting image file to the physical machine so that the physical machine loads the kernel and the target starting image file and executes an image loading script in the target starting image file.
7. A system update method, applied to a physical machine, the method comprising:
receiving a system updating instruction sent by a management machine;
responding to the system updating instruction, and receiving a system starting file sent by the management machine;
acquiring a target system mirror image in the local storage equipment of the physical machine based on the system starting file; the target system image is generated after the physical machine configures the initial system image on the management machine on the local storage device;
and completing system updating according to the target system mirror image.
8. A system update apparatus, comprising:
a synchronization module, configured to synchronize an initial system image stored on a storage device of a hypervisor to a local storage device of a physical machine in response to a synchronization request for the initial system image;
the first sending module is used for sending a configuration instruction to the physical machine; the configuration instruction is used for indicating the physical machine to configure the initial system mirror image on the local storage device to obtain a target system mirror image;
the second sending module is used for responding to an updating request aiming at the target system mirror image and sending a system updating instruction to the physical machine; and the system updating instruction is used for indicating the physical machine to acquire the target system image so as to complete system updating.
9. A system update apparatus, comprising:
a memory for storing executable instructions;
a processor for implementing the method of any one of claims 1 to 6 or claim 7 when executing executable instructions stored in the memory.
10. A computer-readable storage medium having stored thereon executable instructions for, when executed by a processor, implementing the method of any one of claims 1 to 6 or claim 7.
CN202011126702.6A 2020-10-20 2020-10-20 System updating method, device, equipment and computer readable storage medium Active CN111966384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011126702.6A CN111966384B (en) 2020-10-20 2020-10-20 System updating method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011126702.6A CN111966384B (en) 2020-10-20 2020-10-20 System updating method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111966384A true CN111966384A (en) 2020-11-20
CN111966384B CN111966384B (en) 2021-01-29

Family

ID=73387029

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011126702.6A Active CN111966384B (en) 2020-10-20 2020-10-20 System updating method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111966384B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416377A (en) * 2020-11-23 2021-02-26 苏州浪潮智能科技有限公司 Boot image manufacturing method and device, electronic equipment and storage medium
CN112965734A (en) * 2021-03-05 2021-06-15 上海电气集团股份有限公司 Spartan6 series FPGA multi-mirror image program remote refreshing method
CN113312064A (en) * 2021-06-01 2021-08-27 中国民航信息网络股份有限公司 Installation configuration method and device of physical machine and computer readable medium
CN114253609A (en) * 2021-11-10 2022-03-29 苏州浪潮智能科技有限公司 Method and system for installing OS (operating system) through network PXE (peripheral component interconnect extensions) based on Feiteng platform

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100192143A1 (en) * 2009-01-27 2010-07-29 Microsoft Corporation Consistent operating system servicing for distributed nodes
CN102957562A (en) * 2011-08-16 2013-03-06 中国石油化工股份有限公司 Linux cluster system remote automatic maintenance method and maintenance system
CN107465709A (en) * 2016-06-03 2017-12-12 阿里巴巴集团控股有限公司 Distributed mirror image structure multitask method and device, system
CN107665157A (en) * 2017-09-21 2018-02-06 成都领沃网络技术有限公司 It is a kind of to improve the method without the experience of disk speed
CN108089913A (en) * 2017-12-28 2018-05-29 创新科存储技术(深圳)有限公司 A kind of virtual machine deployment method of super emerging system
CN108958843A (en) * 2018-07-12 2018-12-07 成都数字天空科技有限公司 Plug-in unit construction method, system, equipment and medium based on lightweight script
CN111625320A (en) * 2020-05-27 2020-09-04 苏州浪潮智能科技有限公司 Mirror image management method, system, device and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100192143A1 (en) * 2009-01-27 2010-07-29 Microsoft Corporation Consistent operating system servicing for distributed nodes
CN102957562A (en) * 2011-08-16 2013-03-06 中国石油化工股份有限公司 Linux cluster system remote automatic maintenance method and maintenance system
CN107465709A (en) * 2016-06-03 2017-12-12 阿里巴巴集团控股有限公司 Distributed mirror image structure multitask method and device, system
CN107665157A (en) * 2017-09-21 2018-02-06 成都领沃网络技术有限公司 It is a kind of to improve the method without the experience of disk speed
CN108089913A (en) * 2017-12-28 2018-05-29 创新科存储技术(深圳)有限公司 A kind of virtual machine deployment method of super emerging system
CN108958843A (en) * 2018-07-12 2018-12-07 成都数字天空科技有限公司 Plug-in unit construction method, system, equipment and medium based on lightweight script
CN111625320A (en) * 2020-05-27 2020-09-04 苏州浪潮智能科技有限公司 Mirror image management method, system, device and medium

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416377A (en) * 2020-11-23 2021-02-26 苏州浪潮智能科技有限公司 Boot image manufacturing method and device, electronic equipment and storage medium
CN112416377B (en) * 2020-11-23 2022-11-25 苏州浪潮智能科技有限公司 Method and device for manufacturing boot image, electronic equipment and storage medium
CN112965734A (en) * 2021-03-05 2021-06-15 上海电气集团股份有限公司 Spartan6 series FPGA multi-mirror image program remote refreshing method
CN113312064A (en) * 2021-06-01 2021-08-27 中国民航信息网络股份有限公司 Installation configuration method and device of physical machine and computer readable medium
CN113312064B (en) * 2021-06-01 2024-03-26 中国民航信息网络股份有限公司 Method and device for installing and configuring physical machine and computer readable medium
CN114253609A (en) * 2021-11-10 2022-03-29 苏州浪潮智能科技有限公司 Method and system for installing OS (operating system) through network PXE (peripheral component interconnect extensions) based on Feiteng platform
CN114253609B (en) * 2021-11-10 2023-07-18 苏州浪潮智能科技有限公司 Method and system for installing OS system through network PXE based on Feiteng platform

Also Published As

Publication number Publication date
CN111966384B (en) 2021-01-29

Similar Documents

Publication Publication Date Title
CN111966384B (en) System updating method, device, equipment and computer readable storage medium
US11513809B2 (en) Kernel-integrated instance-specific operational resources with virtualization
US9250672B2 (en) Cloning target machines in a software provisioning environment
US20220066787A1 (en) Remote provisioning of hosts in public clouds
US9176744B2 (en) Quickly provisioning a virtual machine by identifying a path to a differential file during pre-boot
CN105765534B (en) Virtual computing system and method
EP2191385B1 (en) Software deployment in large-scale networked systems
CN108089913B (en) Virtual machine deployment method of super-fusion system
CN109840096B (en) Installation method and device of operating system
US9720719B2 (en) Method and system for optimizing virtual disk provisioning
GB2516842A (en) Deployment of software images with distinct configuration logic
CN111198696B (en) OpenStack large-scale deployment method and system based on bare computer server
CN113906388A (en) Supervisory device deployed with independent application container for automation control program
CN111796838B (en) Automatic deployment method and device for MPP database
CN112445495A (en) Mirroring and recovery method for high-performance computing cluster nodes
CN113632064A (en) Provisioning services (PVS) cloud streaming with read caching
CN109600439B (en) PaaS platform and deployment method thereof based on microservice
US20090300609A1 (en) Combining system blueprints, functional layer, and software bits in parallel development of machines
JP2019120974A (en) Computer system, baseboard management controller, OS installation method, and program
JP2021184235A5 (en)
CN107621956B (en) Method for starting operating system based on network
CN112199161A (en) Cloud platform service management method and device and related components
CN115004151A (en) System and method for updating add-on card firmware and collecting hardware information on any server or bare metal server installed with any OS
CN111600751A (en) Data center management method and system
CN110830550A (en) Computer cluster and diskless starting method thereof

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