Virtual Machine Management Method and Device

By determining the attribute information of the target virtual machine during the peak computing period of the cloud computing platform, storing its computing status and deleting the virtual machine, the problem of virtual machine deletion resulting in failure of computing service is solved, realizing the state saving and subsequent recovery of the virtual machine, and improving the processing efficiency of computing tasks.

CN114546601BActive Publication Date: 2025-05-27ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210265174.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-17
Publication Date
2025-05-27
Estimated Expiration
2042-03-17

AI Technical Summary

Technical Problem

During the peak computing period of cloud computing platforms, the host needs to release computing resources, resulting in the virtual machine being deleted, which in turn causes the computing service to fail to execute. How to save its computing status when deleting the virtual machine for subsequent recovery?

Method used

By determining the current running status of the host, after meeting the preset status conditions, determine the attribute information of the target virtual machine, store its computing status information and delete the virtual machine to free up computing resources.

Benefits of technology

It realizes saving the computing status of the virtual machine during peak computing periods, avoiding the failure of computing services, and restoring the virtual machine during the idle computing period, improving the processing efficiency of computing tasks and avoiding waste of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114546601B_ABST
    Figure CN114546601B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a virtual machine management method and apparatus. The virtual machine management method includes: determining the current running state of a host machine, and when the current running state meets a first preset state condition, determining the virtual machines currently running in the host machine and the attribute information of the currently running virtual machines; determining the virtual machines whose attribute information meets a preset processing condition as target virtual machines; storing the computing state information of the target virtual machines, and deleting the target virtual machines in the host machine. Thus, the computing state of the virtual machines is saved, which is convenient for subsequent recovery of the virtual machines and further ensures the normal execution of computing services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technologies, and particularly to a virtual machine management method. Background Art

[0002] With the continuous popularization of cloud computing and the continuous increase in high-performance computing scenarios, more and more customer requirements are to utilize the idle computing resources (such as virtual machines) of cloud computing for computing services when the host of cloud computing is in the computing idle period. And with the continuous increase in the amount of data, it will cause the host to require more computing resources during the computing peak period. Therefore, it is necessary to delete the virtual machines running on the host to release the computing resources of the host and improve the computing efficiency of the host.

[0003] However, deleting the virtual machines in the host will cause the execution of the customer's computing services to fail. Therefore, in the process of deleting the virtual machines, how to save the computing state of the virtual machines to facilitate the subsequent recovery of the virtual machines during the computing idle period and ensure the normal execution of the computing services has become a problem to be solved. Summary of the Invention

[0004] In view of this, the embodiments of this specification provide a virtual machine management method. One or more embodiments of this specification also relate to a virtual machine management device, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in the prior art.

[0005] According to the first aspect of the embodiments of this specification, a virtual machine management method is provided, including:

[0006] Determine the current running state of the host, and when the current running state meets the first preset state condition, determine the virtual machines currently running in the host and the attribute information of the currently running virtual machines;

[0007] Determine the virtual machines whose attribute information meets the preset processing conditions as target virtual machines;

[0008] Store the computing state information of the target virtual machines and delete the target virtual machines in the host.

[0009] According to the second aspect of the embodiments of this specification, a virtual machine management device is provided, including:

[0010] A first determination module, configured to determine the current running state of the host, and when the current running state meets the first preset state condition, determine the virtual machines currently running in the host and the attribute information of the currently running virtual machines;

[0011] A second determination module, configured to determine a virtual machine whose attribute information meets a preset processing condition as a target virtual machine;

[0012] A deletion module, configured to store the computing state information of the target virtual machine and delete the target virtual machine in the host machine.

[0013] According to a third aspect of the embodiments of the present specification, there is provided a computing device, including:

[0014] A memory and a processor;

[0015] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the virtual machine management method are implemented.

[0016] According to a fourth aspect of the embodiments of the present specification, there is provided a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the steps of the virtual machine management method are implemented.

[0017] According to a fifth aspect of the embodiments of the present specification, there is provided a computer program. When the computer program is executed on a computer, the computer is made to execute the steps of the virtual machine management method.

[0018] The virtual machine management method provided in this specification includes: determining the current running state of the host machine, and when the current running state meets a first preset state condition, determining the virtual machines currently running in the host machine and the attribute information of the currently running virtual machines; determining a virtual machine whose attribute information meets a preset processing condition as a target virtual machine; storing the computing state information of the target virtual machine and deleting the target virtual machine in the host machine.

[0019] Specifically, when the current running state of the host machine meets the first preset state condition, the virtual machine management method can determine a target virtual machine whose attribute information meets the preset processing condition in the host machine, store the computing state information of the target virtual machine, and then delete the target virtual machine, thereby realizing the preservation of the computing state of the virtual machine, facilitating the subsequent recovery of the virtual machine, and further ensuring the normal execution of the computing service. Description of the Drawings

[0020] Figure 1 is an application scenario diagram of a virtual machine management method provided by an embodiment of this specification;

[0021] Figure 2 is a flowchart of a virtual machine management method provided by an embodiment of this specification;

[0022] Figure 3 It is a flowchart of the processing procedure of a virtual machine management method provided by an embodiment of this specification;

[0023] Figure 4 It is a schematic structural diagram of a virtual machine management device provided by an embodiment of this specification;

[0024] Figure 5 It is a structural block diagram of a computing device provided by an embodiment of this specification. Detailed implementation manners

[0025] Many specific details are set forth in the following description in order to provide a thorough understanding of this specification. However, this specification can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the connotation of this specification. Therefore, this specification is not limited by the specific implementations disclosed below.

[0026] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a", "the", and "said" used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more of the associated listed items.

[0027] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0028] First, the noun terms related to one or more embodiments of this specification are explained.

[0029] Cloud server: It is a computing service that is simple, efficient, secure, reliable, and whose processing capacity can be elastically scaled.

[0030] Operating system: It is a computer program that manages computer hardware and software resources and is also the kernel and cornerstone of a computer system.

[0031] System configuration: It refers to some configurations related to the operating system that can be accessed by users and includes networking, security, storage, etc.

[0032] Linux operating system: Linux is a free-to-use and freely distributable Unix-like operating system, which is a multi-user, multi-tasking, multi-threaded and multi-CPU (Central Processing Unit) operating system based on POSIX (Portable Operating System Interface) and Unix (an operating system).

[0033] Access permission: It is a mechanism that restricts access to certain information items or certain controls based on the identity of users and their memberships in various predefined groups.

[0034] HPC: High Performance Computing Cluster.

[0035] Object Storage Service: Object Storage Service (OSS) is a massive, secure, low-cost and highly reliable cloud storage service, suitable for storing any type of files. Its capacity and processing power can be elastically expanded, and multiple storage types are available for selection to comprehensively optimize storage costs.

[0036] Memory snapshot: It is an instant copy of the virtual machine's memory at a certain point.

[0037] Libvirt Save&Restore: It is a technology used to save the memory state of a running virtual machine to a file, and subsequently, the computing state of the virtual machine can be restored through this file.

[0038] Cloud disk: A professional Internet storage tool, which is a product of Internet cloud technology. It provides services such as information storage, reading, and downloading for enterprises and individuals through the Internet.

[0039] Region: It refers to a large divided area. For example: North China Region, East China Region 3, Frankfurt Region, East China Region 1, etc. This Region represents the physical location of the OSS data center. Users can choose a suitable region to create a Bucket (in the OSS scenario, the storage space used by users to manage the stored objects) based on factors such as cost and request source. Generally speaking, the closer the Region is to the user, the faster the access speed.

[0040] NTP service: It is a protocol used to synchronize computer time.

[0041] With the continuous popularization of cloud computing and the increasing number of high-performance computing user scenarios, many customers can complete various types of computing tasks based on cloud computing technology. Such computing tasks include, but are not limited to, the training of neural network models, big data retrieval, etc. In an embodiment provided in this specification, the price of the computing resources of this cloud computing can be flexibly adjusted according to the needs of customers. For example, when the computing resources in a certain period are purchased by more users, the price of the computing resources in this period (computing peak period) will be relatively high. When the computing resources in a certain period are purchased by fewer users, the price of the computing resources in this period (computing idle period) will be relatively low. And more and more customers, considering the cost of a single computing task, demand to utilize the idle computing resources of cloud computing to perform computing services (execute computing tasks) when the host in the cloud computing is in the computing idle period, so as to reduce their computing costs. Among them, the computing task is a batch-level computing task, that is, a computing service that processes a large amount of data operations in a single batch. For example, it could be the derivation of a model (training of a neural network module) in some AI calculations, or big data analysis, etc.

[0042] Among them, the derivation of the model is a gradually converging process. This computing task needs to improve the accuracy rate of the model to 90% or above 95%. During this process, a large amount of time and a large amount of computing resources are required to analyze a large number of pictures to obtain a result. For example, a converged model.

[0043] Among them, this big data analysis, that is, massive data analysis, these data analyses are also single-batch computing tasks. This computing task requires a unified result, that is, a statistical computing result. Both this result and the result of the above module derivation are single-annotation single-conclusion.

[0044] However, with the continuous increase in the amount of data, the computing time consumption of the host in cloud computing is also increasing. In the scenario of elastic cloud computing, when the cloud computing platform reaches the computing peak period, but the computing tasks in the computing idle period are not completed, it may cause the need to use more computing resources for operation during the computing peak period, thus increasing the cost of cloud computing.

[0045] Based on this, the virtual machine management method provided in this specification can be applied to a cloud computing platform. This cloud computing platform performs various calculations based on a high-performance computing cluster (HPC). In the case where the cloud computing platform is at the peak of computing, the virtual machine that is currently executing a computing task is deleted. And during the process of deleting this virtual machine, the computing state of this virtual machine is saved, so that in the case of the computing idle period subsequently, the virtual machine running in the host can be restored based on this computing state, ensuring that the virtual machine can complete the user's computing task, avoiding recalculation of the computing task when deleting the virtual machine, avoiding waste of computing resources, and improving the processing efficiency of the computing task. Moreover, the virtual machine management method provided in this specification saves the computing state of the virtual machine during the process of deleting the virtual machine at the computer level, and restores the virtual machine based on this computing state, so as to achieve the purpose of continuing the calculation. Thus, it is ensured that the user is unaware of the process of deleting the virtual machine during the execution of the computing service.

[0046] Specifically, in this specification, a virtual machine management method is provided. This specification also relates to a virtual machine management device, a computing device, a computer-readable storage medium, and a computer program, which will be described in detail one by one in the following embodiments.

[0047] See Figure 1 , Figure 1 is an application scenario diagram of a virtual machine management method provided by an embodiment of this specification. Among them, the virtual machine management method provided in this specification can be applied to a cloud computing scenario. Based on this, this virtual machine can be used to execute a specific computing service in the cloud computing platform, and this virtual machine runs on a host. When the control system of the cloud computing platform determines that the current running state of this host meets the first preset state condition, it determines the virtual machines currently running in this host and the attribute information of this currently running virtual machine. Among the virtual machines currently running in the host, the virtual machine whose attribute information meets the preset processing condition is determined as the target virtual machine, and the computing state information of this target virtual machine is stored in the information storage module, and the target virtual machine in this host is deleted. Thus, the computing resources and memory resources of the host are released, and the cost of the cloud computing platform is reduced. At the same time, when the control system of the cloud computing platform determines that the current running state of this host meets the second preset state condition, it obtains the previously saved computing state information of this target virtual machine from the information storage module, and restores the target virtual machine in the host based on this computing state information. Thus, the purpose of continuing to execute the computing service is achieved, avoiding the problem that the computing service needs to be recalculated due to the deletion of the virtual machine, improving the operation efficiency of the computing service, and avoiding waste of computer resources.

[0048] Figure 2The figure shows a flowchart of a virtual machine management method provided according to an embodiment of this specification, which specifically includes the following steps.

[0049] Step 202: Determine the current running state of the host machine, and when the current running state meets the first preset state condition, determine the virtual machines currently running in the host machine and the attribute information of the currently running virtual machines.

[0050] In practical applications, the virtual machine management method provided in this specification can be applied to the cloud computing scenario. Among them, the virtual machine can be understood as a cloud server or a cloud server host in the cloud computing platform that can process users' computing tasks. Correspondingly, the host machine can be understood as a physical machine that can support the operation of the virtual machine. That is to say, the cloud computing platform is the embodiment of the computing power of the host machine, and the host machine in the cloud computing platform is the sum of the computing power of the cloud computing platform. The current state information of the host machine can be understood as the information characterizing the current running state of the host machine. For example, the current state information can be the current idle computing resources of the host machine. Or the current state information can be the current time of the host machine.

[0051] Correspondingly, the first preset state condition can be understood as the condition for determining whether the host machine is currently in the peak computing state, and the first preset state condition can be set according to the actual application scenario. For example, when the current running state information is the current idle computing resources of the host machine, the meeting of the first preset state condition can be understood as that the idle computing resources are less than the first preset resource threshold. Among them, the first preset resource threshold can be set according to the actual application scenario. For example, when the first preset resource threshold is 10%, the meeting of the first preset state condition can be that the current idle computing resources of the host machine are less than 10%. Another example is when the current running state information is the current time of the host machine, the meeting of the first preset state condition can be understood as whether the current time is in the computing peak period, that is, the period when computing resources are purchased by more users.

[0052] Or, the first preset state condition can be understood as the condition for determining whether the host machine is currently in the idle computing state. In practical applications, when the cloud computing platform reaches the computing idle period, but the computing tasks in the computing peak period are not completed, it may cause the need to continue to operate the uncompleted computing tasks in the computing peak period during the computing idle period, thereby occupying a certain amount of computing resources in the computing idle period and resulting in the inability to normally complete the tasks in the computing idle period. Therefore. For example, when the current running state information is the current time of the host machine, the meeting of the first preset state condition can be understood as whether the current time is in the computing idle period, that is, the period when computing resources are purchased by fewer users.

[0053] Among them, the attribute information of the virtual machine can be understood as characterizing whether the virtual machine supports data backup technology, and / or characterizing the type of data backup technology supported by the virtual machine. Among them, the data backup technology can be understood as a technology for backing up the computing state of the virtual machine so as to facilitate subsequent restoration of the virtual machine based on the backed-up computing state. For example, the data backup technology can be the Libvirt Save&Restore technology. The type of data backup technology can be understood as the type of the data backup technology. In practical applications, a virtual machine may not be configured with different data backup technologies; however, not all data backup technologies can implement backing up the computing state of the virtual machine and restoring the virtual machine based on the backed-up computing state.

[0054] In practical applications, the virtual machine management method provided in this specification can be applied to a virtual machine control system, which can be understood as a platform configured in the host of a cloud computing platform and capable of managing virtual machines in the cloud computing platform. Specifically, the control system can determine the current running state of the host, and when the current running state meets the first preset state condition, it can determine each virtual machine currently running in the host and determine the corresponding attribute information of each virtual machine.

[0055] Next, taking the application of the virtual machine management method provided in this specification in the scenario of resuming interrupted calculations for cloud servers as an example, a further description is given of determining the virtual machines currently running in the host and their attribute information when the current running state of the host meets the first preset state condition. Among them, the virtual machine is a cloud server of the cloud computing platform, and the virtual machine is implemented based on the host; the current running state is the current time of the host; the attribute information of the virtual machine can be the type of data backup technology supported by the virtual machine.

[0056] Based on this, the control system of the cloud computing platform monitors the current time of the host to obtain the current time of the host in real time. When it is determined that the current time is in the computing peak period, the cloud computing platform determines all the cloud servers currently running in the cloud computing platform and performs a shutdown operation on the specified cloud server. During the execution of this shutdown operation, the control system needs to determine the data backup technology supported by the cloud servers created in the cloud computing platform.

[0057] Alternatively, when the cloud computing platform determines that the current time is in the computing idle period, the cloud computing platform determines all the cloud servers currently running in the cloud computing platform and performs a shutdown operation on the specified cloud server. During the execution of this shutdown operation, the control system needs to determine the data backup technology supported by the cloud servers created in the cloud computing platform.

[0058] In the embodiments provided in this specification, due to the continuous upgrading of technology, in order to improve the performance of virtual machines, the cloud computing platform will configure data backup technology for the newly created virtual machines. However, there may be a situation where the historically created cloud servers do not support the data backup technology. Based on this, in the virtual machine management method provided in this specification, when the control system determines that the current time of the host is during the computing peak period, it will determine the currently running virtual machines and obtain information indicating whether the virtual machines support the resume technology. Subsequently, based on this information, it will determine whether the virtual machines support the resume technology; that is, it will determine whether the virtual machines can perform data backup and recover based on the backed-up data.

[0059] In addition, since the cloud computing platform will configure data backup technology for the newly created virtual machines, and for the cloud servers that are not created for the first time, it is more likely that they are not configured with the resume technology. Therefore, for the cloud servers that are not created for the first time, it is necessary to obtain the information indicating whether they support the resume technology. This is used to subsequently determine whether the cloud servers support the resume technology.

[0060] Step 204: Determine the virtual machines whose attribute information meets the preset processing conditions as the target virtual machines.

[0061] Among them, when the attribute information of the virtual machine can indicate whether the virtual machine supports the data backup technology, this meeting the preset processing conditions can be understood as determining that the virtual machine supports the data backup technology; when the attribute information of the virtual machine is the type of data backup technology supported by the virtual machine, this meeting the preset processing conditions can be understood as the data backup technology supported by the virtual machine being a specific type of data backup technology; among them, this specific type of data backup technology can be set according to the actual application scenario. For example, this specific type of data backup technology can be the Libvirt Save&Restore technology, the Restore&Save technology (data recovery and storage technology).

[0062] Among them, the target virtual machine can be understood as the virtual machine that is currently running in the host and meets the preset processing conditions. For example, the target virtual machine can be understood as the virtual machine that supports the data backup technology and the type of the backed-up data is a specific type.

[0063] Continuing with the above example, after determining the information indicating whether the cloud server supports the resume technology and / or determining the type of data backup technology supported by the cloud server, the cloud server that supports the resume technology and the type of data backup technology supported is the Restore&Save technology is determined as the target cloud server (i.e., the target virtual machine) to be deleted.

[0064] Step 206: Store the computing status information of the target virtual machine and delete the target virtual machine in the host machine.

[0065] Among them, the computing status information can be understood as the information of the current computing status of the virtual machine. For example, the memory snapshot of the virtual machine, the memory status information of the virtual machine, etc.

[0066] Specifically, after the control system determines the target virtual machine from the virtual machines currently running on the host machine, it can determine the computing status information of the target virtual machine and store the computing status information; and after completing the storage of the computing status information, delete the virtual machine currently running on the host machine. Thereby releasing the computing resources of the host machine.

[0067] Continuing with the above example, in the case of determining the target cloud server that supports breakpoint continuation calculation and uses the data backup technology of Restore&Save technology from the cloud service, obtain the memory snapshot of the cloud server based on the Restore&Save technology and store the memory snapshot; when the storage of the memory snapshot is completed, destroy the cloud server, thereby returning CPU resources, memory resources, etc.

[0068] The virtual machine management method provided in this specification can, under the condition of the first preset state condition of the current running state of the host machine, determine the target virtual machine whose attribute information meets the preset processing conditions in the host machine, and after storing the computing status information of the target virtual machine, delete the target virtual machine, thereby realizing the preservation of the computing status of the virtual machine, facilitating the subsequent restoration of the virtual machine, and further ensuring the normal execution of the computing service.

[0069] In the embodiments of this specification, in order to improve the security and stability of the breakpoint continuation calculation of the cloud server, the cloud provider (i.e., the cloud computing platform) can use the object storage service as the storage medium for saving (i.e., restoring the computing status of the cloud server) and restoring (i.e., saving the computing status of the cloud server) of the cloud server. Or, the cloud provider (i.e., the cloud computing platform) can use the cloud disk as the storage medium for saving and restoring the cloud server. The specific implementation method is as follows.

[0070] The storing the computing status information of the target virtual machine includes:

[0071] Determine the computing status information of the target virtual machine and store the computing status information in the information storage module.

[0072] Among them, the information storage module can be understood as a module for storing the computing state information. For example, the information storage module can be an object storage medium in an object storage service for storing data such as the computing state and memory snapshots of a cloud server. Alternatively, the information storage module can be a cloud disk.

[0073] Specifically, after the control system determines the target virtual machine from the virtual machines currently running on the host, it can obtain the computing state information of the target virtual machine and store the computing state information in the information storage module.

[0074] Furthermore, in an embodiment provided in this specification, in order to facilitate accurately determining the corresponding computing state information from the information storage module during the subsequent recovery of the target virtual machine, an information storage unit corresponding to the target virtual machine can be created in the information storage module, and the computing state data of the target virtual machine can be stored based on this information storage unit, thereby improving the efficiency of obtaining the computing state data and further improving the recovery efficiency of the target virtual machine. The specific implementation method is as follows.

[0075] Obtaining the computing state information of the target virtual machine and storing the computing state information in the information storage module includes:

[0076] Creating an information storage unit corresponding to the target virtual machine in the information storage module;

[0077] Obtaining the computing state information of the target virtual machine and storing the computing state information in the information storage unit.

[0078] Among them, the information storage unit can be understood as a unit created in the information storage module and used for storing the computing state information of the target virtual machine. For example, the information storage unit can be a memory file created in an object storage (object storage service) and corresponding to the cloud server, and this memory file is used for storing the memory snapshot of the cloud server. Alternatively, the information storage unit can be a memory file created in the cloud disk and corresponding to the cloud server.

[0079] Continuing with the above example, after the control system determines the cloud server to be deleted, for a cloud server that supports checkpoint restart and whose data backup technology is the Restore&Save technology, a memory file A corresponding to the cloud server is created on the object storage, and this memory file A is used to store the memory snapshot saved by the cloud server during the checkpoint restart process.

[0080] After completing the creation of this memory file, the memory information, memory snapshot, and Meta information (metadata) of the cloud server are saved to the memory file A in the object storage.

[0081] Further, in practical applications, when it is determined that the current time is in the peak calculation period, the cloud computing platform determines all the cloud servers currently running in the cloud computing platform and performs a shutdown operation on the specified cloud server. During the execution of this shutdown operation, the control system needs to determine the data backup technology supported by the cloud servers created in the cloud computing platform, and directly delete the cloud servers that do not support the use of the data backup technology without performing data backup operations. The specific implementation method is as follows.

[0082] After determining the virtual machines currently running in the host and the attribute information of the currently running virtual machines, it further includes:

[0083] The virtual machines to be processed whose attribute information does not meet the preset processing conditions are determined as initial virtual machines, and the initial virtual machines in the host are deleted.

[0084] Following the above example, the control system directly destroys the cloud servers in the cloud computing service that do not support checkpoint restart, thereby returning CPU resources, memory resources, etc.

[0085] In an embodiment provided in this specification, for the virtual machine management method provided in this specification, after deleting the target virtual machine, when the current running state of the host meets the second preset state condition, the target virtual machine will be restored based on the pre-stored calculation state information, so as to achieve checkpoint restart for the target virtual machine, and further achieve the purpose of continuing to perform calculation operations on the calculation task based on the restored target virtual machine. The specific implementation method is as follows.

[0086] In the virtual machine management method provided in this specification, after deleting the target virtual machine in the host, it further includes steps one to three:

[0087] Step one: Determine the current running state of the host.

[0088] Specifically, the control system can determine the current running state of the host.

[0089] Step two: When the current running state meets the second preset state condition, obtain the calculation state information of the target virtual machine.

[0090] In practical applications, the second preset status condition can be set to different conditions according to different first preset status conditions. For example, when the first preset status condition is a condition for determining whether the host is currently in a peak computing state, the second preset status condition can be understood as a condition for determining whether the host is currently in an idle computing state; for example, when the current running status information is the current idle computing resources of the host, the satisfaction of the second preset status condition can be understood as the idle computing resources being greater than or equal to a second preset resource threshold. Among them, the second preset resource threshold can be set according to the actual application scenario. For example, when the preset resource threshold is 70%, the satisfaction of the second preset status condition can be that the current idle computing resources of the host are greater than or equal to 70%. Another example is when the current running status information is the current time of the host, the satisfaction of the second preset status condition can be understood as whether the current time is in a computing idle period, and the computing idle period is the time period when the computing resources are purchased by fewer users.

[0091] Or, when the first preset status condition is a condition for determining whether the host is currently in an idle computing state, the second preset status condition can be understood as a condition for determining whether the host is currently in a peak computing state. Correspondingly, when the current running status information is the current time of the host, the satisfaction of the second preset status condition can be understood as whether the current time is in a computing peak period, and the computing peak period is the time period when the computing resources are purchased by more users. Based on this, subsequently, when it is determined that the host reaches the computing peak period based on the second preset status condition, based on the pre-stored computing status information of the target virtual machine, the virtual machine deleted when the host reaches the computing idle period at the current time is restored.

[0092] Specifically, after the control system obtains the current running status of the host, when it is determined that the current running status satisfies the second preset status condition, it obtains the pre-stored computing status information of the target virtual machine, which is convenient for subsequently restoring the target virtual machine based on this computing status information.

[0093] In the embodiments of this specification, the obtaining of the computing status information of the target virtual machine includes:

[0094] Determine the historical virtual machines of the host, where the historical virtual machines are the virtual machines that have been historically deleted in the host;

[0095] Create a virtual machine in the host based on the configuration information of the historical virtual machine, and determine the target virtual machine to be restored from the virtual machines;

[0096] Obtain the computing status information corresponding to the target virtual machine to be restored from the information storage module.

[0097] Among them, the historical virtual machine can be understood as the virtual machine that has been deleted by the host in history. The historical virtual machine includes virtual machines that support breakpoint resume technology and virtual machines that do not support breakpoint resume technology.

[0098] The configuration information of the target virtual machine can be understood as the configuration parameters required to create the target virtual machine. For example, the system configuration of the virtual machine, the type of mirror technology (data backup technology) adopted by the target virtual machine, the number of the target virtual machine, etc.

[0099] Continuing with the above example, when the control system determines that the current running state of the host meets the second preset state condition, it can determine the cloud servers that have been deleted in history in the cloud computing platform, and recreate the cloud servers that have been deleted in history in the cloud computing platform from the configuration information of the cloud servers that have been deleted in history.

[0100] After that, the control system determines the target cloud server to be restored from the created cloud servers. Among them, the target cloud server to be restored is the cloud server created based on the configuration information of the target cloud server that has been deleted in history. Therefore, after determining the target cloud server to be restored, the control system can determine multiple memory snapshots that are pre-stored in the object storage service and correspond to the target cloud server to be restored.

[0101] Further, determining the target virtual machine from the historical virtual machines of the host includes:

[0102] Determining the attribute information of the virtual machines in the host;

[0103] Determining the virtual machines whose attribute information meets the preset processing conditions as the target virtual machines to be restored.

[0104] Continuing with the above example, among the cloud servers deleted by the cloud computing platform, there are both cloud servers that support breakpoint resume and cloud servers that do not support breakpoint resume. Based on this, after the control system creates multiple cloud servers based on the configuration information of the cloud servers that have been deleted in history, it is necessary to determine the information indicating whether the cloud server supports breakpoint resume and / or determine the type of data backup technology supported by the cloud server, and determine the cloud server that supports breakpoint resume and whose supported data backup technology type is Restore&Save technology as the target cloud server to be restored (i.e., the target virtual machine to be restored).

[0105] Step 3: Restoring the target virtual machine in the host based on the computing state information.

[0106] Further, restoring the target virtual machine in the host based on the computing state information includes:

[0107] Based on the computing state information corresponding to the target virtual machine to be restored, adjust the current computing state of the target virtual machine to be restored to obtain a target virtual machine.

[0108] Specifically, after determining the pre-saved computing state information, based on this computing state information, the current computing state of the created target virtual machine to be restored can be adjusted, so that the target virtual machine to be restored is adjusted to be consistent with the computing state of the deleted target virtual machine, thereby realizing the restoration of the target virtual machine.

[0109] In practical applications, in order to avoid storing a large amount of invalid computing state information in the object storage service and save the storage resources of the object storage service, after completing the restoration of the target virtual machine based on the computing state information stored in the object storage service, it is necessary to delete the computing state information stored in the object storage service, so as to save the storage resources of the object storage service. The specific implementation method is as follows.

[0110] After restoring the target virtual machine in the host based on the computing state information, it further includes:

[0111] Determine the computing state information of the target virtual machine stored in the information storage module, and delete the computing state information.

[0112] Continuing with the above example, in practical applications, after the control system determines that the virtual machine restoration is completed, it can delete the memory file A stored on the object storage service.

[0113] The following combines the attached Figure 3 ... Taking the application of the virtual machine management method provided in this specification in the cloud server breakpoint continuation calculation scenario as an example, the virtual machine management method will be further described. Among them, Figure 3 shows the processing procedure flowchart of a virtual machine management method provided in an embodiment of this specification. Based on Figure 3 It can be known that the virtual machine management method provided in this specification can achieve breakpoint continuation calculation for cloud servers. This breakpoint continuation calculation technology aims to save the computing state of virtual machines during the peak period (the computing peak period of the host), and at the same time, when the host is in the low peak (computing idle period), restore the computing state of the virtual machine, so as to achieve the purpose of continuing to calculate and execute the computing service. Therefore, the application process of this breakpoint continuation calculation technology includes a breakpoint continuation calculation save process and a breakpoint continuation calculation restoration process.

[0114] Among them, the breakpoint continuation calculation save process of the cloud server can be that when the host is in the computing peak period, save the computing state of the virtual machines running in the host and delete the virtual machines. Specifically, it includes steps 302 to step 308.

[0115] Step 302: The control system starts the process of shutting down the virtual machine.

[0116] Among them, when the control system determines that the current host has reached the computing peak period or the free computing resources of the host are relatively small, the control system can start the process of shutting down the virtual machine, so as to specify the cloud server (virtual machine) in the cloud computing platform to perform the shutdown operation.

[0117] In practical applications, the control system can use one of its own instances to specify the cloud server to perform the shutdown operation, and this instance can be StopInstances (a certain instance).

[0118] Step 304: The control system determines whether the restore&save technology is supported.

[0119] Specifically, for the virtual machine management method provided in this specification, since the images (data backup technologies) used by cloud servers may be different, it is necessary to determine whether the images (data backup technologies) used by cloud servers support checkpoint restart. That is, the control system determines whether the created cloud server supports the use of the Restore&Save technology. If so, step 306 is executed; if not, step 308 is executed to perform a normal shutdown.

[0120] In addition, for the cloud computing platform in the virtual machine management method provided in this specification, data backup technology will be configured for the newly created virtual machine, but there may be a situation where the historically created cloud servers do not support the data backup technology. Based on this, the virtual machine management method can also determine whether the cloud server is a checkpoint restart server through the control system, that is, determine whether the cloud server to be shut down supports checkpoint restart. If so, step 306 is executed; if not, step 308 is executed to perform a normal shutdown.

[0121] Step 306: The control system virtualizes the virtual machine.

[0122] Specifically, for the cloud server that supports checkpoint restart, the control system creates a memory file A on the object storage medium (OSS) to store the memory snapshot saved by checkpoint restart. After that, the control system virtualizes and pauses the CPU operation of the cloud server, and saves the memory information and Meta information of the cloud server to the memory file A on the object storage medium.

[0123] Step 308: The control system shuts down the virtual machine.

[0124] Specifically, the control system destroys the cloud server and returns the CPU and memory resources.

[0125] Among them, the breakpoint resumption process of the cloud server can be as follows: when the host is in the computing idle period, based on the pre-saved computing state of the virtual machine, the virtual machine is restored to continue executing the user's computing service. Specifically, it includes steps 310 to 320.

[0126] Step 310: The control system starts the process of restoring the virtual machine.

[0127] Among them, when the control system determines that the current host has reached the computing idle period or there are a large number of idle computing resources on the host, the control system can start the process of restoring the virtual machine, thereby creating a cloud server host and starting the cloud server.

[0128] In practical applications, the control system can, through one of its own instances, implement the operation of specifying the creation of a cloud server host and starting the cloud server. This instance can be RunInstance (a type of instance).

[0129] Step 312: The control system determines whether it supports the restore&save technology.

[0130] Specifically, for the virtual machine management method provided in this specification, since the images (data backup technologies) used by the cloud server may be different, during the process of restoring the cloud server, it is also necessary to determine whether the image (data backup technology) used by the cloud server to be restored supports breakpoint resumption. That is, the control system determines whether the created cloud server supports the use of the Restore&Save technology. If so, step 314 is executed; if not, step 320 is executed.

[0131] In addition, for the cloud computing platform in the virtual machine management method provided in this specification, data backup technology will be configured for the newly created virtual machine, but there may be a situation where the historically created cloud servers do not support the data backup technology. Based on this, during the process of restoring the cloud server, the virtual machine management method also needs to, through the control system, determine whether a non-first-time created cloud server is a breakpoint resumption server for non-first-time created cloud servers, that is, determine whether the cloud server to be restored supports breakpoint resumption. If so, step 314 is executed; if not, step 320 is executed.

[0132] Step 314: The control system virtualizes the virtual machine.

[0133] Specifically, the control system starts the cloud server that supports breakpoint resumption and virtualizes the cloud server.

[0134] Step 316: The control system restores the virtual machine through a memory snapshot.

[0135] Specifically, the control system virtualizes and restores the cloud server through the memory snapshot stored on the OSS.

[0136] Step 318: The virtual machine restores its own clock information, hot-pluggable memory, and CPU.

[0137] Specifically, for the restored cloud server, its operating system synchronizes the operating system clock through the NTP service, restores the hot-pluggable memory, and the computing state of the CPU. Among them, the operating system of the cloud server can be the Linux operating system.

[0138] Step 320: Determine that the VM is completed.

[0139] Specifically, the control system determines that the virtual machine (VM) restoration is completed and applies the restored calculation of the virtual machine.

[0140] In practical applications, after the control system determines that the virtual machine restoration is completed, it can delete the memory file A stored on the object storage service.

[0141] In the virtual machine management method provided in this specification, the cloud provider uses the object storage save and restore technology to restore the virtual machine state, and at the same time utilizes the object storage content generated by the management and control through virtualization, and returns the memory and CPU resources after using the virtualization restore, thus avoiding the problem of insufficient computing resources available during peak periods and reducing costs.

[0142] Corresponding to the above method embodiment, this specification also provides a virtual machine management device embodiment. Figure 4 It shows a schematic structural diagram of a virtual machine management device provided in an embodiment of this specification. As Figure 4 shown, the device includes:

[0143] The first determination module 402 is configured to determine the current running state of the host, and when the current running state meets the first preset state condition, determine the virtual machine currently running in the host and the attribute information of the currently running virtual machine;

[0144] The second determination module 404 is configured to determine the virtual machine whose attribute information meets the preset processing condition as the target virtual machine;

[0145] The deletion module 406 is configured to store the computing state information of the target virtual machine and delete the target virtual machine in the host.

[0146] Optionally, the virtual machine management device further includes a restoration module, which is configured to:

[0147] Determine the current running state of the host;

[0148] When the current operating state meets the second preset state condition, obtain the computing state information of the target virtual machine;

[0149] Restore the target virtual machine in the host based on the computing state information.

[0150] Optionally, the restoration module is further configured to:

[0151] Determine the historical virtual machines of the host, where the historical virtual machines are the virtual machines that have been historically deleted in the host;

[0152] Create a virtual machine in the host based on the configuration information of the historical virtual machine, and determine the target virtual machine to be restored from the virtual machine;

[0153] Obtain the computing state information corresponding to the target virtual machine to be restored from the information storage module.

[0154] Optionally, the restoration module is further configured to:

[0155] Adjust the current computing state of the target virtual machine to be restored based on the computing state information corresponding to the target virtual machine to be restored, to obtain the target virtual machine.

[0156] Optionally, the restoration module is further configured to:

[0157] Determine the attribute information of the virtual machines in the host;

[0158] Determine the virtual machines whose attribute information meets the preset processing conditions as the target virtual machines to be restored.

[0159] Optionally, the deletion module 306 is further configured to:

[0160] Determine the computing state information of the target virtual machine, and store the computing state information in the information storage module.

[0161] Optionally, the deletion module 306 is further configured to:

[0162] Create an information storage unit corresponding to the target virtual machine in the information storage module;

[0163] Obtain the computing state information of the target virtual machine, and store the computing state information in the information storage unit.

[0164] Optionally, the virtual machine management device further includes an information deletion module, which is configured to:

[0165] Determine the computing status information of the target virtual machine stored in the information storage module, and delete the computing status information.

[0166] Optionally, the virtual machine management device further includes an initial virtual machine deletion module, configured to:

[0167] Determine the virtual machine to be processed whose attribute information does not meet the preset processing conditions as the initial virtual machine, and delete the initial virtual machine in the host.

[0168] The virtual machine management device provided in this specification can, when the current operating state of the host meets the first preset state condition, determine the target virtual machine in the host whose attribute information meets the preset processing conditions, store the computing status information of the target virtual machine, and then delete the target virtual machine, thereby realizing the preservation of the computing status of the virtual machine, facilitating the subsequent recovery of the virtual machine, and further ensuring the normal execution of the computing service.

[0169] The above is a schematic solution of a virtual machine management device according to this embodiment. It should be noted that the technical solution of this virtual machine management device and the technical solution of the above virtual machine management method belong to the same concept. For the details not described in detail in the technical solution of the virtual machine management device, reference can be made to the description of the technical solution of the above virtual machine management method.

[0170] Figure 5 FIG. shows a block diagram of a computing device 500 according to an embodiment of this specification. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 through a bus 530, and a database 550 is used to store data.

[0171] The computing device 500 further includes an access device 540, and the access device 540 enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of wired or wireless network interfaces (for example, a network interface card (NIC)), such as an IEEE802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0172] In an embodiment of this specification, the above components of the computing device 500 and Figure 5Other components not shown may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The block diagram of the computing device shown is for illustrative purposes only and is not a limitation on the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0173] The computing device 500 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.) or other types of mobile devices, or a stationary computing device such as a desktop computer or a PC. The computing device 500 can also be a mobile or stationary server.

[0174] Wherein, the processor 520 is used to execute the following computer-executable instructions, and when the computer-executable instructions are executed by the processor virtual machine management, the steps of the above virtual machine management method are implemented.

[0175] The above is a schematic solution of a computing device according to this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above virtual machine management method belong to the same concept. For the details not described in detail in the technical solution of the computing device, reference can be made to the description of the technical solution of the above virtual machine management method.

[0176] An embodiment of this specification also provides a computer-readable storage medium, which stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the above virtual machine management method are implemented.

[0177] The above is a schematic solution of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above virtual machine management method belong to the same concept. For the details not described in detail in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above virtual machine management method.

[0178] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is made to execute the steps of the above virtual machine management method.

[0179] The above is a schematic solution of a computer program according to this embodiment. It should be noted that the technical solution of the computer program and the technical solution of the above virtual machine management method belong to the same concept. For the details not described in detail in the technical solution of the computer program, reference can be made to the description of the technical solution of the above virtual machine management method.

[0180] The above description relates to specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the accompanying drawings do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0181] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0182] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of this specification are not limited by the described order of actions, because according to the embodiments of this specification, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of this specification.

[0183] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0184] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The alternative embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can understand and utilize this specification well. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A virtual machine management method, comprising: determining the current running state of the host machine, and when the current running state meets the first preset state condition, determining the virtual machines currently running in the host machine and the attribute information of the currently running virtual machines, wherein the first preset state condition includes the condition for determining that the host machine is currently in a peak computing state; determining the virtual machines whose attribute information meets the preset processing conditions as target virtual machines, wherein meeting the preset processing conditions includes: the virtual machine supports data backup technology, or the data backup technology supported by the virtual machine is a specific type of data backup technology, and the specific type of data backup technology is set according to the actual application scenario; storing the computing state information of the target virtual machines and deleting the target virtual machines in the host machine.

2. The virtual machine management method according to claim 1, after deleting the target virtual machines in the host machine, further comprising: determining the current running state of the host machine; when the current running state meets the second preset state condition, obtaining the computing state information of the target virtual machines, wherein the second preset state condition includes the condition for determining that the host machine is currently in an idle computing state; restoring the target virtual machines in the host machine based on the computing state information.

3. The virtual machine management method according to claim 2, for obtaining the computing state information of the target virtual machines, comprising: determining the historical virtual machines of the host machine, where the historical virtual machines are the virtual machines historically deleted in the host machine; creating virtual machines in the host machine based on the configuration information of the historical virtual machines, and determining the target virtual machines to be restored from the virtual machines; obtaining the computing state information corresponding to the target virtual machines to be restored from the information storage module.

4. The virtual machine management method according to claim 3, for restoring the target virtual machines in the host machine based on the computing state information, comprising: adjusting the current computing state of the target virtual machines to be restored based on the computing state information corresponding to the target virtual machines to be restored to obtain target virtual machines.

5. The virtual machine management method according to claim 3, for determining the target virtual machines to be restored from the virtual machines, comprising: determining the attribute information of the virtual machines in the host machine; determining the virtual machines whose attribute information meets the preset processing conditions as the target virtual machines to be restored.

6. The virtual machine management method according to claim 1, for storing the computing state information of the target virtual machines, comprising: determining the computing state information of the target virtual machines and storing the computing state information in the information storage module.

7. The virtual machine management method according to claim 6, for determining the computing state information of the target virtual machines and storing the computing state information in the information storage module, comprising: creating an information storage unit corresponding to the target virtual machines in the information storage module; obtaining the computing state information of the target virtual machines and storing the computing state information in the information storage unit.

8. The virtual machine management method according to claim 3, after restoring the target virtual machine in the host machine based on the computing status information, further comprises: determining the computing status information of the target virtual machine stored in the information storage module, and deleting the computing status information.

9. The virtual machine management method according to claim 1, after determining the virtual machines currently running in the host machine and the attribute information of the currently running virtual machines, further comprises: determining the virtual machines to be processed whose attribute information does not meet the preset processing conditions as initial virtual machines, and deleting the initial virtual machines in the host machine.

10. A virtual machine management device, comprises: a first determination module configured to determine the current running status of the host machine, and determine the virtual machines currently running in the host machine and the attribute information of the currently running virtual machines when the current running status meets the first preset status condition, wherein the first preset status condition includes the condition for determining that the host machine is currently in a peak computing state; a second determination module configured to determine the virtual machines whose attribute information meets the preset processing conditions as target virtual machines, wherein the meeting of the preset processing conditions includes: the virtual machine supports a data backup technology, or the data backup technology supported by the virtual machine is a specific type of data backup technology, and the specific type of data backup technology is set according to the actual application scenario; a deletion module configured to store the computing status information of the target virtual machine and delete the target virtual machine in the host machine.

11. A computing device, comprises: a memory and a processor; the memory is used for storing computer-executable instructions, and the processor is used for executing the computer-executable instructions, and when the computer-executable instructions are executed by the processor, the steps of the virtual machine management method according to any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium storing computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the virtual machine management method according to any one of claims 1 to 9 are implemented.

13. A computer program product, characterized in that it comprises computer instructions, and when the computer instructions are executed by a processor, the steps of the virtual machine management method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Method and device for obtaining cloud service and cloud management server

    CN113034166A

  • Forensic instance snapshotting

    US9524389B1