Cross-virtualization platform online migration method based on mirror relay
By creating cutover transaction objects and asynchronous task verification, the problem of simultaneous writing to the source and target ends during cross-virtualization platform migration was solved, achieving control over data consistency and unique write rights, and avoiding data forks and incomplete images.
Patent Information
- Application Number
- CN202611354423.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-02
- Publication Date
- 2026-11-20
AI Technical Summary
Existing online migration systems lack unified transaction control during cross-virtualization platform migration, which may cause the source and target ends to write to external systems simultaneously, resulting in a dual-active state and leading to problems such as data inconsistency, data forks, and incomplete images.
By creating a cutover transaction object, using transaction identifiers and status version numbers to control source-side write freezes and generate write barriers, it ensures that external services are only allowed after final incremental synchronization and target-side startup. Furthermore, it prevents out-of-order execution through asynchronous task callback verification, thereby achieving causal consistency and unique write right control.
It effectively avoids data inconsistency and incomplete mirroring during the migration process, ensures causal consistency and unique write rights during the migration process, and reduces the risks of data fork and business dual-active operation.
Smart Images

Figure CN123137791A_ABST
Abstract
Description
Technical Field
[0001] This application relates to data processing technology, and more particularly to an online migration method across virtualization platforms based on mirror relay. Background Technology
[0002] With the development of cloud computing infrastructure, heterogeneous virtualization platforms, and hybrid cloud architectures, online migration technology across virtualization platforms is widely used in scenarios such as business system upgrades, resource pool migrations, data center relocations, and disaster recovery switching.
[0003] Existing online migration solutions typically employ a migration model that involves continuous incremental synchronization at the source, merging of the image transfer layer, and startup takeover at the target. During the migration process, incremental data of the source virtual machine is continuously synchronized through the image transfer layer, and the target virtual machine is started after the final incremental synchronization is performed in the final cutover phase.
[0004] However, in actual engineering implementation, operations such as pausing the source virtual machine, deleting the source snapshot, final incremental synchronization, starting the target machine, and network switching are usually executed in parallel by different asynchronous tasks, and the tasks often rely on simple status fields or asynchronous callbacks for cooperation.
[0005] Without unified cutover transaction control, strong state machine constraints, and write mutual exclusion mechanisms, it is easy for the target virtual machine to provide services to the outside world while the source virtual machine has not yet completed writing or still has the ability to write to the outside world. This can lead to a "dual-active" state where the source and target can be written to simultaneously for a short period of time, resulting in problems such as inconsistent business data, data forks, transaction conflicts, or incomplete image versions. Summary of the Invention
[0006] This application provides an online migration method across virtualization platforms based on image relay, to solve the problems of dual-active windows, incomplete target image data, and unverifiable migration status that occur during the migration and cutover process.
[0007] This application provides a cross-virtualization platform online migration method based on image relay. By creating a cutover transaction object for the virtual machine to be migrated, and controlling cutover steps such as source-side write freezing, write barrier generation, final incremental synchronization, target-side startup, and network switching based on a unified transaction identifier and state version number, the target virtual machine only gains startup and external service permissions after the source-side is no longer writable, the final incremental synchronization is completed, and the target image version verification passes. This effectively avoids the problem of simultaneous writes from both the source and target sides. Furthermore, by performing transaction identifier verification, state version verification, and causal order verification on asynchronous task callbacks, expired tasks, duplicate tasks, or out-of-order callbacks can be prevented from incorrectly advancing the cutover state. Therefore, even in complex environments such as network jitter, platform interface latency, task retries, or batch migrations, image consistency, write uniqueness, and state verifiability during the migration cutover process can be guaranteed, reducing the risks of data forks, dual-active business operations, and incomplete images during online migration. Attached Figure Description
[0008] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0009] Figure 1 This is a flowchart illustrating an online migration method across virtualization platforms based on image relay, according to an example embodiment of this application. Figure 2 This is a schematic flowchart of S200 shown in the first example embodiment of this application; Figure 3 This is a schematic flowchart of S200 shown in the second example embodiment of this application; Figure 4 This is a schematic flowchart of S200 shown in the third exemplary embodiment of this application; Figure 5 This is a schematic flowchart of S200 shown in the fourth exemplary embodiment of this application; Figure 6 This is a schematic flowchart of S300 shown in the first example embodiment of this application; Figure 7 This is a schematic flowchart of S300 shown in the second example embodiment of this application; Figure 8 This is a schematic flowchart of S300 shown in the third exemplary embodiment of this application; Figure 9 This is a schematic flowchart of S300 shown in the fourth example embodiment of this application.
[0010] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0011] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0012] With the widespread deployment of cloud computing platforms, virtualization resource pools, and hybrid cloud architectures, online migration technology across virtualization platforms has gradually become a core capability for data center migration, business continuity assurance, and disaster recovery switching. Existing migration systems typically employ a technical path of continuous incremental synchronization at the source end, data merging at the image transfer layer, and takeover of operation at the target end to achieve uninterrupted business migration. In this path, the migration system first performs a full image copy of the source virtual machine. Then, based on snapshot mechanisms, change block tracking mechanisms, or incremental log mechanisms, it continuously acquires incremental data generated during the operation of the source virtual machine and synchronizes it to the target image through the image transfer layer. During the business cutover phase, the system typically needs to pause or freeze the source virtual machine, perform a final incremental synchronization, and start the target virtual machine after the target image is merged. Finally, network traffic is switched to the target end, thereby achieving business takeover.
[0013] However, most existing online migration systems are distributed asynchronous orchestration systems, which often involve multiple independent subsystems, such as the source virtualization platform, image relay layer, target virtualization platform, network controller, and storage controller. These subsystems typically coordinate through asynchronous interfaces, task queues, or callback mechanisms, rather than completing within the same atomic transaction. To improve batch migration efficiency, existing systems also commonly employ parallel scheduling methods, such as executing target startup preparation before the source pause operation is fully completed, triggering snapshot deletion tasks in parallel during the final incremental synchronization process, or having an independent network control module asynchronously perform network switching operations.
[0014] In this scenario, the migration orchestration system typically determines the cutover progress using only simple stage status fields. For example, the system only records stage statuses such as "source stopping," "final synchronization in progress," and "target starting," lacking unified constraints on the actual write status of the source, incremental synchronization boundaries, target image version, and network switching status. Therefore, even if the control layer considers the source virtual machine to be frozen, incomplete write paths may still exist on the underlying data plane. For instance, although the source virtual machine has received a pause command, its virtual processor cache, storage I / O queues, and background snapshot merging process may not have finished; or the network control layer may not have truly blocked the source's access paths to the database, message queues, and shared storage. Meanwhile, the target virtual machine may have already started and connected to the business network.
[0015] Due to the lack of unified cutover transaction control and a unique write right constraint mechanism, the source and target virtual machines may simultaneously possess business write capabilities for a short period, forming a "dual-active window." During this window, the source and target may simultaneously write different data to the database, file system, caching system, or messaging system, leading to problems such as data fork, transaction conflicts, inconsistent image states, and unrecoverable business states. Especially in financial transactions, database clusters, and high-consistency business scenarios, even a dual-active window lasting only a few hundred milliseconds can cause data inconsistency issues that cannot be automatically merged.
[0016] Furthermore, existing migration orchestration processes typically lack the ability to constrain the out-of-order delivery of asynchronous tasks. Due to network jitter, task retries, message backlogs, or platform interface latency, callback results from different asynchronous tasks may be returned in an unexpected order. For example, a successful start callback on the target end may arrive before a pause completion callback on the source end; a snapshot deletion task may complete before the final incremental synchronization has truly ended; and repeated retry tasks may overwrite existing states. Because existing systems typically advance the migration phase solely based on "task execution success," without verifying the transaction version, prior states, and causal order of the tasks, they are prone to issues such as expired or erroneous tasks advancing into the cutover state.
[0017] Furthermore, existing virtualization platform interfaces are typically control plane interfaces, not data plane consistency interfaces. A virtualization platform returning "pause successful" or "snapshot complete" only indicates that a control request has been received or scheduled; it does not mean the underlying data path is completely stable. For example, after a virtual machine is paused, the backend storage may continue processing writes to be committed; snapshot deletion operations may be performing block merging in the background; and incremental logs may not yet be fully written to the image relay layer. Therefore, there is an inherent timing difference between the control plane state and the underlying data state.
[0018] Existing technologies lack a unified state machine control mechanism to address the timing differences between the control plane and data plane. This results in the migration system being unable to verify whether the target image truly covers all writes made before the source was frozen, and also unable to guarantee that the same migration instance has only one writable subject at any given time. Consequently, there is a high consistency risk during the final cutover phase of online migration.
[0019] In short, the above problems essentially stem from the inconsistency between the control state advancement and the underlying data consistency convergence in the online migration system, as well as the lack of unified transaction constraints among multiple control modules.
[0020] Specifically, the final cutover phase of online migration typically includes at least the following processes: pausing or shutting down the source virtual machine, fixing the source snapshot, final incremental synchronization, merging data in the image transit layer, importing the target image, starting the target virtual machine, and switching network access. Theoretically, these processes should adhere to a strict timing sequence: source writes must be completely stopped before final incremental synchronization; the target machine can only provide services after final incremental synchronization is complete; and before the target machine officially takes over operations, it must be ensured that the source machine has lost all write capabilities.
[0021] However, in real-world engineering environments, the above steps are often executed by multiple independent asynchronous tasks. These tasks coordinate through database status, message notifications, or callback events, rather than through a unified atomic transaction. Therefore, when the orchestration system sends a pause request to the source platform, the source platform may only have paused the virtual processors, without having flushed the storage cache to disk; when the mirror relay layer begins executing the final incremental synchronization, the source may still have dirty pages that haven't been written to the snapshot chain; and the target's startup task may complete before the final incremental merge due to an early arrival of an asynchronous callback.
[0022] Furthermore, in existing systems, a complete freeze is typically a logical state, rather than a complete blockage of the actual write path. For example, simply pausing a virtual machine does not prevent background snapshot merging from continuing to write to disk; simply shutting down a virtual processor does not prevent existing network connections from continuing to send data; and simply performing a network switch does not prevent the source from continuing to access shared storage. Therefore, there is a lack of a unified standard for defining the writable state in existing systems.
[0023] Furthermore, existing mirror relay layers typically only record the synchronization completion result, without establishing a binding relationship between the source freeze boundary and the target image version. For example, although the relay layer completes the final incremental synchronization, it cannot prove whether the synchronized data has overwritten the last write before the source freeze; although the target starts successfully, the image version it uses may correspond to an earlier incremental boundary. Without the correlation between write barrier sequence numbers, incremental boundary versions, and image commit versions, the system cannot verify whether the target image is truly in a consistent state.
[0024] Out-of-order asynchronous tasks are also a significant cause of problems. In distributed systems, task callbacks inherently possess uncertainty. For example, a successful network switch callback may arrive before the final synchronization completion callback; retry tasks may repeatedly advance to the same state; and compensation processes may execute concurrently with the main process. If the system does not add transaction identifiers, state version numbers, and causal order verification mechanisms for asynchronous tasks, expired or duplicate tasks may incorrectly modify the current state, causing the target end to gain business access prematurely.
[0025] From a lower-level system control perspective, migration and cutover are essentially processes of transferring unique write rights. Unique write rights mean that within the same business lifecycle, only one running entity is allowed to have external write capabilities. However, current technologies lack a unified write right arbitration mechanism between the source and target ends. If the source end hasn't completely revoked its write capabilities, the target end may have already started and taken over the business network, resulting in two running entities simultaneously possessing write permissions. This problem essentially falls under the category of resource mutual exclusion failure in a distributed environment.
[0026] Therefore, the fundamental technical reason for the above problems is not a single script execution order error, but the lack of a unified transactional state control mechanism in existing online migration systems that can simultaneously constrain the source freeze state, write boundaries, final incremental synchronization, target image version, target startup permissions, and network switching permissions. This results in a lack of causal consistency and unique write right constraints in the state advancement during the migration and cutover process, ultimately causing problems such as dual-active windows, image inconsistency, and data forks during online migration.
[0027] For ease of understanding, let's consider the first possible implementation scenario: the technical scenario where asynchronous pauses lead to simultaneous writes on both the source and target ends. Specifically, taking the cross-virtualization platform migration scenario of a financial institution's core transaction system as an example, the source virtual machine runs on the first virtualization platform, and the target virtual machine runs on the second virtualization platform. The migration system continuously synchronizes the transaction database mirror data through an image relay layer. In the initial stage of migration, the migration system first performs a full image copy, and during continuous business operation, it continuously synchronizes incremental data based on a change block tracking mechanism.
[0028] When the migration enters the final cutover phase, the migration orchestration system sends a virtual machine pause command to the source virtualization platform. After receiving a "pause successful" response from the control layer, the migration status is updated to "source frozen". Subsequently, the image transfer layer begins to perform the final incremental synchronization, while the target virtual machine enters the startup process.
[0029] However, in actual operation, although the virtual processors of the source virtual machine were paused, some cache write requests in the source storage system were still being flushed to disk in the background, and the database log thread had not completely stopped writing. Meanwhile, the target virtual machine had started based on the relay image and reconnected to the business network to begin receiving new transaction requests. Because the source database still had a small number of uncommitted transactions, while the target database had begun receiving new transaction data, a dual-active state where both the source and target were writable was achieved within a short period.
[0030] During this active-active window, some transaction records were written to the source database, while others were written to the target database. Because the two databases generated different transaction logs, even if incremental synchronization continued, the order of transactions could not be automatically determined, ultimately leading to a database fork. This demonstrates that without unified cutover transaction control and a unique write right constraint mechanism, relying solely on the paused state of the control layer cannot guarantee that the underlying data path has completely stopped writing, thus easily creating active-active risks during online migration.
[0031] In the second possible implementation scenario, namely the technical scenario where out-of-order asynchronous tasks lead to erroneous cutover, specifically, taking a batch migration scenario of a cloud data center as an example, the migration system simultaneously performs online migration of multiple business virtual machines. To improve migration efficiency, the system adopts an asynchronous task scheduling mechanism, with the source control module, image synchronization module, and network switching module executing related operations in parallel.
[0032] During the cutover process of a virtual machine to be migrated, the system first sends a snapshot freeze request to the source end and simultaneously creates a final incremental synchronization task. Due to network jitter, the source end's freeze completion callback does not return for a long time, while the image synchronization module has already completed the current cache incremental synchronization ahead of time. Subsequently, the target end's startup task is executed ahead of time due to the retry mechanism and returns a "startup successful" status to the orchestration system.
[0033] Without verifying the task transaction version and prior status, the migration orchestration system proceeds the migration process solely based on the successful startup status of the target virtual machine and triggers a network switchover operation, causing external business traffic to switch to the target virtual machine. At this point, the source virtual machine has not actually been truly frozen, and background applications can still continue to write data to shared storage.
[0034] Because the target end has already started providing services, while the source end still retains write capabilities, both the source and target ends modify the same business data simultaneously, ultimately leading to file version conflicts in the shared file system. Furthermore, since the subsequent "source end freeze complete" callback belongs to an earlier stage task, its status overrides the current migration status, causing state disorder throughout the entire migration process.
[0035] The above process shows that in a distributed asynchronous migration environment, if a unified state verification mechanism based on transaction identifier, state version number and causal order is lacking, different asynchronous tasks may incorrectly advance the migration process due to out-of-order callbacks, task retries or state overwriting, which may lead to the target end obtaining business access permissions in advance.
[0036] In the second possible implementation scenario, the incomplete image is caused by inconsistencies between the control plane and data plane states. Specifically, taking the migration of a large database system as an example, the source virtual machine uses a distributed storage system as its backend storage. During the final cutover phase, the migration system sends a snapshot deletion request to the virtualization platform and receives a "snapshot deletion complete" interface response.
[0037] However, the deletion completion only indicates that the control plane task has been successfully committed; the backend storage system is still actually performing block data merging operations. Meanwhile, the image transfer layer has begun generating the final image version based on the control plane state and mounting the corresponding image to the target virtual machine.
[0038] Because the background block merging is not yet complete, some of the latest database log pages have not yet been written to the final image file. Therefore, although the database on the target virtual machine can run normally after startup, some recently committed transactions have been lost. After running for a period of time, the business system discovered that some order statuses were missing and that the database log chain was broken.
[0039] This scenario demonstrates that a successful control plane status returned by the virtualization platform does not equate to the underlying data plane having achieved consistent convergence. If the migration system fails to establish a correlation and verification relationship between the source freeze boundary, write barrier boundary, and the target image version, it cannot ensure that the target image truly covers all written data before the source freeze, resulting in an incomplete image state after migration.
[0040] The above scenarios demonstrate that the problems in existing online migration systems do not stem from a single module failure, but rather from the lack of unified transaction constraints among multiple control modules in a distributed asynchronous environment. Because of the temporal differences between the control plane state and the underlying data state, and because asynchronous tasks can experience out-of-order execution, duplicate execution, and state overwriting, relying solely on simple stage states cannot guarantee data consistency during the migration and cutover process.
[0041] Furthermore, the final cutover process during online migration is essentially a transfer of write rights from the source to the target. If the system cannot guarantee that only one writable entity exists at any given time, a dual-active window can easily form during the migration process, leading to data forks, mirror inconsistencies, and business anomalies. Therefore, a transactional control mechanism is needed to uniformly constrain the source's frozen state, write boundaries, final incremental synchronization, target mirror version, and target's startup permissions, in order to achieve causal consistency and unique write right control during the migration cutover process.
[0042] To address the aforementioned issues, the embodiments provided in this application establish a strong state machine control mechanism based on the cutover transaction object. This mechanism integrates operations such as source-side freezing, isolation control, write barrier generation, final incremental synchronization, target image commit, target startup authorization, and network switching authorization into the same transactional state flow, and uses state version numbers to restrict the order of state transitions. Specifically, after confirming that the source virtual machine is in a writable state, a write barrier sequence number is generated and used as the upper bound of the final incremental synchronization, binding the target image commit version with the source's final write boundary. Simultaneously, the startup of the target virtual machine and the switching of the service entry point are controlled through target startup authorization tokens and network switching authorization tokens, ensuring that the target only has external service capabilities after the source's write right is revoked and the final incremental synchronization is completed. Furthermore, by verifying the transaction identifier, state version number, previous state summary, and idempotent key in asynchronous task callbacks, expired callbacks, duplicate executions, and out-of-order tasks can be prevented from illegally advancing the state machine, thereby achieving causal consistency and unique write right control during the cutover process in a distributed asynchronous migration environment.
[0043] Figure 1 This is a flowchart illustrating an online migration method across virtualization platforms based on image relay, according to an example embodiment of this application. Figure 1 As shown, the method provided in this embodiment includes: S100. Create the cutover transaction object corresponding to the virtual machine to be migrated.
[0044] In this step, the migration control node responds to the migration task creation request by generating a unique cutover transaction object for the virtual machine to be migrated. Specifically, the migration control node obtains the source virtual machine identifier, the target virtual machine identifier, the migration task creation time, and the migration batch identifier, and generates a transaction identifier based on these identifiers. Subsequently, a transaction record entry corresponding to the transaction identifier is created and written to the state storage area so that subsequent cutover actions are all associated with the same cutover transaction object.
[0045] S200, based on the cutover transaction object, performs write freeze and isolation control operations on the source virtual machine.
[0046] Figure 2 This is a schematic flowchart of S200 shown in the first example embodiment of this application. Figure 2 As shown, the above S200 includes: S211. Send a freeze request carrying the transaction identifier and status version number to the source platform.
[0047] After creating the cutover transaction object, the migration control node reads the transaction identifier and status version number corresponding to the current cutover transaction object and generates a freeze control message. Specifically, the freeze control message includes the migration task identifier, the source virtual machine identifier, the transaction identifier, the status version number, and the freeze action type. Subsequently, the migration control node sends the freeze control message to the source platform through the virtualization management interface, so that the source platform can associate and register the current freeze operation based on the transaction identifier and status version number, and establish a corresponding freeze task record.
[0048] S212, Control the source virtual machine to pause operation.
[0049] Upon receiving the freeze control message, the source platform invokes the corresponding virtual machine lifecycle control interface to perform a pause or suspension operation on the source virtual machine. Specifically, the source platform first stops the virtual processor scheduling corresponding to the source virtual machine, then pauses memory page update operations, and blocks new disk write requests from entering the I / O queue, thereby causing the source virtual machine to enter a stopped state. Subsequently, the source platform returns the pause completion result to the migration control node.
[0050] S213. Query the virtual processor status, input / output queue status, and snapshot baseline status of the source virtual machine.
[0051] After receiving the pause completion result, the migration control node sends a status query request to the source platform. Specifically, the status query request is used to obtain the virtual processor running status, disk I / O queue length, number of writes to be committed, snapshot chain status, and current snapshot identifier. The source platform responds to the status query request, reads the corresponding status information, and returns the status information to the migration control node for subsequent freeze status confirmation processing.
[0052] S214. After the virtual processor is in a stopped state, the input / output queue state meets the preset conditions, and the snapshot baseline state meets the preset conditions, generate a freeze certificate.
[0053] When the migration control node detects that the virtual processor is in a stopped state, there are no pending write requests in the disk I / O queue, there are no incomplete merge tasks in the snapshot chain, and the current snapshot identifier is fixed, it generates a freeze certificate. The freeze certificate includes the transaction identifier, status version number, freeze completion time, current snapshot identifier, and I / O queue verification result. The freeze certificate is then written to the cutover transaction object as the status basis for subsequently generating write barrier sequence numbers.
[0054] Figure 3 This is a schematic flowchart of S200 according to the second example embodiment of this application. Figure 3 As shown, the above S200 includes: S221. Send an isolation control request to the network control device.
[0055] After creating the cutover transaction object, the migration control node reads the transaction identifier, status version number, and network identifier information corresponding to the virtual machine to be migrated, and generates an isolation control message. Specifically, the isolation control message includes the source virtual machine identifier, service network identifier, transaction identifier, status version number, isolation action type, and rule scope. Subsequently, the migration control node sends the isolation control message to the network control device through the network control interface, so that the network control device establishes an isolation task record corresponding to the current cutover transaction object and enters the rule issuance process.
[0056] S222, Control network control devices to block the access paths of source virtual machines to business networks, database services, storage services, or message services.
[0057] Upon receiving the isolation control message, the network control device parses the virtual switch port, virtual network interface address, and service access address corresponding to the source virtual machine, and generates corresponding access control rules. Specifically, the network control device isolates the external access path of the source virtual machine by disabling virtual switch port forwarding capabilities, deleting service routing entries, updating access control list rules, blocking database access ports, blocking storage service connection channels, and blocking message service communication connections, or by doing one or more of these actions. Subsequently, the network control device records the rule number and effective time of the currently effective rule and returns the rule execution result to the migration control node.
[0058] S223. Obtain the rule version number returned by the network control device.
[0059] After receiving the rule execution result, the migration control node reads the rule version number, rule number, and rule effective time returned by the network control device. Specifically, the rule version number identifies the network configuration version status corresponding to the current isolation control rule, and the rule number identifies the rule set corresponding to this isolation control action. Subsequently, the migration control node establishes an association record between the rule version number and the current cutover transaction object, and writes it into the corresponding cutover status record.
[0060] S224. If the rule version number matches the state version number, generate an isolation control certificate.
[0061] The migration control node compares the rule version number with the state version number in the current cutover transaction object. Specifically, when the rule version number matches the state version number, the migration control node generates an isolation control certificate; the isolation control certificate includes the transaction identifier, state version number, rule version number, rule number, and isolation completion time. Subsequently, the migration control node writes the isolation control certificate into the cutover transaction object as the basis for generating write barrier sequence numbers and performing final incremental synchronization.
[0062] Figure 4 This is a schematic flowchart of S200 according to the third exemplary embodiment of this application. Figure 4 As shown, the above S200 includes: S231. Send a write permission revocation request to the storage backend.
[0063] After creating the cutover transaction object, the migration control node reads the transaction identifier, status version number, migration disk identifier, and storage connection identifier corresponding to the virtual machine to be migrated, and generates a write permission revocation request message. Specifically, the write permission revocation request message includes the transaction identifier, status version number, migration disk identifier, source virtual machine identifier, write permission revocation type, and storage access scope. Subsequently, the migration control node sends the write permission revocation request to the storage backend through the storage control interface, so that the storage backend establishes a write permission revocation task record corresponding to the current cutover transaction object and enters the access permission switching process.
[0064] S232. Control the storage backend to switch the access permissions of the migration disk corresponding to the source virtual machine from read-write mode to read-only mode or access denied mode.
[0065] Upon receiving a write permission revocation request, the storage backend parses the logical volume, block storage device, or shared disk path corresponding to the migration disk identifier and modifies the corresponding access control state. Specifically, the storage backend switches the access permissions of the migration disk to read-only mode or access-denied mode by closing the write commit channel, disabling new write transactions, removing write mount permissions, or disconnecting the write session, or by doing one or more of these actions. Subsequently, the storage backend records the switching time and access control version number corresponding to the current access permission switching action and generates the permission switching result.
[0066] S233. Clear the pending write queue corresponding to the migration disk.
[0067] After completing the access permission switch, the storage backend continues to query the cached write records, delayed write records, and incomplete I / O requests corresponding to the migrated disk. Specifically, the storage backend clears the pending write queue corresponding to the migrated disk by performing one or more of the following operations: cache refresh, committing received write data, waiting for I / O requests to return completion status, and closing pending transactions. Subsequently, the storage backend generates a corresponding write queue completion identifier and records the last completed write time.
[0068] S234. Obtain the storage access generation number returned by the storage backend.
[0069] After receiving the permission switch result and the write queue completion flag, the migration control node reads the storage access generation number, access control version number, and last write completion time returned by the storage backend. Specifically, the storage access generation number identifies the storage access state boundary corresponding to the currently migrated disk, and the access control version number identifies the storage control state corresponding to the current access permission switch action. Subsequently, the migration control node writes the storage access generation number into the status record corresponding to the current cutover transaction object.
[0070] S235. Generate isolation control proof based on storage access generation number.
[0071] The migration control node compares the storage access generation number with the current state version number. Specifically, when the access control state corresponding to the storage access generation number has taken effect and there are no incomplete write requests on the migration disk, the migration control node generates an isolation control certificate. The isolation control certificate includes the transaction identifier, state version number, storage access generation number, access control version number, and permission switch completion time. Subsequently, the migration control node writes the isolation control certificate into the cutover transaction object as the basis for generating write barrier sequence numbers and performing final incremental synchronization.
[0072] Figure 5 This is a schematic flowchart of S200 according to the fourth exemplary embodiment of this application. Figure 5As shown, the above S200 includes: S241. Perform network-side isolation control operations.
[0073] The migration control node reads the transaction identifier, status version number, business network identifier, and network access information corresponding to the virtual machine to be migrated, and sends a network isolation control command to the network control device. Specifically, the network isolation control command includes the transaction identifier, status version number, source virtual machine network address, target blocking scope, and isolation rule activation order. Subsequently, the network control device modifies access control rules, forwarding tables, or virtual network policies based on the network isolation control command to block data communication paths between the source virtual machine and the business network, database service, storage service, and messaging service. Further, the network control device records the corresponding rule change time, rule version number, and rule activation status, and returns the rule version number to the migration control node.
[0074] S242. Perform a pause or shutdown operation on the source virtual machine.
[0075] Upon receiving the rule version number, the migration control node sends a virtual machine shutdown control command to the source platform. Specifically, the virtual machine shutdown control command includes a transaction identifier, a status version number, the source virtual machine identifier, and the shutdown action type. Subsequently, the source platform suspends virtual processor scheduling, memory write operations, and I / O request submission operations corresponding to the source virtual machine, or executes the operating system shutdown process for the source virtual machine. Further, the source platform records the shutdown completion time, virtual processor stop status, and disk mount status corresponding to the current shutdown action, and generates shutdown result information to return to the migration control node.
[0076] S243, Query the status of the stored input / output queue.
[0077] After receiving the shutdown result information, the migration control node sends an I / O status query request to the storage backend. Specifically, the I / O status query request includes the transaction identifier, status version number, migration disk identifier, and queue query range. Subsequently, the storage backend reads the cache write records, delayed commit records, and incomplete I / O request records corresponding to the migration disk, and counts the number of currently pending I / O requests. Further, the storage backend generates I / O queue status results; these results include the number of pending requests, the last completed write time, cache refresh status, and queue completion identifier.
[0078] S244. When network isolation is complete, the source virtual machine is in a stopped state, and the storage input / output queue is empty, generate a combined freeze proof.
[0079] The migration control node receives the rule version number, shutdown result information, and I / O queue status results, and performs consistency verification on the status corresponding to the current cutover transaction object. Specifically, the migration control node determines whether the network isolation status has taken effect, whether the virtual processor corresponding to the source virtual machine has stopped, and whether the number of pending I / O requests is zero. Further, if the network isolation status has taken effect, the source virtual machine is in a stopped state, and the number of pending I / O requests is zero, the migration control node generates a combined freeze proof; the combined freeze proof includes the transaction identifier, status version number, rule version number, shutdown completion time, last write completion time, and queue completion identifier. Subsequently, the migration control node writes the combined freeze proof into the cutover transaction object as the status basis for generating the write barrier sequence number.
[0080] Regarding the above Figures 2-5 For ease of understanding, the following comparison can be made between the illustrated embodiments: First of all, for Figure 2 In the illustrated embodiment, in some virtualization platforms, the write behavior of the source virtual machine is mainly scheduled uniformly by the virtual machine monitoring layer. The virtual processor scheduling status, I / O queue status, and snapshot baseline status can directly reflect the current data consistency status of the virtual machine. In this scenario, by sending a freeze request to the source platform and generating a freeze certificate by combining the virtual processor stop status, I / O queue status, and snapshot baseline status, write freeze control can be directly completed at the virtualization execution layer.
[0081] Figure 2 The illustrated embodiment is applicable to centralized virtualization platforms with complete virtual machine lifecycle control capabilities, such as virtualization environments with unified virtual machine pause interfaces, snapshot interfaces, and change tracking interfaces. Since no new memory-state writes occur after the virtual processor stops, and pending write requests in the I / O queue are gradually cleared, a stable data quiescent boundary can be formed at the virtualization execution layer. Furthermore, the snapshot baseline state can provide a data version anchor point corresponding to the freeze moment, thereby ensuring boundary consistency for the final incremental synchronization.
[0082] Compared to simply relying on storage-side permission switching, Figure 2 The illustrated embodiment can simultaneously control the consistency of the computation state and the input / output state, making it more suitable for database virtual machines, transactional application virtual machines, and business scenarios with frequent dirty page writes to memory. The underlying technical reason is that data changes within the virtual machine originate not only from disk writes but also from the continuous flushing of dirty pages during virtual processor scheduling. Therefore, simply restricting storage writes cannot completely block changes in the state of newly added data, while pausing the virtual processor can cut off the process of generating new states at the source of execution.
[0083] Secondly, for Figure 3 In the illustrated embodiment, in some cloud platform environments, business systems typically access database services, caching services, messaging services, and remote storage services via network paths. Even if the virtual machine is still running, blocking its external business access path can prevent new business write requests from continuing to enter the source system. Therefore, by implementing isolation control through network control devices, business write freezes can be achieved without immediately stopping the virtual machine.
[0084] Figure 3 The illustrated embodiments are applicable to software-defined network environments, multi-tenant cloud platform environments, and online migration scenarios where a smooth service switchover needs to be prioritized. Because the network control device can dynamically modify access control rules, forwarding tables, and virtual network policies, it can block service traffic in a short time and reduce the risk of service interruption caused by directly suspending virtual machines.
[0085] Figure 3 The technical advantage of the illustrated embodiment lies in the fact that the object frozen is not the internal execution state of the virtual machine, but rather the business write path itself. Since the vast majority of online business write requests must reach the database, storage service, or messaging service via network access links, blocking the corresponding communication path at the network layer prevents new business write requests from reaching the data persistence link, thus indirectly freezing the source data. The underlying technical reason is that data write behavior in a distributed system inherently depends on network communication links; once the network path is blocked, even if the business system continues to run, it cannot continue to form new, valid persistent writes.
[0086] Furthermore, compared to directly pausing the virtual machine's operation, Figure 3 The illustrated embodiment can preserve the internal runtime context of the source system, making it more suitable for migration scenarios that require fast rollback, fast recovery, or keeping the application hot.
[0087] Secondly, regarding Figure 4 In the illustrated embodiments, in some shared storage architectures or centralized block storage architectures, the data write behavior of virtual machines ultimately needs to be persisted through the storage backend. Therefore, by directly revoking the write permissions of the migration disk through the storage backend and switching the migration disk to read-only mode or access-denied mode, new data writes can be blocked at the storage medium level.
[0088] Figure 4 The illustrated embodiments are applicable to centralized storage array environments, distributed block storage environments, and cloud storage platforms that support storage access control policies. Because write permission control directly affects the underlying storage object corresponding to the migrated disk, even if residual write threads still exist on the source virtual machine, they cannot continue to submit valid write data to the target migrated disk.
[0089] Figure 4 The core technical advantage of the illustrated embodiment lies in the fact that its freeze control is located at the final disk write position in the data persistence link, thus avoiding the risk of data write-to-disk failure due to abnormal upper-layer software status, virtual machine control failure, or network policy delays. The underlying technical reason is that any new data must ultimately be written to the disk medium via the storage controller. If the underlying storage backend refuses the write operation, the new data cannot form a persistent version, thereby ensuring the stability of the final image boundary.
[0090] Furthermore, by clearing the pending write queue, the problem of historical data retention caused by cached delayed writes can be eliminated; while the storage access generation number can identify the unique generation boundary corresponding to the current storage permission status, which can then be used for the correlation verification between the target image version and the frozen status.
[0091] Compared to network isolation solutions, Figure 4 The illustrated embodiment has stronger constraints on network bypass writes, background copy writes, and internal system cache refresh writes, and is therefore more suitable for data migration scenarios with high consistency requirements.
[0092] Finally, for Figure 5 As illustrated in the embodiment, in large-scale distributed business systems, single-level freeze control often cannot fully guarantee the consistency of migration boundaries. For example, when only network isolation is performed, there may still be incomplete cache refresh operations within the source virtual machine; when only virtual machine suspension is performed, there may still be delayed commit queues in the storage backend; and when only storage permission revocation is performed, there may still be incomplete business requests on the network side. Therefore, in high-consistency online migration scenarios, a combined freeze mechanism is needed that integrates the network side, the compute side, and the storage side.
[0093] Figure 5 The illustrated embodiment is applicable to financial transaction systems, distributed database systems, large-scale messaging systems, and core business systems requiring strong consistency. By first executing network-side isolation control, then performing virtual machine pause or shutdown operations, and further confirming that the storage input / output queues are empty, a multi-layered freeze control chain covering the entire process of business entry, computation execution, and data persistence can be formed.
[0094] in, Figure 5 The technical advantage of the illustrated embodiment lies in that it does not rely on a single point of freezing, but rather forms a unified freeze proof through multi-dimensional state joint verification, thereby reducing the risk of state penetration in asynchronous systems. The underlying technical reason is that data state propagation in modern virtualization systems is typically asynchronous and hierarchical, with time differences existing between business requests, memory caches, input / output queues, and disk writes. If only a single state is verified, data residue issues may arise due to incomplete links in some processes.
[0095] Network isolation can prevent new business requests from entering the system; pausing or shutting down virtual machines can prevent new changes in memory state; and clearing and verifying input / output queues can confirm that all historical writes have been persisted. Therefore, Figure 5 The illustrated embodiment can form a unified state convergence boundary between the business layer, execution layer, and storage layer, making it more suitable for online migration scenarios with extremely high data consistency requirements.
[0096] S300: After confirming that the source virtual machine is in a writable state, generate a write barrier sequence number.
[0097] Optionally, the write barrier sequence number mentioned above includes one of the following: snapshot version number, change block tracking version number, or incremental log sequence number.
[0098] Figure 6 This is a schematic flowchart of S300 according to the first example embodiment of this application. Figure 6 As shown, the above-mentioned S300 includes: S311. Obtain the current snapshot identifier or the current change block tracking version number.
[0099] After confirming that the source virtual machine is in a non-writable state, the migration control node calls the snapshot query interface or change block trace query interface corresponding to the source platform to read the latest snapshot identifier or the latest change block trace version number corresponding to the current migration disk. The snapshot identifier represents the data snapshot boundary of the current migration disk, and the change block trace version number represents the boundary of the current changed data record. Further, the migration control node associates the snapshot identifier or change block trace version number with the transaction identifier and status version number in the current cutover transaction object to form the data boundary identifier corresponding to the freeze time.
[0100] During the snapshot query interface call, the migration control node sends a query request to the source platform containing a transaction identifier, a migration disk identifier, and a status version number. The source platform returns the snapshot identifier corresponding to the currently valid snapshot, the snapshot generation time, and the snapshot-associated disk identifier. After confirming that the returned snapshot-associated disk identifier matches the current migration disk, the migration control node writes the snapshot identifier into the cutover transaction object.
[0101] During the call to the change block tracing query interface, the migration control node sends a version query request to the source platform, containing the transaction identifier, migration disk identifier, and status version number. The source platform returns the version number corresponding to the current change block tracing record and the version generation time. After confirming that the current change block tracing record is in a stopped growth state, the migration control node writes the change block tracing version number to the cutover transaction object.
[0102] S312. Use the current snapshot identifier or the current change block tracking version number as the write barrier sequence number.
[0103] The migration control node registers the current snapshot identifier or the current change block tracking version number as the boundary sequence number corresponding to the final incremental synchronization, and writes the write barrier sequence number into the final incremental sequence number field in the cutover transaction object. Subsequently, the mirror relay layer reads the incremental data between the previous synchronization boundary and the write barrier sequence number based on the write barrier sequence number to ensure that no new write data generated after the freeze time is included in the final incremental synchronization process.
[0104] Furthermore, after generating the write barrier sequence number, the migration control node performs a uniqueness check on the current write barrier sequence number. Specifically, the migration control node queries whether a corresponding write barrier sequence number record already exists in the current cutover transaction object; if it does not exist, it confirms that the current write barrier sequence number is valid; if it already exists, it rejects duplicate registration and records the transaction log corresponding to the current duplicate generation event.
[0105] Furthermore, after the write barrier sequence number is generated, the migration control node generates corresponding barrier summary information. This barrier summary information includes the transaction identifier, status version number, write barrier sequence number, generation time, and migration disk identifier. The migration control node writes the barrier summary information to the cutover transaction object for boundary consistency verification during subsequent target image commit version verification.
[0106] Figure 7 This is a schematic flowchart of S300 according to the second example embodiment of this application. Figure 7 As shown, the above-mentioned S300 includes: S321. Generate sequentially increasing log sequence numbers for incremental data based on the mirror relay layer.
[0107] After receiving incremental write data from the source virtual machine, the image relay layer assigns a corresponding log sequence number to each incremental write record according to the order of receipt time. Each log sequence number is greater than the log sequence number of the previous incremental write record, forming a continuously increasing log sequence. Furthermore, the image relay layer associates the log sequence number with the corresponding migration disk identifier, data block address, write length, and write time, and writes this information to the incremental log queue for later reading during the final incremental synchronization process.
[0108] Furthermore, when generating log sequence numbers, the mirror relay layer reads the latest log sequence number corresponding to the current migration task and performs incremental allocation based on the latest log sequence number to avoid different incremental write records corresponding to the same log sequence number. After completing the log sequence number allocation, the mirror relay layer writes the log sequence number into the corresponding incremental data metadata and synchronously writes it into the incremental boundary record field of the cutover transaction object.
[0109] Furthermore, before writing to the incremental log queue, the mirror relay layer performs an order integrity check on the current incremental write record. Specifically, the mirror relay layer determines whether the current log sequence number is consecutive to the previous log sequence number; if they are consecutive, writing to the incremental log queue is allowed; if they are not consecutive, an exception log is recorded, and the current incremental synchronization process is paused.
[0110] S322. Record the last received log sequence number corresponding to the freeze time.
[0111] After confirming that the source virtual machine has completed the write freeze operation, the migration control node sends a log boundary query request to the image relay layer. The image relay layer reads the log sequence number corresponding to the last successfully received incremental write record in the current incremental log queue and returns the log sequence number to the migration control node. The migration control node records the log sequence number as the last received log sequence number corresponding to the freeze time and writes it into the final incremental sequence number field in the cutover transaction object.
[0112] Furthermore, when recording the last received log sequence number, the migration control node performs a write completion status confirmation on the current incremental log queue. Specifically, the migration control node only allows the registration of the current last received log sequence number after confirming that there are no incremental write records currently in the receiving state, in order to avoid missing incomplete incremental data outside the final incremental range.
[0113] Furthermore, when returning the last received log sequence number, the image relay layer also returns the corresponding log generation time, migration disk identifier, and log verification digest. The migration control node associates and stores the log generation time, migration disk identifier, and log verification digest with the last received log sequence number for consistency verification during subsequent target image submission version verification.
[0114] S323. Use the last received log sequence number as the write barrier sequence number.
[0115] The migration control node registers the last received log sequence number corresponding to the freeze time as the final incremental synchronization boundary and writes the last received log sequence number into the write barrier field of the cutover transaction object. Subsequently, the mirror transit layer reads all incremental write records between the previous synchronization boundary and the last received log sequence number in log sequence order, and merges the corresponding incremental data into the target mirror to ensure that all incremental data generated before the freeze time is synchronized.
[0116] Furthermore, after writing the barrier field, the migration control node generates a corresponding boundary confirmation record. This record includes the transaction identifier, status version number, last received log sequence number, boundary generation time, and migration disk identifier. The migration control node writes the boundary confirmation record to the cutover transaction object for boundary consistency verification during subsequent target image commit version verification and asynchronous callback status verification.
[0117] Furthermore, during the final incremental synchronization process, the mirror relay layer performs an integrity check on the read log sequence number range. Specifically, the mirror relay layer determines whether the read log sequence number covers the entire log range from the previous synchronization boundary to the last received log sequence number; if it covers the entire range, the target mirror merging operation continues; if there are missing ranges, the final incremental synchronization process is aborted, and a record of missing ranges is generated.
[0118] Figure 8 This is a schematic flowchart of S300 according to the third exemplary embodiment of this application. Figure 8 As shown, the above-mentioned S300 includes: S331. Determine the final change area.
[0119] After confirming that the source virtual machine has completed the write freeze operation, the migration control node obtains the incremental change record corresponding to the current migration disk. The incremental change record includes the data block address, the start position of the interval, the end position of the interval, and the corresponding write time. The migration control node sorts the incremental change records according to the data block address order and determines the disk intervals where write changes occurred after the previous synchronization boundary as the final change area. Further, the migration control node writes the interval number, interval range, and the identifier of the migration disk corresponding to the final change area into the change area record field of the cutover transaction object.
[0120] Furthermore, after determining the final change region, the migration control node performs a merging process on adjacent or consecutive data block intervals. Specifically, the migration control node determines whether there are intervals between adjacent data block intervals that have not undergone write changes; if no intervals exist, the corresponding data block intervals are merged into the same final change region; if intervals exist, the corresponding data block interval records are retained separately. This interval merging process reduces the number of interval traversals during the final incremental synchronization process.
[0121] Furthermore, when determining the final change region, the migration control node performs an integrity check on the incremental change records. Specifically, the migration control node reads the change record sequence of the corresponding migration disk and determines whether there are missing, duplicate, or out-of-order intervals in the change record sequence; if abnormal intervals are found, an abnormal record is generated, and the current write barrier generation process is paused.
[0122] S332. Generate a region verification summary for the final changed region.
[0123] The migration control node reads the data block content corresponding to the final changed region and performs digest calculation processing on each data block content in interval number order to generate a region verification digest. The region verification digest is used to characterize the data status of the final changed region at the time of freeze. Further, the migration control node associates the region verification digest with the transaction identifier, status version number, migration disk identifier, and digest generation time, and writes it to the verification digest field in the cutover transaction object.
[0124] Furthermore, during the generation of region verification summaries, the migration control node generates corresponding interval summaries for each final changed region, and then generates an overall region verification summary based on these interval summaries. Specifically, the migration control node concatenates the summary data corresponding to each interval summary according to the interval number order, and performs summary calculation again on the concatenated summary data to generate the overall region verification summary. By using an interval-based summary generation method, the summary generation efficiency in large-capacity migration disk scenarios is improved.
[0125] Furthermore, after generating the regional verification digest, the migration control node performs digest consistency verification. Specifically, the migration control node rereads the data block content corresponding to at least one final changed region and performs digest calculation again; if the recalculated digest result is consistent with the interval digest corresponding to the current regional verification digest, the digest is confirmed to be valid; if they are inconsistent, a digest mismatch record is generated, and the subsequent final incremental synchronization process is paused.
[0126] S333, Use the version boundary corresponding to the region verification digest as the write barrier sequence number.
[0127] After generating the region checksum, the migration control node generates a version boundary record corresponding to the region checksum and registers the version boundary record as the write barrier sequence number corresponding to the current migration task. The version boundary record includes one or more of the following: transaction identifier, status version number, region checksum, boundary generation time, and migration disk identifier. Subsequently, the migration control node writes the write barrier sequence number into the write barrier field of the cutover transaction object for use by the mirror transit layer in executing the final incremental synchronization process.
[0128] Furthermore, after registering and writing the barrier sequence number, the migration control node generates the corresponding boundary confirmation record. The boundary confirmation record includes a version boundary summary, the final changed area range, the summary generation time, and the current synchronization boundary number. The migration control node writes the boundary confirmation record to the cutover transaction object for subsequent boundary consistency verification during the target image commit version verification process.
[0129] Furthermore, before performing the final incremental synchronization, the mirror relay layer reads the final change area range corresponding to the write barrier sequence number and determines whether the incremental synchronization interval corresponding to the target image completely covers the final change area range. If it completely covers the target image, the target image merging operation is allowed. If it does not completely cover the target image, a region missing record is generated, and the current final incremental synchronization process is terminated.
[0130] Figure 9 This is a schematic flowchart of S300 according to the fourth exemplary embodiment of this application. Figure 9 As shown, the above-mentioned S300 includes: S341. Maintain the interval status table corresponding to the migrated disk.
[0131] Before performing final incremental synchronization, the migration control node divides the migration disk into intervals according to the data block address range of the migration disk, generating multiple contiguous disk intervals. Each disk interval corresponds to an interval number, start address, end address, and current synchronization status. The migration control node establishes a corresponding interval status record for each disk interval and writes the interval status record to the interval status table. Further, after receiving incremental write data at the mirror relay layer, the migration control node parses the corresponding data block address range and locates the corresponding disk interval; if there are write changes in the corresponding disk interval, it updates the synchronization status field in the corresponding interval status record.
[0132] Furthermore, during the maintenance of the interval status table, the migration control node performs version advancement processing on the synchronization status corresponding to each disk interval. Specifically, after each incremental synchronization is completed, the migration control node records the latest synchronization boundary number of the corresponding disk interval and writes the latest synchronization boundary number into the synchronization boundary field of the corresponding interval status record. By maintaining the synchronization boundary for each disk interval separately, the interval status management capability in multi-interval concurrent synchronization scenarios is improved.
[0133] Furthermore, during the maintenance of the interval status table, the migration control node performs integrity checks on the interval status records. Specifically, the migration control node periodically reads the interval number sequence corresponding to each interval status record and determines whether there are missing interval numbers, duplicate interval numbers, or overlapping intervals with abnormal addresses. If an anomaly is found, an interval anomaly record is generated, and the current interval-level write barrier generation process is paused.
[0134] S342. The interval status table is used to record the source version, target version, and merge status corresponding to the disk interval.
[0135] After completing the partitioning, the migration control node records the source version number and target version number for each disk partition. The source version number represents the current data version of the disk partition corresponding to the source virtual machine, while the target version number represents the current synchronization version of the disk partition corresponding to the target image. Furthermore, after the migration control node completes the data merging of the corresponding partitions at the image transfer layer, it updates the merge status field of the corresponding disk partition to indicate whether the incremental merging process has been completed.
[0136] Furthermore, during the process of updating the merge status field, the migration control node performs consistency verification on the interval synchronization results. Specifically, the migration control node reads the source version number and target version number of the corresponding disk interval respectively, and determines whether the two are consistent. If they are consistent, the merge status of the corresponding disk interval is updated to the completed status; if they are inconsistent, the merge status of the corresponding disk interval is updated to the pending synchronization status, and the corresponding interval difference record is generated.
[0137] Furthermore, after recording the source version number and target version number, the migration control node generates a range checksum for the corresponding disk range. Specifically, the migration control node reads the data block content of the corresponding disk range and performs a summary calculation to generate the corresponding range checksum; subsequently, the migration control node associates the range checksum with the corresponding range number, source version number, and target version number, and writes it to the summary field of the range status table.
[0138] S343. Generate interval-level write barrier sequence numbers based on interval status tables.
[0139] The migration control node reads the synchronization boundary field, source version number, target version number, and merge status field corresponding to each disk interval in the interval status table, and filters out the disk intervals whose merge status is "completed". Then, the migration control node combines the synchronization boundary fields of the corresponding disk intervals according to the interval number order to generate the interval-level write barrier sequence number corresponding to the current migration task.
[0140] Furthermore, after generating the interval-level write barrier sequence number, the migration control node performs continuity verification on the corresponding interval range. Specifically, the migration control node determines whether the disk interval corresponding to the completed state continuously covers the entire migration range corresponding to the currently migrated disk; if it continuously covers the entire range, the current interval-level write barrier sequence number is confirmed to be valid; if there are uncovered intervals, an interval missing record is generated, and the final incremental synchronization process is paused.
[0141] Furthermore, during the final incremental synchronization process, the mirror relay layer reads the interval boundary information corresponding to the interval-level write barrier sequence number, and performs data synchronization and version merging processing on the corresponding disk intervals based on the corresponding interval boundary information. After synchronization is complete, the mirror relay layer writes the target version number of the corresponding interval back to the interval status table to update the synchronization status of the corresponding disk interval.
[0142] Regarding the above Figures 6-9 For ease of understanding, the following comparison can be made between the illustrated embodiments: for Figure 6 The illustrated embodiment uses the current snapshot identifier or the current change block tracking version number as the write barrier sequence number. This is suitable for online migration scenarios where the virtualization platform itself already has snapshot management or change block tracking capabilities, such as data center platforms, enterprise private cloud platforms, and virtual desktop infrastructure environments with virtual disk snapshot chain management mechanisms. In such scenarios, data changes to the source virtual machine can be continuously recorded by the underlying virtualization storage components. Therefore, the existing version boundaries can be directly used to generate the write barrier sequence number without the need to establish an additional independent log system.
[0143] Figure 6 The technical advantage of the illustrated embodiment lies in its ability to reduce the overhead of additional data recording during the migration process and decrease the complexity of the migration control chain, thereby improving migration execution efficiency. The underlying technical reason is that snapshot identifiers and change block tracking version numbers are essentially data consistency boundaries already existing within the virtualization platform. When the source virtual machine is frozen, the corresponding version number naturally forms a stable data cross-section. Therefore, the image transfer layer only needs to synchronize data changes after the corresponding version boundary to complete the final incremental synchronization, thereby avoiding repeated scanning of the entire migration disk and improving incremental positioning efficiency.
[0144] Furthermore, since snapshot chains and change block records are typically maintained uniformly at the underlying virtualization platform level, this solution can adapt well to the migration control process within a single virtualization platform. In scenarios with a high degree of platform interface standardization, it can reduce the state transition steps during migration and improve the stability of the cutover process.
[0145] for Figure 7 The embodiment shown uses sequentially increasing log sequence numbers as write barrier sequence numbers, which is suitable for high-concurrency write scenarios, continuous data stream write scenarios, and cross-heterogeneous platform migration scenarios, such as financial transaction systems, message queue systems, large-scale database clusters, and distributed storage business systems.
[0146] Figure 7 The technical advantage of the illustrated embodiment lies in its ability to achieve high-precision write order control and improve consistency control capabilities for cross-platform incremental synchronization. The underlying technical reason is that the log sequence number continuously increments according to the incremental write order, and each write operation can be mapped to a unique log interval. When the source virtual machine is frozen, the last received log sequence number forms a globally unique write boundary. The image relay layer then only needs to synchronize the data within the corresponding log interval to complete consistency convergence.
[0147] Because log sequence numbers inherently possess a time-order attribute, this solution effectively addresses the inconsistency in underlying snapshot mechanisms across heterogeneous platforms. Even if different virtualization platforms employ different disk formats, snapshot mechanisms, or caching strategies, cross-platform data order alignment can still be achieved through unified log sequence numbers. Furthermore, the log sequence number mechanism supports breakpoint recovery, log replay, and range missing detection, making it more suitable for scenarios involving long-term continuous migration or significant network fluctuations.
[0148] for Figure 8 The embodiment shown uses the region verification digest version boundary corresponding to the final changed region as the write barrier sequence number, which is suitable for large-capacity disk migration scenarios, low-bandwidth migration scenarios, and scenarios with high requirements for data verification reliability, such as medical image storage systems, backup archiving systems, object storage platforms, and ultra-large-scale database migration scenarios.
[0149] Figure 8 The technical advantage of the illustrated embodiment lies in its ability to improve regional consistency verification during the final incremental synchronization process and reduce the amount of invalid data transfer during large-capacity disk migration. The underlying technical reason is that this scheme is not based on the global log order, but rather on generating regional verification digests based on the data regions that have ultimately changed. The data content of the corresponding region forms a fixed verification result after freezing, thus allowing direct confirmation through digest comparison whether the target image has completely covered the corresponding changed region.
[0150] Since region-level checksums are generated only for the regions that have changed, there is no need to repeatedly synchronize unchanged data regions in large-capacity disk scenarios, thus reducing network transmission load. Furthermore, region-level checkssums can detect corrupted regions, missing intervals, or region overlay errors during migration, making them more suitable for business environments with high data integrity requirements.
[0151] Furthermore, this solution can reduce the amount of duplicate data synchronization and improve the final cutover efficiency in scenarios with limited network bandwidth. Especially in large-scale storage systems with a high proportion of cold data, its region-level verification mechanism can significantly reduce the final incremental synchronization time.
[0152] for Figure 9 The illustrated embodiment uses a range-level write barrier sequence number generated by a range-state table. This scheme is more suitable for ultra-large-scale disk migration scenarios, multi-threaded concurrent synchronization scenarios, and distributed migration scenarios requiring fine-grained synchronization control, such as cloud storage cluster migration, hyper-converged infrastructure migration, and multi-disk parallel synchronization scenarios.
[0153] The technical advantages of this solution lie in its ability to improve state management during multi-interval concurrent synchronization and enhance local recovery and fine-grained control capabilities during incremental synchronization. The underlying technical reason is that this solution divides the migration disk into multiple contiguous disk intervals and maintains the source version number, target version number, and merge status for each interval, thereby enabling different disk intervals to independently advance their synchronization status.
[0154] Because each interval maintains its own synchronization boundary, the mirror relay layer can perform concurrent synchronization processing on different disk intervals without waiting for the global disks to complete unified synchronization. This interval-level state advancement mechanism can significantly improve synchronization throughput in high-capacity disk scenarios. Furthermore, when synchronization fails in some intervals, only the abnormal intervals need to be recovered or retransmitted, without needing to re-execute full synchronization, thus reducing the cost of anomaly recovery.
[0155] Furthermore, the interval status table supports interval continuity verification, interval missing data detection, and interval version consistency verification, thus effectively avoiding local data omissions in distributed migration scenarios. Compared to a single global version boundary solution, this approach is more suitable for large-scale online migration environments requiring high concurrency, high throughput, and fine-grained recovery capabilities.
[0156] S400, based on the write barrier sequence number, controls the image transfer layer to perform final incremental synchronization in order to generate the target image commit version.
[0157] During the final incremental synchronization process, the migration control node first reads the previous synchronization boundary recorded in the cutover transaction object and obtains the current write barrier sequence number. The mirror transit layer determines the corresponding incremental interval range based on the previous synchronization boundary and the write barrier sequence number, and reads the corresponding incremental data sequentially according to log sequence number order, change block order, or disk interval order.
[0158] Specifically, when the write barrier number is the log sequence number, the mirror relay layer reads the incremental write records in the corresponding log interval in ascending order of the log sequence number; when the write barrier number is the change block tracking version number, the mirror relay layer reads the change block set in the corresponding version interval; when the write barrier number is the version boundary corresponding to the region verification summary, the mirror relay layer reads the incremental data in the corresponding final change region.
[0159] During the reading process, the mirror relay layer generates a corresponding data interval record for each batch of incremental data. The data interval record includes the start boundary number, end boundary number, migration disk identifier, and read completion time. Subsequently, the mirror relay layer verifies the continuity of the incremental interval based on the data interval record; if a boundary is missing, an interval exception record is generated and the final incremental synchronization process is aborted.
[0160] After the incremental data reading is completed in the image relay layer, the image relay layer writes the incremental data to the data area corresponding to the target image according to the writing order of the incremental data.
[0161] Specifically, the mirror transit layer first queries the target version number corresponding to the target image and establishes an incremental merge transaction based on the target version number. Subsequently, the mirror transit layer performs data overwrite operations sequentially according to the migration disk range order to ensure that the corresponding disk area in the target image is consistent with the data state at the time of freezing on the source end.
[0162] During the merge process, the mirror transit layer generates a corresponding interval merge record for each merged data interval. The interval merge record includes the disk interval identifier, target version number, write completion time, and data digest. Subsequently, the mirror transit layer performs a target mirror consistency check based on the data digest; if the check fails, the current incremental merge transaction is rolled back and a merge failure record is generated.
[0163] In addition, in multi-disk migration scenarios, the image transfer layer establishes corresponding interval merge states for each migration disk and submits the target image version uniformly after all migration disks have completed incremental merging, so as to avoid cross-disk status inconsistencies caused by some disks being submitted in advance.
[0164] After all incremental data merging is completed in the image transit layer, the migration control node obtains the final version information corresponding to the current target image and generates the target image submission version based on the final version information.
[0165] Specifically, the migration control node obtains the target image digest, the region verification digest, the final incremental range, and the target version number, and establishes a binding relationship between the target image digest, the region verification digest, the final incremental range, and the target version number and the write barrier sequence number.
[0166] Subsequently, the migration control node generates a corresponding target image commit record, which includes the transaction identifier, status version number, write barrier sequence number, target image version number, and commit completion time. Then, the migration control node writes the target image commit record into the cutover transaction object as the data basis for subsequent target startup authorization verification.
[0167] After generating the target image submission version, the migration control node further verifies the continuity of the target image version based on the write barrier sequence number; if a target image version is missing, an incremental range is missing, or the version boundary is not continuous, the generation of the target startup authorization token is refused.
[0168] Optionally, the target image submission version mentioned above includes one or more of the following: image digest, region checksum, target image version number, and incremental synchronization interval.
[0169] S500 verifies the binding relationship between the target image submission version and the write barrier sequence number, and generates a target startup authorization token after the verification is successful.
[0170] During the target image commit version verification process, the migration control node first reads the target image version number, write barrier sequence number, and final incremental synchronization record recorded in the cutover transaction object. Subsequently, the migration control node obtains the incremental interval information of the image transit layer that has completed synchronization based on the final incremental synchronization record.
[0171] Specifically, the migration control node reads the start log number, end log number, change block version boundary, or disk range boundary corresponding to the incremental data, and generates the final incremental range based on the start log number, end log number, change block version boundary, or disk range boundary.
[0172] Specifically, when the write barrier number is a log number, the final increment range includes the log interval between the previous synchronization boundary and the last received log number; when the write barrier number is a change block tracking version number, the final increment range includes all change block intervals within the corresponding version boundary; when the write barrier number is an interval-level write barrier number, the final increment range includes the final synchronization range corresponding to each disk interval.
[0173] Subsequently, the migration control node generates a final incremental range record, which includes one or more of the following: transaction identifier, status version number, target image version number, start boundary number, end boundary number, and range generation time. The final incremental range record is then written to the cutover transaction object.
[0174] After generating the final incremental range, the migration control node reads the boundary information corresponding to the written barrier sequence number and performs an integrity check on the final incremental range based on the boundary information.
[0175] Specifically, the migration control node obtains continuous interval records, log sequence number records, change block records, or disk interval records in the final incremental range, and compares them item by item to see if all the data boundaries corresponding to the write barrier sequence number exist in the final incremental range.
[0176] When an unsynchronized range, missing log sequence number, missing change block, or missing disk range is detected, the migration control node generates a range missing record and marks the current target image commit version as uncommittable.
[0177] In addition, in multi-disk migration scenarios, the migration control node verifies the final incremental range corresponding to each migration disk, and confirms that the current target image submission version meets the submission conditions after all migration disks have completed full coverage verification.
[0178] After confirming that the final incremental range fully covers all incremental data corresponding to the written barrier sequence number, the migration control node generates a version binding confirmation record.
[0179] Specifically, the migration control node establishes a correspondence between the target image version number, the write barrier sequence number, the final incremental range summary, and the region verification summary, and generates a version binding summary based on the correspondence.
[0180] Subsequently, the migration control node writes the version binding summary, transaction identifier, status version number, and verification completion time into the cutover transaction object, and updates the cutover status corresponding to the current target image commit version to the verification passed status.
[0181] Afterward, the migration control node allows the generation of a target boot authorization token and allows the subsequent target virtual machine boot process to continue.
[0182] S600 controls the startup of the target virtual machine based on the target startup authorization token.
[0183] Upon receiving the startup request corresponding to the target virtual machine, the migration control node first reads the transaction identifier, status version number, target image version number, and verification result identifier recorded in the current cutover transaction object. Subsequently, the migration control node sends a target startup authorization request to the cutover state machine. The target startup authorization request includes one or more of the following: transaction identifier, status version number, target virtual machine identifier, and target image version number.
[0184] Specifically, the cutover state machine first checks whether the current cutover transaction object is in a verified state, and then further checks whether the source virtual machine is in a writable state, whether the final incremental synchronization is completed, and whether the network switching authorization token has not yet been generated.
[0185] When the above conditions are met, the cutover state machine generates a target startup authorization token. The target startup authorization token includes one or more of the following: transaction identifier, state version number, authorization generation time, target virtual machine identifier, and authorization validity range.
[0186] Subsequently, the cutover state machine writes the target startup authorization token to the cutover transaction object and advances the current cutover state to the target startup allowed state.
[0187] After obtaining the target boot authorization token, the migration control node reads the transaction identifier, target image version number, and target virtual machine identifier from the target boot authorization token, and sends a virtual machine boot request to the target platform.
[0188] Specifically, the virtual machine startup request includes one or more of the following: target image version number, target virtual machine configuration parameters, network isolation identifier, and storage mount mode.
[0189] After receiving the virtual machine startup request, the target platform first verifies the validity of the target startup authorization token and reads the target image submission version corresponding to the target image version number.
[0190] Subsequently, the target platform creates a target virtual machine instance based on the target image submission version and mounts the corresponding migration disk.
[0191] During the startup process of the target virtual machine, the target platform continuously monitors the virtual processor initialization status, system startup status, and disk mount status.
[0192] Once the virtual processor enters the running state, the system boots up successfully, and the migration disk is successfully mounted, the target platform generates a target boot completion record. This record includes one or more of the following: transaction identifier, status version number, boot completion time, target virtual machine running identifier, and target image version number. Subsequently, the target platform writes the target boot completion record to the cutover transaction object and returns a successful boot result for the target virtual machine to the migration control node.
[0193] It is worth noting that when the target virtual machine starts up, it is in a non-writable state. After the target virtual machine completes startup and is in an isolated network environment, the migration control node reads the source end's writability revocation proof, final incremental completion proof, transaction identifier, and status version number recorded in the current cutover transaction object. Subsequently, the migration control node verifies whether the storage access status in the source end's writability revocation proof is read-only or access denied, and verifies whether the final incremental sequence number in the final incremental completion proof matches the write barrier sequence number.
[0194] After completing the above verifications, the migration control node generates a target writable token. The target writable token includes one or more of the following: transaction identifier, status version number, target virtual machine identifier, target image version number, writable authorization generation time, and authorization validity status. Subsequently, the migration control node writes the target writable token into the cutover transaction object and switches the current writable right status from the target read-only state to the write right transfer state.
[0195] After the target virtual machine receives the business write request, the target platform first reads the target writable token corresponding to the target virtual machine and verifies the transaction identifier, status version number and authorization validity status in the target writable token.
[0196] Once the verification is successful, the target platform sends a read / write permission switch request to the storage backend to switch the access permission of the migration disk corresponding to the target virtual machine from read-only mode to read-write mode. Subsequently, the target platform removes the blocking status of the write channel corresponding to the target virtual machine and allows business write requests to write to the target migration disk.
[0197] After the target virtual machine completes its first write operation, the target platform generates a target-side writable completion record. This record includes one or more of the following: transaction identifier, status version number, first write time, target image version number, and target virtual machine identifier. Subsequently, the target platform writes the target-side writable completion record to the cutover transaction object and switches the current writable state to the target-side writable state.
[0198] It is worth noting that after the target virtual machine starts, the migration disk is mounted in read-only mode. After the final incremental synchronization is completed, the migration control node reads the transaction identifier, status version number, final incremental completion proof, target image commit version, and target virtual machine startup status recorded in the current cutover transaction object. Subsequently, the migration control node verifies whether the incremental synchronization interval corresponding to the target image commit version covers all incremental data corresponding to the write barrier sequence number, and verifies whether the target virtual machine is currently in an isolated network environment and in a read-only mounted state.
[0199] After completing the above verifications, the migration control node generates a storage read / write switch token. This token includes one or more of the following: transaction identifier, status version number, migration disk identifier, target image version number, read / write switch time, and authorization status. Subsequently, the migration control node writes the storage read / write switch token to the cutover transaction object and switches the current write permission status from the target end's read-only state to the write permission transfer state.
[0200] After the target platform receives the migration disk read / write switch request, it first reads the storage read / write switch token and verifies the transaction identifier, status version number and authorization status in the storage read / write switch token.
[0201] After successful verification, the target platform sends a disk permission switching command to the storage backend to change the access permissions of the migration disk from read-only mode to read-write mode. The target platform then remounts the migration disk and updates the disk access status of the target virtual machine.
[0202] After completing the read-write switchover, the target platform generates a read-write switchover completion record. This record includes one or more of the following: transaction identifier, status version number, migration disk identifier, switchover completion time, and current access mode. The target platform writes the read-write switchover completion record to the cutover transaction object and switches the current writable state to the target-side writable state.
[0203] S700: After confirming that the target virtual machine has started, generate a network switching authorization token.
[0204] After confirming that the target virtual machine has started, the migration control node reads the transaction identifier, status version number, target image commit version, target startup completion record, and current write permission status recorded in the current cutover transaction object. Subsequently, the migration control node queries the virtual network interface status, service listening port status, and migration disk mount status corresponding to the target virtual machine to confirm that the target virtual machine is currently in a state where it can take over service traffic.
[0205] After confirming that the virtual network interface is connected, the service listening port is in a service-ready state, and the migration disk is mounted normally, the migration control node further verifies whether the current target virtual machine is still in an isolated network environment and whether the current service access entry still points to the source virtual machine.
[0206] After completing the above verifications, the migration control node generates a network switch authorization token. This token includes one or more of the following: transaction identifier, status version number, target virtual machine identifier, service network identifier, switch authorization time, and authorization status. The migration control node writes the network switch authorization token into the cutover transaction object and advances the current cutover state to the network switch pending execution state.
[0207] S800, based on network switching authorization tokens, switches the business access entry point to the target virtual machine.
[0208] After the target virtual machine completes startup and is in an isolated network environment, the migration control node receives the network switching authorization token and reads the transaction identifier, status version number, target virtual machine identifier, and business network identifier recorded in the network switching authorization token.
[0209] The migration control node sends a network access switching request to the network control device. The network access switching request includes the virtual network interface identifier corresponding to the target virtual machine, the target switching port identifier, the service address information, and the current transaction identifier.
[0210] After receiving a network access switching request, the network control device verifies the transaction identifier and status version number, and queries the address binding relationship, switching forwarding table entries, and service entry forwarding status in the current service network.
[0211] After successful verification, the network control device adds the virtual network interface corresponding to the target virtual machine to the forwarding domain corresponding to the service network, and updates the address mapping relationship, forwarding table entries or traffic forwarding relationship corresponding to the service access entry, so that the service access traffic is forwarded to the target virtual machine.
[0212] The network control device generates a target access completion record, which includes one or more of the following: transaction identifier, status version number, target network interface identifier, service network identifier, and access completion time.
[0213] The migration control node writes the target access completion record to the cutover transaction object and advances the current cutover state to the target access completion state.
[0214] After the business access traffic is switched to the target virtual machine, the migration control node sends a source isolation maintenance request to the network control device. The source isolation maintenance request includes the source virtual machine identifier, the business network identifier, the transaction identifier, and the status version number.
[0215] Upon receiving a request to maintain source isolation, the network control device maintains the network isolation rules corresponding to the source virtual machine and continuously blocks the source virtual machine's access paths to the business network, database services, storage services, and message services.
[0216] Subsequently, the network control device periodically queries the network interface status, traffic transmission status, and session connection status corresponding to the source virtual machine to detect whether the source virtual machine is reconnecting to the business network.
[0217] If the source virtual machine is detected to be sending service traffic or reconnecting to the network, the network control device generates an abnormal isolation record and returns an isolation abnormality notification to the migration control node.
[0218] Upon receiving an isolation anomaly notification, the migration control node switches its current cutover state to an abnormal blocking state and refuses to perform subsequent source resource cleanup operations.
[0219] If the source virtual machine remains isolated and no abnormal behavior is detected, the migration control node generates a source isolation confirmation record and writes the source isolation confirmation record into the cutover transaction object.
[0220] S900: After the target virtual machine provides services to the outside world, perform resource cleanup operations on the source side.
[0221] After the target virtual machine provides external services and the current cutover status is in the migration completed state, the migration control node reads the transaction identifier, status version number, and source snapshot identifier from the current cutover transaction object, and sends a snapshot deletion request to the source platform.
[0222] After receiving a snapshot deletion request, the source platform queries the reference relationship, incremental chain relationship and disk usage status of the source snapshot, and determines whether there are currently any recovery tasks, rollback tasks or incremental synchronization tasks that still reference the source snapshot.
[0223] If no reference relationship exists, the source snapshot is deleted, and the incremental storage area corresponding to the source snapshot is released.
[0224] After the source snapshot deletion is completed, the source platform generates a snapshot deletion completion record. The snapshot deletion completion record includes one or more of the following: transaction identifier, status version number, source snapshot identifier, released storage capacity, and deletion completion time.
[0225] The migration control node writes the snapshot deletion completion record to the cutover transaction object and advances the current cutover state to the snapshot deletion completion state.
[0226] After confirming that the source snapshot has been deleted, the migration control node reads the source virtual machine identifier, transaction identifier, and status version number from the current cutover transaction object, and sends a virtual machine deregistration request to the source platform.
[0227] After receiving a virtual machine deregistration request, the source platform queries the running status, network interface status, mounted disk status, and migration lock status of the source virtual machine.
[0228] If the source virtual machine is in a stopped state, a network isolated state, and there is no migration lock conflict, then release the computing resource binding relationship, network interface binding relationship, and storage mount relationship corresponding to the source virtual machine.
[0229] Subsequently, the source platform deletes the configuration records, running records, and resource mapping records corresponding to the source virtual machine, and generates a virtual machine deregistration completion record.
[0230] The virtual machine deregistration completion record includes one or more of the following: transaction identifier, status version number, source virtual machine identifier, resource release result, and deregistration completion time.
[0231] The migration control node writes the virtual machine deregistration completion record to the cutover transaction object and advances the current cutover state to the source end deregistration completion state.
[0232] After confirming the deregistration of the source virtual machine, the migration control node reads the migration disk identifier, source storage pool identifier, transaction identifier, and status version number from the current cutover transaction object, and sends a storage resource reclamation request to the storage backend.
[0233] After receiving a storage resource reclamation request, the storage backend queries the data block reference relationship, snapshot chain status, and storage occupancy status corresponding to the migration disk, and determines whether there are currently any data recovery tasks, backup tasks, or image synchronization tasks that still reference the migration disk.
[0234] If no reference relationship exists, release the data block space, cache space, and storage quota resources corresponding to the migration disk, and update the capacity record corresponding to the source storage pool.
[0235] The storage backend generates a storage resource reclamation completion record, which includes one or more of the following: transaction identifier, status version number, migrated disk identifier, released capacity result, and reclamation completion time.
[0236] The migration control node writes the storage resource reclamation completion record to the cutover transaction object and advances the current cutover state to the source end resource reclamation completion state.
[0237] Based on the above embodiments, due to differences in task scheduling mechanisms, callback mechanisms, and state synchronization mechanisms between different platforms, various asynchronous task callbacks are often returned by different threads, different service nodes, or different time windows. In actual migration, problems such as out-of-order callbacks, duplicate callbacks, old states overwriting new states, and state drift caused by abnormal retries can easily occur. This can lead to errors in cutover state progression, migration link mismatch, and inconsistencies between the two ends of the state, thereby affecting business continuity and data consistency during online migration.
[0238] It's worth noting that the aforementioned problems arise because online migration across virtualization platforms is essentially a typical distributed asynchronous collaborative process. There is no unified atomic transaction execution environment between the source platform, target platform, network devices, and storage backend. Different components typically use asynchronous messages, event notifications, or task callbacks for state interaction. However, asynchronous communication links inherently suffer from network latency, duplicate message delivery, execution retries, and out-of-order callbacks. Furthermore, the different state progression speeds within each platform mean that some callbacks may arrive after their corresponding migration states have changed. Without a unified transaction identifier, state version constraints, idempotent action control, and causal ordering mechanisms, issues such as old callbacks overwriting new states, repeated execution of duplicate actions, and incorrect state progression across stages can easily occur, ultimately leading to instability of the migration state machine.
[0239] In this regard, based on the above embodiments, it is also necessary to perform status verification on asynchronous task callback execution, wherein the status verification includes transaction identifier verification and status version number verification.
[0240] In the first implementation, for the above-mentioned asynchronous task callback execution status verification, it is possible to first obtain the transaction identifier and status version number corresponding to the asynchronous task callback, then determine whether the transaction identifier is consistent with the transaction identifier corresponding to the current cutover transaction object, and then determine whether the status version number matches the current status version number. If they match, the cutover status can be advanced; if they do not match, the asynchronous task callback is rejected.
[0241] In the second implementation, for the above-mentioned asynchronous task callback execution status verification, the preceding state summary corresponding to the asynchronous task can be obtained first, and then the preceding state summary can be used as the task preceding signature. Then, after the asynchronous task callback arrives, the task preceding signature is compared with the currently confirmed state summary. If they match, the cutover state can be advanced. If they do not match, the suspension process or rejection process is executed.
[0242] In the third implementation, for the above-mentioned asynchronous task callback execution status verification, an idempotent key can be generated for the cutover action. The idempotent key includes the migration instance identifier, action type, transaction identifier, and status version number. Then, before executing the cutover action, it is registered based on the idempotent key. If the cutover action corresponding to the same idempotent key is detected to be in the execution state or in the success state, the duplicate execution is rejected.
[0243] The three implementation methods described above propose different control mechanisms to address three typical problems during asynchronous migration: state consistency verification, complex dependency verification, and suppression of duplicate actions. The first method establishes the basic temporal relationship of the migration phase through transaction identifiers and state version numbers, suitable for online migration scenarios with clear process phases and short state chains, achieving asynchronous callback state consistency judgment with low control overhead. The second method establishes dependency references between migration actions through pre-state summaries, suitable for large-scale migration scenarios with complex cross-component collaboration and long asynchronous dependency chains, avoiding premature state advancement due to out-of-order task completion. The third method restricts the repeated execution of the same cutover action through an idempotent key registration mechanism, suitable for migration environments with frequent network fluctuations, concurrent scheduling of multiple control nodes, and high probability of task retries, suppressing abnormal situations such as repeated switching, repeated freezing, and repeated authorization. These multiple solutions improve the stability, consistency, and fault tolerance of cutover state advancement during cross-virtualization platform online migration from different levels, including state temporal control, dependency chain constraints, and action uniqueness control.
[0244] Furthermore, a corresponding evidence item can be generated for each cutover action. This evidence item includes one or more of the following: a prior evidence summary, action type, transaction identifier, status version number, and action result summary. Then, a causal order check is performed on the asynchronous task callbacks based on the prior evidence summary. Specifically, this involves determining whether the prior evidence summary in the current evidence item matches the latest confirmed evidence item summary. If they match, the current asynchronous task callback is confirmed as valid; if they do not match but belong to a future step, suspension is performed; if they do not match but belong to a completed step, duplicate callback processing is performed.
[0245] In the above embodiments, a cutover transaction object is constructed as a unified state carrier, and the transaction identifier, state version number, action evidence item, and prior evidence digest are associated and stored to form a state constraint chain during the migration process. When an asynchronous task callback arrives, the transaction identifier and state version number are first used to match and verify the transaction to which the callback belongs and the current stage to block illegal callbacks corresponding to old states or erroneous transactions. Subsequently, idempotent keys are used to uniquely register cutover actions to prevent the same action from being executed repeatedly. Furthermore, causal dependencies between cutover actions are established through prior evidence digests, and the execution order is verified based on the latest confirmed evidence digest to identify out-of-order callbacks, future stage callbacks, and duplicate callbacks. Based on the above multi-layered state constraint mechanism, stable convergence and consistent progress of cross-platform asynchronous migration states can be achieved in distributed migration scenarios lacking a global atomic transaction environment.
[0246] Furthermore, it's worth noting that, based on the above embodiments, in cases of network jitter, link interruption, control message delay, or storage session remnants, the source virtual machine may not have completely lost its write capability, while the target virtual machine has already obtained new disk write permissions. This can lead to the same migration disk being written to by two nodes simultaneously, ultimately resulting in data forks, log conflicts, inconsistent image states, and unrecoverable business data. This dual-end simultaneous write problem is particularly prone to occur in cross-cloud migrations, heterogeneous virtualization platform migrations, and distributed storage environments, where the number of participating nodes is large and the state synchronization link is long.
[0247] The root cause of these problems lies in the fact that online migration across virtualization platforms is essentially a distributed collaborative process involving multiple nodes. The source host, target host, image relay layer, migration control node, network control device, and storage system rely on network communication for state synchronization. When partial network outages occur or there is a time lag in state propagation, different nodes may determine their own legitimate write permissions based on their respective local states. Simultaneously, session-level permission caching, multi-path connections, pending write queues, and operating system cache flushing delays in the storage system can cause the source host to retain actual write capabilities for a short period even after logically revoking write permissions. Furthermore, asynchronous task callbacks, message retries, and out-of-order propagation of migration states can also cause the target host to prematurely switch to a writable state before the source host has completely failed, thus creating a typical split-brain write risk.
[0248] To address this, based on the above embodiments, a writable state can be established, which includes one or more of the following: source-side writable state, write right transfer state, target-side read-only state, target-side writable state, and source-side retired state. Then, the write permission switching between the source virtual machine and the target virtual machine is controlled based on the writable state.
[0249] Specifically, for controlling the write permission switching between the source and target virtual machines based on writable state, a unique write permission token can be maintained for the current migration instance. When the writable state switches from the source writable state to the write permission transfer state, the storage write permission corresponding to the source virtual machine is revoked, and storage session disconnection and disk flushing of pending write data are performed. Then, the current final write sequence number is recorded, and it is verified that there is no pending incremental data in the image relay layer. Next, after confirming that the write permission corresponding to the source virtual machine has been revoked and the final incremental synchronization is completed, the migration disk corresponding to the target virtual machine is switched from read-only mode to read-write mode. Finally, if the target virtual machine loses the arbitration connection, the migration disk corresponding to the target virtual machine is switched to read-only mode or access denied mode.
[0250] By establishing a writable state and maintaining a unique write permission token for the current migration instance, this application ensures that only one virtual machine node with actual write capability exists at any given time. By executing source storage write permission revocation, storage session disconnection, flushing of pending write data to disk, and final write sequence number verification during write permission switching, the application effectively eliminates source-side delayed writes and cached residual writes. By allowing the target migration disk to switch from read-only mode to read-write mode only after confirming that there is no pending incremental data in the image transfer layer and that final incremental synchronization is complete, the application prevents data boundary inconsistencies caused by premature writes from the target. Furthermore, by automatically switching to read-only mode or access denied mode when the target loses the arbitration connection, the application effectively suppresses the risk of dual-master writes in network partition scenarios, thereby improving data consistency, cutover reliability, and anomaly recovery capabilities during online migration across virtualization platforms.
[0251] To facilitate understanding, the following example of a specific cross-cloud virtual machine online migration scenario will be used to illustrate the above-mentioned cross-virtualization platform online migration method based on unique write permission control: In one embodiment, a financial business system runs on a source virtual machine within a first cloud platform. The business disk corresponding to the source virtual machine stores transaction logs, account data, and real-time cached data. Due to business expansion requirements, the source virtual machine needs to be migrated online to a target virtual machine on a second cloud platform. During the migration process, the business system continuously performs write operations on the database; therefore, data synchronization of the migration disk and business handover need to be completed without interrupting business operations.
[0252] After the migration begins, the migration control node first creates the target virtual machine on the second cloud platform and establishes an image relay layer. The source virtual machine continues to perform read and write operations on the business disk, while the image relay layer continuously receives incremental write data generated by the source and synchronously writes it to the target image. During this stage, the migration disk corresponding to the target virtual machine remains in a read-only state to prevent premature writing by the target from causing image content forks.
[0253] As incremental synchronization continues, the migration control node detects that the current incremental backlog has fallen below the business-allowed threshold and begins the final cutover phase. At this point, the migration control node sends a write freeze command to the source host, which suspends new disk write requests and flushes the data to be committed from the operating system cache to the migration disk. Subsequently, the migration control node records the current final write sequence number and requests the image relay layer to continue synchronizing all incremental data between the previous synchronization boundary and the final write sequence number.
[0254] In one specific scenario, due to network jitter between the two cloud platforms, the source host has completed write freezing, but the target host has not yet received the freezing completion notification. If the target is directly allowed to switch to read-write mode, the source may still retain some write capability, while the target has already started receiving new database write requests, resulting in simultaneous writes to the same migrated disk on both nodes. This situation can easily lead to data forks in a distributed storage environment, causing inconsistencies in database logs, transaction loss, and file system corruption.
[0255] To avoid the aforementioned issues, before performing a write permission switch, the migration control node first sends a write permission revocation request to the storage system and disconnects the storage session connection between the source host and the migration disk. Subsequently, the migration control node reads the final incremental synchronization status in the image relay layer. After confirming that there is no incremental data to be committed, it verifies whether the data range corresponding to the final write sequence number has been fully synchronized to the target image. Only after all the above verifications pass does the migration control node generate a unique write permission token and grant it to the target virtual machine.
[0256] Once the target virtual machine receives the unique write permission token, it switches the migration disk from read-only mode to read-write mode and begins providing business services. Simultaneously, the migration control node updates its current write permission status, causing the source virtual machine to lose write access. At this point, even if the source host machine attempts to access the migration disk again due to network latency, the storage system will reject its write request because its corresponding storage session has been revoked, thus ensuring that only one node is allowed to perform write operations on the migration disk at any given time.
[0257] Furthermore, in another implementation scenario, if the arbitration connection between the target virtual machine and the migration control node is interrupted after startup, the migration control node cannot continue to confirm whether the target still has legitimate write permissions. To avoid the risk of "dual-master write" in network partition scenarios, the target host automatically switches the migration disk to read-only mode or access-denied mode and suspends new business write requests after detecting the arbitration connection failure. Write capability is restored to the target only after the arbitration connection is restored and the unique write permission status is reconfirmed.
[0258] Through the above methods, this embodiment can achieve unique control of write permissions for migration disks in cross-cloud, heterogeneous virtualization platforms and distributed storage environments, avoiding the problem of simultaneous writing to both ends due to state propagation delays, network partitions or cache residues during the migration process, thereby improving data consistency, cutover stability and reliability of anomaly recovery during online migration.
[0259] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
[0260] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A cross-virtualization platform online migration method based on image relay, characterized in that, include: Create a cutover transaction object corresponding to the virtual machine to be migrated, and perform write freeze operation and isolation control operation on the source virtual machine based on the cutover transaction object; After confirming that the source virtual machine is in a non-writable state, a write barrier sequence number is generated, and based on the write barrier sequence number, the image transfer layer is controlled to perform final incremental synchronization to generate the target image submission version. Verify the binding relationship between the target image submission version and the write barrier sequence number. After the verification is successful, generate a target startup authorization token. Based on the target startup authorization token, control the startup of the target virtual machine, and generate a network switching authorization token after confirming that the target virtual machine has started. Based on the network switching authorization token, the service access point is switched to the target virtual machine, and after the target virtual machine provides services to the outside world, the source resource cleanup operation is performed.
2. The method according to claim 1, characterized in that, Based on the cutover transaction object, write freeze and isolation control operations are performed on the source virtual machine, including: Send a freeze request carrying the transaction identifier and status version number to the source platform; The source virtual machine is controlled to pause operation; Query the virtual processor status, input / output queue status, and snapshot baseline status corresponding to the source virtual machine; After the virtual processor is in a stopped state, the input / output queue state meets preset conditions, and the snapshot baseline state meets preset conditions, a freeze certificate is generated.
3. The method according to claim 1, characterized in that, Based on the cutover transaction object, write freeze and isolation control operations are performed on the source virtual machine, including: Send an isolation control request to the network control device; The network control device is controlled to block the source virtual machine's access path to the business network, database service, storage service, or message service. Obtain the rule version number returned by the network control device; If the rule version number matches the status version number, an isolation control certificate is generated.
4. The method according to claim 1, characterized in that, Based on the cutover transaction object, write freeze and isolation control operations are performed on the source virtual machine, including: Send a write permission revocation request to the storage backend; The storage backend controls the access permissions of the migration disk corresponding to the source virtual machine to switch from read-write mode to read-only mode or access denied mode. Clear the pending write queue corresponding to the migration disk; Obtain the storage access generation number returned by the storage backend; An isolation control certificate is generated based on the storage access generation number.
5. The method according to claim 1, characterized in that, Based on the cutover transaction object, write freeze and isolation control operations are performed on the source virtual machine, including: Perform network-side isolation control operations; Perform a pause or shutdown operation on the source virtual machine; Query the status of the stored input / output queues; Once network isolation is complete, the source virtual machine is in a stopped state, and the storage input / output queue is empty, a combined freeze proof is generated.
6. The method according to claim 1, characterized in that, After confirming that the source virtual machine is in a writable state, a write barrier sequence number is generated, including: Get the current snapshot identifier or the current change block tracking version number; The current snapshot identifier or the current change block tracking version number is used as the write barrier sequence number.
7. The method according to claim 1, characterized in that, After confirming that the source virtual machine is in a writable state, a write barrier sequence number is generated, including: Based on the mirror relay layer, incremental log sequence numbers are generated for incremental data. Record the sequence number of the last received log file corresponding to the moment of freeze; The last received log sequence number is used as the write barrier sequence number.
8. The method according to claim 1, characterized in that, After confirming that the source virtual machine is in a writable state, a write barrier sequence number is generated, including: Determine the final area to be changed; Generate a region verification summary for the final changed region; The version boundary corresponding to the region verification digest is used as the write barrier sequence number.
9. The method according to claim 1, characterized in that, After confirming that the source virtual machine is in a writable state, a write barrier sequence number is generated, including: Maintain the interval status table corresponding to the migrated disk; The interval status table is used to record the source version, target version, and merge status corresponding to the disk interval; An interval-level write barrier sequence number is generated based on the interval status table.
10. The method according to claim 1, characterized in that, Based on the write barrier sequence number, the control image relay layer performs final incremental synchronization to generate the target image commit version, including: The mirror relay layer is controlled to read incremental data between the previous synchronization boundary and the write barrier sequence number; Merge the incremental data into the target image; Generate a target image submission version corresponding to the write barrier sequence number.
11. The method according to claim 1, characterized in that, Verifying the binding relationship between the target image submission version and the write barrier sequence number includes: Determine the final increment range corresponding to the target image submission version; Determine whether the final increment range covers all incremental data corresponding to the write barrier number; If the data is covered, then the verification is considered successful.
12. The method according to claim 1, characterized in that, Based on the target startup authorization token, control the startup of the target virtual machine, including: In response to receiving a target startup request, request the target startup authorization token from the cutover state machine; After obtaining the target startup authorization token, the target platform interface is called to start the target virtual machine.
13. The method according to claim 1, characterized in that, The method further includes: Perform status verification on asynchronous task callbacks, including transaction identifier verification and status version number verification.
14. The method according to claim 1, characterized in that, The method further includes: Establish a writable state; The writable state includes one or more of the following: source writable state, write right transfer state, target read-only state, target writable state, and source retirement state. The write permission switching between the source virtual machine and the target virtual machine is controlled based on the write permission status.
