Virtual machine migration methods, systems, devices, equipment, and storage media

By establishing data access channels and interactive middleware components during virtual machine migration, the problem of business connectivity during cross-storage type migration was solved, enabling virtual machine migration without business interruption.

CN123067995APending Publication Date: 2026-11-10JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611339163.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

During virtual machine migration across storage types, existing technologies cannot maintain business connectivity, causing virtual machine I/O requests to become unresponsive during the migration period. Access to the target platform can only be obtained after the full data migration is completed, resulting in business interruption.

Method used

By establishing data access channels between the interactive middleware component and the source and target disks, the virtual machine's disk interaction requests are received in real time, and the requests are forwarded to the corresponding storage media for processing according to the migration status of the data blocks. At the same time, the virtual machine's disk interaction path is switched after all the data blocks on the source disk are written to the target disk.

Benefits of technology

It enables continuous response to virtual machine disk interaction requests during data block synchronization without interrupting virtual machine services, ensuring business continuity throughout the migration process and completing disk data migration across storage types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123067995A_ABST
    Figure CN123067995A_ABST
Patent Text Reader

Abstract

This application discloses a virtual machine migration method, system, apparatus, device, and storage medium, relating to the field of cloud computing technology. In the virtual machine migration method of this application, data access channels with the source disk and the target disk are established through an interaction middleware component. During the process of writing data blocks from the source disk to the target disk, the interaction middleware component receives disk interaction requests from the virtual machine and forwards the disk interaction requests to the corresponding source disk or target disk for processing according to the migration status of the data blocks. After all data blocks from the source disk are written to the target disk, the virtual machine's disk interaction path is switched to the target disk to complete the migration. In this way, disk interaction requests from the virtual machine can be continuously responded to during data block synchronization, and disk data migration can be completed without pausing virtual machine services, ensuring uninterrupted virtual machine services throughout the migration process. This solves the problem of maintaining business continuity during virtual machine migration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to virtual machine migration methods, systems, apparatuses, devices, and storage media. Background Technology

[0002] With the rapid development of cloud computing technology, the demand for virtual machine service scheduling and migration across cloud platforms continues to grow. Due to the significant differences in storage types used by different cloud platforms, including storage devices from different vendors, differentiated access protocols or self-developed proprietary protocols, and incompatibility in storage architecture and management logic, virtual machine migration across storage types has become a major challenge that urgently needs to be overcome in the cloud computing field.

[0003] To accommodate the heterogeneous differences between various storage types, the current virtual machine migration method employs an offline full data copy implementation mode. The virtual machine is then started on the target platform only after all disk data has been migrated. While this effectively ensures data integrity before and after migration, it prevents the normal handling of virtual machine I / O (Input / Output) requests during the migration process. Access to the target platform's disks can only be achieved after the full data migration is complete. Therefore, maintaining business continuity during virtual machine migration has become a pressing issue that needs to be addressed. Summary of the Invention

[0004] This application provides a virtual machine migration method, system, apparatus, device, and storage medium to at least solve the problem of business continuity not being maintained during virtual machine migration in related technologies.

[0005] This application provides a virtual machine migration method, including: Establish data access channels between the interactive middleware component and the target disk and source disk; where the target disk and source disk correspond to different storage types; Data blocks are read from the source disk and written to the target disk via the data access channel. During the process of writing data blocks to the target disk, receive disk interaction requests issued by the virtual machine; Based on the migration status of the data block corresponding to the disk interaction request, the disk interaction request is forwarded to the corresponding source disk or target disk for processing; With all data blocks from the source disk written to the target disk, the virtual machine's disk interaction path is switched to the target disk to complete the virtual machine migration.

[0006] This application also provides a virtual machine migration system, including: Source disk, target disk, and interaction middleware components; The interactive middleware component is used to migrate virtual machines between the source disk and the target disk using a virtual machine migration method.

[0007] This application also provides a virtual machine migration apparatus, including: The channel establishment module is used to establish data access channels between the interactive middleware component and the target disk and the source disk; where the target disk and the source disk correspond to different storage types; The data block writing module is used to read data blocks from the source disk and write the data blocks to the target disk through the data access channel; The request receiving module is used to receive disk interaction requests issued by the virtual machine during the process of writing data blocks to the target disk. The request processing module is used to forward the disk interaction request to the corresponding source disk or target disk for processing based on the migration status of the corresponding data block of the disk interaction request; The path switching module is used to switch the virtual machine's disk interaction path to the target disk when all data blocks on the source disk have been written to the target disk, so as to complete the virtual machine migration.

[0008] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above-described virtual machine migration methods when executing the computer program.

[0009] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described virtual machine migration methods.

[0010] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described virtual machine migration methods.

[0011] In some embodiments of this application, data access channels with the source disk and the target disk are established through an interactive middleware component. During the process of writing data blocks from the source disk to the target disk, the interactive middleware component receives disk interaction requests from the virtual machine and forwards them to the corresponding source disk or target disk for processing based on the migration status of the data blocks. After all data blocks from the source disk are written to the target disk, the virtual machine's disk interaction path is switched to the target disk to complete the migration. This allows for continuous response to the virtual machine's disk interaction requests during data block synchronization, enabling cross-storage type disk data migration without pausing virtual machine services. This ensures uninterrupted virtual machine services throughout the migration process and maintains business continuity. Thus, the problem of maintaining business connectivity during virtual machine migration in related technologies can be solved. Attached Figure Description

[0012] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 A flowchart illustrating a virtual machine migration method provided for some embodiments of this application; Figure 2 The architecture diagram of the virtual machine migration technology solution provided in this application; Figure 3 The overall flowchart of the virtual machine migration method provided in this application; Figure 4 System diagrams of a virtual machine migration system provided for some embodiments of this application; Figure 5 Schematic diagram of a virtual machine migration apparatus provided for some embodiments of this application; Figure 6 A schematic diagram of the modules of an electronic device provided for some embodiments of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0015] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0016] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0017] In related technologies, when facing the need to migrate virtual machines across storage types, an offline full data copy migration solution is often adopted. This involves completely copying all data from the source disk to the target storage, and then starting the virtual machine on the target platform after the migration is complete, thus adapting to the differences between different storage types. However, the entire migration process cannot respond normally to the virtual machine's input / output requests; access to the target disk is only possible after the full data migration is complete, and virtual machine services must be suspended during the migration period. Therefore, maintaining business continuity during virtual machine migration has become a pressing issue that needs to be addressed.

[0018] In view of this, this application provides a virtual machine migration method that can solve the above problems. The virtual machine migration method can be applied to electronic devices. Electronic devices may include, but are not limited to, tablet computers, laptops, desktop computers, servers, etc. (See also...) Figure 1 This is a flowchart illustrating a virtual machine migration method provided in some embodiments of this application. Figure 1 In this context, the virtual machine migration method includes the following steps: Step S101: Establish a data access channel between the interactive intermediate layer component and the target disk and source disk.

[0019] Specifically, a virtual machine is a virtual computing instance that hosts business operations. It remains online throughout the migration process and continuously generates read and write operations on disk data.

[0020] Specifically, the interaction middleware component refers to the execution unit deployed on the target disk computing node, which is used to handle the disk interaction requests of the virtual machine. It can shield the protocol and architecture differences of heterogeneous storage and uniformly perform data synchronization and request forwarding operations.

[0021] Specifically, the target disk refers to the intended storage medium for carrying business data after the virtual machine migration. Its initial state is a blank storage space, used to receive data blocks synchronized from the source disk and incremental write data blocks generated during the migration process.

[0022] Specifically, the source disk refers to the original storage medium that carries all business data before the virtual machine is migrated, and stores the data blocks required for the virtual machine to run.

[0023] Specifically, the target disk and the source disk correspond to different storage types, and belong to different storage architectures, equipment manufacturers, or access protocol systems. For example, they adopt different distributed block storage, self-developed storage protocols, block storage, or file storage from different manufacturers, and the two do not have the ability to directly exchange data.

[0024] Specifically, the data access channel refers to the read / write channel established between the interactive middleware component and the source disk and the target disk based on the corresponding native storage protocol, which supports bidirectional interaction of reading and writing data blocks.

[0025] In this embodiment, the interactive middleware component establishes data access channels adapted to the storage types of the source disk and the target disk respectively, thereby completing the connection between the read and write channels on both sides and enabling the interactive middleware to perform data read and write operations on the source disk and the target disk simultaneously.

[0026] Step S102: Read data blocks from the source disk through the data access channel and write the data blocks to the target disk.

[0027] In this embodiment, based on the established data access channel, the interactive intermediate layer component reads and copies data from the source disk block by block and writes it to the target disk in units of data blocks, thus completing the transfer of data blocks from the source disk to the target disk.

[0028] Step S103: During the process of writing data blocks to the target disk, a disk interaction request is received from the virtual machine.

[0029] Specifically, a disk interaction request refers to an input / output operation instruction initiated by a virtual machine, including two types: disk read requests and disk write requests. The disk interaction request carries the logical address information of the disk to be accessed.

[0030] In this embodiment, while data block migration and writing are being performed in the background, the interactive middleware component takes over the disk interaction requests issued by the virtual machine, thereby enabling parallel processing of data migration tasks and virtual machine business input / output requests.

[0031] Step S104: Based on the migration status of the data block corresponding to the disk interaction request, forward the disk interaction request to the corresponding source disk or target disk for processing.

[0032] Specifically, migration status is used to mark whether the data blocks corresponding to each logical address on the disk have completed synchronization from the source disk to the target disk, and can reflect whether the data blocks at the corresponding addresses in the target disk have completed synchronization.

[0033] In this embodiment, the migration status of the data block corresponding to the disk interaction request is first determined, and then the request is forwarded to the source disk or target disk for execution, thus completing the distribution and processing of the disk interaction request during the migration process.

[0034] Step S105: With all data blocks from the source disk written to the target disk, the virtual machine's disk interaction path is switched to the target disk to complete the virtual machine migration.

[0035] In this embodiment, after the data on the source disk is written to the target disk and synchronized, the interaction path of the disk interaction request is adjusted to uniformly switch all disk access paths of the virtual machine to the target disk, thereby completing the virtual machine migration operation across storage types.

[0036] In summary, in the technical solutions of some embodiments of this application, data access channels with the source disk and the target disk are established respectively through an interactive middleware component. During the process of writing data blocks from the source disk to the target disk, the interactive middleware component receives disk interaction requests issued by the virtual machine and forwards the disk interaction requests to the corresponding source disk or target disk for processing according to the migration status of the data blocks. After all data blocks from the source disk are written to the target disk, the virtual machine's disk interaction path is switched to the target disk to complete the migration. In this way, the virtual machine's disk interaction requests can be continuously responded to during the data block synchronization process, and cross-storage type disk data migration can be completed without pausing virtual machine services, ensuring uninterrupted virtual machine services throughout the migration process and maintaining business continuity. This solves the problem of not being able to maintain business connectivity during virtual machine migration in related technologies.

[0037] In some embodiments, step S102, reading data blocks from the source disk and writing the data blocks to the target disk via the data access channel, includes: Step S1021: Obtain the access frequency of each data block in the source disk.

[0038] Step S1022: Determine the hot priority of data blocks based on the access frequency of each data block.

[0039] Step S1023: Write the data blocks to the target disk according to their hotness priority through the data access channel.

[0040] Specifically, access popularity is an indicator used to characterize how frequently a source disk data block is accessed by a virtual machine. It is based on the number of times a data block is triggered for read and write requests within a preset statistical period. The more times it is accessed, the higher the access popularity of the corresponding data block.

[0041] Specifically, the priority of data blocks is positively correlated with the access frequency of data blocks. The higher the access frequency of data blocks, the higher the synchronization priority, and the more likely they are to be scheduled to be migrated and written to the target disk.

[0042] In this embodiment, firstly, based on historical access records within a preset statistical period, the access popularity of each data block on the source disk is statistically obtained; then, the data blocks are sorted according to their access popularity to determine the priority of each data block; finally, based on the priority of the data blocks, the read and write operations of the data blocks are executed in sequence to complete the synchronization of the data blocks.

[0043] In the above embodiments, the logic for determining the synchronization priority of data blocks based on access popularity is clarified, so that hot data blocks with high-frequency business access can be migrated to the target disk first, reducing the impact on interaction performance and providing reliable support for ensuring business access performance during virtual machine migration across storage types.

[0044] In some embodiments, step S104, which involves forwarding the disk interaction request to the corresponding source disk or target disk for processing based on the migration status of the data block corresponding to the disk interaction request, includes: Step S1041: Determine whether the disk interaction request is a disk read request.

[0045] Step S1042: If the disk interaction request is a disk read request, determine whether the migration status of the data block corresponding to the disk interaction request is an unmigrated state.

[0046] Step S1043: If the data block is in an unmigrated state, forward the disk interaction request to the corresponding source disk for processing.

[0047] Step S1044: If the data block is in a migrated state, forward the disk interaction request to the target disk for processing; wherein, the migration state of the data block includes an unmigrated state and a migrated state.

[0048] Specifically, a disk read request refers to a read-type input / output operation instruction initiated by the virtual machine. The request carries the disk logical block address information corresponding to the data to be read, which is used to obtain business data stored within the specified address range.

[0049] Specifically, migration status is a status indicator used to mark whether the data blocks corresponding to each logical block address on the disk have completed synchronization from the source disk to the target disk. It includes unmigrated status and migrated status. The unmigrated status means that the data block corresponding to the logical address has not yet been copied from the source disk to the target disk; the migrated status means that the data block corresponding to the logical address has completed copying from the source disk to the target disk.

[0050] In this embodiment, firstly, the type of the received disk interaction request is determined to identify the disk read request; then, for the disk read request, the migration status of the data block corresponding to its access address is queried; if the data block is in a non-migrated state, the disk read request is forwarded to the source disk to perform the read operation; if the data block is in a migrated state, the disk read request is forwarded to the target disk to perform the read operation.

[0051] In the above embodiments, the hierarchical forwarding logic of disk read requests during the migration process is clarified, and the corresponding storage medium is matched for data blocks in different migration states, providing reliable support for business continuity during the migration of virtual machines across storage types.

[0052] In some embodiments, the method of this application further includes: Step a1: If the disk interaction request is a disk write request, forward the disk interaction request to the target disk for processing.

[0053] Specifically, a disk write request refers to a write-type input / output operation instruction initiated by the virtual machine, which carries the data to be written and the disk logical block address information, and is used to add or modify data within a specified address range on the disk.

[0054] In this embodiment, after receiving a disk interaction request from the virtual machine during the migration process, the read / write type of the request is first identified. When it is determined to be a disk write request, the disk write request is directly forwarded to the target disk to perform the write operation, so that the incremental data generated during the migration is directly written to the target disk.

[0055] In the above embodiments, the forwarding rules for disk write requests during the migration process are clarified, enabling incremental write data generated by the virtual machine to be directly written to the target disk, reducing redundant data transmission overhead, and providing reliable support for improving the business continuity and migration execution efficiency of virtual machine migration across storage types.

[0056] In some embodiments, the method of this application further includes: Step b1: Create a temporary data area.

[0057] Step b2: When the disk interaction request is a disk write request, the newly added write data block is written to the target disk and simultaneously stored in the temporary data area.

[0058] Step b3: Construct a verification dataset based on the source disk and the temporary data area.

[0059] Step b4: Perform data consistency verification on the data blocks in the target disk based on the verification dataset.

[0060] Specifically, the temporary data area refers to an independent storage area partitioned off from the target disk storage space, used to store incremental write data blocks generated by the virtual machine during the migration process.

[0061] Specifically, the verification dataset is a set of data composed of data blocks stored on the source disk and incremental data blocks stored in the temporary data area, which can represent the data blocks that the target disk should have after the migration is completed.

[0062] Specifically, consistency verification refers to the process of comparing the actual data stored in the target disk with the data at each address, using the verification dataset as a benchmark and the disk logical block address as an index, to verify whether the data at each address of the target disk is consistent with the verification dataset. It is used to investigate potential data errors or loss during data migration.

[0063] In this embodiment, firstly, a temporary data area is established during the migration process; secondly, when a disk write request is received, the newly added write data block corresponding to the request is written to the target disk and simultaneously backed up to the temporary data area; then, after all the data blocks of the source disk are written to the target disk, a verification dataset is constructed by combining the data blocks of the source disk and the incremental data blocks of the temporary data area; finally, using the verification dataset as a reference, address-by-address consistency verification is performed on the data blocks of the target disk.

[0064] In the above embodiments, the establishment of temporary data areas, the backup mechanism of incremental data blocks, and the construction logic of verification datasets are clarified, so that data consistency verification can simultaneously cover the original data blocks and incrementally written data blocks, and can verify the integrity and accuracy of the target disk data blocks.

[0065] In some embodiments, the method of this application further includes: Step c1: If it is necessary to terminate the virtual machine migration operation, merge the newly written data blocks in the temporary data area into the source disk.

[0066] Step c2: Switch the virtual machine's disk interaction path to the source disk to complete the virtual machine migration rollback.

[0067] Specifically, situations requiring termination of virtual machine migration operations refer to scenarios such as storage link anomalies, business scheduling adjustments, or verification results failing to meet requirements during the migration process. In such cases, the current cross-storage type virtual machine migration process needs to be interrupted to restore the virtual machine to its pre-migration running state.

[0068] In this embodiment, firstly, when it is determined that the virtual machine migration operation needs to be terminated, the newly added write data blocks of the temporary data area backup are written to the source disk according to the address mapping to complete the data block completion of the source disk; then, the disk interaction path of the virtual machine is adjusted to switch the disk interaction path to access the source disk, so that the virtual machine is restored to the storage access state before the migration, and the migration process is rolled back.

[0069] In the above embodiments, the incremental data block merging and path rollback logic in the migration termination scenario is clarified, which enables the rollback operation to be performed at any stage of virtual machine migration across storage types, thereby improving the fault tolerance and scenario adaptability of the virtual machine migration process.

[0070] In some embodiments, to enable online migration of virtual machines, the interactive middleware component continuously reads disk data from the source disk and writes it to the target disk until the full data of the source disk and the target disk are consistent. After the data synchronization between the two ends is completed, the I / O requests issued by the virtual machine are no longer forwarded through the interactive middleware component, but instead directly read the disk data of the target disk to complete the storage access.

[0071] In some embodiments, to enable online migration processing, the interactive middleware module supports starting and stopping in a dynamic unloading and dynamic loading manner; after completing the virtual machine migration, the interactive middleware component is dynamically unloaded and the corresponding data access channel is disconnected; when it is necessary to perform virtual machine migration or migration rollback operations, the interactive middleware component is dynamically loaded while the virtual machine is running and the corresponding data access channel is established.

[0072] See also Figure 2 , Figure 2 The architecture diagram of the virtual machine migration technology solution provided in this application. Figure 2 In this setup, compute node A is the target node, configured with a KVM (Kernel-based Virtual Machine) virtualization environment, virtual machine vm1, an interaction middleware component, and a storage pool. The target disk is deployed within the storage pool. The interaction middleware component connects to the data access channel of virtual machine vm1, receiving disk interaction requests from vm1 and establishing connections with the target disk and the cross-node data access channel, respectively. It is responsible for the directed forwarding of disk interaction requests and the scheduling and execution of data migration tasks. Compute node B is the source node, configured with a KVM virtualization environment, virtual machine vm1, and a storage pool. The source disk is configured within the storage pool. The data access channel connects the storage resources of compute node A and compute node B, enabling data block synchronization from the source disk to the target disk and responding to I / O requests.

[0073] See also Figure 3 , Figure 3 The overall flowchart of the virtual machine migration method provided in this application. Figure 3 In the process, starting from the initial node, the virtual machine startup, the I / O interaction middleware component startup, and the detection of virtual machine I / O issuance are executed sequentially to complete the pre-migration environment deployment. Then, the process proceeds to the disk data synchronization check node. If the check is successful, the I / O return is executed directly and the process flows to the end. If the check is unsuccessful, two execution paths are triggered simultaneously: one establishes a connection with the source disk, performs data read and write operations, completes the I / O return, and responds to the virtual machine's single read and write request; the other reads data from the source disk and writes it to the new disk. After checking whether all data has been synchronized, if not, the above operations are executed repeatedly. After all data is synchronized, the I / O middleware module is removed, and the full online migration is completed.

[0074] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0075] Corresponding to the virtual machine migration method, this application also provides a virtual machine migration system. (See also...) Figure 4 This is a system diagram of a virtual machine migration system provided in some embodiments of this application. Figure 4 In this context, the virtual machine migration system includes: Source disk; Target disk; Interactive middleware component, used to migrate virtual machines between source and target disks using virtual machine migration methods.

[0076] Specifically, the source disk is the original storage medium that carries the business operation data before the virtual machine migration. It can establish a dedicated data access channel based on its corresponding storage access protocol and interaction middleware components. The target disk is the target storage medium that carries the business operation data after the virtual machine migration. It corresponds to a different storage type than the source disk. The two have heterogeneous differences in access protocol or storage architecture. They can establish a dedicated data access channel based on their corresponding storage access protocol and interaction middleware components.

[0077] Specifically, the interaction middleware component is a scheduling component deployed between the virtual machine and storage resources. It can establish data access channels adapted to the corresponding storage types with the source disk and the target disk respectively, perform data block synchronous copying from the source disk to the target disk in the background, and receive disk interaction requests issued by the virtual machine in real time. According to the migration status of the data block corresponding to the request, it forwards the request to the corresponding disk for processing, and switches the disk access path of the virtual machine after the full data synchronization is completed, thus completing the online migration of the virtual machine across storage types.

[0078] Corresponding to the virtual machine migration method, this application also provides a virtual machine migration apparatus. (See also...) Figure 5 This is a schematic diagram of a virtual machine migration apparatus provided in some embodiments of this application. Figure 5 In this context, the virtual machine migration device includes: The channel establishment module 501 is used to establish a data access channel between the interactive intermediate layer component and the target disk and the source disk; wherein the target disk and the source disk correspond to different storage types.

[0079] The data block writing module 502 is used to read data blocks from the source disk and write the data blocks to the target disk through the data access channel.

[0080] The request receiving module 503 is used to receive disk interaction requests issued by the virtual machine during the process of writing data blocks to the target disk.

[0081] The request processing module 504 is used to forward the disk interaction request to the corresponding source disk or target disk for processing based on the migration status of the corresponding data block of the disk interaction request.

[0082] The path switching module 505 is used to switch the virtual machine's disk interaction path to the target disk when all data blocks of the source disk have been written to the target disk, so as to complete the migration of the virtual machine.

[0083] In some embodiments, the data block writing module 502 is specifically used for: Get the access frequency of each data block in the source disk; Determine the priority of data blocks based on their access frequency; Data blocks are written to the target disk according to their popularity priority through the data access channel.

[0084] In some embodiments, the request processing module 504 is specifically used for: Determine whether a disk interaction request is a disk read request; When the disk interaction request is a disk read request, determine whether the migration status of the data block corresponding to the disk interaction request is an unmigrated state; If the data block is in an unmigrated state, the disk interaction request will be forwarded to the corresponding source disk for processing; If the data block is in a migrated state, forward the disk interaction request to the target disk for processing; The migration status of data blocks includes unmigrated and migrated states.

[0085] In some embodiments, the request processing module 504 is further configured to: If the disk interaction request is a disk write request, the disk interaction request is forwarded to the target disk for processing.

[0086] In some embodiments, the device further includes a temporary data module, which is specifically used for: Establish a temporary data area; When the disk interaction request is a disk write request, the newly added write data block is written to the target disk and simultaneously stored in the temporary data area. Based on the source disk and temporary data area, construct a verification dataset; Based on the verification dataset, perform data consistency verification on the data blocks in the target disk.

[0087] In some embodiments, the temporary data module is also used for: If it is necessary to terminate the virtual machine migration operation, merge the newly written data blocks in the temporary data area into the source disk; Switch the virtual machine's disk interaction path to the source disk to complete the virtual machine migration rollback.

[0088] For a description of the features in the embodiment corresponding to the virtual machine migration device, please refer to the relevant description in the embodiment corresponding to the sample data processing method, which will not be repeated here.

[0089] See also Figure 6 The embodiments of this application also provide an electronic device, including a memory 10 and a processor 20, wherein the memory 10 stores a computer program and the processor 20 is configured to run the computer program to perform the steps in any of the above-described virtual machine migration method embodiments.

[0090] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described virtual machine migration method embodiments at runtime.

[0091] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0092] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described virtual machine migration method embodiments.

[0093] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described virtual machine migration method embodiments.

[0094] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be executed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-a-chip (SoC), a complex programmable logic device (CPLD), a microprocessor (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or one or more combinations thereof. The aforementioned computer program (also known as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.

[0095] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0096] The foregoing has provided a detailed description of a virtual machine migration method, system, apparatus, device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A virtual machine migration method, characterized in that, The method, applied to an interactive middleware component, includes: Establish data access channels between the interactive middleware component and the target disk and the source disk; wherein the target disk and the source disk correspond to different storage types; Data blocks are read from the source disk and written to the target disk through the data access channel. During the process of writing the data block to the target disk, a disk interaction request is received from the virtual machine; Based on the migration status of the data block corresponding to the disk interaction request, the disk interaction request is forwarded to the corresponding source disk or target disk for processing; Once all data blocks on the source disk have been written to the target disk, the virtual machine's disk interaction path is switched to the target disk to complete the virtual machine migration.

2. The virtual machine migration method according to claim 1, characterized in that, The step of reading data blocks from the source disk and writing the data blocks to the target disk through the data access channel includes: Get the access frequency of each data block in the source disk; Based on the access frequency of each data block, the priority of the data blocks is determined; Through the data access channel, the data blocks are written to the target disk according to their popularity priority.

3. The virtual machine migration method according to claim 1, characterized in that, The step of forwarding the disk interaction request to the corresponding source disk or target disk for processing based on the migration status of the data block corresponding to the disk interaction request includes: Determine whether the disk interaction request is a disk read request; If the disk interaction request is a disk read request, determine whether the migration status of the data block corresponding to the disk interaction request is an unmigrated state. If the data block is in an unmigrated state, the disk interaction request is forwarded to the corresponding source disk for processing; If the data block is in a migrated state, the disk interaction request is forwarded to the target disk for processing; The migration status of the data block includes the unmigrated state and the migrated state.

4. The virtual machine migration method according to claim 3, characterized in that, The method further includes: If the disk interaction request is a disk write request, the disk interaction request is forwarded to the target disk for processing.

5. The virtual machine migration method according to claim 1, characterized in that, The method further includes: Establish a temporary data area; When the disk interaction request is a disk write request, the newly added write data block is written to the target disk and simultaneously stored in the temporary data area. Based on the source disk and temporary data area, construct a verification dataset; Based on the verification dataset, perform data consistency verification on the data blocks in the target disk.

6. The virtual machine migration method according to claim 5, characterized in that, The method further includes: If it is necessary to terminate the virtual machine migration operation, the newly written data blocks in the temporary data area will be merged into the source disk; Switch the virtual machine's disk interaction path to the source disk to complete the virtual machine migration rollback.

7. A virtual machine migration system, characterized in that, The system includes: a source disk, a target disk, and an interactive middleware component; The interactive middleware component is used to perform virtual machine migration between the source disk and the target disk using the virtual machine migration method as described in any one of claims 1 to 6.

8. A virtual machine migration device, characterized in that, The device includes: The channel establishment module is used to establish a data access channel between the interactive middleware component and the target disk and the source disk; wherein the target disk and the source disk correspond to different storage types; A data block writing module is used to read data blocks from the source disk through the data access channel and write the data blocks to the target disk; The request receiving module is used to receive disk interaction requests issued by the virtual machine during the process of writing the data block to the target disk; The request processing module is used to forward the disk interaction request to the corresponding source disk or target disk for processing based on the migration status of the data block corresponding to the disk interaction request; The path switching module is used to switch the disk interaction path of the virtual machine to the target disk when all data blocks of the source disk have been written to the target disk, so as to complete the migration of the virtual machine.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the virtual machine migration method as described in any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the virtual machine migration method as described in any one of claims 1 to 6.