Cross-platform migration method and device of virtual machine, equipment and storage medium

By using NFS storage servers to backup and mark processing during virtual machine migration, the problems of cumbersome and inefficient migration of virtual machines in the existing technology are solved, and efficient migration and continuous operation of cross-platform virtual machines are achieved.

CN118885261AInactive Publication Date: 2024-11-01WUHAN STONE INFORMATION SERVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411355786.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-11-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is complicated and inefficient in the heterogeneous migration of virtual machines, resulting in complex and time-consuming migration process.

Method used

By receiving virtual machine migration requests, obtaining virtual machine information and network information, creating virtual machines on the target platform, and using NFS storage servers to back up and mark processing, data migration and configuration processing are realized, and cross-platform migration of virtual machines is completed.

Benefits of technology

The virtual machine migration process is simplified, the migration efficiency and user experience are improved, and the virtual machine is continuously running during the migration process is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885261A_ABST
    Figure CN118885261A_ABST
Patent Text Reader

Abstract

The invention discloses a cross-platform migration method and device for a virtual machine, electronic equipment and a storage medium, and the method comprises the steps: obtaining a to-be-migrated first virtual machine when a virtual machine migration request is received, and obtaining virtual machine information and network information of the first virtual machine; sending the virtual machine information and the network information to a second platform, and creating a second virtual machine on the second platform according to the virtual machine information; marking backup data of the first virtual machine on the NFS storage server according to the first virtual machine to obtain migration data; and connecting the NFS storage server and the second virtual machine, controlling the second virtual machine to read the migration data from the NFS storage server, and performing configuration processing on the second virtual machine according to the migration data and the network information to obtain the configured second virtual machine. In the cross-platform migration process of the virtual machine, the service of the source virtual machine does not need to be terminated, and the migration convenience of the virtual machine and the use experience of a user are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual machine management and control technology, and in particular to a method, device, electronic device and storage medium for cross-platform migration of a virtual machine. Background Art

[0002] Virtual machine migration technology is to migrate a running virtual machine from one host to another, while ensuring that the services provided by the currently running virtual machine are not affected during the migration process, so as to ensure that users are unaware of the service, such as uninterrupted service.

[0003] In the prior art, when performing heterogeneous migration of virtual machines, the storage backend mounted by the second cluster is first configured as the storage backend mounted by the first cluster, and then the storage information contained in the virtual machines to be migrated deployed in the first cluster is migrated to the storage backend mounted by the second cluster, so as to finally achieve the virtual machine migration operation between heterogeneous clusters. This method is not only cumbersome to operate, but also has low migration efficiency. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for cross-platform migration of virtual machines to solve the technical problems of cumbersome operation and low efficiency in heterogeneous migration of virtual machines in related technologies.

[0005] In a first aspect, an embodiment of the present application provides a method for cross-platform migration of a virtual machine, comprising: When a virtual machine migration request is received, acquiring a first virtual machine to be migrated, and obtaining virtual machine information and network information of the first virtual machine, wherein the first virtual machine runs on a first platform; Sending the virtual machine information and the network information to a second platform, and creating a second virtual machine on the second platform according to the virtual machine information; Marking the backup data of the first virtual machine on the NFS storage server according to the first virtual machine to obtain migration data; The NFS storage server and the second virtual machine are connected, the second virtual machine is controlled to read the migration data from the NFS storage server, and the second virtual machine is configured according to the migration data and the network information to obtain the configured second virtual machine.

[0006] In a second aspect, an embodiment of the present application provides a cross-platform migration device for a virtual machine, comprising: a request receiving module, configured to, when receiving a virtual machine migration request, obtain a first virtual machine to be migrated, and obtain virtual machine information and network information of the first virtual machine, wherein the first virtual machine runs on a first platform; An information receiving module, used for sending the virtual machine information and the network information to the second platform, and creating a second virtual machine on the second platform according to the virtual machine information; A data processing module, configured to mark the backup data of the first virtual machine on the NFS storage server according to the first virtual machine to obtain migration data; The migration processing module is used to connect the NFS storage server and the second virtual machine, control the second virtual machine to read the migration data from the NFS storage server, and configure the second virtual machine according to the migration data and the network information to obtain the configured second virtual machine.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the cross-platform migration method of a virtual machine described in any one of the above items when executing the computer program.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the cross-platform migration method of a virtual machine described in any one of the above items are implemented.

[0009] The embodiment of the present application provides a method, device, electronic device and storage medium for cross-platform migration of virtual machines. When a virtual machine migration request is received, a first virtual machine to be migrated is determined, and virtual machine information and network information of the first virtual machine are obtained, wherein the first virtual machine runs on the first platform, and then the virtual machine information and network information are sent to the second platform, and a corresponding second virtual machine is created on the second platform based on the virtual machine information, and then the backup data of the first virtual machine on the NFS storage server is obtained and marked to obtain migration data, and finally the NFS storage server and the second virtual machine are connected, and the second virtual machine is controlled to read the migration data from the NFS storage server, and finally the second virtual machine is configured according to the migration data and network information to obtain the second virtual machine after configuration processing. In the process of cross-platform migration of virtual machines, data backup processing of the NFS storage server is realized, and the service of the source virtual machine does not need to be terminated. During the migration, the virtual machine is created and the data is obtained according to the relevant information of the virtual machine to be migrated, and then the creation of the virtual machine on another platform is completed through data recovery to complete the migration of the virtual machine, thereby improving the convenience of virtual machine migration and the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1This is a flow chart of a cross-platform migration method of a virtual machine provided in an embodiment of the present application; Figure 2 It is a schematic block diagram of a cross-platform migration system of a virtual machine provided in an embodiment of the present application; Figure 3 This is a flowchart of the steps of obtaining migration data provided in an embodiment of the present application; Figure 4 is a flowchart of steps for configuring a second virtual machine provided in an embodiment of the present application; Figure 5 It is a flowchart of the steps of virtual machine recovery provided in an embodiment of the present application; Figure 6 It is a structural schematic diagram of a cross-platform migration device for a virtual machine provided in an embodiment of the present application; Figure 7 is a structural schematic diagram of an electronic device provided in an embodiment of the present application; Figure 8 This is another structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0011] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0012] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0013] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0014] In the related art, when performing heterogeneous migration of virtual machines, the storage backend mounted by the second cluster is first configured as the storage backend mounted by the first cluster, and then the storage information contained in the virtual machines to be migrated deployed in the first cluster is migrated to the storage backend mounted by the second cluster, so as to finally achieve the virtual machine migration operation between heterogeneous clusters. This method is not only cumbersome to operate, but also has low migration efficiency.

[0015] In order to solve the technical problems existing in the related art, the present application embodiment provides a cross-platform migration method for a virtual machine. Figure 1 , Figure 1 It is a flow chart of a cross-platform migration method of a virtual machine provided in an embodiment of the present application, and the method includes steps 101 to 104.

[0016] Step 101, when a virtual machine migration request is received, a first virtual machine to be migrated is acquired, and virtual machine information and network information of the first virtual machine are obtained, wherein the first virtual machine runs on a first platform.

[0017] In one embodiment, when performing heterogeneous migration of a virtual machine, the virtual machine is migrated from one platform to another platform for operation, and at the same time, the operation of the virtual machine on the current platform is not affected. Specifically, when a virtual machine migration request is received, the first virtual machine to be migrated is determined, and the virtual machine information and network information of the first virtual machine are obtained, wherein the first virtual machine is running on the first platform. It should be noted that different virtualization technologies correspond to different virtualization platforms, KVM (kernel-based Virtual Machine) and VMware are two different virtualization technologies, and converting a virtual machine created based on VMware technology into a virtual machine created based on KVM technology is the migration process of the virtual machine, which migrates the virtual machine from a platform based on VMware technology to a platform based on KVM technology. Therefore, the first platform can be one of the platforms, and the migration of the virtual machine is to migrate the virtual machine from one platform to another platform for operation, while ensuring that the operation of the virtual machine is not affected in any way.

[0018] Exemplarily, when a virtual machine migration request is received, the virtual machine that needs to be migrated, i.e., the first virtual machine, is located. When determining the first virtual machine, the virtual machine migration request can be identified, and the virtual machine identifier contained therein can be identified and obtained to determine the virtual machine that needs to be migrated.

[0019] For example, when receiving a virtual machine migration request, the virtual machine identifier contained in the virtual machine migration request is identified, and the first virtual machine to be migrated is determined according to the virtual machine identifier, and the virtual machine information and network information of the first virtual machine are obtained by querying the storage space of the first platform according to the identified virtual machine identifier. After obtaining the virtual machine information and network information, they can be compressed and sent to the second platform for recording, so as to create a second virtual machine consistent with the first virtual machine on the second platform. In order to obtain a consistent second virtual machine, further processing is required, including obtaining relevant data of the normal operation of the first virtual machine.

[0020] After determining the virtual machine that needs to be migrated, in order to ensure the normal operation of the virtual machine on the second platform, the virtual machine information and network information of the first virtual machine will also be obtained, where the virtual machine information at least includes the configuration information of the virtual machine (such as CPU, memory, hard disk, etc.), running status, installed operating system and applications, etc., and the network information of the first virtual machine at least includes the network configuration of the virtual machine, IP address, VLAN to which it belongs, etc., so that when the virtual machine is deployed on the second platform, a second virtual machine that is consistent with the first virtual machine can be obtained.

[0021] Step 102: Send the virtual machine information and the network information to the second platform, and create a second virtual machine on the second platform according to the virtual machine information.

[0022] In one embodiment, when implementing cross-platform virtual machine migration, the virtual machine information and network information of the first virtual machine when running on the first platform are first sent to the second platform, so that a second virtual machine can be created on the second platform based on the virtual machine information. At this time, the created second virtual machine cannot operate normally and needs to be configured with the same data and information as the first virtual machine before it can operate normally.

[0023] In the migration process, after the migration of the virtual machine is completed, the second virtual machine is the first virtual machine on the second platform, that is, the first virtual machine and the second virtual machine are the same virtual machines on different platforms.

[0024] Step 103: Mark the backup data of the first virtual machine on the NFS storage server according to the first virtual machine to obtain migration data.

[0025] In one embodiment, after the virtual machine information and network information of the first virtual machine are obtained, the backup data corresponding to the first virtual machine is obtained to be migrated to the second platform as migration data to perform recovery processing on the created second virtual machine. Specifically, when obtaining the migration data, data query is performed on the NFS storage server according to the first virtual machine to obtain the backup data corresponding to the first virtual machine, and the backup data is marked as migration data.

[0026] Exemplarily, for the first virtual machine, its data during operation will be backed up in the NFS (Network File System) storage server, which has the function of data sharing. By backing up the virtual machine in the NFS storage server, the corresponding backup data can be directly obtained in the NFS storage server to complete the creation of the virtual machine on the second platform, that is, virtual machine migration. At the same time, when the virtual machine on the first platform has an operational abnormality, the corresponding backup data can also be obtained in the NFS storage server to complete the recovery of the virtual machine.

[0027] After the backup data of the first virtual machine is obtained, the backup data may be marked according to the migration requirement to obtain corresponding migration data, wherein the purpose of marking is to determine which data in the backup data needs to be migrated.

[0028] Based on the above description, refer to Figure 2 , Figure 2 This is a block diagram of a cross-platform migration system for virtual machines provided in an embodiment of the present application, wherein the system includes a front end (such as a PC end or a Web end), a server end, a first platform, a second platform, and an NFS storage server. Users can access the server end through the front end to perform corresponding operations on the server end, including backup, recovery, migration, and configuration settings, etc. The first platform and the second platform are platforms created based on different virtual machine technologies, and the NFS storage server is used to back up virtual machines running on the first platform and the second platform.

[0029] Based on Figure 2 When the system migrates a virtual machine, the user sends a virtual machine migration request at the front end. The server analyzes and processes the received virtual machine migration request, determines the first virtual machine that needs to be migrated (taking the first virtual machine on the first platform as an example), and sends the virtual machine information and network information of the first virtual machine to the second platform. At this time, the second platform creates a corresponding second virtual machine, and determines the migration data in the NFS storage server according to the first virtual machine, informs the second platform and grants the second platform the permission to read the data, and then the second platform reads the corresponding migration data from the NFS storage server to complete the configuration of the second virtual machine. After the second virtual machine completes the configuration, the migration of the virtual machine from the first platform to the second platform is completed.

[0030] Further, when the migration data is obtained from the NFS storage server according to the first virtual machine, the Figure 3 , Figure 3 It is a flowchart of the steps of obtaining migration data provided in an embodiment of the present application, wherein the steps include steps 301 to 303.

[0031] Step 301, obtaining a first identifier of a first virtual machine, and performing data query in an NFS storage server according to the first identifier to obtain backup data corresponding to the first identifier; Step 302: convert the format of the backup data to obtain intermediate data compatible with the second platform; Step 303: Mark the intermediate data to obtain migration data.

[0032] Specifically, when determining and obtaining migration data, the first identifier of the first virtual machine is obtained, and then a query and match is performed in the NFS storage server based on the first identifier. Since the backup data of the first virtual machine is stored in the NFS storage server, the backup data corresponding to the first virtual machine stored in the NFS storage server can be obtained by querying through the first identifier. At the same time, since different virtualization platforms or cloud service providers may use different data formats or storage mechanisms, after obtaining the backup data, the backup data is converted into a format that can be applied on the second platform, wherein the backup data after the format conversion is completed is called intermediate data, and finally the intermediate data is marked as migration data.

[0033] Furthermore, when determining the migration data, all the backup data may be marked as the migration data, or part of the backup data may be marked as the migration data. Therefore, when the backup data is marked to obtain the migration data, the obtained backup data may be displayed to the user for selection, such as displaying the backup time of the backup data, the backup cycle, or the version information of the data in different backup cycles, etc. Then the user may make a selection to determine the running state of the second virtual machine on the second platform after the migration, which is specifically reflected in the difference in the data used for the migration and recovery.

[0034] In order to more conveniently select backup data and determine migration data, data backup is performed on the first virtual machine on the first platform, specifically including: when a backup request for the virtual machine is received, identifying a third virtual machine identifier contained in the backup request; obtaining incremental data in the third virtual machine, and deduplicating and compressing the incremental data to obtain data to be backed up, wherein the third virtual machine corresponds to the third virtual machine identifier; controlling the NFS storage server to read the data to be backed up, and performing format conversion and storage on the data to be backed up.

[0035] Specifically, when a backup request for a virtual machine is received, the data that needs to be backed up by the third virtual machine identifier of the virtual machine that needs to be backed up, that is, the incremental data, is determined. Then, after obtaining the incremental data, it is deduplicated and compressed to eliminate duplicate parts in the data and reduce the demand for storage space. At the same time, the efficiency of backup storage and transmission is improved through compression processing.

[0036] After the incremental data is processed to obtain the data to be backed up, the data to be backed up will be stored in the NFS storage server. Before storage, the format of the data to be backed up is converted, and then stored after the conversion is completed.

[0037] Step 104, connecting the NFS storage server and the second virtual machine, controlling the second platform to read the migration data from the NFS storage server, and performing configuration processing on the second virtual machine according to the migration data and network information to obtain the configured second virtual machine.

[0038] In one embodiment, after the migration data is determined, the NFS storage server and the second virtual machine are connected, and the second platform is controlled to read the marked migration data from the NFS storage server, and then the second virtual machine is configured and processed according to the migration data and network information to obtain the configured second virtual machine.

[0039] Exemplarily, the migration data is stored on the NFS storage server. In order to complete the configuration of the second virtual machine on the second platform, the migration data needs to be read from the NFS storage server. The second platform is controlled to read the migration data from the NFS storage server, so as to configure the second virtual machine according to the migration data and network information to complete the migration of the virtual machine from the first platform to the second platform.

[0040] Further, refer to Figure 4 , Figure 4 It is a flowchart of the steps for configuring the second virtual machine provided in an embodiment of the present application, wherein the steps include steps 401 to 403.

[0041] Step 401, connecting the server disk of the NFS storage server and the virtual machine disk of the second virtual machine; Step 402, creating a virtual machine snapshot of the second virtual machine, and writing the migration data read from the server disk to the virtual machine disk according to the virtual machine snapshot, wherein the virtual machine snapshot includes a data write address; Step 403: configure the second virtual machine according to the network information to obtain the configured second virtual machine.

[0042] Specifically, when processing, it is first necessary to realize the reading of the migration data in the NFS storage server. The second platform is in a connected state with the NFS storage server. At this time, the server disk of the NFS storage server and the virtual machine disk of the second virtual machine are connected through the second platform to read the migration data into the second virtual machine for configuration processing.

[0043] It should be noted that when connecting the server disk of the NFS storage server and the virtual machine disk of the second virtual machine, it is implemented through a pre-written interface. When writing the interface, the program can be written using the Java native interface to ensure that the code is ported on different platforms, and then the connection is implemented using C language to access the disk of the virtual machine running on the platform through the NFS storage server, such as accessing the storage files of the VMware virtual machine disk through the NFS storage server to realize the reading and writing of the virtual machine disk.

[0044] When reading the migration data, a virtual machine snapshot of the second virtual machine is created, wherein the virtual machine snapshot records the status record information of the second virtual machine, such as the data write address, the data write status, etc., and then the migration data is read from the NFS storage server based on the created virtual machine snapshot and written to the virtual machine disk, and then the second virtual machine is configured according to the obtained network information and migration data to obtain the configured second virtual machine.

[0045] Furthermore, when writing the migration data to the virtual machine disk of the second virtual machine, it includes: dividing the migration data into several sub-migration data according to preset rules, wherein the preset rules include the size of the data; selecting the first sub-migration data and creating a first snapshot corresponding to the first sub-migration data, and writing the first sub-migration data to the virtual machine disk according to the first snapshot; selecting the second sub-migration data and creating a second snapshot corresponding to the second sub-migration data, and writing the second sub-migration data to the virtual machine disk according to the second snapshot; until the last sub-migration data is written to the virtual machine disk.

[0046] Exemplarily, the migration data is divided according to a preset rule to obtain a plurality of sub-migration data, wherein the preset rule is the size of the data volume. By reducing the size of the data to be transmitted, the data transmission efficiency and stability can be improved.

[0047] When the sub-migration data is migrated, one data is selected from the divided sub-migration data, such as the first data, i.e., the first sub-migration data, and a corresponding virtual machine snapshot is created for the first sub-migration data. By creating a virtual machine snapshot, it can be ensured that if any problem occurs during the data migration process, the virtual machine can be controlled to be restored to the state before the migration begins, thereby avoiding data loss or damage. Then, the first sub-migration data is written to the virtual machine disk according to the created virtual machine snapshot. Next, the second data in the divided sub-migration data is migrated, i.e., the next data of the first sub-migration data. The second sub-migration data is processed by the same processing as the first sub-migration data, so that the second sub-migration data is written to the virtual machine disk, and the processing is repeated until the last sub-migration data is written to the virtual machine disk of the second virtual machine.

[0048] In this way, a large amount of migration data can be written to the virtual machine disk step by step and in an orderly manner, ensuring the stability of the migration process and the integrity of the data. At the same time, by creating virtual machine snapshots, an effective data recovery mechanism can also be provided to deal with possible problems and errors.

[0049] Furthermore, the above description records the process of migrating a virtual machine from one platform to another platform, which can be understood as completing the recovery of the virtual machine on another platform. When the recovery of the virtual machine is realized on the same platform, reference can be made to Figure 5 , Figure 5 It is a flowchart of the steps of virtual machine recovery provided in an embodiment of the present application, wherein the steps include steps 501 to 505.

[0050] Step 501, when receiving a recovery request of a virtual machine, identifying a fourth virtual machine identifier included in the recovery request; Step 502, obtaining fourth virtual machine information of a fourth virtual machine, and creating a corresponding virtual machine snapshot according to the fourth virtual machine information, wherein the fourth virtual machine corresponds to the fourth virtual machine identifier; Step 503, connecting the fourth virtual machine disk of the fourth virtual machine to the service disk of the NFS storage server; Step 504: acquiring recovery data from the NFS storage server according to the fourth virtual machine identifier, performing format conversion on the recovery data, and writing the converted recovery data to the fourth virtual machine disk; Step 505: When it is determined that the data writing is completed and the fourth virtual machine runs normally after the data is written, the fourth virtual machine snapshot is deleted.

[0051] Specifically, when performing recovery processing of a virtual machine on the same platform, a recovery request of the virtual machine is received and a fourth virtual machine identifier included in the recovery request is identified, and then, based on the identified fourth virtual machine identifier, all information related to the fourth virtual machine is obtained, such as configuration, storage location, etc. After obtaining this information, the system creates a virtual machine snapshot based on the information, and simultaneously connects the fourth virtual machine disk of the fourth virtual machine with the server disk of the NFS storage server, thereby obtaining recovery data for recovering the fourth virtual machine from the NFS storage server.

[0052] After the connection is completed and the recovery data is obtained from the NFS storage server, the recovery data is converted into a data format that can be read by the platform where the fourth virtual machine is located, and then the converted recovery data is written to the fourth virtual machine disk. Finally, after the data is written, the operation status of the fourth virtual machine is checked and verified to ensure that it is running normally and meets the user's recovery requirements. Then, after determining that the fourth virtual machine is running normally and meets the recovery requirements, the fourth virtual machine snapshot created previously is deleted.

[0053] Furthermore, when the recovery data is obtained according to the fourth virtual machine identifier and written into the fourth virtual machine disk, it also includes: querying in the NFS storage server according to the fourth virtual machine identifier to obtain the recovery data; displaying the recovery data and receiving an input data recovery node; filtering the recovery data according to the data recovery node to obtain target data for recovering the fourth virtual machine; formatting the target data and writing the converted target data into the fourth virtual machine disk.

[0054] In actual applications, when restoring a virtual machine, it is not necessarily necessary to restore the virtual machine to the latest state, but it may be necessary to restore it to a previous state. Therefore, after querying in the NFS storage server according to the fourth virtual machine identifier and obtaining the restored data, the restored data is displayed for the user to view, and then the data recovery node to be restored is selected, and then the restored data is filtered according to the selected data recovery node to obtain the target data to be restored with the fourth virtual machine, and finally the target data is converted into a format that can be written by the fourth virtual machine and written to the fourth virtual machine disk.

[0055] In summary, the present application discloses a cross-platform migration method for a virtual machine. When a virtual machine migration request is received, a first virtual machine to be migrated is determined, and virtual machine information and network information of the first virtual machine are obtained, wherein the first virtual machine runs on the first platform, and then the virtual machine information and network information are sent to the second platform, and a corresponding second virtual machine is created on the second platform based on the virtual machine information, and then the backup data of the first virtual machine on the NFS storage server is obtained and marked, and migration data is obtained, and finally the NFS storage server and the second virtual machine are connected, and the second virtual machine is controlled to read the migration data from the NFS storage server, and finally the second virtual machine is configured and processed according to the migration data and network information, and the second virtual machine after configuration processing is obtained. In the process of cross-platform migration of virtual machines, data backup processing of the NFS storage server is realized, and there is no need to terminate the service of the source virtual machine. During the migration, the virtual machine is created and the data is obtained according to the relevant information of the virtual machine to be migrated, and then the creation of the virtual machine on another platform is completed through data recovery to complete the migration of the virtual machine, thereby improving the convenience of virtual machine migration and the user experience.

[0056] According to the method described in the above embodiments, this embodiment will be further described from the perspective of a cross-platform migration device of a virtual machine. The cross-platform migration device of the virtual machine can be implemented as an independent entity or integrated in an electronic device, such as a terminal. The terminal may include a mobile phone, a tablet computer, etc.

[0057] See also Figure 6 , Figure 6 is a structural diagram of a cross-platform migration device for a virtual machine provided in an embodiment of the present application, such as Figure 6 As shown, the cross-platform migration device 600 of a virtual machine provided in an embodiment of the present application includes: The request receiving module 601 is used to obtain a first virtual machine to be migrated and obtain virtual machine information and network information of the first virtual machine when receiving a virtual machine migration request, wherein the first virtual machine runs on a first platform; An information receiving module 602 is used to send the virtual machine information and the network information to the second platform, and create a second virtual machine on the second platform according to the virtual machine information; The data processing module 603 is used to mark the backup data of the first virtual machine on the NFS storage server according to the first virtual machine to obtain migration data; The migration processing module 604 is used to connect the NFS storage server and the second virtual machine, control the second virtual machine to read the migration data from the NFS storage server, and configure the second virtual machine according to the migration data and network information to obtain the configured second virtual machine.

[0058] In one embodiment, the data processing module 603 is further used to: Obtaining a first identifier of the first virtual machine, and performing data query in the NFS storage server according to the first identifier to obtain backup data corresponding to the first identifier; Convert the format of the backup data to obtain intermediate data compatible with the second platform; The intermediate data is marked to obtain the migration data.

[0059] In one embodiment, the migration processing module 604 is further configured to: Connecting the server disk of the NFS storage server to the virtual machine disk of the second virtual machine; Creating a virtual machine snapshot of the second virtual machine, and writing the migration data read from the server disk to the virtual machine disk according to the virtual machine snapshot, wherein the virtual machine snapshot includes a data write address; The second virtual machine is configured according to the network information to obtain the configured second virtual machine.

[0060] In one embodiment, the migration processing module 604 is further configured to: Dividing the migration data into a plurality of sub-migration data according to a preset rule, wherein the preset rule includes the size of the data; Selecting the first sub-migration data and creating a first snapshot corresponding to the first sub-migration data, and writing the first sub-migration data to the virtual machine disk according to the first snapshot; Selecting the second sub-migration data and creating a second snapshot corresponding to the second sub-migration data, and writing the second sub-migration data to the virtual machine disk according to the second snapshot; Until the last child migration data is written to the virtual machine disk.

[0061] In one embodiment, the cross-platform migration device of a virtual machine further includes a backup processing module, which is used to: When receiving a backup request for the virtual machine, identifying a third virtual machine identifier included in the backup request; Acquire incremental data in the third virtual machine, and perform deduplication and compression processing on the incremental data to obtain data to be backed up, wherein the third virtual machine corresponds to the third virtual machine identifier; Control the NFS storage server to read the data to be backed up, and perform format conversion and storage on the data to be backed up.

[0062] In one embodiment, the cross-platform migration device of a virtual machine further includes a recovery processing module, which is used to: When receiving a recovery request of the virtual machine, identifying a fourth virtual machine identifier included in the recovery request; Obtaining fourth virtual machine information of a fourth virtual machine, and creating a corresponding virtual machine snapshot according to the fourth virtual machine information, wherein the fourth virtual machine corresponds to the fourth virtual machine identifier; connecting a fourth virtual machine disk of the fourth virtual machine to a service disk of the NFS storage server; Acquire recovery data in the NFS storage server according to the fourth virtual machine identifier, convert the format of the recovery data, and write the converted recovery data to the fourth virtual machine disk; When it is determined that the data writing is completed and the fourth virtual machine runs normally after the data is written, the fourth virtual machine snapshot is deleted.

[0063] In one embodiment, the recovery processing module is further used for: Querying the NFS storage server according to the fourth virtual machine identifier to obtain the restored data; Displays the recovered data and receives the input data recovery node; Filter the restored data according to the data restoration node to obtain target data for restoring the fourth virtual machine; The target data is formatted and the converted target data is written into the fourth virtual machine disk.

[0064] Also, see Figure 7 , Figure 7 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and the electronic device may be a mobile terminal such as a smart phone, a tablet computer, or the like. Figure 7 As shown, the electronic device 700 includes a processor 701 and a memory 702. The processor 701 is electrically connected to the memory 702.

[0065] The processor 701 is the control center of the electronic device 700. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device 700 and processes data by running or loading applications stored in the memory 702 and calling data stored in the memory 702, thereby monitoring the electronic device 700 as a whole.

[0066] In this embodiment, the processor 701 in the electronic device 700 will load the instructions corresponding to the processes of one or more applications into the memory 702 according to the following steps, and the processor 701 will run the application stored in the memory 702, thereby implementing any step in the cross-platform migration method of the virtual machine provided in the above embodiment.

[0067] The electronic device 700 can implement the steps in any embodiment of the cross-platform migration method of the virtual machine provided in the embodiments of the present application. Therefore, it can achieve the beneficial effects that can be achieved by any cross-platform migration method of the virtual machine provided in the embodiments of the present application. Please refer to the previous embodiments for details and will not be repeated here.

[0068] See also Figure 8 , Figure 8 is another structural schematic diagram of an electronic device provided in an embodiment of the present application, such as Figure 8 As shown, Figure 8 The specific structural block diagram of the electronic device provided in the embodiment of the present application is shown, and the electronic device can be used to implement the cross-platform migration method of the virtual machine provided in the above embodiment. The electronic device 800 can be a mobile terminal such as a smart phone or a laptop computer.

[0069] The RF circuit 810 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The RF circuit 810 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity module (SIM) cards, memories, etc. The RF circuit 810 can communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices through wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The above-mentioned wireless networks may use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (such as Institute of Electrical and Electronics Engineers standards IEEE 802.11a, IEEE 802.11b, IEEE802.11g and / or IEEE802.11n), Voice over Internet Protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), other protocols for email, instant messaging and short messages, and any other suitable communication protocols, even those that have not yet been developed.

[0070] The memory 820 can be used to store software programs and modules, such as the program instructions / modules corresponding to the cross-platform migration method of the virtual machine in the above-mentioned embodiment. The processor 880 executes various functional applications and the cross-platform migration method of the virtual machine by running the software programs and modules stored in the memory 820.

[0071] The memory 820 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 820 may further include a memory remotely arranged relative to the processor 880, and these remote memories may be connected to the electronic device 800 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0072] The input unit 830 can be used to receive uploaded digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 830 may include a touch-sensitive surface 831 and other input devices 832. The touch-sensitive surface 831, also known as a touch display screen or touchpad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 831), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 831 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 880, and can receive and execute commands sent by the processor 880. In addition, the touch-sensitive surface 831 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 831, the input unit 830 may further include other input devices 832. Specifically, the other input devices 832 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0073] The display unit 840 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device 800, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 840 may include a display panel 841, and optionally, the display panel 841 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 831 may cover the display panel 841, and when the touch-sensitive surface 831 detects a touch operation on or near it, it is transmitted to the processor 880 to determine the type of the touch event, and then the processor 880 provides corresponding visual output on the display panel 841 according to the type of the touch event. Although in the figure, the touch-sensitive surface 831 and the display panel 841 are implemented as two independent components to implement input and output functions, in some embodiments, the touch-sensitive surface 831 can be integrated with the display panel 841 to implement input and output functions.

[0074] The electronic device 800 may also include at least one sensor 850, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor may generate an interrupt when the flip cover is closed or closed. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can also be configured in the electronic device 800, they will not be repeated here.

[0075] The audio circuit 860, the speaker 861, and the microphone 862 can provide an audio interface between the user and the electronic device 800. The audio circuit 860 can transmit the electrical signal converted from the received audio data to the speaker 861, which is converted into a sound signal for output; on the other hand, the microphone 862 converts the collected sound signal into an electrical signal, which is received by the audio circuit 860 and converted into audio data, and then the audio data is output to the processor 880 for processing, and then sent to another terminal through the RF circuit 810, or the audio data is output to the memory 820 for further processing. The audio circuit 860 may also include an earplug jack to provide communication between an external headset and the electronic device 800.

[0076] The electronic device 800 can help the user receive requests, send information, etc. through the transmission module 870 (such as a Wi-Fi module), which provides the user with wireless broadband Internet access. Although the transmission module 870 is shown in the figure, it can be understood that it is not a necessary component of the electronic device 800 and can be omitted as needed without changing the essence of the invention.

[0077] The processor 880 is the control center of the electronic device 800. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 820, and calling data stored in the memory 820, it executes various functions of the electronic device 800 and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 880 may include one or more processing cores; in some embodiments, the processor 880 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 880.

[0078] The electronic device 800 also includes a power supply 890 (such as a battery) for supplying power to various components. In some embodiments, the power supply can be logically connected to the processor 880 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 890 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0079] Although not shown, the electronic device 800 also includes a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the display unit of the electronic device is a touch screen display, and the mobile terminal also includes a memory, and one or more programs, wherein the one or more programs are stored in the memory, and are configured to be executed by one or more processors to implement any step of the cross-platform migration method of the virtual machine provided in the above embodiment.

[0080] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation of the above modules can be found in the previous method embodiments, which will not be repeated here.

[0081] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present application provides a storage medium, which stores a plurality of instructions, and when the instructions are executed by the processor, any step in the cross-platform migration method of the virtual machine provided in the above embodiments can be implemented.

[0082] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0083] Since the instructions stored in the storage medium can execute the steps in any embodiment of the cross-platform migration method of the virtual machine provided in the embodiments of the present application, the beneficial effects that can be achieved by any cross-platform migration method of the virtual machine provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0084] The above is a detailed introduction to a cross-platform migration method, device, electronic device and storage medium of a virtual machine provided in the embodiment of the present application. The principles and implementation methods of the present application are described in detail using specific examples herein. The description of the above embodiments is only used to help understand the method and its core idea of ​​the present application. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present application. Moreover, for those of ordinary skill in the art, without departing from the principles of the present application, several improvements and modifications can be made, and these improvements and modifications are also considered to be within the scope of protection of the present application.

Claims

1. A method for cross-platform migration of a virtual machine, characterized in that: include: When a virtual machine migration request is received, acquiring a first virtual machine to be migrated, and obtaining virtual machine information and network information of the first virtual machine, wherein the first virtual machine runs on a first platform; Sending the virtual machine information and the network information to a second platform, and creating a second virtual machine on the second platform according to the virtual machine information; Marking the backup data of the first virtual machine on the NFS storage server according to the first virtual machine to obtain migration data; The NFS storage server and the second virtual machine are connected, the second virtual machine is controlled to read the migration data from the NFS storage server, and the second virtual machine is configured according to the migration data and the network information to obtain the configured second virtual machine.

2. The method according to claim 1, characterized in that The step of marking the backup data of the first virtual machine on the NFS storage server according to the first virtual machine to obtain the migration data includes: Obtaining a first identifier of the first virtual machine, and performing data query in an NFS storage server according to the first identifier to obtain backup data corresponding to the first identifier; Converting the format of the backup data to obtain intermediate data compatible with the second platform; The intermediate data is marked to obtain migration data.

3. The method according to claim 1, characterized in that The connecting the NFS storage server and the second virtual machine, controlling the second virtual machine to read the migration data from the NFS storage server, and performing configuration processing on the second virtual machine according to the migration data and the network information to obtain the configured second virtual machine includes: Connecting the server disk of the NFS storage server to the virtual machine disk of the second virtual machine; Creating a virtual machine snapshot of the second virtual machine, and writing the migration data read from the server disk to the virtual machine disk according to the virtual machine snapshot, wherein the virtual machine snapshot includes a data write address; The second virtual machine is configured according to the network information to obtain a configured second virtual machine.

4. The method according to claim 3, characterized in that The step of creating a virtual machine snapshot of the second virtual machine, and writing the migration data read from the server disk to the virtual machine disk according to the virtual machine snapshot, includes: Dividing the migration data into a plurality of sub-migration data according to a preset rule, wherein the preset rule includes the size of the data; Selecting first sub-migration data and creating a first snapshot corresponding to the first sub-migration data, and writing the first sub-migration data to the virtual machine disk according to the first snapshot; Selecting second sub-migration data and creating a second snapshot corresponding to the second sub-migration data, and writing the second sub-migration data to the virtual machine disk according to the second snapshot; Until the last sub-migration data is written to the virtual machine disk.

5. The method according to claim 1, characterized in that The method further comprises: When receiving a backup request for the virtual machine, identifying a third virtual machine identifier included in the backup request; Acquire incremental data in a third virtual machine, and perform deduplication and compression processing on the incremental data to obtain data to be backed up, wherein the third virtual machine corresponds to the third virtual machine identifier; The NFS storage server is controlled to read the data to be backed up, and format-convert and store the data to be backed up.

6. The method according to claim 1, characterized in that The method further comprises: When receiving a recovery request of the virtual machine, identifying a fourth virtual machine identifier included in the recovery request; Acquire fourth virtual machine information of the fourth virtual machine, and create a corresponding virtual machine snapshot according to the fourth virtual machine information, wherein the fourth virtual machine corresponds to the fourth virtual machine identifier; Connecting a fourth virtual machine disk of the fourth virtual machine to a service disk of the NFS storage server; Acquire recovery data in the NFS storage server according to the fourth virtual machine identifier, perform format conversion on the recovery data, and write the converted recovery data to the fourth virtual machine disk; When it is determined that the data writing is completed and the fourth virtual machine runs normally after the data is written, the fourth virtual machine snapshot is deleted.

7. The method according to claim 6, characterized in that The acquiring the recovery data in the NFS storage server according to the fourth virtual machine identifier, converting the format of the recovery data, and writing the converted recovery data to the fourth virtual machine disk includes: Querying the NFS storage server according to the fourth virtual machine identifier to obtain the recovery data; Displaying the recovered data and receiving an input data recovery node; Filtering the restored data according to the data restoration node to obtain target data for restoring the fourth virtual machine; The target data is formatted and the converted target data is written into the fourth virtual machine disk.

8. A cross-platform migration device for a virtual machine, characterized in that: include: a request receiving module, configured to, when receiving a virtual machine migration request, obtain a first virtual machine to be migrated, and obtain virtual machine information and network information of the first virtual machine, wherein the first virtual machine runs on a first platform; An information receiving module, used for sending the virtual machine information and the network information to the second platform, and creating a second virtual machine on the second platform according to the virtual machine information; A data processing module, configured to mark the backup data of the first virtual machine on the NFS storage server according to the first virtual machine to obtain migration data; The migration processing module is used to connect the NFS storage server and the second virtual machine, control the second virtual machine to read the migration data from the NFS storage server, and configure the second virtual machine according to the migration data and the network information to obtain the configured second virtual machine.

9. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the steps in the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • A virtual machine backup system based on a distributed storage technology

    CN109582443A

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

    CN114860393A

  • Virtual machine application migration method and device between heterogeneous platforms

    CN115904603A

  • Data migration method and device, storage medium and electronic equipment

    CN116719482A

  • Cross-platform data migration and management

    US20220245033A1