A whole machine image making method, image installation method, device and electronic equipment
By sending specified trigger instructions to the target server through the management node, automatically downloading and running the mirror production tool, the problem of low image file production efficiency in the existing technology is solved, and rapid data migration and the use of new expansion servers are realized.
Patent Information
- Application Number
- CN202111424246.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-11-26
AI Technical Summary
In the prior art, users need to manually create the entire machine image file of the bare metal server, resulting in low efficiency in image file production and unable to meet the needs of rapid data migration.
Through the management node, the specified trigger instructions are sent to the target server, the mirror production tool is downloaded, the entire machine image file is automatically created, and the entire machine image file is stored to the object storage server, so as to realize the automatic production and installation of the image file.
It improves the efficiency of image file production, reduces user operation process and time, ensures that the new expansion server is ready to use, and realizes rapid data migration.
Smart Images

Figure CN114338645B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a whole machine image production method, an image installation method, a device and an electronic device. Background Art
[0002] When users use bare metal servers to deploy their own businesses, they will create servers in different regions and availability zones, which are called online expansion servers. Since deploying the same server can expand the online server capacity, after online expansion of the server, the system disk and data disk of the original server need to be copied to the newly expanded server.
[0003] In order to copy the data of the system disk and data disk of the original server to the newly expanded server, it is usually necessary to create an image file of the original server's entire machine data, that is, the image file of the system disk and the data disk, so as to use the created image file to achieve data replication. In the related art, when it is necessary to create an image file of the original server, the user initiates an assistance application for generating the image file of the original server to the cloud service provider through the work order system, so that the internal staff of the cloud service provider manually create the image file of the original server.
[0004] Since the internal staff of the cloud service provider need to manually create the image file, it can be seen that in the related art, the efficiency of creating the image file is low. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a whole machine image production method, an image installation method, a device and an electronic device to improve the efficiency of image file production and provide a basis for rapid data migration. On this basis, the present invention also provides an image installation method for installing image files to improve data migration efficiency. The specific technical solution is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a method for creating a whole machine image, which is applied to a target server, wherein the target server is a server pre-created by a user in any region, and the server pre-created by a user in any region communicates with a management node; the method comprises:
[0007] When receiving a first designated trigger instruction sent by the management node, downloading a first system file containing an image creation tool from a pre-execution environment PXE server in communication with the target server; wherein the first designated trigger instruction is sent by the management node after receiving a user's image creation request for the target server;
[0008] Running the first system file to enter the operating system indicated by the first system file;
[0009] Under the operating system indicated by the first system file, when the image creation instruction sent by the management node is received, the image creation tool is used to create an image file belonging to the entire machine data.
[0010] Optionally, after using the image creation tool to create an image file belonging to the entire machine data, the method further includes:
[0011] Store the created image file in the specified object storage server.
[0012] Optionally, the target server is a server of a pre-divided private network VPC;
[0013] Before downloading the system file including the image creation tool from the pre-execution environment PXE server communicating with the target server, the method further includes:
[0014] Disconnect from other servers in the VPC.
[0015] Optionally, the first designated trigger instruction is sent by the management node after receiving an image creation request for the target server sent by a user based on a corresponding front-end console or a software development kit SDK.
[0016] Optionally, storing the produced image file in a designated object storage server includes:
[0017] The prepared image file is uploaded to the PXE server, so that the PXE server transmits the image file to a designated object storage server, so that the designated object storage server stores the image file.
[0018] In a second aspect, an embodiment of the present invention provides an image installation method, which is applied to a designated server, wherein the designated server is a server pre-created in any region, and the server pre-created in any region communicates with a management node;
[0019] The method comprises:
[0020] After receiving the second designated trigger instruction sent by the management node, obtaining the second system file of the target PXE server that communicates with the designated server; wherein the second designated trigger instruction is sent by the management node after receiving the image installation request of the user for the designated server;
[0021] Running the second system file to enter the operating system indicated by the second system file;
[0022] Under the operating system indicated by the second system file, when receiving an installation instruction for the image file of the target server sent by the management node, obtaining the image file stored in the designated storage server;
[0023] Install the obtained image file;
[0024] The designated storage server is an object storage server in the region where the designated server is located, and the image file stored in the designated storage server is a file produced according to any of the above-mentioned whole machine image production methods.
[0025] In a third aspect, an embodiment of the present invention provides a whole machine image production device, which is applied to a target server, wherein the target server is a server pre-created by a user in any region, and the server pre-created by a user in any region communicates with a management node; the device comprises:
[0026] A download module, configured to download a system file including an image creation tool from a pre-execution environment PXE server in communication with the target server upon receiving a first designated trigger instruction sent by the management node; wherein the first designated trigger instruction is sent by the management node after receiving a user's image creation request for the target server;
[0027] A first running module, used for running the first system file to enter the operating system indicated by the first system file;
[0028] A production module is used to use the image production tool to produce an image file belonging to the whole machine data under the operating system indicated by the first system file when receiving the image production instruction sent by the management node.
[0029] Optionally, the device further comprises:
[0030] The storage module is used to store the produced image file in the specified object storage server.
[0031] Optionally, the target server is a server of a pre-divided private network VPC;
[0032] Before downloading the system file including the image creation tool from the pre-execution environment PXE server communicating with the target server, the method further includes:
[0033] Disconnect from other servers in the VPC.
[0034] Optionally, the first designated trigger instruction is sent by the management node after receiving an image creation request for the target server sent by a user based on a corresponding front-end console or a software development kit SDK.
[0035] Optionally, the storage module is specifically used to:
[0036] The prepared image file is uploaded to the PXE server, so that the PXE server transmits the image file to a designated object storage server, so that the designated object storage server stores the image file.
[0037] In a fourth aspect, an embodiment of the present invention provides an image installation device, which is applied to a designated server, wherein the designated server is a server pre-created in any region, and the server pre-created in any region communicates with a management node; the device includes:
[0038] A first acquisition module is used to acquire a second system file of a target PXE server that communicates with the designated server after receiving a second designated trigger instruction sent by the management node; wherein the second designated trigger instruction is sent by the management node after receiving a mirror installation request from a user for the designated server;
[0039] A second running module, used for running the second system file to enter the operating system indicated by the second system file;
[0040] A second acquisition module is used to acquire the image file stored in the designated storage server under the operating system indicated by the second system file when receiving an installation instruction for the image file of the target server sent by the management node;
[0041] The installation module is used to install the acquired image file. The designated storage server is an object storage server in the region where the designated server is located, and the image file stored in the designated storage server is a file produced according to any of the above-mentioned whole machine image production methods.
[0042] In a fifth aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
[0043] Memory, used to store computer programs;
[0044] The processor is used to implement the steps of any of the above-mentioned whole machine image production methods, or the steps of any of the above-mentioned image installation methods when executing the program stored in the memory.
[0045] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the steps of any of the above-mentioned whole-machine image production methods or the steps of any of the above-mentioned image installation methods are implemented.
[0046] In a seventh aspect, an embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the steps of any of the above-described whole-machine image production methods, or the steps of any of the above-described image installation methods.
[0047] Beneficial effects of the embodiments of the present invention:
[0048] The whole machine image production method provided by the embodiment of the present invention sends a first specified trigger instruction to the target server through the management node. After receiving the first specified trigger instruction, the target server downloads the first system file containing the image production tool from the server communicating with the target server, and then runs the first system file to enter the PXE system. After entering the PXE system, when the image production instruction sent by the management node is received, the image production tool is used to produce an image file belonging to the whole machine data. Therefore, when the target server receives the first specified trigger instruction sent by the management node, the relevant steps of the whole machine image production can be automatically executed, and the internal personnel of the cloud service provider do not need to manually produce the whole machine image, which saves the user's operation process and time. It can be seen that through this solution, the efficiency of image file production can be improved, providing a basis for rapid data migration.
[0049] In addition, since the image file in this embodiment does not need to rely on the newly expanded server, the image file of the original service to be used can be pre-made before the server is expanded, so that after the server is expanded, the pre-made image file can be directly downloaded and installed to achieve rapid data migration, thereby ensuring that the newly expanded server is ready for use.
[0050] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0052] Figure 1A flowchart of a method for making a whole machine image provided by an embodiment of the present invention;
[0053] Figure 2 Another flow chart of a whole machine image production method provided by an embodiment of the present invention;
[0054] Figure 3 A flowchart of a mirror image installation method provided by an embodiment of the present invention;
[0055] Figure 4 A system structure diagram of a whole machine image production method provided by an embodiment of the present invention;
[0056] Figure 5 A topological diagram of a specific example of a method for making a whole machine image provided by an embodiment of the present invention;
[0057] Figure 6 A network topology diagram of a whole machine image production method provided by an embodiment of the present invention;
[0058] Figure 7 A schematic diagram of the structure of a whole machine image making device provided by an embodiment of the present invention;
[0059] Figure 8 A schematic diagram of the structure of a mirror mounting device provided by an embodiment of the present invention;
[0060] Fig. 9 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.
[0062] First, the terms involved in the present invention are explained here:
[0063] Whole machine image file: The computer hard disk consists of two parts: the system disk and the data disk. The whole machine image file includes a copy of the computer system disk data and the data disk data. The whole machine image file can also be called the image file belonging to the whole machine data;
[0064] region: region, used to describe the location of a data center. Different regions are completely independent.
[0065] PXE: Preboot Execute Environment. The client can use PXE to automatically install the operating system when the computer is turned on. The server can monitor and respond to client system installation requests, and provide services such as DHCP (Dynamic Host Configuration Protocol) and TFTP (Trivial File Transfer Protocol).
[0066] When users expand the capacity of servers online, deploying the same server can expand the online server capacity. However, deploying the same server requires copying the entire machine (system disk and data disk) data of the original server to the newly expanded server.
[0067] In the related art, in order to copy the entire machine data of the original server to the newly expanded server, it is usually necessary to create an image file of the entire machine data of the original server, that is, the entire machine image file. When it is necessary to create the entire machine image file of the original server, the user submits a work order for assistance to the cloud service provider through the work order system. After the cloud service provider receives the work order, the internal staff manually creates the entire machine image file of the original server. There are many manual operations and the efficiency of image file creation is low. At the same time, it takes a long time for the user to initiate a work order to the cloud service provider and for the work order to be received and processed by the cloud service provider, resulting in a poor user experience.
[0068] In addition, in the related art, the system disk data of the original server can also be copied to the newly expanded server through the traditional installation method, wherein the traditional installation can be to automatically complete the migration of the system disk data of the original server through the console, that is, to migrate the system disk data of the original server to the newly expanded server. Then, after the traditional installation is completed, the data disk data is copied to complete the copying of the entire machine data of the original server to the newly expanded server. In this traditional installation method, a script file needs to be written in advance, and the communication connection between the original server and the newly expanded server is realized through the script file.
[0069] For example, if the original server and the newly expanded server are in the same VPC (Virtual Private Cloud), a script needs to be written to prompt the newly expanded server to find the original server according to the IP (Internet Protocol) address in the VPC group, and complete the data migration between the original server and the newly expanded server by establishing a communication connection. For example, if the original server and the newly expanded server are not in the same VPC, the console binds the two servers to the public IP, and a script needs to be written to prompt the newly expanded server to find the original server through the public IP address, so as to establish a communication connection for data migration.
[0070] In addition, copying the data disk data requires a certain amount of transmission time. For example, in the cloud gaming scenario, the amount of data on each node server is large. After the traditional installation of the newly expanded server is completed, the transmission time of the mode of copying the data disk data of the original server is long. It can be seen that in this traditional installation method, after the server is expanded, it is necessary to go through the server connection process, the system disk data migration process, and the data disk data copy process, which is inefficient and cannot ensure that the newly expanded server can be used immediately, thus making it difficult to meet the business needs of users.
[0071] In order to solve the above technical problems existing in the related art, the embodiments of the present invention provide a whole machine image production method, an image installation method, an apparatus and an electronic device.
[0072] The following first introduces a whole machine image manufacturing method provided by an embodiment of the present invention.
[0073] A whole-machine image production method provided by an embodiment of the present invention is applied to a target server, which is a server for which an image file is to be produced, and which can be a server pre-created by a user in any region, and communicates with a management node. Among them, each region may include multiple availability zones and an object storage server, and each availability zone has multiple instances (i.e., servers pre-created by users in the region) and a PXE server. The instances between different availability zones are independent of each other, and the instances between different regions are also independent of each other. There are links between PXE servers in different availability zones in the same region, so that instances in different availability zones in the same region can communicate through the PXE servers in their availability zones; there are links between object storage servers in different regions, so that instances in different regions can communicate through the object storage servers in their regions.
[0074] Exemplarily, the servers pre-created in each region may be bare metal servers, wherein the bare metal servers are computing servers that have both elastic cloud services and physical machine performance.
[0075] Exemplarily, the management node may be a server independent of various servers in various regions, and used to communicate with various servers in various regions. In addition, the management node may receive requests sent by users based on the OpenApi (Open Application Programming Interface) of the corresponding front-end console or SDK (Software Development Kit), for example, an image creation request for a target server or an installation request for a designated server (a server to install an image file).
[0076] Among them, the above-mentioned front-end console can be used to interact with the user, and then transmit the relevant requests input by the user through the console to the management node. The management node performs the corresponding operation after receiving the request, so that the user can use the console to realize automatic image file production and installation. Exemplarily, the console can display control buttons, such as an "image production" button, an "image installation" button, and a "data query" button, to provide users with the functions of making image files, installing image files, and querying image files. Specifically, by clicking the "image production" button in the console, the automatic production of image files can be realized; by clicking the "image installation" button in the console, the automatic installation can be realized; by clicking the "data query" button, the relevant image files can be queried.
[0077] Exemplarily, when the console detects a click operation on the "Image Creation" button, that is, when the JS (JavaScript, a scripting language for developing Web pages) control of the console listens to the user clicking the "Image Creation" button event, the console interface pops up a related form for image creation, guiding the user to fill in the relevant field information, and after the user submits the form, the relevant field information filled in by the user is transmitted to the management node through the API (Application Programming Interface), and the management node responds automatically to complete the whole process of making the image file.
[0078] Exemplarily, when the console detects a click operation on the "image installation" button, the console interface pops up a form related to the image installation, which may include a "data query" button. When the console detects a click operation on the "data query" button, a list of image files pops up, which provides a query for image files by region; wherein, the data display field in the list can display the id, size and other information of the image file based on the information required by the user, and accurately display the content. When the user clicks to select an image file in the list and submits the form related to the image installation to the management node, the management node can automatically execute the entire process of installing the image file selected by the user.
[0079] The whole machine image production method provided in the embodiment of the present invention may include the following steps:
[0080] When receiving a first designated trigger instruction sent by the management node, downloading a first system file containing an image creation tool from a pre-execution environment PXE server in communication with the target server; wherein the first designated trigger instruction is sent by the management node after receiving a user's image creation request for the target server;
[0081] Running the first system file to enter the operating system indicated by the first system file;
[0082] Under the operating system indicated by the first system file, when the image creation instruction sent by the management node is received, the image creation tool is used to create an image file belonging to the entire machine data.
[0083] In the solution provided by the embodiment of the present invention, when the first designated trigger instruction sent by the management node is received, the first system file containing the image creation tool is downloaded from the pre-execution environment PXE server that communicates with the target server; then, the first system file is run to enter the operating system indicated by the first system file; under the operating system indicated by the first system file, when the image creation instruction sent by the management node is received, the image creation tool is used to create an image file belonging to the entire machine data. Thus, by using the image creation tool in the PXE server that communicates with the target server to create an image file belonging to the target server, it is not necessary for the internal personnel of the cloud service provider to manually create the image file, thereby improving the efficiency of image file creation.
[0084] The following describes the whole machine image manufacturing method provided by the embodiment of the present invention in conjunction with the accompanying drawings.
[0085] like Figure 1As shown, the whole machine image production method provided in the embodiment of the present invention is applied to a target server, wherein the target server is a server pre-created by a user in any region, and the server pre-created by a user in any region communicates with a management node; the method may include steps S101-S103:
[0086] S101, when receiving a first designated trigger instruction sent by a management node, downloading a first system file including an image creation tool from a pre-execution environment PXE server in communication with the target server; wherein the first designated trigger instruction is sent by the management node after receiving an image creation request from a user for the target server;
[0087] In this embodiment, when the user needs to make a whole machine image file belonging to the target server, first, an image making request for the target server can be sent to the management node, wherein the image making request can carry ID information for indicating the target server. After receiving the above image making request, the management node sends a first designated trigger instruction to the target server indicated by the above image making request, and the first designated trigger instruction can instruct the target server to download a first system file from a PXE (Preboot eXecution Environment) server communicating with it, and the first system file is integrated with an image making tool. Exemplarily, the image making tool can be a DISM (Deployment Imaging and Management) tool, but it is certainly not limited to this.
[0088] Optionally, in one implementation, the first designated trigger instruction is sent by the management node after receiving a mirror creation request for the target server sent by a user based on a corresponding front-end console or software development kit SDK.
[0089] That is, the user can send an image creation request to the management node through the console or SDK. After receiving the image creation request, the management node sends the first specified trigger instruction to the target server. Exemplarily, if the user sends an image creation request to the management node through the console, the image creation request can be sent to the management node by clicking the "Create Image" button on the console interface. Exemplarily, if the user sends an image creation request to the management node through the SDK, the image creation request can be sent to the management node through the SDK's OpenApi.
[0090] S102, running the first system file to enter the operating system indicated by the first system file;
[0091] After obtaining the first system file in step S101, the target server may run the first system file in the local memory, thereby entering the operating system indicated by the first system file, that is, the PXE system.
[0092] S103, under the operating system indicated by the first system file, when receiving the image creation instruction sent by the management node, using the image creation tool to create an image file belonging to the entire machine data.
[0093] In this embodiment, after entering the PXE system, the target server will feed back the information of entering the PXE system to the console. After receiving the above feedback information, the console sends an image creation instruction to the target server through the management node, so that after receiving the image creation instruction, the target server uses the image creation tool under the PXE system to create an image file belonging to the entire machine data of the target server.
[0094] Among them, the target server can support a system logical partition (system disk) and a data logical partition (data disk), so that the target server can make a mirror file belonging to the whole machine data, that is, make a whole machine mirror file including system disk data and data disk data. It is worth mentioning that the data disk data can be all the data disk data in the target server, or it can be part of the data disk data in the target server. It can be understood that when the whole machine data includes system disk data and all data disk data, it is convenient for the newly deployed server to obtain all the data in the target server. In some scenarios, such as game scenarios, the system disk and data disk data of each server are the same and the data volume is large. The traditional system disk is installed. The mode of copying the data disk data is inefficient, and the method of making the system disk data and the mirror file of all data disk data, because the mirror file can be pre-made before the game node is created, can ensure that the game node is ready to use; when the whole machine data includes system disk data and part of the data disk data, the data that needs to make the mirror file can be flexibly selected to avoid the waste of resources caused by making the mirror file of unnecessary data.
[0095] Among them, if the whole machine data includes system disk data and part of the data disk data, the image making instruction can carry relevant parameters indicating image making, for example, the relevant parameters can be a storage area identifier, which indicates the storage area where the data for which the image file needs to be made is located.
[0096] After receiving the image creation instruction, the target server can determine the data for which the image file needs to be created based on the relevant parameters in the image creation instruction, and then create the image file based on the data. For example, when the relevant parameter is a storage area identifier, the target server can determine the data in the storage area indicated by the storage area identifier as the data for which the image file needs to be created, and then create the image file based on the data in the storage area.
[0097] In addition, the prepared image file can be cached locally on the target server, uploaded to a PXE server communicating with the target server, or uploaded to an object storage server in the domain through the target PXE server for subsequent use.
[0098] It can be seen that in the solution of this embodiment, the management node sends the first designated trigger instruction to the target server. After receiving the first designated trigger instruction, the target server downloads the first system file containing the image making tool from the server communicating with the target server, and then runs the first system file to enter the PXE system. After entering the PXE system, when the image making instruction sent by the management node is received, the image making tool is used to make an image file belonging to the whole machine data. Therefore, when the target server receives the first designated trigger instruction sent by the management node, the relevant steps of the whole machine image making can be automatically executed, and the internal personnel of the cloud service provider do not need to manually make the whole machine image, which saves the user's operation process and time.
[0099] In addition, since the image file in this embodiment does not need to rely on the newly expanded server, the image file of the original service to be used can be pre-made before the server is expanded, so that after the server is expanded, the pre-made image file can be directly downloaded and installed to achieve rapid data migration, thereby ensuring that the newly expanded server is ready for use.
[0100] Optionally, in another embodiment of the present invention, Figure 1 Based on the embodiment shown, Figure 2 As shown, after the image file belonging to the whole machine data is created by using the image creation tool, the method further includes step S104:
[0101] S104, storing the produced image file in a designated object storage server.
[0102] In this embodiment, after the image file of the entire data of the target server is created through the above step S103, the image file can be transferred to the designated object storage server in the region where it is located for storage. It can be understood that the object storage server in each region can be a server that can communicate across regions, so that the object storage servers in other regions can subsequently obtain the image file from the designated object storage server.
[0103] Exemplarily, the image creation instruction sent by the management node in the above step S103 may carry an object storage server identifier, which indicates a designated object storage server. At this time, after the target server completes the creation of the image file, it can determine the designated object storage server based on the object storage server identifier and store the created image file in the designated object storage server.
[0104] Optionally, in one implementation, storing the produced image file in a designated object storage server includes:
[0105] The prepared image file is uploaded to the PXE server, so that the PXE server transmits the image file to a designated object storage server, so that the designated object storage server stores the image file.
[0106] In this implementation, after the target server has created the image file belonging to the entire machine, it can upload the image file to a PXE server that communicates with the target server for storage, and send an instruction to the PXE server to instruct the PXE server to transfer the image file to a designated object storage server, so as to store the image file in the designated object storage server. The designated object storage server can be an object storage server that can communicate across domains in the region where the target server is located. Thus, by storing the image file in the designated object storage server, it can facilitate the subsequent calling of object storage servers in other regions.
[0107] It can be seen that in the solution of this embodiment, by storing the produced image file in the designated object storage server, it is convenient for object storage servers in other regions to obtain the image file from the designated object storage server, thereby facilitating servers in other regions that are to install the image file to obtain and install the image file from the object storage server in their domain.
[0108] Optionally, in another embodiment of the present invention, the target server is a server of a pre-divided private network VPC.
[0109] Therein, multiple servers can be deployed in the VPC to jointly handle the client's business requests, and the target server is a server in the pre-divided VPC.
[0110] In the case where the target server is a server in a VPC, optionally, before downloading the system file including the image creation tool from the pre-execution environment PXE server communicating with the target server, the method provided by the embodiment of the present invention further includes:
[0111] Disconnect from other servers in the VPC.
[0112] It is understandable that, since the servers in the VPC provide external computing or storage services, when a server in the VPC is creating an image, it can disconnect from the intranet, that is, disconnect from other servers in the VPC, so that when the server is creating an image, the service requests that originally need to be processed by the server can be assigned to other servers in the above VPC for processing, thereby not delaying the processing of the client's service requests. In addition, it can be guaranteed that the data of the entire server will not change during the process of creating an image.
[0113] It can be seen that in the solution of this embodiment, in the case where the target server belongs to a server in the VPC, the connection with other servers in the VPC is disconnected before the image file is created, that is, the image creation process is isolated from the business processing process. This can avoid the impact of image creation on the response to business requests, and at the same time avoid changes in the data of the entire machine, thereby ensuring the integrity of the data of the entire machine.
[0114] On the basis of the above scheme, Figure 3 As shown, an embodiment of the present invention further provides an image installation method, which is applied to a designated server, wherein the designated server is a server pre-created in any region, and the server pre-created in any region communicates with the management node; the method comprises steps S301-S304:
[0115] S301, after receiving a second designated trigger instruction sent by a management node, obtaining a second system file of a target PXE server that communicates with the designated server; wherein the second designated trigger instruction is sent by the management node after receiving a mirror installation request from a user for the designated server;
[0116] In this embodiment, when a user needs to install an image file produced based on the above-mentioned whole machine image production method for a designated server, first, an image installation request for the designated server can be sent to the management node, wherein the image installation request can carry ID information for indicating the designated server. Exemplarily, the ID information can be name information or IP address information. After receiving the above-mentioned image installation request, the management node sends a second designated trigger instruction to the designated server indicated by the above-mentioned image installation request, and the second designated trigger instruction can instruct the designated server to obtain the second system file from the target PXE server communicating with it.
[0117] Optionally, in one implementation, the second designated trigger instruction is sent by the management node after receiving an image installation request for the designated server sent by a user based on a corresponding front-end console or software development kit SDK.
[0118] That is, the user can send the image installation request to the management node through the console or SDK. After receiving the image installation request, the management node sends the second specified trigger instruction to the specified server. Exemplarily, if the user sends the image installation request to the management node through the console, the image installation request can be sent to the management node by clicking the "Image Installation" button on the console interface. Exemplarily, if the user sends the image installation request to the management node through the SDK, the image installation request can be sent to the management node through the SDK's OpenApi.
[0119] S302, running the second system file to enter the operating system indicated by the second system file;
[0120] After obtaining the second system file in step S301, the designated server may run the second system file in the local memory, thereby entering the operating system indicated by the second system file.
[0121] S303, under the operating system indicated by the second system file, when receiving an installation instruction for the image file of the target server sent by the management node, obtaining the image file stored in the designated storage server;
[0122] In this embodiment, the designated storage server is an object storage server in the region where the designated server is located, and the image file stored in the designated storage server is an image file produced according to the above-mentioned whole machine image production method.
[0123] After the designated server enters the operating system indicated by the second system file, it will feed back the information of entering the system to the console. After receiving the above feedback information, the console sends an installation instruction to the designated server through the management node. The installation instruction may carry a designated storage server identifier, and the designated storage server identifier indicates an object storage server in the region where the designated server is located, so that the designated server can obtain the image file stored in the designated storage server after receiving the installation instruction.
[0124] S304, installing the acquired image file;
[0125] After the image file is obtained in step S303, the image file can be installed in the designated server. It is worth mentioning that after the designated server has installed the image file, it can also self-check whether the image file is successfully installed, and feedback the installation result to the user through the console or SDK.
[0126] It can be seen that through this embodiment, the automatic installation of the image file can be realized through the relevant operations of the console or SDK, thereby reducing the user operation process and time. In addition, since the image file of the target server can be prepared in advance, this solution can realize fast and effective data migration, so that the newly expanded server, that is, the designated server, can be used immediately.
[0127] In order to more clearly understand the content of the embodiments of the present invention, Figure 4 and Figure 5 The system structure and a specific example of the present invention are introduced.
[0128] like Figure 4 As shown, the user can interact with the backend server system through the webconsole console or the SDK's OpenApi, where the backend server system consists of an application middle platform and a grassroots server. The application middle platform integrates storage, computing, network and other service products to ensure high availability of image production and preservation; the grassroots server can correspond to the server pre-created by the user above, and the user can use the SDK's OpenApi to perform various service purchase or change functions.
[0129] like Figure 5 As shown, a specific example of the whole machine image production method provided by an embodiment of the present invention may include the following steps:
[0130] 1. The user operates the client's webconsole (console) or the SDK's OpenApi and enters the relevant parameters required for image creation;
[0131] 2. The client sends an image creation request to the management node, which carries relevant parameters entered by the user;
[0132] 3. After receiving the image creation request, the management node sends a first designated trigger instruction to the target server, instructing the target server to execute image creation;
[0133] 4. After receiving the first specified trigger instruction, the target server goes offline from the VPC, that is, disconnects from other servers in the VPC;
[0134] 5. After the target server is offline from the VPC, it requests the PXE server communicating with it to create a script file for the image (corresponding to the first system file containing the image creation tool mentioned above);
[0135] 6. The PXE server requests the download script file from the PXE database;
[0136] 7. The PXE database transfers the script file to the target server;
[0137] 8. After receiving the script file, the target server automatically runs the script file and establishes a connection with the management node to read the parameters required for making the image;
[0138] 9. The target server performs image creation;
[0139] 10. After the image is created, transfer the image file to the PXE server;
[0140] 11. The PXE server stores the image file in the PXE database;
[0141] 12. Transfer the image file to the object storage server through the PXE server;
[0142] 13. The object storage server stores the image file in the object storage data;
[0143] 14. The object storage server feeds back the image creation result information to the management node;
[0144] 15. The target server rejoins the VPC, that is, reestablishes connections with other servers in the VPC.
[0145] 16. The management node feeds back the image creation result information to the console or SDK.
[0146] 17. Users can view the image creation results through the console or SDK.
[0147] Take the cloud gaming scenario as an example, using the console to create a whole machine image file of the target server with the system version of Windows 10 Pro in one click:
[0148] (1) When the user needs to create a whole machine image file of the target server, first, enter the relevant parameters required for image creation (for example, the storage area identifier mentioned above) through the console, and when it is detected that the system of the target server is Windows 10 Pro, click the "Image Creation" button.
[0149] (2) The console monitors the "image creation" button event and transmits relevant parameters to the back-end management node through the interface, so that after receiving the relevant parameters, the management node sends a first specified trigger instruction to the target server, instructing the target server to execute image creation, that is, automatically creating a whole machine image file through the DISM tool, that is, an image file belonging to the whole machine data.
[0150] (3) After step (2) is completed, the system will return a value, and the system will determine whether the image creation is successful based on the return value. If it fails, the console will provide feedback that the image creation failed, and the user can know the result of this operation in a timely manner; if it succeeds, the entire machine image file will be cached locally on the target server, and then automatically uploaded to the object storage server in the region where the target server is located through the object storage server interface.
[0151] in addition, Figure 6 It shows the star topology structure of user-made mirroring and data migration, such as Figure 6 As shown in the figure, a PXE server can provide data migration services for multiple bare metal servers, forming a star topology. The bare metal server that creates the image file can upload the image file to the PXE server for storage, and the PXE server can transfer the stored image file to the bare metal server for installation. By uploading the image file created by the user to the PXE server, the bare metal server of the user can realize the data transmission within the group (within the star topology) when installing the image file later, reducing the user's bandwidth traffic cost. Compared with the end-to-end data transmission of multiple users, it has higher reliability.
[0152] Corresponding to the above method embodiment, the embodiment of the present invention further provides a whole machine image production device, which is applied to a target server, wherein the target server is a server pre-created by a user in any region, and the server pre-created by a user in any region communicates with a management node; Figure 7 As shown, the device comprises:
[0153] The download module 710 is configured to download a system file including an image creation tool from a pre-execution environment PXE server in communication with the target server when receiving a first designated trigger instruction sent by the management node; wherein the first designated trigger instruction is sent by the management node after receiving a user's image creation request for the target server;
[0154] A first running module 720, configured to run the first system file to enter the operating system indicated by the first system file;
[0155] The production module 730 is used to use the image production tool to produce an image file belonging to the whole machine data under the operating system indicated by the first system file when receiving the image production instruction sent by the management node.
[0156] Optionally, the device further comprises:
[0157] The storage module is used to store the produced image file in the specified object storage server.
[0158] Optionally, the target server is a server of a pre-divided private network VPC;
[0159] Before downloading the system file including the image creation tool from the pre-execution environment PXE server communicating with the target server, the method further includes:
[0160] Disconnect from other servers in the VPC.
[0161] Optionally, the first designated trigger instruction is sent by the management node after receiving an image creation request for the target server sent by a user based on a corresponding front-end console or a software development kit SDK.
[0162] Optionally, the storage module is specifically used to:
[0163] The prepared image file is uploaded to the PXE server, so that the PXE server transmits the image file to a designated object storage server, so that the designated object storage server stores the image file.
[0164] Corresponding to the above method embodiment, the embodiment of the present invention further provides an image installation device, which is applied to a designated server, wherein the designated server is a server pre-created in any region, and the server pre-created in any region communicates with the management node; Figure 8 As shown, the device comprises:
[0165] A first acquisition module 810 is configured to acquire a second system file of a target PXE server in communication with the designated server after receiving a second designated trigger instruction sent by the management node; wherein the second designated trigger instruction is sent by the management node after receiving a mirror installation request from a user for the designated server;
[0166] A second running module 820, configured to run the second system file to enter the operating system indicated by the second system file;
[0167] A second acquisition module 830 is configured to, under the operating system indicated by the second system file, acquire the image file stored in the designated storage server when receiving an installation instruction for the image file of the target server sent by the management node;
[0168] The installation module 840 is used to install the acquired image file. The designated storage server is an object storage server in the region where the designated server is located, and the image file stored in the designated storage server is a file produced according to any of the above-mentioned whole machine image production methods.
[0169] The embodiment of the present invention further provides an electronic device, such as Fig. 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.
[0170] Memory 903, used for storing computer programs;
[0171] The processor 901 is used to implement the steps of the whole machine image production method described in any of the above embodiments, or the steps of the image installation method described in any of the above embodiments when executing the program stored in the memory 903.
[0172] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0173] The communication interface is used for communication between the above electronic device and other devices.
[0174] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0175] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0176] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of the whole machine image production method described in any of the above embodiments, or the steps of the image installation method described in any of the above embodiments are implemented.
[0177] In another embodiment provided by the present invention, a computer program product containing instructions is also provided. When the computer program product is run on a computer, the computer executes the steps of the whole machine image production method described in any of the above embodiments, or the steps of the image installation method described in any of the above embodiments.
[0178] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0179] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0180] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0181] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for making a whole machine image, characterized in that: Applied to a target server, the target server is a server pre-created by a user in any region, and the server pre-created by a user in any region communicates with a management node; each region includes multiple availability zones, each availability zone has multiple servers pre-created by the user and a pre-execution environment PXE server, and PXE servers in different availability zones in the same region are linked; each region has an object storage server, and object storage servers in different regions are linked; the management node is a server independent of various servers in each region, and is used to communicate with various servers in each region; the method includes: When receiving a first designated trigger instruction sent by the management node, downloading a first system file containing an image creation tool from a pre-execution environment PXE server in communication with the target server; wherein the first designated trigger instruction is sent by the management node after receiving a user's image creation request for the target server; Running the first system file to enter the operating system indicated by the first system file; Under the operating system indicated by the first system file, when receiving the image making instruction sent by the management node, using the image making tool to make an image file belonging to the whole machine data, the image making instruction carries relevant parameters for indicating image making, and the relevant parameters include a storage area identifier; the image file is used to be downloaded and installed to the designated server for capacity expansion; the designated server is a server in a different region or a different availability zone; The produced image file is stored in a designated object storage server; the storing the produced image file in the designated object storage server includes: uploading the produced image file to the PXE server, so that the PXE server transmits the image file to the designated object storage server, so that the designated object storage server stores the image file; the designated object storage server is an object storage server in the region where the target server is located; The whole machine data includes system disk data and part of data disk data, and the use of the image creation tool to create an image file belonging to the whole machine data includes: Determine the data in the storage area indicated by the storage area identifier in the image making instruction as the data for which the image file needs to be made; The image file is created based on the data for which the image file needs to be created by utilizing the image creation tool.
2. The method according to claim 1, characterized in that The target server is a server in a pre-divided private network VPC; Before downloading the system file including the image creation tool from the pre-execution environment PXE server communicating with the target server, the method further includes: Disconnect from other servers in the VPC.
3. The method according to claim 1, characterized in that The first designated trigger instruction is sent by the management node after receiving a mirroring request for the target server sent by a user based on a corresponding front-end console or a software development kit SDK.
4. A mirror image installation method, characterized in that: Applied to a designated server, the designated server being a server pre-created in any region, and the server pre-created in any region communicating with the management node; The method comprises: After receiving the second designated trigger instruction sent by the management node, obtaining the second system file of the target PXE server that communicates with the designated server; wherein the second designated trigger instruction is sent by the management node after receiving the image installation request of the user for the designated server; Running the second system file to enter the operating system indicated by the second system file; Under the operating system indicated by the second system file, when receiving an installation instruction for the image file of the target server sent by the management node, obtaining the image file stored in the designated storage server; Install the obtained image file; The designated storage server is an object storage server in the region where the designated server is located, and the image file stored in the designated storage server is a file produced by the method according to any one of claims 1 to 3.
5. A whole machine mirroring device, characterized in that: Applied to a target server, the target server is a server pre-created by a user in any region, and the server pre-created by a user in any region communicates with a management node; each region includes multiple availability zones, each availability zone has multiple servers pre-created by the user and a pre-execution environment PXE server, and PXE servers in different availability zones in the same region are linked; each region has an object storage server, and object storage servers in different regions are linked; the management node is a server independent of various servers in each region, and is used to communicate with various servers in each region; the device includes: A download module, configured to download a system file including an image creation tool from a pre-execution environment PXE server in communication with the target server upon receiving a first designated trigger instruction sent by the management node; wherein the first designated trigger instruction is sent by the management node after receiving a user's image creation request for the target server; A first running module, used for running a first system file to enter an operating system indicated by the first system file; a production module, configured to, under the operating system indicated by the first system file, upon receiving an image production instruction sent by the management node, use the image production tool to produce an image file belonging to the whole machine data, wherein the image production instruction carries relevant parameters indicating the production of an image, and the relevant parameters include a storage area identifier; the image file is used to be downloaded and installed on a designated server for expansion; the designated server is a server in a different region or a different availability zone; A storage module is used to store the produced image file in a designated object storage server; the storage module is specifically used to: upload the produced image file to the PXE server, so that the PXE server transfers the image file to the designated object storage server, so that the designated object storage server stores the image file; the designated object storage server is an object storage server in the region where the target server is located; The whole machine data includes system disk data and part of data disk data. The production module is specifically used for: Determine the data in the storage area indicated by the storage area identifier in the image making instruction as the data for which the image file needs to be made; The image file is created based on the data for which the image file needs to be created by utilizing the image creation tool.
6. The device according to claim 5, characterized in that The target server is a server in a pre-divided private network VPC; Before downloading the system file including the image creation tool from the pre-execution environment PXE server communicating with the target server, the method further includes: Disconnect from other servers in the VPC.
7. The device according to claim 5, characterized in that The first designated trigger instruction is sent by the management node after receiving a mirroring request for the target server sent by a user based on a corresponding front-end console or a software development kit SDK.
8. A mirror image mounting device, characterized in that: Applied to a designated server, the designated server is a server pre-created in any region, and the server pre-created in any region communicates with the management node; the device includes: A first acquisition module is used to acquire a second system file of a target PXE server that communicates with the designated server after receiving a second designated trigger instruction sent by the management node; wherein the second designated trigger instruction is sent by the management node after receiving a mirror installation request from a user for the designated server; A second running module, used for running the second system file to enter the operating system indicated by the second system file; A second acquisition module is used to acquire the image file stored in the designated storage server under the operating system indicated by the second system file when receiving an installation instruction for the image file of the target server sent by the management node; Installation module, used to install the acquired image file; The designated storage server is an object storage server in the region where the designated server is located, and the image file stored in the designated storage server is a file produced by the method according to any one of claims 1 to 3.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the whole machine image production method described in any one of claims 1 to 3, or the steps of the image installation method described in claim 4 when executing the program stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the whole machine image production method according to any one of claims 1 to 3, or the steps of the image installation method according to claim 4 are implemented.
Citation Information
Patent Citations
Computer data synchronous duplicating method based on PXE
CN101001152A
Automatic server cluster deploying method and device
CN104219099A
Implementation method for enterprise cloud service virtual mirror image management service
CN106603725A
Method of cloud platform to create mirror image, and cloud platform device
CN107888695A
Operating system batch installation method, relevant equipment and system
CN108958742A
