CN112068930B - Method for migrating virtual machine across platforms - Google Patents
Method for migrating virtual machine across platforms Download PDFInfo
- Publication number
- CN112068930B CN112068930B CN202010854701.7A CN202010854701A CN112068930B CN 112068930 B CN112068930 B CN 112068930B CN 202010854701 A CN202010854701 A CN 202010854701A CN 112068930 B CN112068930 B CN 112068930B
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- platform
- volume
- openstack
- intermediate host
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 230000005012 migration Effects 0.000 claims abstract description 49
- 238000013508 migration Methods 0.000 claims abstract description 39
- 230000008569 process Effects 0.000 claims abstract description 18
- 230000007246 mechanism Effects 0.000 claims abstract description 5
- 238000012544 monitoring process Methods 0.000 claims description 3
- 230000001360 synchronised effect Effects 0.000 abstract description 3
- 230000008859 change Effects 0.000 description 4
- 230000007547 defect Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000007792 addition Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000033001 locomotion Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a method for migrating virtual machines across platforms, which comprises the steps of preparing an intermediate host provided with a Linux operating system, preparing NFS storage, and migrating a source virtual machine to the NFS storage; creating a volume on a target platform, and mounting the volume on the NFS storage and the target platform to an intermediate host; the method comprises the steps that an intermediate host migrates disk data of a source virtual machine in NFS storage to a volume on a destination platform, the intermediate host monitors the disk data of the source virtual machine in the NFS storage by using an inotify mechanism of a Linux operating system in the migration process, increment continuous synchronization is carried out on data generated by the source virtual machine in the migration process, and data increments are continuously synchronized to the volume on the destination platform; and after the disk data synchronization is finished, stopping the source virtual machine, creating a secondary volume in the target platform, starting the target virtual machine, and finishing the migration. Through the mode, the virtual machine can be migrated across platforms, online migration is supported, the downtime in the migration process is short, the operation is simple and convenient, and the compatibility is good.
Description
Technical Field
The invention relates to the technical field of cloud computing, in particular to a method for migrating a virtual machine across platforms.
Background
The Openstack platform is widely used as cloud management software to manage related resources, more and more users migrate virtual machines of virtualization platforms such as Vmware vSphere to the Openstack platform, and currently, common cross-platform cloud migration technical solutions include:
1. the manual deployment has the advantages of being consistent with the physical machine deployment mode and strong in universality; the defects are that the redeployment is needed, the efficiency is low, the operation is complex, and more manual intervention is needed.
2. Mirror image migration, namely directly mirroring a migrated cloud host through a tool, and migrating the original environment to a new environment without change; the defects are that the mirror image is troublesome to manufacture, the migration flow is complex, and shutdown is needed in the migration process.
3. The online migration is realized, the migration is realized through a third-party tool, the shutdown time is short or no shutdown is needed, and the real-time synchronization of data can be ensured in the migration process; the disadvantage is that it is expensive to charge and typically requires an agent to be installed in the operating system of the virtual machine to be migrated.
Disclosure of Invention
The invention mainly solves the technical problem of providing a method for migrating a virtual machine across platforms, which comprises the steps of running a migration program across platforms on an intermediate host, mounting a volume created on a migration target cloud platform on the intermediate host, copying disk data of a source virtual machine to the volume, and carrying out incremental continuous synchronization on data generated by the virtual source machine in the migration process, so that the consistency of the data of the virtual machine before and after migration is ensured, the migration process is greatly simplified, the migration efficiency is high, and the method can be compatible with various virtualized storage back ends.
In order to solve the technical problems, the invention adopts a technical scheme that: a method for migrating virtual machines across platforms is provided, comprising: preparing NFS storage and an intermediate host provided with a Linux operating system, and migrating a source virtual machine to the NFS storage; creating a volume on a target platform, and mounting the volume on the NFS storage and the target platform to an intermediate host; the method comprises the steps that an intermediate host migrates disk data of a source virtual machine in NFS storage to a volume on a destination platform, the intermediate host monitors the disk data of the source virtual machine in the NFS storage by using an inotify mechanism of a Linux operating system in the migration process, increment continuous synchronization is carried out on data generated by the source virtual machine in the migration process, and data increments are continuously synchronized to the volume on the destination platform; and after the disk data synchronization is finished, stopping the source virtual machine, creating a secondary volume in the target platform, starting the target virtual machine, and finishing the migration.
Further, the source virtual machine is a virtual machine in the Vmware vSphere platform, when preparing the NFS storage, the NFS storage is added to the virtual machine in the Vmware vSphere platform, and the disk data of the source virtual machine is migrated to the NFS storage on the Vmware vSphere platform.
Further, the destination platform is an Openstack platform, when a volume is created on the Openstack platform, the volume is created on the Openstack platform by calling an application program call interface API of the Openstack, and if the source virtual machine has a plurality of disks, the volume with the same number as the number of the disks of the source virtual machine is created on the Openstack platform.
Further, when the volume on the target platform is mounted to the intermediate host, the Openstack API is called first to obtain information stored at the back end of the volume of the Openstack platform, the intermediate host matches the client stored correspondingly according to the information stored at the back end of the volume, mounts the volume of the Openstack platform to the intermediate host, and reads and writes data in the volume.
Further, the storage types adopted by the volume storage back end of the Openstack platform comprise ceph, iscsi, glusterfs and nbd; the information stored at the back end of the volume of the Openstack platform comprises the id of the volume and the stored authentication information, and the intermediate host judges the storage type adopted at the back end of the volume storage of the Openstack platform according to the id of the volume and the stored authentication information.
Further, the intermediate host runs a migration program, and the migration program reads a disk file of the source virtual machine stored in the NFS, and writes the content of the disk file to a mounted volume of the Openstack platform.
Further, after the disk data synchronization is completed, the virtual machine in the Vmware vSphere platform is temporarily stopped, then Openstack API is called, the target virtual machine is created and started from the volume in the Openstack platform, and migration is completed.
Further, the intermediate host is a physical machine or a virtual machine.
The invention has the beneficial effects that: (1) the operation is simple and convenient, and the manual intervention is less; and the user initiates a migration task, and the migration program running on the intermediate host completes a series of work such as disk data copying, target virtual machine creation and the like for the user.
(2) In the migration process, the virtual machine has short downtime; and only in the final stage of migration, after the data synchronization of the virtual machines is completed, the source virtual machine is temporarily stopped.
(3) No data loss occurs in the migration process; in the migration process, the data of the disk of the source virtual machine can be continuously subjected to incremental synchronization, so that data loss in the migration process is avoided.
(4) The compatibility is good, and the storage back end of various volumes can be supported; a variety of volume storage back-ends including iscsi, ceph, nbd, watch dog, glusterfs, etc. may be supported.
(5) No agent; in the whole migration process, no agent program or drive in any form is required to be installed in the source virtual machine, so that the security threat caused by the installation of the agent program in the virtual machine is avoided, and the influence of the agent program installed in the virtual machine on the running service system in the virtual machine is also avoided. And the agent program does not need to be run on the source platform and the destination platform.
Drawings
FIG. 1 is a flowchart illustrating a method for migrating a virtual machine across platforms according to an embodiment of the present invention.
Detailed Description
The following detailed description of the preferred embodiments of the present invention, taken in conjunction with the accompanying drawings, will make the advantages and features of the invention easier to understand by those skilled in the art, and thus will clearly and clearly define the scope of the invention.
Referring to fig. 1, an embodiment of the present invention includes:
for example, a virtual machine is migrated from a Vmware vSphere platform to Openstack, a source virtual machine is a virtual machine in the Vmware vSphere platform, and a migration destination cloud platform is an Openstack platform.
VMware vSphere is a VMware virtualization platform that can convert a data center into an aggregated computing infrastructure that includes CPU, storage, and network resources. vSphere manages these infrastructures as a unified runtime environment and provides tools to manage the data centers that join the environment.
The OpenStack is an open-source cloud computing management platform project and is a combination of a series of software open-source projects. OpenStack provides scalable and resilient cloud computing services for private and public clouds.
A method for migrating virtual machines across platforms includes the steps of:
step one, preparing a host provided with a Linux operating system as a migration intermediary, called an intermediate host for short, wherein the intermediate host runs a migration program and is a physical machine or a virtual machine;
step two, preparing an NFS storage, adding the NFS storage to a VMware virtualization host, migrating a virtual machine to be migrated to the NFS storage on a VMware vSphere platform, and mounting the NFS storage on an intermediate host;
and step three, calling an application program calling interface API of the Openstack, creating a blank volume on the Openstack platform, and creating the volume with the same number as the number of the disks of the source virtual machine according to the number of the disks on the source virtual machine.
And step four, calling Openstack API, and acquiring the information of the volume created in the step three, wherein the information is mainly information stored at the back end of the volume and comprises the id of the volume, stored authentication information and the like. The migration program is executed on the intermediate host, the volumes are mounted to the intermediate host by using the corresponding storage clients, various storage mounting can be supported, and the volumes of the Openstack can be mounted remotely by using the corresponding storage clients no matter how ceph, iscsi, glusterfs, nbd and the like are adopted at the volume storage back end of the Openstack, and then the volumes are read and written.
And step five, reading the disk file of the source virtual machine on the NFS by the migration program, writing the content of the disk file into the mounted Openstack volume, and finishing one-time full-scale copying.
And step six, monitoring the change of a disk file of a source virtual machine on NFS storage by using an inotify mechanism of a Linux operating system, synchronizing the change data of the monitored file block into a volume of Openstack, and avoiding data loss in the migration process.
Inotify is a strong, fine-grained and asynchronous file system time monitoring mechanism, Inotify support is added to a linux kernel from 2.6.13, time of addition, deletion, modification, movement and the like in a file system can be monitored through Inotify, and various change conditions of files in the file system can be monitored by third-party software through the kernel interface.
And step seven, after the disk data of the virtual machines are synchronized, temporarily stopping the source virtual machine of the Vmware vSphere platform, then calling Openstack API, creating and starting the target virtual machine from the volume in the Openstack platform, and completing the migration.
The invention is not limited to the virtual machine migration between the two platforms, and the cross-platform cloud migration can be completed by adopting the same manner for the virtual machine migration between other platforms. The method mounts the volume of the NFS storage and the target platform to the intermediate host, and uses the intermediate host to copy the disk data of the virtual machine from the source platform to the target platform, thereby solving the problem that the data between the cross-platforms cannot be directly copied. During operation, the volume of the target platform is used as a bare device to be mounted on an intermediate host, and a migration program running on the intermediate host directly writes the disk data of the virtual machine into the bare device. Compared with the traditional mode, the method and the system have the advantages that the source virtual machine does not need to be made into a mirror image and converted into a format supported by the target platform, then the mirror image is uploaded to the target platform, and finally the virtual machine is created by the mirror image on the target platform.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (6)
1. A method for migrating virtual machines across platforms, comprising: preparing an intermediate host provided with a Linux operating system, preparing NFS storage, and migrating a source virtual machine to the NFS storage; creating a volume on a target platform, and mounting the volume on the NFS storage and the target platform to an intermediate host; migrating disk data of a source virtual machine in NFS storage to a volume on a destination platform by an intermediate host, monitoring the disk data of the source virtual machine in the NFS storage by the intermediate host by using an inotify mechanism of a Linux operating system in the migration process, performing incremental continuous synchronization on data generated by the source virtual machine in the migration process, and continuously synchronizing data increments to the volume on the destination platform; after the disk data synchronization is completed, the source virtual machine is stopped, a target virtual machine is established and started from the volume in the target platform, and the migration is completed;
the source virtual machine is a virtual machine in a Vmware vSphere platform, when NFS storage is prepared, the NFS storage is added to the virtual machine in the Vmware vSphere platform, and disk data of the source virtual machine is migrated to the NFS storage on the VMware vSphere platform;
the target platform is an Openstack platform, and when a volume is created on the Openstack platform, the volume is created on the Openstack platform by calling an application program calling interface API of Openstack;
when the volumes stored in the NFS and the destination platform are mounted to the intermediate host, the Openstack API is called first to obtain information stored at the back end of the volumes of the Openstack platform, the intermediate host matches the client stored correspondingly according to the information stored at the back end of the volumes, mounts the volumes of the Openstack platform to the intermediate host, and reads and writes data in the volumes.
2. The method for migrating virtual machines across platforms according to claim 1, wherein: the source virtual machine is provided with a plurality of disks, and volumes with the same number as the disks of the source virtual machine are created on the Openstack platform.
3. The method for migrating virtual machines across platforms according to claim 1, wherein: the storage types adopted by the volume storage back end of the Openstack platform comprise ceph, iscsi, glusterfs and nbd; the information stored at the back end of the volume of the Openstack platform comprises the id of the volume and the stored authentication information, and the intermediate host judges the storage type adopted at the back end of the volume storage of the Openstack platform according to the id of the volume and the stored authentication information.
4. The method for migrating virtual machines across platforms according to claim 1, wherein: and the intermediate host runs a migration program, the migration program reads a disk file of the source virtual machine stored in the NFS, and writes the content of the disk file into a mounted volume of the Openstack platform.
5. The method for migrating virtual machines across platforms according to claim 4, wherein: after the disk data synchronization is completed, the virtual machine in the Vmware vSphere platform is temporarily stopped, then Openstack API is called, the target virtual machine is created and started from the volume in the Openstack platform, and migration is completed.
6. The method for migrating virtual machines across platforms according to claim 1, wherein: the intermediate host is a physical machine or a virtual machine.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010854701.7A CN112068930B (en) | 2020-08-24 | 2020-08-24 | Method for migrating virtual machine across platforms |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010854701.7A CN112068930B (en) | 2020-08-24 | 2020-08-24 | Method for migrating virtual machine across platforms |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112068930A CN112068930A (en) | 2020-12-11 |
CN112068930B true CN112068930B (en) | 2022-09-20 |
Family
ID=73660752
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010854701.7A Active CN112068930B (en) | 2020-08-24 | 2020-08-24 | Method for migrating virtual machine across platforms |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112068930B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113485787A (en) * | 2021-06-30 | 2021-10-08 | 南京壹进制信息科技有限公司 | Method for agent-free live migration of virtual machine to Openstack |
CN113326105B (en) * | 2021-08-04 | 2021-11-05 | 深圳市科力锐科技有限公司 | Hardware equipment configuration method, device and equipment based on host migration |
CN116301593B (en) * | 2023-02-09 | 2024-02-02 | 安超云软件有限公司 | Method and application for cross-cluster and cross-storage copy block data under cloud platform |
CN117290059B (en) * | 2023-11-27 | 2024-03-15 | 四川中电启明星信息技术有限公司 | Cross-chip architecture linux virtual machine transfer method and system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103312729A (en) * | 2012-03-07 | 2013-09-18 | 上海聚耘信息科技有限公司 | Method for realizing virtual machine cloud sharing and cross-platform migration |
WO2018201461A1 (en) * | 2017-05-05 | 2018-11-08 | 华为技术有限公司 | Method and device for migrating virtual machine and virtualization system |
CN110737512A (en) * | 2019-10-25 | 2020-01-31 | 北京浪潮数据技术有限公司 | Cross-platform virtual machine online migration method and related components |
-
2020
- 2020-08-24 CN CN202010854701.7A patent/CN112068930B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103312729A (en) * | 2012-03-07 | 2013-09-18 | 上海聚耘信息科技有限公司 | Method for realizing virtual machine cloud sharing and cross-platform migration |
WO2018201461A1 (en) * | 2017-05-05 | 2018-11-08 | 华为技术有限公司 | Method and device for migrating virtual machine and virtualization system |
CN110737512A (en) * | 2019-10-25 | 2020-01-31 | 北京浪潮数据技术有限公司 | Cross-platform virtual machine online migration method and related components |
Also Published As
Publication number | Publication date |
---|---|
CN112068930A (en) | 2020-12-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112068930B (en) | Method for migrating virtual machine across platforms | |
US9575991B2 (en) | Enabling coarse-grained volume snapshots for virtual machine backup and restore | |
CN102594849B (en) | Data backup and recovery method and device, virtual machine snapshot deleting and rollback method and device | |
US10114706B1 (en) | Backup and recovery of raw disks [RDM] in virtual environment using snapshot technology | |
US10853189B2 (en) | Image restore from incremental backup | |
JP6132323B2 (en) | Live migration protocol and cluster server failover protocol | |
WO2018177107A1 (en) | Data migration method, migration server, and storage medium | |
US20140059539A1 (en) | Virtual machine migration | |
MX2008014244A (en) | Stack signaling to application lack of requested bandwidth. | |
CN110737512A (en) | Cross-platform virtual machine online migration method and related components | |
US20140109095A1 (en) | Seamless extension of local computing power | |
US10725980B2 (en) | Highly available cluster agent for backup and restore operations | |
CN111651305A (en) | Virtual machine backup method, virtual machine backup assembly and cloud computing system | |
US11307934B1 (en) | Virtual backup and restore of virtual machines | |
CN111045781B (en) | Method, device and storage medium for creating mirror image by cloud platform | |
CN111679889A (en) | Virtual machine conversion migration method and system | |
CN110837441A (en) | KVM virtual machine backup method based on dirty data bitmap and network block equipment | |
CN114691290A (en) | Cross-cloud-platform application migration system and method and disaster recovery method | |
CN107402839B (en) | Method and system for backing up data | |
US9485308B2 (en) | Zero copy volume reconstruction | |
CN109344001B (en) | Concurrent backup method and system for virtual machine files | |
US10592133B1 (en) | Managing raw device mapping during disaster recovery | |
US12026062B2 (en) | Provider-agnostic management of backup data stored on a cloud-based object storage | |
CN110837442B (en) | KVM virtual machine backup system based on dirty data bitmap and network block equipment | |
CN112527325A (en) | Deployment method and system applied to super-fusion architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |