Data migration method and server

By obtaining incremental data and disk information to determine the switching conditions, combined with full and incremental snapshot processing, the problem of excessive business interruption time in virtual machine temperature migration is solved, and business continuity and high availability are achieved.

WO2025138597A1PCT designated stage expired Publication Date: 2025-07-03XFUSION DIGITAL TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/097415
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-27
Filing Date
2024-06-05
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

During the data copying process, the existing virtual machine temperature migration technology has caused large new business data to increase the duration of business interruption, which cannot meet the business's requirements for continuity and high availability.

Method used

By obtaining the size of incremental data and disk information of the virtual machine, it is necessary to perform virtual machine switching operations when the switching conditions are met, including full snapshot processing and incremental snapshot processing, reducing the business interruption time.

Benefits of technology

It effectively reduces the business interruption time during data migration and meets the business's requirements for continuity and high availability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024097415_03072025_PF_FP_ABST
    Figure CN2024097415_03072025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a data migration method and a server. The method comprises: copying data of a first virtual machine to a second virtual machine; acquiring the size of first incremental data, which is data generated by the first virtual machine in a data copying process; and when it is determined, on the basis of the size of the first incremental data and disk information of the first virtual machine, that a switching condition is met, executing a virtual-machine switching operation, which is configured to indicate switching a service running on the first virtual machine to the second virtual machine. The data migration method provided in the embodiments of the present application can reduce the duration of service interruption in a data migration process and reduce the impact on a service, thereby meeting the requirements of the service for continuity and high availability.
Need to check novelty before this filing date? Find Prior Art

Description

Data migration method and server

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on December 27, 2023, with application number 202311818170.6 and application name “Data Migration Method and Server”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of server technology, and in particular to a data migration method and a server. Background Art

[0003] In today's digital age, virtualization has become a key technology for enterprises and service providers, enabling more efficient management and utilization of computing resources, improving service performance and reliability. For example, a virtual machine (VM) is a virtualization technology based on physical servers. It uses software to simulate a real computer environment and run an operating system and applications within it. The VM's operating system and applications share the physical server's hardware resources, but each maintains its own independent operating system and application environment.

[0004] For heterogeneous clusters, virtual machine data migration includes cold migration and warm migration. Cold migration of virtual machines requires stopping the source virtual machine and copying the data to the target virtual machine, resulting in business interruption and service unavailability, which cannot meet the business requirements for continuity and high availability. Warm migration of virtual machines can be performed while the source virtual machine is running. In other words, the source virtual machine copies data to the target virtual machine before shutting down. However, since the business will continue to run during the data copy process, the source virtual machine will generate new business data. To avoid data loss, the new business data needs to be copied to the target virtual machine after the source virtual machine is shut down, and then the target virtual machine can be started to run the business. If the new business data is large, it will take a long time to copy, increasing the duration of business interruption, which cannot meet the business requirements for continuity and high availability.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a data migration method and server, which can reduce the duration of business interruption during data migration and reduce the impact on the business, so as to meet the business requirements for continuity and high availability.

[0007] In a first aspect, an embodiment of the present application provides a data migration method, the method comprising:

[0008] Copying data of the first virtual machine to the second virtual machine;

[0009] Obtaining a size of first incremental data, where the first incremental data is data generated by the first virtual machine during the data copy process;

[0010] When it is determined that the switching condition is met based on the size of the first incremental data and the disk information of the first virtual machine, a virtual machine switching operation is performed, where the virtual machine switching operation is used to switch the business running on the first virtual machine to the second virtual machine.

[0011] That is to say, the data migration method provided in the embodiment of the present application determines whether the switching conditions are met based on the size of the incremental data and the disk information, so as to reduce the duration of business interruption and have higher accuracy.

[0012] In one possible implementation, when determining that a switching condition is met based on the size of the first incremental data and the disk information of the first virtual machine, performing a virtual machine switching operation, where the virtual machine switching operation is used to indicate switching a service running on the first virtual machine to the second virtual machine, includes:

[0013] Determine a first disk increment status and / or a first disk copy status of the first virtual machine based on the size of the first incremental data and the disk information of the first virtual machine;

[0014] When the first disk increment and / or the first disk copy of the first virtual machine meets the switching condition, a virtual machine switching operation is performed, where the virtual machine switching operation is used to switch the service running on the first virtual machine to the second virtual machine.

[0015] Taking into account the impact of incremental data and disk information on the duration of business interruption, before the first virtual machine stops running, it is determined whether the switching conditions are met based on the first disk incremental situation and / or the first disk copy situation of the first virtual machine. If the switching conditions are met, it means that the duration of the business interruption is short and the impact on the business is low. The virtual machine switching operation can be performed to meet the business requirements for continuity and high availability. If the switching conditions are not met, it means that the duration of the business interruption is long, and the virtual machine switching operation is not performed to reduce the impact on the business.

[0016] In one possible implementation, the disk information includes a disk capacity of the first virtual machine, the first disk incremental status includes a first disk incremental ratio, and determining the first disk incremental status of the first virtual machine based on the size of the first incremental data and the disk information includes:

[0017] The first disk incremental ratio is determined based on the size of the first incremental data and the disk capacity.

[0018] In the embodiment of the present application, the disk increment ratio is used to represent the disk increment of the first virtual machine, which can more accurately represent the impact of the incremental data size generated by the business on the business.

[0019] In one possible implementation, the disk information includes a total disk copy duration of the first virtual machine, a data size of a last data copy, and a duration of the last data copy; the first disk copy status includes a first copy duration ratio; and determining the first disk copy status of the first virtual machine based on the first incremental data and the disk capacity includes:

[0020] Determining a first copy duration based on the size of the first incremental data, the size of the last data copy, and the duration of the last data copy;

[0021] The first copy duration ratio is determined based on the first copy duration and the total disk copy duration.

[0022] In the embodiment of the present application, the copy duration ratio is used to represent the disk copy status of the first virtual machine, which can more accurately represent the impact of the copy duration of the incremental data generated by the business on the business.

[0023] In one possible implementation, the method further includes:

[0024] If the first disk increment ratio is less than the first threshold, and the first copy duration ratio is less than the second threshold, the switching condition is met;

[0025] If the first disk increment ratio is greater than or equal to the first threshold, or the first copy duration ratio is greater than or equal to the second threshold, the switching condition is not met.

[0026] In an embodiment of the present application, in order to further reduce the duration of business interruption during data migration and reduce the impact on the business, a virtual machine switching operation is performed when the disk increment ratio is less than a first threshold and the copy duration ratio is less than a second threshold; otherwise, the virtual machine switching operation is not performed.

[0027] In one possible implementation manner, the first threshold and / or the second threshold is a set value, or the first threshold and / or the second threshold is adjusted according to the importance of the service.

[0028] In the embodiment of the present application, considering that the importance of different services may be different, in order to adapt to different services, the first threshold and / or the second threshold may be adjusted according to the importance of the service.

[0029] In one possible implementation, copying data of the first virtual machine to the second virtual machine includes:

[0030] Performing a full snapshot of the first virtual machine to obtain full data of the first virtual machine;

[0031] Copy the full amount of data to the second virtual machine.

[0032] In the embodiment of the present application, in order to improve the efficiency of data copying, a snapshot method is used to copy data.

[0033] In one possible implementation, performing the virtual machine switching operation includes:

[0034] Stopping the first virtual machine;

[0035] Performing incremental snapshot processing on the first virtual machine to obtain incremental data;

[0036] Copying the incremental data to the second virtual machine;

[0037] Run the second virtual machine.

[0038] In an embodiment of the present application, in order to avoid data loss and reduce the duration of business interruption, data is copied using incremental snapshots during the virtual machine switching process.

[0039] In one possible implementation, the method further includes:

[0040] If the first disk incremental condition and / or the first disk copy condition do not meet the switching condition, copying the first incremental data to the second virtual machine;

[0041] Obtaining a size of second incremental data, where the second incremental data is data generated by the first virtual machine during a process of copying the first incremental data to the second virtual machine;

[0042] Determine a second disk increment status and / or a second disk copy status of the first virtual machine based on the size of the second incremental data and the disk information;

[0043] When the second disk increment condition and / or the second disk copy condition meets the switching condition, the virtual machine switching operation is performed.

[0044] In an embodiment of the present application, if the switching condition is not met, the first incremental data is copied to the second virtual machine. After the copy is completed, it is determined again whether the switching condition is met based on the size of the second incremental data and the disk information. If the switching condition is met, the virtual machine switching operation is performed. Otherwise, this cycle is repeated until the business running on the first virtual machine is switched to the second virtual machine or the execution of the data migration method is terminated.

[0045] In one possible implementation, the first virtual machine and the second virtual machine are in a heterogeneous cluster.

[0046] In an embodiment of the present application, the data migration method is applicable to warm migration of virtual machines in a heterogeneous cluster, reducing the impact of warm migration of virtual machines in a heterogeneous cluster on services, thereby meeting the service requirements for continuity and high availability.

[0047] In a second aspect, the present application provides a data migration system, comprising:

[0048] A data copy module, configured to copy data of the first virtual machine to the second virtual machine;

[0049] a data acquisition module, configured to acquire a size of first incremental data, where the first incremental data is data generated by the first virtual machine during the data copy process;

[0050] a determination module, configured to determine a first disk increment status and / or a first disk copy status of the first virtual machine based on a size of the first incremental data and disk information of the first virtual machine;

[0051] The switching module is used to perform a virtual machine switching operation when the first disk increment situation and / or the first disk copy situation meet the switching conditions. The virtual machine switching operation is used to indicate that the business running on the first virtual machine is switched to the second virtual machine.

[0052] In a third aspect, an embodiment of the present application provides a server, comprising: a processor and a memory, wherein the processor is connected to the memory, the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0053] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the method according to any one of the first aspects is implemented.

[0054] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements any one of the methods in the first aspect when executed by a computer. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0056] FIG1 is a schematic diagram of a data migration method provided in an embodiment of the present application;

[0057] FIG2 is a schematic diagram of steps S401 to S404 in a data migration method provided in an embodiment of the present application;

[0058] FIG3 is a schematic diagram of steps S501 to S504 in a data migration method provided in an embodiment of the present application;

[0059] FIG4 is a flow chart of a data migration method provided in an embodiment of the present application;

[0060] 5A is a schematic diagram of copying all data of a source virtual machine to a target virtual machine in a data migration method provided in an embodiment of the present application;

[0061] 5B is a schematic diagram of copying first incremental data of a source virtual machine to a target virtual machine in a data migration method provided in an embodiment of the present application;

[0062] 5C is a schematic diagram of copying the second incremental data of a source virtual machine to a target virtual machine in a data migration method provided in an embodiment of the present application;

[0063] FIG6 is a structural block diagram of a server provided in an embodiment of the present application; DETAILED DESCRIPTION

[0064] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0065] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0066] An embodiment of the present application provides a data migration method, a server, and a computer-readable storage medium, the method comprising: copying data of a first virtual machine to a second virtual machine; obtaining the size of first incremental data, the first incremental data being data generated by the first virtual machine during the data copy process; determining the first disk incremental status and / or the first disk copy status of the first virtual machine based on the size of the first incremental data and the disk information of the first virtual machine; and performing a virtual machine switching operation when the first disk incremental status and / or the first disk copy status meet the switching conditions, the virtual machine switching operation being used to indicate switching the business running on the first virtual machine to the second virtual machine. The data migration method provided by the embodiment of the present application can reduce the duration of business interruption during data migration and reduce the impact on the business, so as to meet the business requirements for continuity and high availability.

[0067] In an embodiment of the present application, the data migration method can be applied to a server (such as a management server, etc.), which may include but is not limited to a cabinet server, a rack server, a blade server, etc., or the server is a general server, a heterogeneous server, a DPU server, a GPU server, an AI server, etc.

[0068] Exemplarily, the data migration method can be applied to a server cluster, which can include multiple servers, such as a management server, a computing server or a storage server, etc. Multiple virtual machines can run in the server cluster, and the virtual machine can be deployed in any server. The data migration method can be executed by a management server in the server cluster, and the management server can communicate data with multiple virtual machines. In the scenario of virtual machine business migration, the management server can execute the data migration method to migrate the business of the source virtual machine to the target virtual machine to meet the business requirements for continuity and high availability, wherein the first virtual machine is the source virtual machine and the second virtual machine is the target virtual machine.

[0069] Exemplarily, the server cluster may be a heterogeneous cluster, that is, the data migration method provided in the embodiments of the present application may be applicable to warm migration of virtual machines in a heterogeneous cluster, that is, the data migration method may be executed by a management server in a heterogeneous cluster, wherein the heterogeneous cluster may include multiple clusters of different functions or types, such as a first cluster, a second cluster, a third cluster, etc. For example, the cluster may include but is not limited to a kubernetes (K8S) cluster, a distributed storage cluster, a load balancing cluster, a high-performance cluster, a high-availability cluster, a grid computing cluster, etc. Exemplarily, the first virtual machine and the second virtual machine may be virtual machines in the same cluster or different clusters, and the management server may communicate data with the virtual machines in each cluster, such as the first virtual machine may be a virtual machine running in the first cluster, and the second virtual machine may be a virtual machine running in the second cluster, and the management server may migrate the business of the first virtual machine in the first cluster to the second virtual machine in the second cluster, without limitation here.

[0070] The following specific embodiments are used to describe the technical solution of the present application in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0071] FIG1 is a schematic diagram of a data migration method provided by an embodiment of the present application. Referring to FIG1 , the method may include steps S101 to S103, which are specifically as follows:

[0072] S101: Copy data of a first virtual machine to a second virtual machine.

[0073] In an embodiment of the present application, the server may provide a management interface that a user may access through a terminal browser to implement human-computer interaction. For example, the management interface may display information about multiple virtual machines, such as virtual machine resource information (e.g., host, CPU, GPU, memory, disk, network card, or other resources, or resource usage information), service information (e.g., service type, service volume, service operation status), and operation status (e.g., virtual machine failure status, performance status, etc.).

[0074] Exemplarily, a user can select a first virtual machine and a second virtual machine from a plurality of virtual machines displayed in a management interface through a terminal, and send a business migration request to the server, wherein the business migration request includes an identifier of the first virtual machine and an identifier of the second virtual machine, and the business migration request is used to request that the business in the first virtual machine be migrated to the second virtual machine. In response to the received business migration request, the server triggers the execution of the data migration method to achieve the migration of the business running in the first virtual machine to the second virtual machine. In step S101, the server copies the data of the first virtual machine to the second virtual machine in response to the received business migration request. More specifically, the server copies the data in the disk mounted on the first virtual machine to the disk mounted on the second virtual machine based on the identifier of the first virtual machine and the identifier of the second virtual machine.

[0075] Exemplarily, the server can determine whether to trigger the execution of the data migration method based on the information of multiple virtual machines. For example, if a virtual machine fails or there are insufficient resources, the execution of the data migration method is triggered. In step S101, the server determines a first virtual machine and a second virtual machine from multiple virtual machines based on the information of the multiple virtual machines, and copies the data of the first virtual machine to the second virtual machine. For example, the first virtual machine can be a virtual machine that meets the first condition, and the second virtual machine can be a virtual machine that meets the second condition. The first condition can include but is not limited to: the resource information of the virtual machine does not meet the resource condition, the virtual machine fails, the business information of the virtual machine does not meet the business condition, or the operating status of the virtual machine does not meet the operating condition, etc. The second condition can include but is not limited to: the resource information of the virtual machine meets the resource condition, the business information of the virtual machine meets the business condition, or the operating status of the virtual machine meets the operating condition, etc.

[0076] In an embodiment of the present application, data generated by a virtual machine running a service can be stored in a disk mounted on the virtual machine. The capacity of the disk mounted on the virtual machine can be determined based on the capacity of the disk allocated to the virtual machine. For example, if the capacity of the disk allocated to the virtual machine is 1GB, then the total capacity of all disks mounted on the virtual machine is greater than or equal to 1GB. Step S101 can be performed while the first virtual machine is running. That is, while the first virtual machine is running, the data (such as full data or incremental data) on the disk mounted on the first virtual machine is copied to the disk mounted on the second virtual machine.

[0077] For example, the server can copy data (such as full data or incremental data) from a disk mounted on the first virtual machine and store the copied data (such as full data or incremental data) on a disk mounted on the second virtual machine. Alternatively, the server sends a data copy request to the first virtual machine, requesting the first virtual machine to copy data (such as full data or incremental data) to the second virtual machine. In response to the data copy request, the first virtual machine transfers and stores the data (such as full data or incremental data) on a disk mounted on the second virtual machine.

[0078] S102: Obtain a size of first incremental data, where the first incremental data is data generated by the first virtual machine during a data copy process.

[0079] That is to say, during the execution of step S101, the first virtual machine is in operation and will continuously generate business data, namely the first incremental data. Specifically, from the start time of data copying to the end time of data copying, the data generated by the first virtual machine running the business will be written to the disk mounted on the first virtual machine. For example, in step S102, the size of the first incremental data can be obtained by means of a snapshot. Alternatively, at the end time of data copying (such as full data, etc.), the size of the first incremental data is obtained by reading the size of the incremental data in all disks mounted on the first virtual machine. For example, the size of the first incremental data is the sum of the sizes of the incremental data in all disks mounted on the first virtual machine.

[0080] In the embodiment of the present application, the method may further include: obtaining disk information of the first virtual machine.

[0081] Exemplarily, the disk information of the first virtual machine is used to represent disk information related to data copying, or disk information that affects the duration of data copying, etc. For example, the disk information of the first virtual machine may include but is not limited to the disk capacity of the first virtual machine, the total duration of the disk copy of the first virtual machine, the data size of the last data copy, or the duration of the last data copy, etc. The disk capacity of the first virtual machine can be determined based on the disk capacity allocated to the first virtual machine, or based on the sum of the capacities of all disks mounted on the first virtual machine. The total duration of the disk copy of the first virtual machine can be determined based on the sum of the durations of all data copies of the first virtual machine during the business migration process. The data size of the last data copy can be determined based on the size of the data copied during the last data copy process, for example, obtained by means of a snapshot. The duration of the last data copy can be determined based on the start time and end time of the last data copy, such as the difference between the start time and the end time, etc.

[0082] S103. When it is determined that the switching conditions are met based on the size of the first incremental data and the disk information of the first virtual machine, a virtual machine switching operation is performed, where the virtual machine switching operation is used to switch the business running on the first virtual machine to the second virtual machine.

[0083] That is to say, the data migration method provided in the embodiment of the present application determines whether the switching conditions are met based on the size of the incremental data and the disk information, so as to reduce the duration of business interruption and have higher accuracy.

[0084] In one possible implementation, step S103 may include:

[0085] S1031. Determine a first disk increment and / or a first disk copy status of the first virtual machine based on the size of the first incremental data and the disk information of the first virtual machine.

[0086] S1032. When the first disk increment and / or the first disk copy of the first virtual machine meet the switching conditions, perform a virtual machine switching operation, where the virtual machine switching operation is used to switch the business running on the first virtual machine to the second virtual machine.

[0087] The disk incremental status of the first virtual machine is used to indicate the incremental status of the business data generated by the first virtual machine during the data copy process, such as the size of the disk incremental data, the disk incremental ratio, etc. The disk copy request of the first virtual machine is used to indicate the data copy status of the first virtual machine, such as the size of the copy duration, the copy duration ratio, etc.

[0088] In the embodiment of the present application, step S1031 may further include: determining the first disk increment status and / or the first disk copy status of the first virtual machine based on the size of the first incremental data and disk information.

[0089] In step S1031, the first disk incremental status may be determined based on the size of the first incremental data and the disk information. In one possible implementation, the first disk incremental status may include a first disk incremental ratio. Determining the first disk incremental status of the first virtual machine based on the size of the first incremental data and the disk information includes:

[0090] S10311. Determine the first disk incremental ratio based on the size of the first incremental data and the disk capacity.

[0091] In the embodiment of the present application, the disk increment ratio is used to represent the disk increment of the first virtual machine, which can more accurately represent the impact of the incremental data size generated by the business on the business.

[0092] Exemplarily, the first disk increment ratio may be calculated using the following formula, where the formula is:

[0093] △sizeThreshold=Sum(disk_i.incrementSize) / Sum(disk_i.Size)

[0094] Wherein, ΔsizeThreshold is the first disk increment ratio, Sum(disk_i.incrementSize) is the size of the first incremental data, and Sum(disk_i.Size) is the disk capacity of the first virtual machine.

[0095] Exemplarily, the disks mounted on the first virtual machine may include a first disk disk1, a second disk disk2, ... an Nth disk diskN, etc. The size of the first incremental data may be calculated by the following formula, where the formula is:

[0096] △incrementSize=disk1.incrementSize+disk2.incrementSize+....+diskN.incrementSize=Sum(disk_i.incrementSize)

[0097] Among them, ΔincrementSize is the size of the first incremental data, and disk1.incrementSize, disk2.incrementSize, ...diskN.incrementSize are the sizes of the incremental data of disk1, disk2, ...diskN respectively.

[0098] Exemplarily, the disk capacity of the first virtual machine can be calculated using the following formula, where the formula is:

[0099] △totalDiskSize=disk1.Size+disk2.Size+...+diskN.Size=Sum(disk_i.Size)

[0100] Here, ΔtotalDiskSize is the disk capacity of the first virtual machine, and disk1.Size, disk2.Size, ...diskN are the incremental capacities of disk1, disk2, ...diskN respectively.

[0101] In step S1031, the first disk copy status can be determined based on the size of the first incremental data and disk information. In one possible implementation, the first disk copy status can include a first copy duration ratio. Determining the first disk copy status of the first virtual machine based on the first incremental data and the disk capacity includes:

[0102] S10312: Determine a first copy duration based on the size of the first incremental data, the size of the last data copy, and the duration of the last data copy;

[0103] S10313. Determine the first copy duration ratio based on the first copy duration and the total disk copy duration.

[0104] In the embodiment of the present application, the copy duration ratio is used to represent the disk copy status of the first virtual machine, which can more accurately represent the impact of the copy duration of the incremental data generated by the business on the business.

[0105] Exemplarily, the first copy duration can be calculated using the following formula, where the formula is:

[0106] △estimatedTime=△incrementSize / △v

[0107] Wherein, ΔestimatedTime is the duration of the first copy, and Δv is the data copy rate, which is determined based on the data size of the last data copy and the duration of the last data copy.

[0108] Exemplarily, the data copy rate can be calculated using the following formula, where:

[0109] △v=△preCopySize / △preCopyTime

[0110] Among them, △preCopySize is the data size of the last data copy, △preCopyTime is the duration of the last data copy, which can be obtained through a snapshot. △preCopyTime = t1-t0, t1 is the start time of the last data copy, and t0 is the end time of the last data copy.

[0111] It should be noted that determining the data copy rate based on the size and duration of the last data copy can cover the impact of disk IO performance or network performance, thereby improving the accuracy of predicting the first copy duration.

[0112] Exemplarily, the first copy duration ratio may be calculated using the following formula, where:

[0113] △copyTimeThreshold=△estimatedTime / Sum(disk_i.copyTime)

[0114] ΔcopyTimeThreshold is the first copy duration ratio, and Sum(disk_i.copyTime) is the total disk copy duration. The total disk copy duration can be determined based on the total duration of all data copies of the first virtual machine during the service migration process.

[0115] For example, the total disk copy duration can be calculated using the following formula:

[0116] △totalCopytime=copyTime1+copyTime2+...+copyTimeN=Sum(disk_i.copyTime)

[0117] Where △totalCopytime is the total disk copy duration, and copyTime1, copyTime2, …copyTimeN are the durations of the first N data copies.

[0118] It is understandable that the method for determining the disk increment status and / or disk copy status of the first virtual machine is not limited to the examples in the embodiments of the present application and is not limited here.

[0119] In an embodiment of the present application, the virtual machine switching operation may include but is not limited to stopping the operation of the first virtual machine (such as shutting down the first virtual machine, etc.), copying the incremental data of the first virtual machine to the second virtual machine, or running the second virtual machine (such as turning on the second virtual machine, etc.), so as to switch the business running by the first virtual machine to the second virtual machine.

[0120] It should be pointed out that during the business migration process, the duration of the business interruption may include but is not limited to the shutdown time of the first virtual machine, the data copy time after the first virtual machine is shut down, or the startup time of the second virtual machine. In order to minimize the duration of the business interruption, in an embodiment of the present application, whether to perform a virtual machine switching operation is determined based on the first disk increment situation and / or the first disk copy situation. Specifically, if the first disk increment situation and / or the first disk copy situation meet the switching conditions, it means that the data copy time after the first virtual machine is shut down is short, and the impact on the business is low. The virtual machine switching operation is performed, thereby reducing the duration of the business interruption. If the first disk increment situation and / or the first disk copy situation does not meet the switching conditions, it means that the data copy time after the first virtual machine is shut down is long, and the impact on the business is large. The virtual machine switching operation is not performed, thereby reducing the impact on the business.

[0121] It is understood that the data migration method provided in the embodiments of the present application shortens the duration of service interruption and reduces the impact on services by at least reducing the data copy duration after the first virtual machine is shut down. In some optional embodiments, the duration of service interruption can be further reduced by further reducing the shutdown duration of the first virtual machine or reducing the startup duration of the second virtual machine.

[0122] In an embodiment of the present application, the method may further include:

[0123] S201: If the first disk increment ratio is less than a first threshold, and the first copy duration ratio is less than a second threshold, then the switching condition is met;

[0124] S202: If the first disk increment ratio is greater than or equal to the first threshold, or the first copy duration ratio is greater than or equal to the second threshold, the switching condition is not met.

[0125] In an example of the present application, in order to further reduce the duration of business interruption during data migration and reduce the impact on the business, a virtual machine switching operation is performed when the disk increment ratio is less than a first threshold and the copy duration ratio is less than a second threshold; otherwise, the virtual machine switching operation is not performed.

[0126] In one possible implementation, the first threshold and / or the second threshold are set values ​​(e.g., pre-set, etc.), or the first threshold and / or the second threshold are adjusted according to the importance of the business. That is, considering that the importance of different businesses may be different, in order to adapt to different businesses, the first threshold and / or the second threshold can be adjusted according to the importance of the business. For example, the importance of the business can be divided into multiple levels, such as high, medium, low, etc. If the importance of the business is high, the value range of the first threshold and / or the second threshold can be less than 1% or 1% to 5%, etc. If the importance of the business is medium, the value range of the first threshold and / or the second threshold can be 5% to 10%, etc. If the importance of the business is low, the value range of the first threshold and / or the second threshold can be greater than or equal to 10%, etc.

[0127] It is understood that determining whether the switching condition is met based on the first disk increment condition and / or the first disk copy condition is not limited to the examples provided in the embodiments of the present application. In some optional embodiments, other methods may be used to determine whether the switching condition is met, or the switching condition may be changed, which is not limited here. For example, the first disk increment condition includes the size of the first incremental data, and / or the first disk copy condition includes the first copy duration. In step S1032, if the first disk increment ratio is less than a first threshold, or the first copy duration ratio is less than a second threshold, then the switching condition is met; otherwise, the switching condition is not met. Alternatively, if the size of the first incremental data is less than the increment threshold, then the switching condition is met; otherwise, the switching condition is not met. Alternatively, if the first copy duration is less than the copy duration threshold, then the switching condition is met; otherwise, the switching condition is not met. Alternatively, if the size of the first incremental data is less than the increment threshold, and the first copy duration is less than the copy duration threshold, then the switching condition is met; otherwise, the switching condition is not met. Alternatively, if the size of the first incremental data is less than the increment threshold, and the first copy duration is less than the copy duration threshold, then the switching condition is met; otherwise, the switching condition is not met.

[0128] In summary, the data migration method provided in the embodiment of the present application takes into account the impact of incremental data and disk information on the duration of business interruption. Before the first virtual machine stops running, it determines whether the switching conditions are met based on the first disk incremental situation and / or the first disk copy situation of the first virtual machine. If the switching conditions are met, it means that the duration of the business interruption is short and the impact on the business is low. The virtual machine switching operation can be performed to meet the business requirements for continuity and high availability. If the switching conditions are not met, it means that the duration of the business interruption is long and the impact on the business is large. The virtual machine switching operation is not performed to reduce the impact on the business.

[0129] In one possible implementation, step S101 may include:

[0130] S301: Perform a full snapshot of the first virtual machine to obtain full data of the first virtual machine;

[0131] S302: Copy the full data to the second virtual machine.

[0132] That is, in the embodiment of the present application, in order to improve the efficiency of data copying, data copying can be performed in the form of snapshots. Specifically, in step S101, during the service migration process, when performing data copying for the first time, the data of the first virtual machine can be fully snapshot-copied to the second virtual machine.

[0133] Correspondingly, in step S102 , the first incremental data is the incremental data generated by the first virtual machine during the full data copy process.

[0134] It is understandable that if the first virtual machine does not generate incremental data during the data copy process, the virtual machine switching operation can be performed. That is, after the first virtual machine is shut down, there is no need to copy incremental data, and the impact on the business is relatively low.

[0135] In one possible implementation, as shown in FIG2 , step S103 may include:

[0136] S401, stopping the first virtual machine;

[0137] S402: Perform incremental snapshot processing on the first virtual machine to obtain incremental data;

[0138] S403, copying the incremental data to the second virtual machine;

[0139] S404: Run the second virtual machine.

[0140] Specifically, when the switching condition is met, it indicates that the impact of executing the virtual machine switching operation on the service is small. Therefore, in step S401, the first virtual machine may be stopped, such as being shut down.

[0141] In steps S402 to S404, in order to avoid business data loss, after the first virtual machine is shut down, an incremental snapshot is performed on the first virtual machine to obtain incremental data, and the incremental data is copied to the second virtual machine. Then, the second virtual machine is run, such as turning on the second virtual machine, etc., so as to migrate the business to the second virtual machine to meet the business requirements for continuity and high availability.

[0142] In an embodiment of the present application, in order to avoid data loss and reduce the duration of business interruption, data is copied using incremental snapshots during the virtual machine switching process.

[0143] Optionally, after the incremental data is copied to the second virtual machine, the virtual machine switching operation may also include: virtual machine image conversion, such as converting the data copied to the second virtual machine into a virtual machine image file, or image file format conversion, so that the second virtual machine can continue to run the business.

[0144] In one possible implementation, as shown in FIG3 , the method may further include:

[0145] S501: If the first disk incremental condition and / or the first disk copy condition do not meet the switching condition, copy the first incremental data to the second virtual machine;

[0146] S502: Obtain a size of second incremental data, where the second incremental data is data generated by the first virtual machine during the process of copying the first incremental data to the second virtual machine;

[0147] S503: Determine a second disk increment and / or a second disk copy status of the first virtual machine based on the size of the second incremental data and the disk information;

[0148] S504: When the second disk increment condition and / or the second disk copy condition meets the switching condition, perform a virtual machine switching operation.

[0149] In step S501, an incremental snapshot process can be performed on the first virtual machine to obtain first incremental data, and the first incremental data can be copied to the second virtual machine. The implementation principle or function of steps S502 to S504 can refer to the above steps S102 to S103 and will not be repeated here.

[0150] In an embodiment of the present application, if the switching condition is not met, the first incremental data is copied to the second virtual machine. After the copy is completed, it is determined again whether the switching condition is met based on the size of the second incremental data and the disk information. If the switching condition is met, the virtual machine switching operation is performed. Otherwise, this cycle is repeated until the business running on the first virtual machine is switched to the second virtual machine or the execution of the data migration method is terminated.

[0151] That is, the incremental data may include first incremental data, second incremental data, third incremental data, fourth incremental data, etc. During the service migration process, the first incremental data is the data generated by the first virtual machine during the first data copy (such as a full data copy, etc.), the second incremental data is the data generated by the first virtual machine during the second data copy (such as the first incremental data copy, etc.), the third incremental data is the data generated by the first virtual machine during the third data copy (such as the second incremental data copy, etc.), the fourth incremental data is the data generated during the fourth data copy (such as the third incremental data copy, etc.), etc., and so on.

[0152] Exemplarily, after determining the first disk incremental situation and / or the second disk copy situation based on the size of the first incremental data, if the first disk incremental situation and / or the first disk copy situation do not meet the switching conditions, the virtual machine switching operation is not performed, and then the size of the second incremental data is obtained, and the second disk incremental situation and / or the second disk copy situation are determined based on the size of the second incremental data. If the second disk incremental situation and / or the second disk copy situation meet the switching conditions, the virtual machine switching operation is performed to complete the business migration. If the second disk incremental situation and / or the second disk copy situation do not meet the switching conditions, the virtual machine switching operation is not performed, and the size of the third incremental data is continued to be obtained, and the third disk incremental situation and / or the third disk copy situation are determined based on the size of the third incremental data. If the third disk incremental situation and / or the third disk copy situation meet the switching conditions, the virtual machine switching operation is performed to complete the business migration. If the third disk incremental situation and / or the third disk copy situation does not meet the switching conditions, continue to obtain the size of the fourth incremental data, and determine the fourth disk incremental situation and / or the fourth disk copy situation based on the size of the fourth incremental data. If the fourth disk incremental situation and / or the fourth disk copy situation meet the switching conditions, perform the virtual machine switching operation to complete the business migration. If the fourth disk incremental situation and / or the fourth disk copy situation does not meet the switching conditions, do not perform the virtual machine switching operation, and so on.

[0153] Optionally, in order to ensure the reliability of the server and avoid the situation where the number of cycles is too many due to failure to meet the switching conditions, the method may further include: recording the number of cycles, and if the number of cycles reaches a threshold, executing a virtual machine switching operation or terminating the execution of the data migration method. For example, the number of cycles can be determined based on the number of times the switching conditions are judged, or the number of cycles can be determined based on the number of times incremental data is obtained or copied, etc. The number threshold can be a set value or determined based on the importance of the business, etc. Optionally, if the importance of the business is low, the virtual machine switching operation can be executed to complete the business migration when the number of cycles reaches the threshold, and if the importance of the business is high, the data migration method can be terminated when the number of cycles reaches the threshold, and a prompt message is issued to prompt that the business migration is not completed or the number of cycles is too high.

[0154] For example, as shown in FIG4 , the process of migrating services of a source virtual machine to a target virtual machine by the server includes:

[0155] S1. Triggering execution of a data migration method. For example, if a data migration request from a user is received, triggering execution of the data migration method.

[0156] S2. Perform a full snapshot copy of the source virtual machine to obtain full data;

[0157] S3. Copy all data to the target virtual machine;

[0158] S4. Get the size of the incremental data;

[0159] S5. Determine whether the switching condition is met based on the size of the incremental data. If not, execute step S6; if so, execute step S7.

[0160] S6. Copy the incremental data to the target virtual machine, for example, perform incremental snapshot processing on the source virtual machine to obtain incremental data, and copy the incremental data to the target virtual machine, and return to step S4;

[0161] S7. Shut down the source virtual machine.

[0162] S8. Copy the incremental data to the target virtual machine, for example, by performing incremental snapshot processing on the source virtual machine to obtain incremental data, and copying the incremental data to the target virtual machine;

[0163] S9. Start the target virtual machine to complete the service migration.

[0164] As shown in FIG5A , for example, the source virtual machine storage space contains full data. When the server triggers the execution of the data migration method, the source virtual machine is snapshotted for the first time (e.g., full snapshot processing, etc.) to obtain full data and copy the full data to the target virtual machine storage space. At the end of the full data copy, the source virtual machine storage space is newly added with first incremental data, the size of the first incremental data is obtained, and based on the size of the first incremental data, it is determined that the switching condition is not met, and the source virtual machine is kept running. Then, as shown in FIG5B , the source virtual machine is snapshotted for the second time (e.g., incremental snapshot processing, etc.) to obtain first incremental data and copy the first incremental data to the target virtual machine storage space. At the end of the first incremental data copy, the source virtual machine storage space is newly added with second incremental data, the size of the second incremental data is obtained, and based on the size of the second incremental data, it is determined that the switching condition is met, and the source virtual machine is shut down. Then, as shown in FIG5C , the source virtual machine is snapshotted for the third time (e.g., incremental snapshot processing, etc.) to obtain second incremental data and copy the second incremental data to the target virtual machine storage space, and then the target virtual machine is turned on to complete the business migration.

[0165] For example, in a laboratory, during a service migration test on a virtual machine (with a 500G disk full of data mounted on it), the solution of the present application was used to test that the service interruption duration could be reduced to about 2 minutes and 30 seconds or even less.

[0166] In summary, the data migration method provided in the embodiment of the present application can reduce the duration of business interruption during data migration and reduce the impact on the business, thereby meeting the business requirements for continuity and high availability.

[0167] On the other hand, an embodiment of the present application further provides a data migration system, which may include:

[0168] A data copy module, configured to copy data of the first virtual machine to the second virtual machine;

[0169] a data acquisition module, configured to acquire a size of first incremental data, where the first incremental data is data generated by the first virtual machine during the data copy process;

[0170] a determination module, configured to determine a first disk increment status and / or a first disk copy status of the first virtual machine based on a size of the first incremental data and disk information of the first virtual machine;

[0171] The switching module is used to perform a virtual machine switching operation when the first disk increment situation and / or the first disk copy situation meet the switching conditions. The virtual machine switching operation is used to indicate that the business running on the first virtual machine is switched to the second virtual machine.

[0172] The data migration system provided in the embodiment of the present application takes into account the impact of incremental data and disk information on the duration of business interruption. Before the first virtual machine stops running, it determines whether the switching conditions are met based on the first disk incremental situation and / or the first disk copy situation of the first virtual machine. If the switching conditions are met, it means that the duration of the business interruption is short and the impact on the business is low. The virtual machine switching operation can be performed to meet the business requirements for continuity and high availability. If the switching conditions are not met, it means that the duration of the business interruption is long, and the virtual machine switching operation is not performed to reduce the impact on the business.

[0173] In one possible implementation, the disk information includes a disk capacity of the first virtual machine, the first disk increment includes a first disk increment ratio, and the determining module is further configured to:

[0174] The first disk incremental ratio is determined based on the size of the first incremental data and the disk capacity.

[0175] In the embodiment of the present application, the disk increment ratio is used to represent the disk increment of the first virtual machine, which can more accurately represent the impact of the incremental data size generated by the business on the business.

[0176] In one possible implementation, the disk information includes a total disk copy duration of the first virtual machine, a data size of a last data copy, and a duration of the last data copy; the first disk copy condition includes a first copy duration ratio; and the determining module is further configured to:

[0177] Determining a first copy duration based on the size of the first incremental data, the size of the last data copy, and the duration of the last data copy;

[0178] The first copy duration ratio is determined based on the first copy duration and the total disk copy duration.

[0179] In the embodiment of the present application, the copy duration ratio is used to represent the disk copy status of the first virtual machine, which can more accurately represent the impact of the copy duration of the incremental data generated by the business on the business.

[0180] In one possible implementation, the system further includes a judgment module configured to:

[0181] If the first disk increment ratio is less than the first threshold, and the first copy duration ratio is less than the second threshold, the switching condition is met;

[0182] If the first disk increment ratio is greater than or equal to the first threshold, or the first copy duration ratio is greater than or equal to the second threshold, the switching condition is not met.

[0183] In an embodiment of the present application, in order to further reduce the duration of business interruption during data migration and reduce the impact on the business, a virtual machine switching operation is performed when the disk increment ratio is less than a first threshold and the copy duration ratio is less than a second threshold; otherwise, the virtual machine switching operation is not performed.

[0184] In one possible implementation manner, the first threshold and / or the second threshold is a set value, or the first threshold and / or the second threshold is adjusted according to the importance of the service.

[0185] In the embodiment of the present application, considering that the importance of different services may be different, in order to adapt to different services, the first threshold and / or the second threshold may be adjusted according to the importance of the service.

[0186] In one possible implementation, the data copy module is further configured to:

[0187] Performing a full snapshot of the first virtual machine to obtain full data of the first virtual machine;

[0188] Copy the full amount of data to the second virtual machine.

[0189] In the embodiment of the present application, in order to improve the efficiency of data copying, a snapshot method is used to copy data.

[0190] In one possible implementation, the switching module is further configured to:

[0191] Stopping the first virtual machine;

[0192] Performing incremental snapshot processing on the first virtual machine to obtain incremental data;

[0193] Copying the incremental data to the second virtual machine;

[0194] Run the second virtual machine.

[0195] In an embodiment of the present application, in order to avoid data loss and reduce the duration of business interruption, data is copied using incremental snapshots during the virtual machine switching process.

[0196] In one possible implementation, the system is further configured to:

[0197] If the first disk incremental condition and / or the first disk copy condition do not meet the switching condition, copying the first incremental data to the second virtual machine;

[0198] Obtaining a size of second incremental data, where the second incremental data is data generated by the first virtual machine during a process of copying the first incremental data to the second virtual machine;

[0199] Determine a second disk increment status and / or a second disk copy status of the first virtual machine based on the size of the second incremental data and the disk information;

[0200] When the second disk increment condition and / or the second disk copy condition meets the switching condition, the virtual machine switching operation is performed.

[0201] In an embodiment of the present application, if the switching condition is not met, the first incremental data is copied to the second virtual machine. After the copy is completed, it is determined again whether the switching condition is met based on the size of the second incremental data and the disk information. If the switching condition is met, the virtual machine switching operation is performed. Otherwise, this cycle is repeated until the business running on the first virtual machine is switched to the second virtual machine or the execution of the data migration method is terminated.

[0202] In one possible implementation, the first virtual machine and the second virtual machine are in a heterogeneous cluster.

[0203] In an embodiment of the present application, the data migration method is applicable to warm migration of virtual machines in a heterogeneous cluster, reducing the impact of warm migration of virtual machines in a heterogeneous cluster on services, thereby meeting the service requirements for continuity and high availability.

[0204] The principles and contents of the data migration system provided in the embodiment of the present application can refer to the data migration method of the method embodiment shown in FIG1 , and will not be repeated here.

[0205] As shown in Figure 6, an embodiment of the present application also provides a server 100, including: a processor 110 and a memory 120, the processor 110 is connected to the memory 120, the memory 120 stores a computer program, and when the processor 110 executes the computer program, it implements the data migration method shown in Figure 1.

[0206] Specifically, the processor 110 of the server 100 may perform the following steps:

[0207] Copying data of the first virtual machine to the second virtual machine;

[0208] Obtaining a size of first incremental data, where the first incremental data is data generated by the first virtual machine during the data copy process;

[0209] Determine a first disk increment status and / or a first disk copy status of the first virtual machine based on the size of the first incremental data and the disk information of the first virtual machine;

[0210] When the first disk increment condition and / or the first disk copy condition meets the switching condition, a virtual machine switching operation is performed, where the virtual machine switching operation is used to switch the service running on the first virtual machine to the second virtual machine.

[0211] In one possible implementation, the disk information includes a disk capacity of the first virtual machine, the first disk incremental status includes a first disk incremental ratio, and the processor 110 of the server 100 determines the first disk incremental status of the first virtual machine based on the size of the first incremental data and the disk information, including:

[0212] The first disk incremental ratio is determined based on the size of the first incremental data and the disk capacity.

[0213] In one possible implementation, the disk information includes a total disk copy duration of the first virtual machine, a data size of a last data copy, and a duration of the last data copy; the first disk copy status includes a first copy duration ratio; and the processor 110 of the server 100 determines the first disk copy status of the first virtual machine based on the first incremental data and the disk capacity, including:

[0214] Determining a first copy duration based on the size of the first incremental data, the size of the last data copy, and the duration of the last data copy;

[0215] The first copy duration ratio is determined based on the first copy duration and the total disk copy duration.

[0216] In one possible implementation, the processor 110 of the server 100 further executes:

[0217] If the first disk increment ratio is less than the first threshold, and the first copy duration ratio is less than the second threshold, the switching condition is met;

[0218] If the first disk increment ratio is greater than or equal to the first threshold, or the first copy duration ratio is greater than or equal to the second threshold, the switching condition is not met.

[0219] In one possible implementation manner, the first threshold and / or the second threshold is a set value, or the first threshold and / or the second threshold is adjusted according to the importance of the service.

[0220] In one possible implementation, the processor 110 of the server 100 executes copying data of the first virtual machine to the second virtual machine, including:

[0221] Performing a full snapshot of the first virtual machine to obtain full data of the first virtual machine;

[0222] Copy the full amount of data to the second virtual machine.

[0223] In one possible implementation, the processor 110 of the server 100 performs a virtual machine switching operation, including:

[0224] Stopping the first virtual machine;

[0225] Performing incremental snapshot processing on the first virtual machine to obtain incremental data;

[0226] Copying the incremental data to the second virtual machine;

[0227] Run the second virtual machine.

[0228] In one possible implementation, the processor 110 of the server 100 further executes:

[0229] If the first disk incremental condition and / or the first disk copy condition do not meet the switching condition, copying the first incremental data to the second virtual machine;

[0230] Obtaining a size of second incremental data, where the second incremental data is data generated by the first virtual machine during a process of copying the first incremental data to the second virtual machine;

[0231] Determine a second disk increment status and / or a second disk copy status of the first virtual machine based on the size of the second incremental data and the disk information;

[0232] When the second disk increment condition and / or the second disk copy condition meets the switching condition, the virtual machine switching operation is performed.

[0233] In one possible implementation, the first virtual machine and the second virtual machine are in a heterogeneous cluster.

[0234] The server in the embodiment of the present application is such as a rack server, a blade server, a tower server, etc., or a cabinet server or equipment cabinet containing multiple server nodes, etc. The server can execute the scheme shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0235] The present application provides a readable storage medium having a computer program stored thereon; the computer program is used to implement the data migration method as described in any of the above embodiments.

[0236] An embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, a computer executes the above-mentioned data migration method.

[0237] All or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above-mentioned method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.

[0238] The present application embodiment is described with reference to the flow chart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flow chart and / or block diagram and the combination of the process and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable terminal device to produce a machine, so that the instruction executed by the processing unit of the computer or other programmable terminal device produces a device for realizing the function specified in one process or multiple processes and / or one box or multiple boxes of the flow chart.

[0239] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0240] These computer program instructions can also be loaded onto a computer or other programmable terminal device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0241] Obviously, those skilled in the art may make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations.

[0242] In this application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". In this application, the terms "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In this application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

Claims

1. A data migration method, characterized in that, The method includes: Copying the data of the first virtual machine to the second virtual machine; Obtaining the size of the first incremental data, where the first incremental data is the data generated by the first virtual machine during the data copying process; When it is determined that the switching condition is met based on the size of the first incremental data and the disk information of the first virtual machine, performing a virtual machine switching operation, where the virtual machine switching operation is used to indicate switching the services running on the first virtual machine to the second virtual machine.

2. The method according to claim 1, wherein The step of, when it is determined that the switching condition is met based on the size of the first incremental data and the disk information of the first virtual machine, performing a virtual machine switching operation, where the virtual machine switching operation is used to indicate switching the services running on the first virtual machine to the second virtual machine, includes: Based on the size of the first incremental data and the disk information of the first virtual machine, determining the first disk increment situation and / or the first disk copy situation of the first virtual machine; When the first disk increment situation and / or the first disk copy situation of the first virtual machine meets the switching condition, performing a virtual machine switching operation, where the virtual machine switching operation is used to indicate switching the services running on the first virtual machine to the second virtual machine.

3. The method according to claim 1, characterized in that, The disk information includes the disk capacity of the first virtual machine, the first disk increment situation includes a first disk increment ratio, and determining the first disk increment situation of the first virtual machine based on the size of the first incremental data and the disk information includes: Based on the size of the first incremental data and the disk capacity, determining the first disk increment ratio.

4. The method according to claim 2 or 3, characterized in that, The disk information includes the total disk copy duration of the first virtual machine, the data size of the previous data copy, and the duration of the previous data copy. The first disk copy situation includes a first copy duration ratio. Determining the first disk copy situation of the first virtual machine based on the first incremental data and the disk capacity includes: Based on the size of the first incremental data, the data size of the previous data copy, and the duration of the previous data copy, determining the first copy duration; Based on the first copy duration and the total disk copy duration, determining the first copy duration ratio.

5. The method according to claim 4, characterized in that, The method further includes: If the first disk increment ratio is less than the first threshold and the first copy duration ratio is less than the second threshold, then the switching condition is met; If the first disk increment ratio is greater than or equal to the first threshold, or the first copy duration ratio is greater than or equal to the second threshold, then the switching condition is not met.

6. The method according to claim 5, wherein The first threshold and / or the second threshold is a set value, or the first threshold and / or the second threshold is adjusted according to the business importance.

7. The method according to any one of claims 1 to 6, characterized in that The step of copying the data of the first virtual machine to the second virtual machine includes: Performing a full snapshot process on the first virtual machine to obtain the full data of the first virtual machine; Copying the full data to the second virtual machine.

8. The method according to any one of claims 1 to 7, characterized in that, The virtual machine switching operation includes: Stopping the operation of the first virtual machine; Performing an incremental snapshot process on the first virtual machine to obtain incremental data; Copying the incremental data to the second virtual machine; Run the second virtual machine.

9. The method according to any one of claims 2 to 8, characterized in that The method further includes: When the first disk increment situation and / or the first disk copy situation do not meet the switching conditions, copy the first incremental data to the second virtual machine; Obtain the size of the second incremental data, where the second incremental data is the data generated by the first virtual machine during the process of copying the first incremental data to the second virtual machine; Based on the size of the second incremental data and the disk information, determine the second disk increment situation and / or the second disk copy situation of the first virtual machine; When the second disk increment situation and / or the second disk copy situation meet the switching conditions, perform a virtual machine switching operation.

10. A server, characterized in that, It includes: A processor and a memory, the processor is connected to the memory, the memory stores a computer program, and when the processor executes the computer program, the method described in any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Cross-platform virtual machine online migration method and related components

    CN110737512A

  • Virtual machine migration method, device and apparatus and computer readable storage medium

    CN111124615A

  • Method for agent-free live migration of virtual machine to Openstack

    CN113485787A

  • Inter-cloud service migration system

    CN114296649A

  • Cross-platform virtual machine migration method, device and equipment

    CN114860393A