Virtual machine starting method and system, computer equipment and storage medium

Through the scheduling platform, the target host and the virtual machine startup process is optimized, which solves the problem of long-term virtual machine startup process and achieves faster virtual machine startup and migration.

CN119690577APending Publication Date: 2025-03-25BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311246789.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-25
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The virtual machines that are currently charged for the relevant machine take a long time during startup, resulting in the inability to quickly provide data services to users.

Method used

Receive the virtual machine startup instructions through the scheduling platform, determine the appropriate target host, and directly start the virtual machine when the target host is the first host, or migrate the virtual machine to the second host when the target host is the second host and start it.

Benefits of technology

This avoids cold migrations per virtual machine during startup, shortens the startup time of virtual machines, and reduces frequent interactions between hosts, and increases the startup rate of virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690577A_ABST
    Figure CN119690577A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual machine starting method and system, computer equipment and a storage medium. The system comprises the steps that a scheduling platform is used for receiving a starting instruction of a target virtual machine, a target host machine matched with the target virtual machine is determined, and when the target host machine is a first host machine where the target virtual machine is located, the target virtual machine is started on the first host machine; and when the target host machine is the second host machine, migrating the target virtual machine from the first host machine to the second host machine, and starting the target virtual machine on the second host machine. When the target host machine is the first host machine, the target virtual machine can be directly started, and only when the first host machine cannot be used as the target host machine, the target virtual machine is migrated to the second host machine and then started, so that each virtual machine can be prevented from experiencing a cold migration process in a starting process; the time consumed in the starting process of the virtual machine which does not charge during shutdown is shortened, and the problem that the time consumed in the starting process of the existing virtual machine which does not charge during shutdown is long is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual machine startup, and in particular to a virtual machine startup method, system, computer device and storage medium. Background Art

[0002] With the development of the Internet, more and more users access the required data through the Internet. In order to meet the access needs of many users, virtual machines are used to provide data services. The free-to-shutdown virtual machines will be cold migrated during the startup process to achieve the purpose of balancing the host resource allocation. However, the cold migration process takes a long time due to the frequent interactions between the source host and the destination host of the virtual machine. As a result, the startup process of each free-to-shutdown virtual machine takes a long time and cannot be quickly started to provide data services for users. Summary of the invention

[0003] The present application provides a virtual machine startup method, system, computer device and storage medium to solve the problem that the current virtual machine startup process that is free of charge after shutdown takes a long time.

[0004] In a first aspect, the present application provides a virtual machine startup system, the system comprising:

[0005] The scheduling platform is used to allocate a suitable target host machine to the target virtual machine upon receiving a startup instruction of the target virtual machine, and forward the startup instruction and the host machine information of the target host machine to a first host machine carrying the target virtual machine, wherein the target virtual machine is any virtual machine that is free of charge when shut down;

[0006] The first host machine is communicatively connected to the scheduling platform, and is used to start the target virtual machine according to the startup instruction when the target host machine is determined to be the first host machine based on the virtual machine information, or to migrate the virtual machine data of the target virtual machine to the second host machine when the target host machine is determined to be the second host machine based on the virtual machine information, and forward the startup instruction to the second host machine;

[0007] The second host machine is respectively connected to the scheduling platform and the first host machine for communication, and is used to receive the virtual machine data and the startup instruction of the target virtual machine sent by the first host machine, and to start the target virtual machine according to the startup instruction after the migration of the virtual machine data of the target virtual machine is completed.

[0008] In a second aspect, the present application provides a virtual machine startup method, which is applied to a scheduling platform, and the method includes:

[0009] Obtaining a startup instruction, wherein the startup instruction is used to start a target virtual machine located in the first host machine, and the target virtual machine is any virtual machine that is free of charge when shut down;

[0010] Determining a target host machine that supports starting the target virtual machine according to the resource requirements of the target virtual machine and the available resources of each host machine;

[0011] Send the host information of the target host and the startup instruction to the first host, wherein when the host information indicates the first host, the first host executes the startup instruction, or when the host information indicates a second host, the first host migrates the target virtual machine from the first host to the second host, and then the second host executes the startup instruction.

[0012] In a third aspect, the present application provides a method for starting a virtual machine, which is applied to a first host machine, and the method includes:

[0013] Obtaining a startup instruction issued by the scheduling platform and host information of the target host, wherein the startup instruction is used to start the target virtual machine located in the first host;

[0014] When the host machine information indicates that the target host machine is the first host machine, starting the target virtual machine according to the start instruction; or,

[0015] When the host machine information indicates that the target host machine is a second host machine, after sending the virtual machine data of the target virtual machine and the startup instruction to the second host machine, the target virtual machine is started on the second host machine.

[0016] In a fourth aspect, the present application provides a method for starting a virtual machine, which is applied to a second host machine, and the method includes:

[0017] Receiving a startup instruction from the first host machine and virtual machine data of a target virtual machine, and monitoring the migration status of the virtual machine data, wherein the startup instruction is used to start the target virtual machine, and the target virtual machine is any virtual machine that is free of charge when shut down;

[0018] When the migration status is migration completed, the target virtual machine is started according to the start instruction, and the virtual machine status of the target virtual machine is updated.

[0019] In a fifth aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned virtual machine startup method when executing the computer program.

[0020] In a sixth aspect, the present application also provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the above-mentioned virtual machine startup method.

[0021] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the system provided by the embodiment of the present application uses a scheduling platform to receive the startup instruction of the target virtual machine and determines a target host machine that matches the target virtual machine. When the target host machine is the first host machine where the target virtual machine is located, the target virtual machine is started on the first host machine; when the target host machine is not the first host machine where the target virtual machine is located, but the second host machine, the target virtual machine is migrated from the first host machine to the second host machine, and then the target virtual machine is started on the second host machine. The target virtual machine is assigned a suitable target host machine according to the scheduling platform. When the target host machine is the first host machine, it can be directly started and powered on. Only when the first host machine cannot be used as the target host machine, the target virtual machine is migrated to the second host machine and then started. This can avoid that each virtual machine will undergo a cold migration process during the startup process, thereby shortening the startup time of the virtual machine that is free of charge when shutting down. In addition, in the present application, even if the first host machine cannot be used as the target host machine to start the target virtual machine, in the process of migrating the target virtual machine from the first host machine to the second host machine, there is no need for frequent interaction between the first host machine and the second host machine. Therefore, the migration time of the target virtual machine can be shortened, thereby solving the problem that the startup process of the existing virtual machine that is free of charge when shutting down takes a long time. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0023] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0024] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0025] Figure 1 A schematic diagram of the structure of a virtual machine startup system provided in an embodiment of the present application;

[0026] Figure 2A flowchart of a method for starting a virtual machine provided in an embodiment of the present application;

[0027] Figure 3 A flowchart of a method for starting a virtual machine provided in an embodiment of the present application;

[0028] Figure 4 A flowchart of a method for starting a virtual machine provided in an embodiment of the present application;

[0029] Figure 5 A flowchart of a method for starting a virtual machine provided in an embodiment of the present application;

[0030] Figure 6 A flowchart of a method for starting a virtual machine provided in an embodiment of the present application;

[0031] Figure 7 A flowchart of a method for starting a virtual machine provided in an embodiment of the present application;

[0032] Figure 8 A flowchart of a method for starting a virtual machine provided in an embodiment of the present application;

[0033] Fig. 9 A flowchart of a method for starting a virtual machine provided in an embodiment of the present application;

[0034] Fig.10 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0036] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0037] Figure 1 A schematic diagram of the structure of a virtual machine startup system provided in an embodiment of the present application. Figure 1 The virtual machine startup method is applied to a virtual machine startup system. The virtual machine startup system includes:

[0038] The scheduling platform 110 is used to allocate a suitable target host machine to the target virtual machine upon receiving a startup instruction of the target virtual machine, and forward the startup instruction and the host machine information of the target host machine to the first host machine 120 carrying the target virtual machine, wherein the target virtual machine is any virtual machine that is free of charge when shut down.

[0039] Specifically, the scheduling platform 110 is denoted as scheduler, and can be implemented by an independent server or a server cluster composed of multiple servers. The startup instruction can be initiated by a backstage staff through a terminal to the scheduling platform 110, or by a backstage staff through a console (console) calling the communication interface (API) of the scheduling platform 110 to initiate the scheduling platform 110. The terminal can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a laptop computer, etc. In this embodiment, the console initiates a startup instruction to the scheduling platform 110 through a communication interface as an example, such as Figure 2 As shown, the start instruction includes the virtual machine identifier of the target virtual machine, which is used to request to start the target virtual machine located in the first host machine 120, indicating that the current target virtual machine is mounted on the first host machine 120 before starting, that is, the first host machine 120 is the source host machine of the target virtual machine. The scheduling platform 110 will assign a target host machine that matches the target virtual machine according to the start instruction.

[0040] The first host machine 120 is communicatively connected to the scheduling platform 110, and is used to start the target virtual machine according to the startup instruction when the target host machine is determined to be the first host machine 120 based on the virtual machine information, or to migrate the virtual machine data of the target virtual machine to the second host machine 130 when the target host machine is determined to be the second host machine 130 based on the virtual machine information, and forward the startup instruction to the second host machine 130.

[0041] Specifically, Figure 2As shown, the first host machine 120 determines whether the target host machine is the first host machine 120 based on the received host machine information. When the target host machine is the first host machine 120, the first host machine 120 directly starts the target virtual machine located locally, and can quickly start the target virtual machine without going through the cold migration process, thereby shortening the startup time of the target virtual machine, so that the target virtual machine can quickly provide data services to users. When the target host machine is not the first host machine 120 but the second host machine 130, the first host machine 120 migrates the virtual machine data of the target virtual machine to the second host machine 130, and forwards the startup instruction to the second host machine 130, but the virtual machine migration process does not require the first host machine 120 and the second host machine 130 to interact frequently, which can also shorten the migration time of the target virtual machine.

[0042] The second host machine 130 is respectively connected to the scheduling platform 110 and the first host machine 120 for communication, and is used to receive the virtual machine data and the startup instruction of the target virtual machine sent by the first host machine 120, and start the target virtual machine according to the startup instruction after the migration of the virtual machine data of the target virtual machine is completed.

[0043] Specifically, the second host machine 130 and the first host machine 120 are different host machines. When the target host machine is the second host machine 130, the second host machine 130 receives the virtual machine data and the startup instruction of the target virtual machine sent by the first host machine 120, such as Figure 2 As shown, the second host machine 130 responds to the start instruction to start the target virtual machine after the virtual machine data of the target virtual machine is migrated. Since there is no frequent interaction between the first host machine 120 and the second host machine 130 during the migration of the virtual machine data of the target virtual machine from the first host machine 120 to the second host machine 130, the migration time of the virtual machine data is shortened compared to the existing process of frequent interaction between the source host machine and the destination host machine to realize cold migration, thereby improving the startup rate of the target virtual machine to solve the problem that the startup process of the existing virtual machine that is free of charge after shutdown takes a long time.

[0044] In one embodiment, Figure 3 A flowchart of a method for starting a virtual machine in an embodiment is shown in FIG. Figure 3 , provides a virtual machine startup method. This embodiment mainly applies this method to the above Figure 1 Taking the scheduling platform 110 in the example as an example, the virtual machine startup method specifically includes the following steps:

[0045] Step S210, obtaining a startup instruction, wherein the startup instruction is used to start a target virtual machine located in the first host machine 120, and the target virtual machine is any virtual machine that is free of charge when shut down.

[0046] Specifically, the scheduling platform 110 obtains a startup instruction of the target virtual machine from the terminal or console. The target virtual machine is any virtual machine that is free of charge when shut down, indicating that the virtual machine will not generate data service fees when shut down. The target virtual machine is mounted on the first host machine 120 before being started, that is, the first host machine 120 is the source host machine of the target virtual machine.

[0047] Step S220: determining a target host machine that supports starting the target virtual machine according to the resource requirements of the target virtual machine and the available resources of each host machine.

[0048] Specifically, the scheduling platform 110 stores the virtual machine information of each virtual machine, and the virtual machine information includes the virtual machine model, the virtual machine identifier, and the resource requirements. The resource requirements include at least the storage space requirements and the processor occupancy requirements. The processor occupancy requirements are used to indicate the virtual machine's requirements for CPU occupancy. The scheduling platform 110 determines the available resources of each host machine through the host machine information regularly reported by each host machine. The parameters contained in the available resources correspond to the parameters in the resource requirements, so the available resources include at least the available storage space and the available processor occupancy. The host machine whose available resources meet the resource requirements is determined as the target host machine that supports the startup of the target virtual machine.

[0049] Step S230, sending the host information of the target host and the startup instruction to the first host 120, wherein when the host information indicates the first host 120, the first host 120 executes the startup instruction, or when the host information indicates the second host 130, after the first host 120 migrates the target virtual machine from the first host 120 to the second host 130, the second host 130 executes the startup instruction.

[0050] Specifically, when the host information of the target host indicates the first host 120, it means that the first host 120 originally carrying the target virtual machine supports starting the target virtual machine, and there is no need to perform cold migration on the target virtual machine, and the target virtual machine can be directly started on the first host 120, thereby simplifying the virtual machine startup process and accelerating the virtual machine startup efficiency; when the host information of the target host indicates the second host 130, it means that the first host 120 originally carrying the target virtual machine cannot support starting the target virtual machine, and the target virtual machine needs to be migrated to the second host 130 that supports its startup before starting, so the scheduling platform 110 sends The host information of the target host is transmitted to the first host machine 120, and the identity of the target host is determined by the first host machine 120 to decide whether to migrate the target virtual machine. When the target virtual machine needs to be migrated, the virtual machine data of the target virtual machine is migrated to the second host machine 130, and the target virtual machine is started on the second host machine 130 to complete the startup process of the target virtual machine. However, during the migration process of the above-mentioned target virtual machine, there is no need for frequent interaction between the first host machine 120 and the second host machine 130, thereby simplifying the migration process of the virtual machine and shortening the migration time of the virtual machine, thereby solving the problem that the startup process of the existing virtual machine that is free of charge when shut down takes a long time.

[0051] In one embodiment, Figure 4 As shown, the determining of the target host machine supporting the startup of the target virtual machine according to the resource requirements of the target virtual machine and the available resources of each host machine includes:

[0052] Step S221, determining a host machine whose available resources meet the resource requirements of the target virtual machine as a candidate host machine;

[0053] Step S222, when the first host machine 120 exists among the multiple candidate host machines, determine the first host machine 120 as the target host machine; or,

[0054] Step S223: when the first host machine 120 does not exist in the plurality of candidate host machines, determine the target host machine from the plurality of candidate host machines.

[0055] Specifically, a host machine whose available resources meet the resource requirements of the target virtual machine is determined as a candidate host machine. If the first host machine 120 exists among multiple candidate host machines, it means that the available resources of the first host machine 120 also meet the resource requirements of the target virtual machine. In this case, the first host machine 120 is directly selected as the target host machine. The startup instruction can be directly executed on the first host machine 120 to start the target virtual machine without the need to migrate the target virtual machine, thereby simplifying the startup process of the virtual machine.

[0056] If the first host machine 120 does not exist among the multiple candidate host machines, it means that the available resources of the first host machine 120 do not meet the resource requirements of the target virtual machine, and any one of the multiple candidate host machines can be selected as the target host machine.

[0057] In one embodiment, Figure 5 As shown, when the first host machine 120 does not exist in the plurality of candidate host machines, determining the target host machine from the plurality of candidate host machines includes:

[0058] Step S2231: when the first host machine 120 does not exist among the multiple candidate host machines, the candidate host machine with the most available resources is determined as the target host machine.

[0059] Specifically, when the available resources of the first host machine 120 do not meet the resource requirements of the target virtual machine, the candidate host machine with the most available resources is selected from multiple candidate host machines as the target host machine. The candidate host machine with the most available resources is the host machine with the least load and meets the resource requirements of the target virtual machine. Selecting the candidate host machine with the most available resources as the target host machine can balance the load on different host machines and avoid unbalanced load on each host machine due to some host machines being overloaded and some host machines being underloaded.

[0060] In one embodiment, Figure 6 As shown, a virtual machine startup method is provided, which is applied to a first host machine 120, and the method includes:

[0061] Step S310 , obtaining a start instruction issued by the scheduling platform 110 and host information of the target host machine, wherein the start instruction is used to start the target virtual machine located in the first host machine 120 .

[0062] Specifically, the host information of the target host includes at least the host identifier of the target host and the communication address of the target host. The first host 120 determines whether the target host is the first host 120 according to the host identifier in the host information, thereby deciding whether to execute the startup instruction.

[0063] Step S320, when the host information indicates that the target host is the first host 120, start the target virtual machine according to the start instruction; or,

[0064] Step S330 , when the host information indicates that the target host is the second host 130 , after sending the virtual machine data of the target virtual machine and the startup instruction to the second host 130 , the target virtual machine is started on the second host 130 .

[0065] Specifically, when the host machine identifier in the host machine information is the same as the host machine identifier of the first host machine 120, it indicates that the target host machine is the first host machine 120. Then, the first host machine 120 directly starts the target virtual machine it carries without migrating the target virtual machine, thereby simplifying the virtual machine startup process.

[0066] When the host identifier in the host information is different from the host identifier of the first host 120 and indicates the second host 130, it means that the target host is not the first host 120, and the first host 120 cannot support the startup of the target virtual machine it carries. The first host 120 sends the virtual machine data and startup instructions of the target virtual machine to the second host 130 according to the communication address in the host information, and starts the target virtual machine on the second host 130. However, the target virtual machine does not require frequent interaction between the first host 120 and the second host 130 during the migration process. Therefore, compared with the existing frequent interaction between the source host and the destination host to realize the cold migration process, the migration time of the virtual machine data is shortened, thereby improving the startup rate of the target virtual machine, so as to solve the problem that the startup process of the existing virtual machine that is free of charge when shut down takes a long time.

[0067] In one embodiment, Figure 7 As shown, when the host information indicates that the target host is the second host 130, sending the virtual machine data of the target virtual machine and the startup instruction to the second host 130 includes:

[0068] Step S331, when the host information indicates that the target host is the second host 130, migrating the configuration data of the target virtual machine from the first host 120 to the second host 130;

[0069] Step S332, obtaining the file storage type of the target virtual machine;

[0070] Step S333, when the file storage type of the target virtual machine is local storage, the storage file corresponding to the target virtual machine in the local memory of the first host machine 120 is migrated to the second host machine 130 through the intermediate database, wherein the virtual machine data includes the configuration data and the storage file; or

[0071] Step S334 , when the file storage type of the target virtual machine is cloud disk storage, redirect and mount the cloud disk storage interface corresponding to the target virtual machine from the first host machine 120 to the second host machine 130 .

[0072] Specifically, the virtual machine data at least includes configuration data and storage files. The configuration data contains basic parameters to ensure the normal operation of the virtual machine. The storage files are used to indicate the data resources used by the virtual machine to provide data services. The configuration data is usually stored in the host machine on which the virtual machine is mounted, and the storage files can be stored in the host machine on which the virtual machine is mounted, or in a cloud disk. Therefore, when migrating the virtual machine data of the target virtual machine, the configuration data of the target virtual machine is first migrated from the first host machine 120 to the second host machine 130, and then the migration method of the storage files of the target virtual machine is determined according to the file storage type of the target virtual machine. The file storage type is local storage or cloud disk storage. When the file storage type of the target virtual machine is local storage, it means that the storage files of the target virtual machine are stored in the local memory of the first host machine 120. At this time, the storage files corresponding to the target virtual machine are copied to the intermediate database, and then the storage files are copied from the intermediate database to the second host machine 130, thereby completing the migration of the storage files.

[0073] When the file storage type of the target virtual machine is cloud disk storage, it means that the storage files of the target virtual machine are stored in the cloud disk. You only need to redirect and mount the cloud disk storage interface corresponding to the target virtual machine from the first host machine 120 to the second host machine 130, so that the second host machine 130 can access the storage files corresponding to the target virtual machine through the cloud disk storage interface corresponding to the target virtual machine.

[0074] In one embodiment, Figure 8 As shown, when the host information indicates that the target host is the second host 130, after sending the virtual machine data of the target virtual machine and the startup instruction to the second host 130, the method further includes:

[0075] Step S340, obtaining the migration status of the virtual machine data of the target virtual machine and the virtual machine status of the target virtual machine;

[0076] Step S350, when the migration status is completed and the virtual machine status is turned on within a preset time after the migration is completed, clear the virtual machine data of the target virtual machine in the local memory of the first host machine 120; or,

[0077] Step S360 , when the migration status is completed and the virtual machine status is in a shutdown state within a preset time after the migration is completed, the virtual machine data of the target virtual machine is rolled back to the first host machine 120 .

[0078] Specifically, after the first host machine 120 transfers the virtual machine data of the target virtual machine to the second host machine 130, the first host machine 120 monitors the migration status of the virtual machine data of the target virtual machine and the virtual machine status of the target virtual machine. The migration status is migrating or migration completed, and the virtual machine status is powered on or powered off. When the migration status is migration completed, it means that the target virtual machine has been completely migrated to the second host machine 130. Then, based on the virtual machine status within the preset time after the migration is completed, it is judged whether the second host machine 130 supports the successful startup of the target virtual machine. If the virtual machine status is powered on within the preset time after the migration is completed, it means that the target virtual machine is successfully started on the second host machine 130. Then, the virtual machine data of the target virtual machine in the first host machine 120 can be cleared, thereby releasing part of the processor resources and part of the storage space of the first host machine 120, so that the first host machine 120 can continue to carry other virtual machine loads.

[0079] If the virtual machine state is in the shutdown state within a preset time after the migration is completed, it means that the target virtual machine fails to start on the second host machine 130. The first host machine 120 rolls back the virtual machine data of the target virtual machine, thereby achieving the normal instance being restored even if the target virtual machine fails to start.

[0080] In one embodiment, Fig. 9 As shown, a virtual machine startup method is provided, which is applied to the second host machine 130, and the method includes:

[0081] Step S410, receiving a startup instruction from the first host machine 120 and virtual machine data of a target virtual machine, and monitoring the migration status of the virtual machine data, wherein the startup instruction is used to start the target virtual machine, and the target virtual machine is any virtual machine that is free of charge when shut down.

[0082] Specifically, when the second host machine 130 receives the startup instruction and the virtual machine data of the target virtual machine sent by the first host machine 120, it indicates that the first host machine 120 that originally carried the target virtual machine cannot support the startup of the target virtual machine, and the available resources of the second host machine 130 meet the resource requirements of the target virtual machine. In this case, the target virtual machine needs to be migrated from the first host machine 120 to the second host machine 130 before being started. The virtual machine data of the target virtual machine includes configuration data and storage files. When the storage files of the target virtual machine are stored in the first host machine 120, the first host machine 120 will copy the storage files of the target virtual machine to the intermediate database, and the second host machine 130 will then copy and obtain the storage files of the target virtual machine from the intermediate database; when the storage files of the target virtual machine are stored in the cloud disk, the second host machine 130 will access the cloud disk 1 through the cloud disk storage interface corresponding to the target virtual machine to obtain the storage files corresponding to the target virtual machine.

[0083] Step S420: When the migration status is migration completed, start the target virtual machine according to the start instruction, and update the virtual machine status of the target virtual machine.

[0084] Specifically, when the second host machine 130 detects that the migration status is completed, it starts the target virtual machine according to the startup instruction, and updates the virtual machine status of the target virtual machine according to the startup result. If the startup is successful, the virtual machine status of the target virtual machine is updated to the power-on state, and if the startup fails, the virtual machine status of the target virtual machine is kept in the power-off state. Even if the first host machine 120 cannot start the target virtual machine as the target host machine, in the process of migrating the target virtual machine from the first host machine 120 to the second host machine 130, there is no need for frequent interaction between the first host machine 120 and the second host machine 130, so the migration time of the target virtual machine can be shortened, thereby solving the problem that the startup process of the existing virtual machine that is free of charge is time-consuming.

[0085] Figure 3-9 FIG. 1 is a flow chart of a method for starting a virtual machine in one embodiment. It should be understood that although Figure 3-9 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 3-9 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0086] like Fig.10 As shown, an embodiment of the present application provides a computer device, including a processor 711, a communication interface 712, a memory 713 and a communication bus 714, wherein the processor 711, the communication interface 712, and the memory 713 communicate with each other through the communication bus 714;

[0087] Memory 713, used for storing computer programs;

[0088] The processor 711 is used to implement the virtual machine startup method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 713.

[0089] Those skilled in the art will understand that Fig.10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0090] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the virtual machine startup method provided in any of the aforementioned method embodiments are implemented.

[0091] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0092] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0093] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0094] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A virtual machine startup system, characterized in that: The system comprises: The scheduling platform is used to allocate a suitable target host machine to the target virtual machine upon receiving a startup instruction of the target virtual machine, and forward the startup instruction and the host machine information of the target host machine to a first host machine carrying the target virtual machine, wherein the target virtual machine is any virtual machine that is free of charge when shut down; The first host machine is communicatively connected to the scheduling platform, and is used to start the target virtual machine according to the startup instruction when the target host machine is determined to be the first host machine based on the virtual machine information, or to migrate the virtual machine data of the target virtual machine to the second host machine when the target host machine is determined to be the second host machine based on the virtual machine information, and forward the startup instruction to the second host machine; The second host machine is respectively connected to the scheduling platform and the first host machine for communication, and is used to receive the virtual machine data and the startup instruction of the target virtual machine sent by the first host machine, and to start the target virtual machine according to the startup instruction after the migration of the virtual machine data of the target virtual machine is completed.

2. A method for starting a virtual machine, characterized in that: Applied to a scheduling platform, the method includes: Obtaining a startup instruction, wherein the startup instruction is used to start a target virtual machine located in the first host machine, and the target virtual machine is any virtual machine that is free of charge when shut down; Determining a target host machine that supports starting the target virtual machine according to the resource requirements of the target virtual machine and the available resources of each host machine; Send the host information of the target host and the startup instruction to the first host, wherein when the host information indicates the first host, the first host executes the startup instruction, or when the host information indicates a second host, the first host migrates the target virtual machine from the first host to the second host, and then the second host executes the startup instruction.

3. The method according to claim 2, characterized in that The step of determining a target host machine that supports starting the target virtual machine according to the resource requirements of the target virtual machine and the available resources of each host machine includes: Determine a host machine whose available resources meet the resource requirements of the target virtual machine as a candidate host machine; When the first host machine exists among multiple candidate host machines, determining the first host machine as the target host machine; or, When the first host machine does not exist among the multiple candidate host machines, the target host machine is determined among the multiple candidate host machines.

4. The method according to claim 3, characterized in that When the first host machine does not exist among the multiple candidate host machines, determining the target host machine among the multiple candidate host machines includes: When the first host machine does not exist among multiple candidate host machines, the candidate host machine with the most available resources is determined as the target host machine.

5. A method for starting a virtual machine, characterized in that: Applied to a first host machine, the method includes: Obtaining a startup instruction issued by the scheduling platform and host information of the target host, wherein the startup instruction is used to start the target virtual machine located in the first host; When the host machine information indicates that the target host machine is the first host machine, starting the target virtual machine according to the start instruction; or, When the host machine information indicates that the target host machine is a second host machine, after sending the virtual machine data of the target virtual machine and the startup instruction to the second host machine, the target virtual machine is started on the second host machine.

6. The method according to claim 5, characterized in that When the host machine information indicates that the target host machine is a second host machine, sending the virtual machine data of the target virtual machine and the startup instruction to the second host machine includes: When the host machine information indicates that the target host machine is a second host machine, migrating the configuration data of the target virtual machine from the first host machine to the second host machine; Obtaining the file storage type of the target virtual machine; When the file storage type of the target virtual machine is local storage, the storage file corresponding to the target virtual machine in the local memory of the first host machine is migrated to the second host machine through the intermediate database, wherein the virtual machine data includes the configuration data and the storage file; or When the file storage type of the target virtual machine is cloud disk storage, the cloud disk storage interface corresponding to the target virtual machine is redirected and mounted from the first host machine to the second host machine.

7. The method according to claim 5, characterized in that When the host information indicates that the target host is a second host, after sending the virtual machine data of the target virtual machine and the startup instruction to the second host, the method further includes: Acquire the migration status of the virtual machine data of the target virtual machine and the virtual machine status of the target virtual machine; When the migration status is completed and the virtual machine status is powered on within a preset time after the migration is completed, clearing the virtual machine data of the target virtual machine in the local memory of the first host machine; or, When the migration status is migration completion and the virtual machine status is a shutdown status within a preset time after the migration is completed, the virtual machine data of the target virtual machine is rolled back to the first host machine.

8. A method for starting a virtual machine, characterized in that: Applied to the second host machine, the method includes: Receiving a startup instruction from the first host machine and virtual machine data of a target virtual machine, and monitoring the migration status of the virtual machine data, wherein the startup instruction is used to start the target virtual machine, and the target virtual machine is any virtual machine that is free of charge when shut down; When the migration status is migration completed, the target virtual machine is started according to the start instruction, and the virtual machine status of the target virtual machine is updated.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 2 to 8 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 2 to 8 are implemented.