Virtual machine live migration method, physical host and storage medium

The virtual machine monitor obtains service feature information feedback from the application, determines the migration strategy, optimizes the virtual machine hot migration process, solves the problem of poor virtual machine migration and achieves efficient and unconscious migration.

WO2025141485A1PCT designated stage expired Publication Date: 2025-07-03CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD

Patent Information

Application Number
PCT/IB2024/063166
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-28
Filing Date
2024-12-25
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

In the prior art, it is difficult to ensure the migration effect during the hot migration of virtual machines, especially in the balance between maintaining service continuity and optimizing migration speed.

Method used

Obtain service characteristic information from application feedback through the virtual machine monitor and determine appropriate migration strategies, including data processing methods, migration methods and service suspension moments, to optimize the hot migration process of the virtual machine.

Benefits of technology

It improves the accuracy and efficiency of hot migration of virtual machines, reduces the amount of data to be migrated, ensures that the service does not interrupt or has a short interruption time during the migration process, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IB2024063166_03072025_PF_FP_ABST
    Figure IB2024063166_03072025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present disclosure are a virtual machine live migration method, a physical host and a storage medium. The method comprises: a virtual machine monitor firstly acquiring service feature information that is fed back by an application program running on a virtual machine and providing a target service; and then, the virtual machine monitor determining a corresponding migration strategy on the basis of the service feature information, and using the migration strategy to migrate the virtual machine. In the method, a migration strategy determined by a virtual machine monitor on the basis of service feature information is obviously applicable to a target service. Therefore, the live migration effect of a virtual machine can be ensured and optimized. Moreover, the service feature information can be directly fed back to the virtual machine monitor by an application program, which, compared with the method of using the virtual machine monitor to perform detection, has low implementation difficulty and higher accuracy. Therefore, using the service feature information can further improve the rationality of the migration strategy determined by the virtual machine monitor, thereby ensuring the live migration effect.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Virtual Machine Live Migration Method, Physical Host, and Storage Medium This disclosure claims priority to Chinese patent application No. 202311848999.0, filed with the China Patent Office on December 28, 2023, entitled "Virtual Machine Live Migration Method, Physical Host, and Storage Medium," the entire contents of which are incorporated herein by reference. Technical Field This disclosure relates to the field of cloud computing technology, and more particularly to a virtual machine live migration method, physical host, and storage medium. Background: Live migration of a virtual machine (VM) refers to the process of migrating a VM from a source physical host to a destination physical host while the VM remains running. During the live migration process, the VM's device state data, memory data, and network connection information are all migrated to the destination physical host, and users can continue to use the VM normally during the migration process, meaning that the user is unaware of the VM migration. As is readily understood, the performance of virtual machine migration is clearly a key area requiring optimization. Therefore, ensuring the effectiveness of live migration has become a pressing issue. SUMMARY OF THE INVENTION In view of this, embodiments of the present disclosure provide a virtual machine live migration method, a physical host, and a storage medium to ensure effective virtual machine live migration. In a first aspect, embodiments of the present disclosure provide a virtual machine live migration method, comprising: obtaining service feature information fed back by an application providing a target service after receiving a live migration message, wherein the service feature information corresponds to the target service running on the virtual machine; determining a migration policy based on the service feature information; and performing live migration on the virtual machine according to the migration policy. In a second aspect, embodiments of the present disclosure provide a virtual machine live migration method, applied to an application providing a target service in a virtual machine, comprising: receiving a live migration message; executing an adjustment policy corresponding to the live migration message, wherein the adjustment policy is used to reduce the amount of data to be migrated in the virtual machine's memory; and, in response to receiving the live migration message, transmitting the service feature information of the target service, so that a virtual machine monitor in the virtual machine can perform live migration on the virtual machine according to the migration policy corresponding to the service feature information. In a third aspect, an embodiment of the present disclosure provides a physical host, comprising: a memory and a processor, and a virtual machine running in an isolated environment constructed by the memory and the processor; the memory is used to store a computer program; and the processor is used to execute the computer program to implement the virtual machine hot migration method as described in the first aspect or the second aspect.In a fourth aspect, embodiments of the present disclosure provide a physical host comprising: a virtual machine and a virtual machine monitor, wherein a monitor agent and an application providing a target service are deployed in the virtual machine; the monitor agent is configured to forward a live migration message generated by the virtual machine monitor to the application; and forward service feature information corresponding to the target service to the virtual monitor; the application is configured to write data to the memory of the virtual machine; and in response to receiving the live migration message, feedback the service feature information of the target service to the monitor agent; the virtual machine monitor is configured to send a live migration message to the monitor agent; determine a migration policy based on the service feature information; and migrate data in the memory of the virtual machine according to the migration policy. In a fifth aspect, embodiments of the present disclosure provide a non-transitory machine-readable storage medium, wherein executable code is stored on the non-transitory machine-readable storage medium. When the executable code is executed by a computing system of an electronic device, the computing system is enabled to implement at least the virtual machine live migration method described in the first or second aspect. In a sixth aspect, embodiments of the present disclosure provide a computer program that, when executed on a computer, causes the computer to perform the virtual machine live migration method described in the first or second aspect. In the virtual machine live migration method provided by embodiments of the present disclosure, a virtual machine monitor may first obtain service characteristic information of a target service running on the virtual machine. This characteristic information may be fed back to the virtual machine monitor by the application after receiving a live migration message. The virtual machine monitor may then determine a corresponding migration strategy based on this service characteristic information and use this migration strategy to migrate the virtual machine. The service characteristic information may describe the characteristics of the target service, such as the modality, amount, frequency, and quality of service requirements of the data generated by the service. In this method, the migration strategy determined by the virtual machine monitor based on this service characteristic information is clearly more suitable for the target service, thereby ensuring an optimized virtual machine live migration effect. On the other hand, compared to detection by a virtual machine monitor or other devices, service feature information can be fed back to the virtual machine monitor by the application providing the target service. This approach is not only easier to implement but also more accurate. Therefore, it can further improve the rationality of the migration strategy determined by the virtual machine monitor, ultimately ensuring the effectiveness of live migration. The virtual machine live migration method provided in the embodiments of the present disclosure also involves the application providing the service in the live migration process, thereby ensuring the effectiveness of live migration.To more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below represent some embodiments of the present disclosure. Persons skilled in the art can also derive other drawings based on these drawings without inventive effort. Figure 1 is a flowchart of a virtual machine live migration method provided in an embodiment of the present disclosure; Figure 2 is a schematic structural diagram of a physical host provided in an embodiment of the present disclosure; Figure 3a is a flowchart of another virtual machine live migration method provided in an embodiment of the present disclosure; Figure 3b is a flowchart of yet another virtual machine live migration method provided in an embodiment of the present disclosure; Figure 3c is a flowchart of yet another virtual machine live migration method provided in an embodiment of the present disclosure; Figure 4 is a flowchart of yet another virtual machine live migration method provided in an embodiment of the present disclosure; Figure 5 is a schematic structural diagram of a virtual machine live migration device provided in an embodiment of the present disclosure; Figure 6 is a schematic structural diagram of another virtual machine live migration device provided in an embodiment of the present disclosure; and Figure 7 is a schematic structural diagram of another physical host provided in an embodiment of the present disclosure. To further clarify the objectives, technical solutions, and advantages of the embodiments of the present disclosure, the technical solutions of the embodiments of the present disclosure will be described clearly and completely below in conjunction with the accompanying drawings. It should be understood that the described embodiments represent only a portion of the embodiments of the present disclosure, and are not exhaustive. All other embodiments devised by persons of ordinary skill in the art based on the embodiments of the present disclosure without inventive effort are within the scope of protection of the present disclosure. The terms used in the embodiments of the present disclosure are intended solely to describe specific embodiments and are not intended to limit the present disclosure. The singular forms "a," "an," "the," and "the" used in the embodiments of the present disclosure and the appended claims are intended to include the plural forms, unless the context clearly indicates otherwise. "A plurality" generally includes at least two, but does not exclude the inclusion of at least one. It should be understood that the term "and / or" as used herein is merely a term used to describe an association between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B simultaneously, or B alone. Furthermore, the character " / " generally indicates an "or" relationship between the associated objects. Depending on the context, the words "if" and "if" as used herein may be interpreted as "when" or "when" or "in response to determining" or "in response to identifying."Similarly, depending on the context, the phrases "if determined" or "if identified (the stated condition or event)" can be interpreted as "when determined" or "in response to determining" or "when identifying (the stated condition or event)" or "in response to identifying (the stated condition or event)." It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse. It should also be noted that the terms "include," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such product or system. In the absence of further restrictions, elements defined by the phrase "comprising a..." do not preclude the presence of other identical elements in the product or system that includes the elements. Before describing the methods and devices provided in the following embodiments of the present disclosure, the following concepts should be explained: A physical host is a server that provides the necessary hardware resources for virtual machine operations. A virtual machine (VM), also known as a VM instance, is a computer system running on a physical host, emulated through software with complete hardware system functionality, and operating in an isolated environment. Applications (APPs) can be deployed in VMs to provide different services to users. Services provided by APPs may include video services, audio services, database services, gaming services, artificial intelligence services, and so on. The videos in video services can be live or on-demand. Live videos can be generated in various scenarios, such as medical care, education, and sporting events. Among them, according to the different types and numbers of computing units set on the physical host where the virtual machine is deployed, the virtual machine instance can be divided into non-heterogeneous instances that use one computing unit to implement computing and heterogeneous instances that use multiple computing units to implement computing.Optionally, the computing unit provided on the physical host may include a central processing unit (CPU), a graphics processing unit (GPU), a field programmable gate array (FPGA), a digital signal processing (DSP) chip, an application specific integrated circuit (ASIC), a coprocessor, and the like. It should be noted that the virtual machines involved in the following embodiments of the present disclosure may be instances of computing based on at least one of the above-mentioned computing units. Hot migration of virtual machines: A mechanism for migrating virtual machine data from a source host to a destination host without interrupting service. "No interruption" here refers to the user experience. However, there is actually a brief downtime window during the live migration process. Since this downtime window can be on the order of milliseconds, for example, less than 100ms, users experience no service interruption. Virtual Machine Monitor (VMM): Software that creates and manages virtual machines on a physical host. Specifically, the VMM is used to partition the physical host's physical resources for virtual machines to create virtual machines, and dynamically allocate hardware resources between them using time-division multiplexing or space-division multiplexing. Specifically, the VMM can include a kernel-based virtual machine (KVM) running in kernel mode and a quick emulator (QEMU) running in user mode. oQEMU has better performance after being accelerated by KVM running in kernel state, and the two can work together to complete the creation and management of virtual machines. Emulator agent (QEMU Guest Agent, abbreviated as QGA): an application running in a virtual machine, which can be used as a QEMU agent for communication between KVM and QEMU. Monitor agent (VMM agent) program is used to implement communication between VMM and APP. Based on the above introduction, some embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. In the absence of conflicts between the embodiments, the following embodiments and the features in the embodiments can be combined with each other. In addition, the sequence of steps in the following method embodiments is only an example and not a strict limitation. Figure 1 is a flow chart of a virtual machine hot migration method provided by an embodiment of the present disclosure. The method provided by an embodiment of the present disclosure can be executed by a virtual machine monitor in the source host. As shown in Figure 1, the method may include the following steps:

[0002] 5101. Obtain service feature information fed back by the application providing the target service after receiving a live migration message. The service feature information corresponds to the target service running on the virtual machine. Optionally, the specific structure of the physical host may be as shown in Figure 2. In Figure 2, a physical host may be deployed with at least one virtual machine, each virtual machine may be deployed with at least one application, and different applications may provide different services. At least one virtual machine is managed by a virtual machine monitor on the physical host. Each virtual machine is also deployed with a monitor agent program that communicates with the virtual machine monitor and the application. In this embodiment, the virtual machine runs on the source host before migration and runs on the destination host after migration. The target service may be a service provided by an application running in a virtual machine on the source host. The target service may specifically be any of the services mentioned in the above embodiments. In practice, the virtual machine on the source host may be live migrated, and the virtual machine monitor on the source host may generate a live migration message. Optionally, the reasons for the live migration may include hardware reasons and software reasons. Hardware reasons may specifically include a source host failure or the need for a hardware upgrade. Software reasons specifically include kernel upgrades or virtual machine monitor upgrades on the source host. After the virtual machine monitor generates a live migration message, it can further obtain service characteristic information from the application providing the target service in the virtual machine to be migrated. Optionally, this service characteristic information may be set by the developer during the application development phase, and this service characteristic information can be considered service configuration information. Upon receiving the live migration message, the application can directly feedback this service characteristic information to the virtual machine monitor. Optionally, the service characteristic information describes the load characteristics and quality requirements of the target service. Optionally, the service characteristic information may specifically include the modality of data generated during the operation of the target service, the amount of data generated, and the frequency of data generation, which describe the load characteristics of the target service. Optionally, the service characteristic information may also include the maximum allowable service suspension duration and service quality requirements, which describe the quality requirements of the target service. For example, when the target service is a video service or a gaming service, the modality of the data generated by the service may be video. When the target service is an audio service, the modality of the data generated by the service may be audio. When the target service is a human-computer interaction service within an AI service, the data generated by the service can be in the form of text. Video and game services generate more data than other services. Database services also generate data more frequently than other services.Interactive services such as gaming and human-computer interaction have high requirements for latency and service pause duration. Services that generate large amounts of data, such as gaming and video services, also have high requirements for bandwidth.

[0003] 5102. Determine a migration strategy based on the service feature information.

[0004] S103: Live migrate the virtual machine according to the migration policy. After obtaining the service feature information fed back by the target service, the virtual machine monitor in the source host can further determine a migration policy corresponding to the service feature information and migrate the data in the virtual machine memory according to the migration policy. Alternatively, the virtual machine monitor can classify the target service according to the service feature information and, based on a preset correspondence between the service type and the migration policy, directly determine the migration policy corresponding to the target service type. The migration parameters in the migration policy are fixed. Alternatively, the virtual machine monitor can determine policy parameters in the hot migration policy according to the service feature information. The policy parameters constitute the migration policy, and the virtual machine is hot migrated according to the migration policy. The specific process for determining the policy parameters can be found in the description of the relevant embodiments below. In other words, in the latter approach, the migration parameters in the migration policy are not fixed but change according to the service feature information. Virtual machine memory refers to the memory allocated by the physical host to the virtual machine, corresponding to one or more blocks of virtual memory in the virtual machine monitor process address space. Optionally, depending on the type of computing unit configured in the physical host, virtual memory may specifically include graphics card memory and / or CPU memory. After the virtual machine is migrated to the destination host, the virtual machine monitor on the destination host can control the recovery of the target service. In this embodiment, the virtual machine monitor can first obtain service feature information of the target service running on the virtual machine. This feature information may be fed back to the virtual machine monitor by the application after receiving a live migration message. The virtual machine monitor can then determine a corresponding migration strategy based on this service feature information and use this migration strategy to migrate the virtual machine. In the above method, on the one hand, the migration strategy determined by the virtual machine monitor based on this service feature information is clearly more suitable for the target service, thereby ensuring an optimized live migration effect for the virtual machine. On the other hand, compared to detection methods performed by the virtual machine monitor or other devices, the service feature information can be fed back to the virtual machine monitor by the application providing the target service. This method is not only easier to implement but also more accurate. Therefore, the rationality of the migration strategy determined by the virtual machine monitor based on the service feature information can be further improved, ultimately ensuring a successful live migration. The effectiveness of hot migration is specifically evaluated by at least one metric, including the hot migration speed, success rate, and duration of service suspension during the hot migration process. Furthermore, the technical effects achieved by the hot migration methods provided in various embodiments of the present disclosure can also be understood in conjunction with the following: In practice, the virtual machine monitor can optionally monitor service feature information of the target service and use this monitored service feature information to determine a migration strategy.However, in this case, additional monitoring logic must be added to the virtual machine monitor, and this monitoring logic must be coupled to the application providing the target service, which significantly increases the difficulty of detection. Furthermore, the virtual machine monitor's monitoring may affect the operation of the target service. Furthermore, the accuracy of the service feature information detected by the virtual machine monitor cannot be guaranteed, and the virtual machine monitor's monitoring may also affect the operation of the target service. However, the methods provided in various embodiments of the present disclosure can alleviate these various issues by enabling the application to directly provide feedback on service feature information. Optionally, a first communication connection may be established between the virtual machine monitor and the monitor agent. A second communication connection may be established between the monitor agent and the application providing the target service. The first communication connection may be established after the virtual machine is created and running. Specifically, the first communication connection may be established using a vsock (Virtual Machine Socket) or a virtual serial port. The second communication connection may be established after the application providing the target service is started. Specifically, the second communication connection may be established using a Unix socket or a pipe. Regarding the process of the virtual machine monitor acquiring service feature information, after the virtual machine monitor generates a live migration message, the message can optionally be transmitted to the monitor agent via a first communication connection, and then forwarded to the application via a second communication connection. The application can then directly send its service feature information to the monitor agent via the second communication connection, which is then forwarded to the virtual machine monitor via the first communication connection. In this embodiment, after the live migration message is generated, interaction between the application providing the target service and the virtual machine monitor can be achieved via the communication connection, allowing the application to participate in the live migration process. In practice, the data that needs to be migrated in the virtual machine can be referred to as data to be migrated. Optionally, as described in the embodiment shown in FIG1 , the data to be migrated can be all data in the virtual machine's memory. Optionally, for a virtual machine running the target service, this total data can include: cached data of the application providing the target service, intermediate data and final response data obtained by the application in response to a user's request to use the target service, and virtual machine state data. During the initial operation of the target service, application data can be stored in the virtual disk file of the virtual machine. During the operation of the target service, frequently read file contents can be read into the cache of the virtual machine. Intermediate data can be generated during the process of obtaining response data.The virtual machine's state data may include hardware queue information on the source host's network card, register information of the source host's computing unit (CPU or GPU), I / O interface information, and so on. To further improve migration speed, another optional approach is to use the core data in the virtual machine's memory, namely, the response data, and the virtual machine's state data, as the data to be migrated, thereby reducing the amount of data to be migrated. In this case, non-core data in the virtual machine's memory, namely, intermediate data and cached data, is not migrated. The virtual machine's memory is divided into multiple virtual memory pages, and the various aforementioned data can be stored in different virtual memory pages. Alternatively, the application can execute a system call to cause the virtual machine kernel to send the virtual machine physical address (GPA) corresponding to the virtual memory page storing the response data and state data to the virtual machine monitor via the virtual machine monitor's interface. The virtual machine monitor can then convert this GPA into its own virtual memory address. Then, when performing live migration according to the migration policy, the data within the converted virtual memory address can be migrated. Alternatively, the application can execute a system call to cause the virtual machine kernel to send the GPA of the virtual machine memory page storing non-core data in virtual memory to the virtual machine monitor via the virtual machine monitor's interface. Then, during live migration according to the migration policy, the virtual machine monitor can skip the data within the converted virtual memory addresses and migrate data at other virtual memory addresses. In other words, it skips the non-core data in virtual memory and migrates the core data. In this embodiment, by obtaining the GPA, the virtual machine monitor can migrate the core data in virtual memory, thereby improving migration speed. Since intermediate data can be recalculated after the virtual machine migrates to the destination host, not migrating intermediate data improves migration speed while not affecting the normal operation of the application. Furthermore, the cost of recalculating intermediate results is less than the cost of migrating intermediate results. Since the virtual machines deployed on both the source and destination hosts use network-based shared storage, the application's cached data can still be obtained after the virtual machine migrates to the destination host. Therefore, not migrating cached data improves migration speed while not affecting the normal operation of the application. As mentioned in the embodiment shown in FIG. 1 , the virtual machine monitor can determine policy parameters in the migration policy based on service feature information. Optionally, the policy parameters can include at least one of a data processing mode, a data migration mode, and a virtual machine pause start time. Optionally, the data processing mode can include compression, and the data migration mode can include incremental migration and full migration.The following embodiments may respectively illustrate different ways of determining policy parameters and how to use the policy parameters to implement hot migration. FIG3a is a flow chart of another method for hot migration of virtual machines provided in an embodiment of the present disclosure. As shown in FIG3a, the method may include the following steps:

[0005] 5201. Obtain the modality of the response data in the service feature information fed back by the application providing the target service after receiving the hot migration message.

[0006] 5202: If the mode of the response data is text, determine that the data processing method in the policy parameter is compression.

[0007] 5203. Compress the response data and / or the state data of the virtual machine to obtain a compression result.

[0008] At step 5204, the compression result is migrated. The virtual machine monitor can obtain the modality of the response data fed back by the target service. If the modality of the response data is text, the data processing method in the policy parameters can be determined to be compression. Furthermore, the virtual machine monitor can compress the response data and migrate the virtual machine's state data and the compressed response data as the data to be migrated to the destination host. To further reduce the amount of data to be migrated, the virtual machine's state data can optionally be compressed at the same time as the response data to obtain a compression result. Finally, the compressed state data and response data are migrated to the destination host. In this embodiment, the data to be migrated includes core data in the virtual machine's memory, thus reducing the amount of data migrated to the destination host. Furthermore, compressing the data to be migrated can further reduce the amount of data to be migrated, increase migration speed, and ensure migration effectiveness. In practice, for different services, the response data may be in the form of video or audio. Since the compression ratio of such data is very low, using compression not only fails to reduce data transmission but also increases the pressure of data processing during the migration process. For response data that is not suitable for compression, the virtual machine monitor can optionally extend the scheduling cycle of the virtual central processing unit (vCPU) in the virtual machine after generating a live migration message. vCPU scheduling is the process of selecting a process for the response data writing task in the ready queue and allocating a vCPU to the process according to a preset scheduling algorithm. The vCPU scheduling cycle can be the period for performing the aforementioned vCPU allocation process. Therefore, by extending the vCPU scheduling cycle, the execution frequency of the response data writing task can be reduced, which in turn reduces the frequency at which the application writes response data to memory, thereby achieving service degradation. Reducing the data generation frequency can obviously reduce the amount of data to be migrated, thereby increasing the migration speed and ensuring migration effectiveness. Furthermore, in this case, when all the data to be migrated on the source host has been migrated to the destination host, the virtual machine monitor running on the destination host can restore the frequency at which the application writes data to memory. Optionally, the virtual machine monitor on the destination host can determine whether the migration is complete based on preset fields in the data to be migrated. The preset field can be set by the source host during data migration. FIG3b is a flowchart of another virtual machine hot migration method provided by an embodiment of the present disclosure. As shown in FIG3b, the method may include the following steps:

[0009] 5301. Obtain service feature information fed back by an application providing a target service after receiving a live migration message. The service feature information includes a proportion of incremental data in the same virtual memory page during this live migration compared to the previous live migration.

[0010] S302: If the proportion of incremental data in the same virtual memory page is less than a preset proportion, determine that the data migration mode in the policy parameters is incremental migration.

[0011] 5303. Compare the data to be migrated corresponding to two adjacent hot migrations to obtain incremental data.

[0012] 5304: Migrate incremental data. The virtual machine monitor can obtain the ratio of incremental data in the same virtual memory page during the current live migration compared to the previous live migration. This ratio indicates the ratio of changed data to all data in the same virtual memory page between the generation of two adjacent live migration messages. If this ratio is less than a preset ratio, indicating that the application's data write pattern is a small-scale update of the data in the virtual memory page, the virtual machine monitor can determine that the data migration method in the policy parameters is incremental migration. The virtual machine monitor can then compare the data to be migrated corresponding to the two live migrations to obtain incremental data and migrate this incremental data. If this ratio is greater than or equal to the preset ratio, indicating that the application's data write pattern is a large-scale overwrite of the data in the virtual memory page, the virtual machine monitor can directly perform a full migration of the data in the virtual memory page. It should be noted that the data to be migrated in this embodiment can also be core data written to virtual memory, namely, response data and virtual machine status data. In this embodiment, based on the percentage of application feedback, the virtual machine monitor can determine whether the application's data writing mode for virtual memory pages is a small-scale update or a large-scale overwrite, and perform data migration using the data migration method corresponding to the data writing mode. In the case of a small-scale update, migrating only incremental data can significantly reduce the amount of data to be migrated, thereby increasing migration speed and ensuring migration effectiveness. Figure 3c is a flowchart of another virtual machine live migration method provided in an embodiment of the present disclosure. As shown in Figure 3c, the method may include the following steps:

[0013] 5401. Obtain service feature information fed back by an application providing a target service after receiving a hot migration message. The service feature information includes a preset pause duration.

[0014] 5402, determining the remaining duration of the hot migration at the current moment.

[0015] S403: If the remaining time is less than or equal to the preset suspension time, the current time is determined as the service suspension start time in the policy parameters.

[0016] 5404, controls the target service to be paused at the current moment.

[0017] 5405: Migrate the virtual machine. In practice, the live migration process may also involve a brief virtual machine downtime, which also means the target service is suspended. For target services that are sensitive to service suspensions, such as the gaming and video services mentioned in the embodiment shown in FIG1 , to ensure a good user experience, the service feature information may also include the maximum allowable suspension duration for the target service, i.e., the preset suspension duration. While obtaining this preset suspension duration, the virtual machine monitor can also estimate the remaining duration for live migration at the current time. Optionally, the virtual machine monitor can estimate the remaining duration for live migration at the current time based on the amount of unmigrated data to be migrated and the data transmission bandwidth. If the remaining duration is less than or equal to the preset suspension duration, the current time is determined as the service suspension start time in the policy parameters. From this time on, the virtual machine on the source host is shut down, effectively pausing the target service. Data continues to migrate to the destination host during the service suspension. Therefore, in this embodiment, steps S404 and S405 are not strictly sequential. If the remaining duration is greater than the preset pause duration, the virtual machine monitor can control the virtual machine on the source host to continue shutting down, that is, to control the target service to continue running and to continue migrating the data to be migrated. It should be noted that the data to be migrated in this embodiment can also be core data written to virtual memory, namely, response data and virtual machine status data. In this embodiment, the virtual machine monitor can determine an appropriate service pause start time based on the maximum service pause duration allowed by the target service, thereby preventing prolonged service pauses during the hot migration process. This ensures that service pauses during the hot migration process are not perceived by users, improving the user experience and ensuring the effectiveness of the hot migration. In summary, the embodiment shown in Figure 3a can reduce the amount of data to be migrated through data compression, while the embodiment shown in Figure 3b can reduce the amount of data to be migrated through incremental migration. Both embodiments ensure the effectiveness of hot migration from the perspective of improving migration speed. The embodiment shown in Figure 3c can ensure that the service pause duration meets the requirements by setting an appropriate service pause start time, thereby ensuring the effectiveness of hot migration. In the process of determining policy parameters and completing live migration according to the methods provided in the above embodiments, to further optimize the live migration effect, after generating a live migration message, the virtual machine monitor may optionally extend the scheduling period of the vCPU in the virtual machine, regardless of the response data modality, thereby reducing the frequency with which the application writes response data to memory. By reducing the frequency of data generation, the amount of data to be migrated is reduced, thereby improving the migration speed and ensuring the migration effect.Optionally, depending on actual circumstances, at least one of the aforementioned methods for reducing the amount of data to be migrated can be selected for execution. During the live migration process, the virtual machine monitor can determine a migration policy applicable to the target service using the methods provided in the aforementioned embodiments. By executing the migration policy, the amount of data to be migrated can be reduced, while also ensuring that the target service is paused at an appropriate time. This improves migration speed while shortening the service pause duration, ensuring that the service pause is not noticeable to users, and thus ensuring the effectiveness of the live migration. Furthermore, optionally, after receiving the live migration message generated by the virtual machine monitor, the application providing the target service can also execute a corresponding adjustment policy. The purpose of this adjustment policy can be to reduce the amount of data to be migrated, thereby ensuring the effectiveness of the migration. The adjustment policy executed by the application can include at least one of the following: reducing the application's data write frequency (i.e., service degradation), releasing the application's cached data in the virtual machine memory, and automatically shutting down the application after completing all requests to use the target service. The service degradation can occur during the migration period, which can include the interval between the time the application receives the live migration message and the start time of the aforementioned service suspension. It should be noted that the application's operation of reducing the write frequency and the virtual machine monitor's operation of increasing the virtual machine's vCPU scheduling period in the above embodiment have the same effect, and in practice, either can be performed. It should also be noted that, if there is no conflict, the application and virtual machine monitor can each perform their own actions to ensure the migration effect. After the target service is automatically shut down and the virtual machine is migrated to the destination host, the virtual machine monitor on the destination host can also proactively start the target service. Simultaneously, the target service can also recalculate unmigrated intermediate data and / or rebuild cached data. The following will further explain the operation of the application providing the target service during the live migration process from a process perspective. Figure 4 is a flowchart of another virtual machine live migration method provided in an embodiment of the present disclosure. This method provided in an embodiment of the present disclosure can be performed by the application providing the target service on the source host. As shown in Figure 4, the method may include the following steps:

[0018] 5501 , receiving hot migration message.

[0019] 5502, execute the adjustment policy corresponding to the hot migration message, where the adjustment policy is used to reduce the amount of data to be migrated in the virtual machine memory.

[0020] S503: In response to receiving the live migration message, the service feature information of the target service is sent, so that the virtual machine monitor in the virtual machine can perform live migration of the virtual machine according to the migration policy corresponding to the service feature information. The application can receive the live migration message generated by the virtual machine monitor via the second communication connection with the monitor agent. In response to receiving this message, the application can execute the corresponding adjustment policy. Furthermore, in response to receiving the live migration message, the application can also provide the virtual machine monitor with the service feature information of the target service it provides, so that the virtual machine monitor can generate a migration policy corresponding to the service feature information and perform live migration of the virtual machine according to the migration policy. Optionally, the adjustment policy can include at least one of reducing the frequency of data writes to the virtual machine memory, releasing cached data of the application providing the target service in the virtual machine memory, and shutting down the application providing the target service after processing a request to use the target service. The above examples only illustrate some adjustment policies. It should be noted that the embodiments of this disclosure are not limited to any specific adjustment policy; any policy that can reduce the amount of data to be migrated is applicable to this solution. While the application executes the aforementioned adjustment policy, the virtual machine monitor can also determine and execute the corresponding migration policy in accordance with the methods provided in the aforementioned embodiments. Optionally, similar to the aforementioned embodiments, the data to be migrated in this embodiment can also include service data generated after the target service is running and the virtual machine's state data, that is, core data in the virtual machine's memory. Alternatively, the application can execute a system call to cause the virtual machine kernel to send the address information of the data to be migrated to the virtual machine monitor via the virtual machine monitor's interface, so that the virtual machine monitor can complete the data migration. The address information can specifically include the GPA corresponding to the virtual memory page storing the data to be migrated. In this embodiment, after receiving the hot migration message, the application can also execute the corresponding adjustment policy. Execution of the adjustment policy can reduce the amount of data to be migrated, thereby increasing the subsequent migration speed of the data to be migrated by the virtual machine monitor and ensuring migration results. Details not described in detail in this embodiment and the technical effects achieved can be found in the relevant descriptions of the aforementioned embodiments and will not be elaborated upon here. The working processes of the virtual machine monitor and the service-providing application during virtual machine hot migration have been described above from a methodological perspective. Furthermore, both the aforementioned virtual machine monitor and application can be deployed on a physical host, which will be further described below. Furthermore, the physical host in this embodiment may be the source host where the virtual machine is migrated. Figure 2 is a schematic diagram of the structure of a physical host provided by an embodiment of the present disclosure.As shown in Figure 2, the physical host may include basic hardware, a virtual machine, and a virtual machine monitor. The virtual machine may be deployed with a monitor agent and an application providing the target service. The basic hardware may specifically include a processor and memory in the physical host. The processor may specifically be at least one computing unit as described in the above embodiments. The virtual machine monitor generates and sends a live migration message to the monitor agent. The monitor agent then forwards this live migration message to the application providing the target service. In response to receiving the live migration message, the application directly provides service feature information of the target service to the monitor agent. Furthermore, after startup, the application can generate data and write this data to the virtual machine memory. The virtual machine monitor then determines a migration strategy based on the service feature information provided by the application and migrates the data in the virtual machine memory according to the migration strategy. Optionally, the data to be migrated in the virtual machine may include the response data and virtual machine status data mentioned in the above embodiments. Optionally, upon receiving a live migration request, the application may also implement a corresponding adjustment strategy, provided that it does not conflict with the migration strategy. In this embodiment, the specific working processes of the various components of the physical host during the live migration process can be found in the relevant descriptions of the above embodiments and will not be repeated here. In this embodiment, the virtual machine monitor on the physical host can first obtain service characteristic information of the target service running on the virtual machine. This characteristic information can be fed back to the virtual machine monitor by the application after receiving the live migration message. The virtual machine monitor can then determine a corresponding migration strategy based on this service characteristic information and use this migration strategy to migrate the virtual machine. In the above method, on the one hand, the migration strategy determined by the virtual machine monitor based on this service characteristic information is clearly more suitable for the target service, thus ensuring an optimized live migration effect for the virtual machine. On the other hand, compared to detection methods performed by the virtual machine monitor or other devices, the service characteristic information can be directly fed back to the virtual machine monitor by the application providing the target service. This method is not only easier to implement but also more accurate. Therefore, the rationality of the migration strategy determined by the virtual machine monitor based on the service characteristic information can be further improved, ultimately ensuring the effectiveness of the live migration. The live migration effect is specifically evaluated by at least one metric, including the hot migration speed, success rate, and the duration of service interruption caused during the hot migration process. In addition, for details not described in this embodiment and the technical effects that can be achieved, please refer to the relevant descriptions of the above embodiments and will not be repeated here. The above embodiments have described the live migration process from the perspective of methods and devices. To facilitate understanding, the specific implementation process of the above virtual machine live migration will be described below using a specific scenario.An application providing human-computer interaction services may be deployed in a virtual machine on the source host. In response to the application being launched, the virtual machine's memory may store text conversation data generated in response to human-computer interaction requests, application cache data, and virtual machine state data. The data to be migrated may include text conversation data and state data. The application's service characteristics may include the response data mode being text, the data write method being a large overwrite, and a preset pause duration of 100 milliseconds. Therefore, when the source host requires an upgrade, the virtual machine needs to be migrated. Specifically, after receiving a live migration request, the application may, via a monitor agent, feed the aforementioned service characteristics information to the virtual machine monitor. The virtual machine monitor may then compress the text conversation data and virtual machine state in memory based on the service characteristics information and migrate the compressed data using a full migration. Furthermore, if the remaining migration time reaches 100 milliseconds, the human-computer interaction service is suspended. During the data migration process, the application may also implement corresponding adjustment policies, such as automatically shutting down after all requests have been processed. When a virtual machine migrates to a destination host, the virtual machine monitor in the destination host can control the application to start and restore the human-computer interaction service. The above is merely a schematic illustration of the migration process for a virtual machine deployed with a single human-computer interaction service. When a virtual machine deploys multiple services, the data for each service can be migrated separately in the same manner, thereby achieving migration of the entire virtual machine. The specific migration process can be found in the relevant descriptions of the above embodiments and will not be elaborated upon here. The following describes in detail the virtual machine hot migration apparatus according to one or more embodiments of the present disclosure. Those skilled in the art will appreciate that these invocation devices can be constructed using commercially available hardware components and configured according to the steps taught in this solution. Figure 5 is a schematic diagram of the structure of a virtual machine hot migration apparatus provided in an embodiment of the present disclosure. As shown in Figure 5, the apparatus may include: an acquisition module 11 for acquiring service feature information fed back by an application providing a target service after receiving a hot migration message. The service feature information corresponds to the target service running on the virtual machine; a policy determination module 12 for determining a migration policy based on the service feature information; and a migration module 13 for hot migrating the virtual machine according to the migration policy. Optionally, the policy determination module 12 is configured to determine policy parameters in the migration policy according to the service characteristic information. The migration module 13 is configured to migrate data to be migrated in the virtual machine memory according to the policy parameters, where the data to be migrated includes response data generated after the target service is running and state data of the virtual machine.Optionally, the acquisition module 11 is further configured to acquire the data to be migrated based on address information, and the memory information includes a virtual machine physical address corresponding to a virtual memory page storing the data to be migrated. Optionally, the service feature information includes a modality of the response data. The policy determination module 12 is configured to determine that the data processing mode in the policy parameters is compression if the modality of the response data is text. The migration module 13 is configured to compress the response data and / or the virtual machine's state data to obtain a compression result, and migrate the compression result. Optionally, the service feature information includes a ratio of incremental data in the same virtual memory page during the current hot migration compared to the previous hot migration. The policy determination module 12 is configured to determine that the data migration mode in the policy parameters is incremental migration if the ratio of incremental data in the same virtual memory page is less than a preset ratio. The migration module 13 is configured to compare the data to be migrated corresponding to two adjacent hot migrations to obtain incremental data, and migrate the incremental data. Optionally, the apparatus further includes a control module 14. The service feature information includes a preset pause duration. The policy determination module 12 is configured to determine the remaining duration of the live migration at the current moment; if the remaining duration is less than or equal to the preset suspension duration, the current moment is determined as the service suspension start time in the policy parameters. The control module 14 is configured to control the suspension of the target service at the current moment. In response to receiving the live migration request, the application providing the target service reduces the frequency of data writes to memory during the live migration period, releases cached data of the application in the virtual machine memory, or closes the application after processing the target service usage request. The live migration period includes the time interval between the time the live migration message is received and the service suspension start time. Optionally, the control module 14 is further configured to increase the scheduling period of the virtual central processing unit in the virtual machine in response to the generation of the live migration message. Optionally, the acquisition module 11 is configured to receive the service feature information via a first communication connection between the virtual machine monitor and a monitor agent in the virtual machine. The monitor agent receives the service feature information via a second communication connection between the application providing the target service and the monitor agent. Optionally, the apparatus further includes: a creating module 15, configured to establish the first communication connection in response to the running of the virtual machine; and establish the second communication connection in response to the starting of the application.The device shown in FIG5 can execute the methods of the embodiments shown in FIG1 through FIG3b . For portions not described in detail in this embodiment, reference is made to the relevant description of the embodiments shown in FIG1 through FIG3b . The execution process and technical effects of this technical solution are described in the embodiments shown in FIG1 through FIG3b and will not be repeated here. FIG6 is a schematic structural diagram of another inter-process communication device provided in an embodiment of the present disclosure. As shown in FIG6 , the device includes: a receiving module 21 for receiving a live migration message; an executing module 22 for executing an adjustment policy corresponding to the live migration message, the adjustment policy being used to reduce the amount of data to be migrated in the virtual machine's memory; a sending module 23 for transmitting service feature information of the target service in response to receiving the live migration message, so that the virtual machine monitor in the virtual machine can perform live migration of the virtual machine according to the migration policy corresponding to the service feature information. The adjustment policy includes at least one of reducing the frequency of data writes to the virtual machine's memory, releasing cached data of the application in the virtual machine's memory, and shutting down the application providing the target service after processing a request to use the target service. Optionally, the device also includes a data determination module 24. The data determination module 24 is configured to determine the response data generated after the target service is run and the state data of the virtual machine as the data to be migrated. The sending module 23 is configured to further send the address information of the data to be migrated to the virtual machine monitor so that the virtual machine monitor can migrate the data to be migrated. The address information includes the virtual machine physical address corresponding to the virtual memory page storing the data to be migrated. The apparatus shown in FIG6 can execute the method shown in the embodiment of FIG4. For portions not described in detail in this embodiment, please refer to the relevant description of the embodiment shown in FIG4. The execution process and technical effects of this technical solution are described in the embodiment shown in FIG4 and will not be repeated here. Based on the above embodiments, FIG7 is a schematic diagram of the structure of a physical host provided in an embodiment of the present disclosure. As shown in FIG7, the physical host may include: a processor, a memory, and a virtual machine running in an isolated environment constructed by the memory and the processor. The memory is configured to store a computer program; the processor is configured to execute the computer program to implement the virtual machine hot migration method provided in the embodiments shown in FIG1 to FIG4. In addition, an embodiment of the present disclosure provides a computer storage medium for storing computer software instructions used by the above electronic device, which includes a program for executing the virtual machine hot migration method shown in Figures 1 to 4.In addition, embodiments of the present disclosure provide a computer program that, when executed on a computer, causes the computer to perform the virtual machine live migration method provided in the embodiments shown in Figures 1 to 4 . Finally, it should be noted that the above embodiments are intended only to illustrate the technical solutions of the present disclosure and are not intended to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, persons of ordinary skill in the art will understand that the technical solutions described in the aforementioned embodiments may be modified or some of the technical features thereof may be replaced with equivalents. Such modifications or replacements do not deviate from the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present disclosure.

Claims

Claims 1. A virtual machine hot migration method, comprising: Acquire service feature information fed back by an application providing a target service after receiving a hot migration message, wherein the service feature information corresponds to the target service running on the virtual machine; Determine a migration strategy according to the service characteristic information; According to the migration strategy, hot migration is performed on the virtual machine.

2. The method according to claim 1, wherein determining the migration strategy according to the service characteristic information comprises: Determining, according to the service characteristic information, policy parameters in the migration policy; The hot migrating the virtual machine according to the migration policy includes: migrating the data to be migrated in the memory of the virtual machine according to the policy parameters.

3. The method according to claim 2, wherein the service characteristic information includes a mode of the response data; and determining a policy parameter in the migration policy according to the service characteristic information comprises: If the mode of the response data is text, determining that the data processing method in the strategy parameter is compression; The migrating the data to be migrated in the memory of the virtual machine according to the policy parameters includes: compressing the response data and / or the state data of the virtual machine to obtain a compression result; The compression result is migrated.

4. The method according to claim 2, wherein the service characteristic information comprises a proportion of incremental data in the same virtual memory page in this hot migration compared with the previous hot migration; and determining the policy parameters in the migration policy according to the service characteristic information comprises: If the proportion of incremental data in the same virtual memory page is less than a preset proportion, determining that the data migration mode in the policy parameters is incremental migration; The migrating the data to be migrated in the memory of the virtual machine according to the policy parameters includes: comparing the data to be migrated corresponding to two adjacent hot migrations to obtain incremental data; The incremental data is migrated.

5. The method according to claim 2, wherein the service characteristic information includes a preset pause duration; and determining the policy parameters in the migration policy according to the service characteristic information comprises: Determine the remaining time of hot migration at the current moment; If the remaining time is less than or equal to the preset suspension time, the current time is determined as the service suspension start time in the policy parameters; the method further includes: controlling the target service to be suspended at the current time.

6. The method according to claim 5, wherein the application providing the target service reduces the frequency of writing data to the memory during the hot migration period in response to receiving the hot migration request, or releases the cached data of the application in the virtual machine memory, or closes the application providing the target service after the use request of the target service is processed; wherein, The hot migration period includes the time interval between the time when the hot migration message is received and the start time of the service suspension.

7. The method according to any one of claims 1 to 6, further comprising: In response to the generation of the hot migration message, a scheduling period of a virtual central processing unit in the virtual machine is increased.

8. The method according to any one of claims 1 to 7, wherein the method is applied to a virtual machine monitor on a physical host; The obtaining of service feature information fed back by the target service after receiving the hot migration message includes: The service characteristic information is received via a first communication connection between the virtual machine monitor and a monitor agent in the virtual machine, wherein the monitor agent receives the service characteristic information via a second communication connection between an application providing the target service and the monitor agent.

9. A virtual machine hot migration method, applied to an application program providing a target service in a virtual machine, comprising: Receive hot migration messages; Executing an adjustment strategy corresponding to the hot migration message, wherein the adjustment strategy is used to reduce the amount of data to be migrated in the memory of the virtual machine; In response to receiving the hot migration message, the service characteristic information of the target service is sent, so that the virtual machine monitor in the virtual machine performs hot migration on the virtual machine according to the migration policy corresponding to the service characteristic information.

10. The method according to claim 9, wherein the adjustment strategy comprises at least one of reducing the frequency of writing to the data virtual machine memory, releasing the cached data of the application in the virtual machine memory, and closing the application providing the target service after the use request of the target service is processed.

11. The method according to claim 9 or 10, further comprising: Determine the response data generated after the target service is run and the state data of the virtual machine as the data to be migrated; The address information of the data to be migrated is sent to a virtual machine monitor so that the virtual machine monitor migrates the data to be migrated, wherein the address information includes a virtual machine physical address corresponding to a virtual memory page storing the data to be migrated.

12. A physical host, comprising: A virtual machine and a virtual machine monitor, wherein a monitor agent and an application providing a target service are deployed in the virtual machine; the monitor agent is used to forward a hot migration message generated by the virtual machine monitor to the application; forward service feature information corresponding to the target service to the virtual monitor; the application is used to write data into the memory of the virtual machine; and in response to receiving the hot migration message, feed back the service feature information of the target service to the monitor agent; The virtual machine monitor is used to send a hot migration message to the monitor agent; determine a migration strategy according to the service feature information; and migrate data in the virtual machine memory according to the migration strategy.

13. A physical host, comprising: A memory and a processor, and a virtual machine running in an isolation environment constructed by the memory and the processor; The memory is used to store computer programs; The processor is used to execute the computer program to implement the virtual machine hot migration method according to any one of claims 1 to 11.

14. A non-transitory machine-readable storage medium having executable code stored thereon, and when the executable code is executed by a computing system of an electronic device, the computing system is enabled to execute the virtual machine hot migration method according to any one of claims 1 to 11.

15. A computer program, when executed in a computer, causes the computer to execute the virtual machine hot migration method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Virtual machine morphing for heterogeneous migration environments

    CN103238136A

  • Virtual machine migration method and system

    CN111736943A

  • Self-adaptive multi-threshold virtual machine dynamic migration optimization method and system

    CN116755833A

  • Method, apparatus and recording medium for migrating a virtual machine

    US20090106409A1

  • Reducing data transfer overhead during live migration of a virtual machine

    US20120324443A1

Cited By

  • Virtual machine cluster monitoring method and system, electronic equipment, storage medium and computer program product

    CN120929333A