CN111352700A - Method, system, terminal and storage medium for online migration of virtual machine across clouds - Google Patents
Method, system, terminal and storage medium for online migration of virtual machine across clouds Download PDFInfo
- Publication number
- CN111352700A CN111352700A CN202010132379.7A CN202010132379A CN111352700A CN 111352700 A CN111352700 A CN 111352700A CN 202010132379 A CN202010132379 A CN 202010132379A CN 111352700 A CN111352700 A CN 111352700A
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- target
- source
- source virtual
- snapshot
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000013508 migration Methods 0.000 title claims abstract description 29
- 230000005012 migration Effects 0.000 title claims abstract description 29
- 238000012544 monitoring process Methods 0.000 claims abstract description 19
- 238000012986 modification Methods 0.000 claims description 9
- 230000004048 modification Effects 0.000 claims description 9
- 238000012360 testing method Methods 0.000 claims description 9
- 230000006870 function Effects 0.000 claims description 8
- 238000006243 chemical reaction Methods 0.000 claims description 7
- 230000008859 change Effects 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 3
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 210000004907 gland Anatomy 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000005192 partition Methods 0.000 description 3
- 238000006467 substitution reaction Methods 0.000 description 3
- 239000003795 chemical substances by application Substances 0.000 description 2
- 239000000725 suspension Substances 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 239000004380 Cholic acid Substances 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000009545 invasion Effects 0.000 description 1
- 239000002071 nanotube Substances 0.000 description 1
- 230000003068 static effect Effects 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
-
- 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/45583—Memory management, e.g. access or allocation
-
- 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/45591—Monitoring or debugging support
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a method, a system, a terminal and a storage medium for online migration of a virtual machine across clouds, which comprise the following steps: collecting a full snapshot of a source virtual machine, and converting the full snapshot into a target cloud system support format in an intermediate virtual machine by creating the intermediate virtual machine which is the same as the source virtual machine; creating a target virtual machine according to the full snapshot of the target cloud system support format; acquiring a modified file block generated by the source virtual machine after the full snapshot in real time; creating a volume for the target virtual machine on a virtual machine storage management platform, and writing the modified file block into the volume; and monitoring the number of modified file blocks generated by the source virtual machine in the latest monitoring period, and switching the service of the source virtual machine to the target virtual machine if the number of the modified file blocks is lower than a preset threshold value. The invention can realize the online cross-cloud migration of the virtual machine, ensures that the service of the virtual machine is not interrupted, and improves the migration timeliness and convenience.
Description
Technical Field
The invention relates to the technical field of virtual machines, in particular to a method, a system, a terminal and a storage medium for cross-cloud online migration of a virtual machine.
Background
Currently, the method for migrating a virtual machine from VMware to OpenStack in the industry is generally offline migration for the reason of involving disk format conversion, and is generally implemented in the following two ways: (1) manually downloading a disk file of a virtual machine of VMware vSphere, converting the VMDK file into a disk file in a QCOW2 format by using a qemu-img tool, uploading the disk file to an image library of OpenStack, and then creating a new virtual machine by specifying the image in the OpenStack; (2) the method is realized by adopting a virt-v2v tool developed by Redhat company, which is a script written by perl language, and can automatically copy the virtual machine created on VMware vSphere to a host of an OpenStack platform, but before copying, the virtual machine needs to be shut down.
On-line migration in the industry generally requires an agent program to be installed inside Guest OS of the virtual machine, and copying of file system and business application data from the operating system level. The existing products realize the nanotube management of VMware clusters and OpenStack clusters, realize the online migration of virtual machines in a single OpenStack cluster or a VMware cluster, and cannot realize the online migration of virtual machines from VMware to OpenStack, which are cross virtualization platforms.
Disclosure of Invention
In view of the above disadvantages in the prior art, the present invention provides a method, a system, a terminal, and a storage medium for online migration of a virtual machine across clouds, so as to solve the above technical problems.
In a first aspect, the present invention provides a method for online migration of a virtual machine across clouds, including:
collecting a full snapshot of a source virtual machine, and converting the full snapshot into a target cloud system support format in an intermediate virtual machine by creating the intermediate virtual machine which is the same as the source virtual machine;
creating a target virtual machine according to the full snapshot of the target cloud system support format;
acquiring a modified file block generated by the source virtual machine after the full snapshot in real time;
creating a volume for the target virtual machine on a virtual machine storage management platform, and writing the modified file block into the volume;
and monitoring the number of modified file blocks generated by the source virtual machine in the latest monitoring period, and switching the service of the source virtual machine to the target virtual machine if the number of the modified file blocks is lower than a preset threshold value.
Further, the collecting the full snapshot of the source virtual machine includes:
starting virtualization service of a source virtual machine;
and acquiring the full snapshot information of the source virtual machine by using the virtual machine client side proxy interface, wherein the full snapshot information comprises disk information and memory information.
Further, the converting the full snapshot into the target cloud system support format in the intermediate virtual machine by creating the intermediate virtual machine same as the source virtual machine includes
Establishing connection between a physical machine where the source virtual machine is located and the temporary storage;
creating an intermediate virtual machine according to the full snapshot of the source virtual machine in the temporary storage;
converting the intermediate virtual machine into a mirror image format supported by a target cloud system;
and configuring the temporary storage to the mirror image management service platform and importing the mirror image supported by the destination cloud system into the mirror image management service platform.
Further, the creating the destination virtual machine according to the full snapshot of the destination cloud system support format includes:
acquiring a full snapshot of a pre-uploaded target cloud system support format from a mirror image management service platform;
calling a virtual machine creation setting interface to create a target virtual machine according to the full snapshot of the target cloud system support format;
setting a network of a target virtual machine and a source virtual machine to be in the same network segment;
and allocating an IP address different from that of the source virtual machine to the destination virtual machine.
Further, the switching the service of the source virtual machine to the destination virtual machine if the number of the modified file blocks is lower than a preset threshold includes:
setting a modified file block quantity threshold;
if the number of the modified file blocks generated in the latest monitoring period is lower than the threshold value, calling a virtual machine creation setting interface to change the IP address of the target virtual machine into the IP address of the source virtual machine;
testing whether the IP address of the changed target virtual machine is available:
if yes, calling a virtual machine closing function of the virtualization interface to stop the source virtual machine and start the service of the target virtual machine.
In a second aspect, the present invention provides a system for online migration of virtual machines across clouds, including:
the system comprises a snapshot acquisition unit, a data processing unit and a data processing unit, wherein the snapshot acquisition unit is configured to acquire a full snapshot of a source virtual machine and convert the full snapshot into a target cloud system support format in an intermediate virtual machine by creating the intermediate virtual machine which is the same as the source virtual machine;
the target creating unit is configured to create a target virtual machine according to the full snapshot of the target cloud system support format;
the modification acquisition unit is configured to acquire a modification file block generated by the source virtual machine after the full snapshot in real time;
the data synchronization unit is configured to create a volume on a virtual machine storage management platform for the destination virtual machine, and write the modified file block into the volume;
and the service switching unit is configured to monitor the number of modified file blocks generated by the source virtual machine in the latest monitoring period, and switch the service of the source virtual machine to the destination virtual machine if the number of the modified file blocks is lower than a preset threshold value.
Further, the snapshot collecting unit includes:
the connection establishing module is configured to establish connection between a physical machine where the source virtual machine is located and the temporary storage;
the intermediate creation module is configured to create an intermediate virtual machine according to the full snapshot of the source virtual machine in the temporary storage;
the format conversion module is configured for converting the intermediate virtual machine into a mirror image format supported by the target cloud system;
and the snapshot uploading module is configured for configuring the temporary storage to the mirror image management service platform and importing the mirror image supported by the target cloud system into the mirror image management service platform.
Further, the service switching unit includes:
the threshold value setting module is configured for setting a modified file block quantity threshold value;
the IP changing module is configured to call a virtual machine creation setting interface to change the IP address of the destination virtual machine into the IP address of the source virtual machine if the number of the modified file blocks generated in the latest monitoring period is lower than the threshold value;
the IP testing module is configured for testing whether the IP address of the changed target virtual machine is available;
and the service switching module is configured to call a virtual machine closing function of the virtualization interface to stop the source virtual machine and start the service of the target virtual machine if the IP address of the modified target virtual machine is available.
In a third aspect, a terminal is provided, including:
a processor, a memory, wherein,
the memory is used for storing a computer program which,
the processor is used for calling and running the computer program from the memory so as to make the terminal execute the method of the terminal.
In a fourth aspect, a computer storage medium is provided having stored therein instructions that, when executed on a computer, cause the computer to perform the method of the above aspects.
The beneficial effect of the invention is that,
according to the cross-cloud online migration method, system, terminal and storage medium of the virtual machine, the full-amount snapshot is converted into the target cloud system supporting format in the intermediate virtual machine by creating the intermediate virtual machine which is the same as the source virtual machine, online format conversion of the virtual machine snapshot is achieved, meanwhile, after the target virtual machine is created in a cross-cloud mode, the modified file block of the source virtual machine is led into the volume of the target virtual machine on the virtual machine storage management platform in real time, data synchronization of the target virtual machine and the source virtual machine is achieved, the service of the source virtual machine is switched to the target virtual machine until the data difference between the target virtual machine and the source virtual machine is not large, the service of the virtual machine does not need to be stopped in the whole process, and online cross-cloud migration of the virtual machine is achieved. The invention can realize the online cross-cloud migration of the virtual machine, ensures that the service of the virtual machine is not interrupted, and improves the migration timeliness and convenience.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention.
FIG. 2 is a schematic block diagram of a system of one embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following explains key terms appearing in the present invention.
Glance is a service that provides mirroring for the creation of virtual machines, i.e., a mirror database.
And the openstack shader virtual machine stores the management platform.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention. The execution subject in fig. 1 may be a virtual machine cross-cloud online migration system.
As shown in fig. 1, the method 100 includes:
In order to facilitate understanding of the present invention, the principle of the virtual machine cross-cloud online migration method of the present invention is combined with the process of performing cross-cloud online migration on a virtual machine in the embodiment, and the virtual machine cross-cloud online migration method provided by the present invention is further described below.
Specifically, the method for online migration of the virtual machine across clouds includes:
s1, collecting the full snapshot of the source virtual machine, and converting the full snapshot into a target cloud system support format in an intermediate virtual machine by creating the intermediate virtual machine which is the same as the source virtual machine.
And the source virtual machine starts the vsphere CBT, and the disk interface uses virto or IDE. Calling the vSphere SDK API to create a Snapshot (full Snapshot) for the source virtual machine, wherein the Snapshot comprises disk information and memory information of the source virtual machine. And saving the created full snapshot to the disk of the source virtual machine. In the embodiment, a silent snapshot mode, namely a file system consistency snapshot, is adopted for collecting the full snapshot, so that the data in the OS cache can be landed after the snapshot is taken. The silent snapshot mode allows the file system of the source virtual machine to suspend reading and writing of the disk instantaneously, and data in the cache of the operating system is copied into the hard disk during the instantaneous suspension time, but the suspension time of the virtual machine in this mode depends on the data volume in the cache of the OS and the write performance of the disk of the virtual machine and the storage of the disk.
The format conversion method comprises the following steps:
and connecting the host where the source virtual machine is located with the temporary storage. And creating an intermediate virtual machine in the temporary storage according to the full snapshot of the source virtual machine. The intermediate virtual machine is converted into an Image of qcow2 or raw, the temporary storage is configured in the gland (the gland is a service for providing the Image for the creation of the virtual machine), and the Image converted by the intermediate virtual machine is imported into the gland as the temporary storage of the gland. The mirror Image can be used for creating a destination virtual machine, and after the creation of the destination virtual machine is completed, the Image mirror Image imported in the angle (mirror Image management service platform) is cleared, the relation between the angle (mirror Image management service platform) and the temporary storage is released, meanwhile, the intermediate virtual machine is cleared, and the relation between the host and the temporary storage is released.
And S2, creating the destination virtual machine according to the full snapshot of the supported format of the destination cloud system.
And acquiring the uploaded Image mirror Image from the angle (mirror Image management service platform), and calling a virtual machine creation setting interface (OpenStack REST API) to create a target virtual machine according to the Image mirror Image. And setting a network of the destination virtual machine and the source virtual machine in the same network segment, and allocating an IP address different from that of the source virtual machine to the destination virtual machine. When the target virtual machine is created, the following interface types are uniformly converted: the disk interface is designated as a hard disk in an IDE interface format, and the network card interface is designated as an Intel E1000 type network card.
And S3, acquiring the modified file blocks generated by the source virtual machine after the full snapshot in real time.
The VMware provides a convenient data Block modification Tracking (CBT) technology, provides a foundation for incremental backup of the virtual machine, and except for the first backup, the whole VM data needs to be completely backed up and transmitted, the subsequent backup only needs to acquire which abnormal blocks by inquiring CBT records, and then only the abnormal blocks are backed up, so that the time for scanning a disk and judging the abnormal blocks is saved, and the data volume needing to be transmitted is also greatly reduced.
Therefore, after the full snapshots of the source virtual machine are collected, the CBT is used for collecting the modified file blocks of the source virtual machine in real time, and the modified file blocks are saved as incremental backups.
And S4, creating a volume for the destination virtual machine in the virtual machine storage management platform, and writing the modified file block into the volume.
Calling a virtual machine creation setting interface (OpenStack REST API) to create an empty volume in an OpenStack folder (virtual machine folder architecture management platform, virtual machine management platform), wherein the size of the empty volume should be larger than the size of a source virtual machine disk, and mounting the volume to a target virtual machine.
Calling a Virtual Disk Library API in the vsphere VDDK to read the incremental backup in the Disk file of the source Virtual machine, and writing the incremental backup into the volume of the destination Virtual machine in time. Reading the disk data of the source virtual machine under the condition of no agent, and reading the disk data of the virtual machine without the agent, namely without installing an agent program in the source virtual machine, thereby ensuring zero invasion to a source environment. And directly reading the disk data of the virtual machine from the storage layer, wherein the disk data comprises a partition format, the size of each partition and the data in the partition. The VMware vSphere provides a VDDK SDK development kit, and data of each disk of the vSphere virtual machine located on the Datastore can be read through interface call provided by VDDK.
S5, monitoring the number of modified file blocks generated by the source virtual machine in the latest monitoring period, and switching the service of the source virtual machine to the target virtual machine if the number of the modified file blocks is lower than a preset threshold value.
In this embodiment, the monitoring period is set to 15min, the data amount of the incremental backup of the source virtual machine within 15min is monitored, whether the data amount exceeds a preset data amount threshold is determined, and if the incremental backup file does not change or changes within the threshold range within 15min, it is indicated that the data of the target virtual machine and the data of the source virtual machine are substantially synchronized.
After the data of the target virtual machine and the data of the source virtual machine are basically synchronized, the network card of the source virtual machine is down, and the service is temporarily stopped. Calling a virtual machine creation setting interface (OpenStack REST API), changing the IP address of the network card of the target virtual machine into the IP address of the source virtual machine, and testing whether the new IP address of the target virtual machine is available. If the target virtual machine is available, calling a function of closing the virtual machine in a virtualization interface (vShperse API), stopping the source virtual machine, and enabling the target virtual machine to start providing services. The embodiment ensures that the IP address and the network segment MAC are unchanged after the virtual machine is migrated.
As shown in fig. 2, the system 200 includes:
the snapshot collecting unit 210 is configured to collect a full snapshot of a source virtual machine, and convert the full snapshot into a target cloud system support format in an intermediate virtual machine by creating the intermediate virtual machine that is the same as the source virtual machine;
a target creation unit 220 configured to create a destination virtual machine according to the full snapshot of the destination cloud system support format;
a modification collecting unit 230 configured to collect, in real time, modified file blocks generated by the source virtual machine after the full snapshot;
a data synchronization unit 240 configured to create a volume on a virtual machine storage management platform for the destination virtual machine, and write the modified file block into the volume;
and a service switching unit 250 configured to monitor the number of modified file blocks generated by the source virtual machine in the latest monitoring period, and switch the service of the source virtual machine to the destination virtual machine if the number of modified file blocks is lower than a preset threshold.
Optionally, as an embodiment of the present invention, the snapshot collecting unit includes:
the connection establishing module is configured to establish connection between a physical machine where the source virtual machine is located and the temporary storage;
the intermediate creation module is configured to create an intermediate virtual machine according to the full snapshot of the source virtual machine in the temporary storage;
the format conversion module is configured for converting the intermediate virtual machine into a mirror image format supported by the target cloud system;
and the snapshot uploading module is configured for configuring the temporary storage to the mirror image management service platform and importing the mirror image supported by the target cloud system into the mirror image management service platform.
Optionally, as an embodiment of the present invention, the service switching unit includes:
the threshold value setting module is configured for setting a modified file block quantity threshold value;
the IP changing module is configured to call a virtual machine creation setting interface to change the IP address of the destination virtual machine into the IP address of the source virtual machine if the number of the modified file blocks generated in the latest monitoring period is lower than the threshold value;
the IP testing module is configured for testing whether the IP address of the changed target virtual machine is available;
and the service switching module is configured to call a virtual machine closing function of the virtualization interface to stop the source virtual machine and start the service of the target virtual machine if the IP address of the modified target virtual machine is available.
Fig. 3 is a schematic structural diagram of a terminal system 300 according to an embodiment of the present invention, where the terminal system 300 may be used to execute the method for online migration of a virtual machine across clouds according to the embodiment of the present invention.
The terminal system 300 may include: a processor 310, a memory 320, and a communication unit 330. The components communicate via one or more buses, and those skilled in the art will appreciate that the architecture of the servers shown in the figures is not intended to be limiting, and may be a bus architecture, a star architecture, a combination of more or less components than those shown, or a different arrangement of components.
The memory 320 may be used for storing instructions executed by the processor 310, and the memory 320 may be implemented by any type of volatile or non-volatile storage terminal or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The executable instructions in memory 320, when executed by processor 310, enable terminal 300 to perform some or all of the steps in the method embodiments described below.
The processor 310 is a control center of the storage terminal, connects various parts of the entire electronic terminal using various interfaces and lines, and performs various functions of the electronic terminal and/or processes data by operating or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory. The processor may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor 310 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
A communication unit 330, configured to establish a communication channel so that the storage terminal can communicate with other terminals. And receiving user data sent by other terminals or sending the user data to other terminals.
The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Therefore, the invention realizes the online format conversion of the virtual machine snapshot by creating the intermediate virtual machine which is the same as the source virtual machine and converting the full snapshot into the target cloud system support format in the intermediate virtual machine, and simultaneously realizes the data synchronization of the target virtual machine and the virtual machine by importing the modification file block of the source virtual machine into the volume of the target virtual machine on the virtual machine storage management platform in real time after the target virtual machine is created in a cross-cloud manner until the difference between the data of the target virtual machine and the data of the target virtual machine is not large and then the service of the source virtual machine is switched to the target virtual machine, so that the service of the virtual machine does not need to be stopped in the whole process, and the online cross-cloud migration of the virtual machine is realized. According to the invention, online cross-cloud migration of the virtual machine can be realized, the service of the virtual machine migration is ensured not to be interrupted, and the migration timeliness and convenience are improved.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in the form of a software product, where the computer software product is stored in a storage medium, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like, and the storage medium can store program codes, and includes instructions for enabling a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, and the like) to perform all or part of the steps of the method in the embodiments of the present invention.
The same and similar parts in the various embodiments in this specification may be referred to each other. Especially, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the description in the method embodiment.
In the embodiments provided in the present invention, it should be understood that the disclosed system and method can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, systems or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
Although the present invention has been described in detail by referring to the drawings in connection with the preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A method for online migration of a virtual machine across clouds is characterized by comprising the following steps:
collecting a full snapshot of a source virtual machine, and converting the full snapshot into a target cloud system support format in an intermediate virtual machine by creating the intermediate virtual machine which is the same as the source virtual machine;
creating a target virtual machine according to the full snapshot of the target cloud system support format;
acquiring a modified file block generated by the source virtual machine after the full snapshot in real time;
creating a volume for the target virtual machine on a virtual machine storage management platform, and writing the modified file block into the volume;
and monitoring the number of modified file blocks generated by the source virtual machine in the latest monitoring period, and switching the service of the source virtual machine to the target virtual machine if the number of the modified file blocks is lower than a preset threshold value.
2. The method of claim 1, wherein collecting the full snapshot of the source virtual machine comprises:
starting virtualization service of a source virtual machine;
and acquiring the full snapshot information of the source virtual machine by using the virtual machine client side proxy interface, wherein the full snapshot information comprises disk information and memory information.
3. The method of claim 1, wherein the converting the full-scale snapshot into a destination cloud system support format in an intermediate virtual machine by creating the same intermediate virtual machine as a source virtual machine comprises
Establishing connection between a physical machine where the source virtual machine is located and the temporary storage;
creating an intermediate virtual machine according to the full snapshot of the source virtual machine in the temporary storage;
converting the intermediate virtual machine into a mirror image format supported by a target cloud system;
and configuring the temporary storage to the mirror image management service platform and importing the mirror image supported by the destination cloud system into the mirror image management service platform.
4. The method of claim 1, wherein creating the destination virtual machine from the full snapshot of the destination cloud system support format comprises:
acquiring a full snapshot of a pre-uploaded target cloud system support format from a mirror image management service platform;
calling a virtual machine creation setting interface to create a target virtual machine according to the full snapshot of the target cloud system support format;
setting a network of a target virtual machine and a source virtual machine to be in the same network segment;
and allocating an IP address different from that of the source virtual machine to the destination virtual machine.
5. The method according to claim 1, wherein switching traffic of a source virtual machine to the destination virtual machine if the number of modified file blocks is lower than a preset threshold comprises:
setting a modified file block quantity threshold;
if the number of the modified file blocks generated in the latest monitoring period is lower than the threshold value, calling a virtual machine creation setting interface to change the IP address of the target virtual machine into the IP address of the source virtual machine;
testing whether the IP address of the changed target virtual machine is available:
if yes, calling a virtual machine closing function of the virtualization interface to stop the source virtual machine and start the service of the target virtual machine.
6. A virtual machine cross-cloud online migration system, comprising:
the system comprises a snapshot acquisition unit, a data processing unit and a data processing unit, wherein the snapshot acquisition unit is configured to acquire a full snapshot of a source virtual machine and convert the full snapshot into a target cloud system support format in an intermediate virtual machine by creating the intermediate virtual machine which is the same as the source virtual machine;
the target creating unit is configured to create a target virtual machine according to the full snapshot of the target cloud system support format;
the modification acquisition unit is configured to acquire a modification file block generated by the source virtual machine after the full snapshot in real time;
the data synchronization unit is configured to create a volume on a virtual machine storage management platform for the destination virtual machine, and write the modified file block into the volume;
and the service switching unit is configured to monitor the number of modified file blocks generated by the source virtual machine in the latest monitoring period, and switch the service of the source virtual machine to the destination virtual machine if the number of the modified file blocks is lower than a preset threshold value.
7. The system of claim 6, wherein the snapshot collection unit comprises:
the connection establishing module is configured to establish connection between a physical machine where the source virtual machine is located and the temporary storage;
the intermediate creation module is configured to create an intermediate virtual machine according to the full snapshot of the source virtual machine in the temporary storage;
the format conversion module is configured for converting the intermediate virtual machine into a mirror image format supported by the target cloud system;
and the snapshot uploading module is configured for configuring the temporary storage to the mirror image management service platform and importing the mirror image supported by the target cloud system into the mirror image management service platform.
8. The system of claim 6, wherein the service switching unit comprises:
the threshold value setting module is configured for setting a modified file block quantity threshold value;
the IP changing module is configured to call a virtual machine creation setting interface to change the IP address of the destination virtual machine into the IP address of the source virtual machine if the number of the modified file blocks generated in the latest monitoring period is lower than the threshold value;
the IP testing module is configured for testing whether the IP address of the changed target virtual machine is available;
and the service switching module is configured to call a virtual machine closing function of the virtualization interface to stop the source virtual machine and start the service of the target virtual machine if the IP address of the modified target virtual machine is available.
9. A terminal, comprising:
a processor;
a memory for storing instructions for execution by the processor;
wherein the processor is configured to perform the method of any one of claims 1-5.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010132379.7A CN111352700A (en) | 2020-02-29 | 2020-02-29 | Method, system, terminal and storage medium for online migration of virtual machine across clouds |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010132379.7A CN111352700A (en) | 2020-02-29 | 2020-02-29 | Method, system, terminal and storage medium for online migration of virtual machine across clouds |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111352700A true CN111352700A (en) | 2020-06-30 |
Family
ID=71195855
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010132379.7A Withdrawn CN111352700A (en) | 2020-02-29 | 2020-02-29 | Method, system, terminal and storage medium for online migration of virtual machine across clouds |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111352700A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111797059A (en) * | 2020-07-07 | 2020-10-20 | 优刻得科技股份有限公司 | Method for online cloud host migration across clouds, migration controller and cloud server |
CN111966449A (en) * | 2020-07-17 | 2020-11-20 | 苏州浪潮智能科技有限公司 | Virtual machine backup management method, system, terminal and storage medium |
CN112214357A (en) * | 2020-10-30 | 2021-01-12 | 上海爱数信息技术股份有限公司 | HDFS data backup and recovery system and backup and recovery method |
CN112527452A (en) * | 2020-12-03 | 2021-03-19 | 北京浪潮数据技术有限公司 | Virtual machine migration method, device and medium across OpenStack |
CN113296716A (en) * | 2021-07-09 | 2021-08-24 | 云宏信息科技股份有限公司 | Virtual machine disk online migration method, computer readable storage medium and computer |
CN113760454A (en) * | 2021-08-13 | 2021-12-07 | 济南浪潮数据技术有限公司 | Method, system, equipment and storage medium for migrating virtual machine across cloud platforms |
CN113821307A (en) * | 2021-09-24 | 2021-12-21 | 济南浪潮数据技术有限公司 | Method, device and equipment for quickly importing virtual machine mirror image |
-
2020
- 2020-02-29 CN CN202010132379.7A patent/CN111352700A/en not_active Withdrawn
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111797059A (en) * | 2020-07-07 | 2020-10-20 | 优刻得科技股份有限公司 | Method for online cloud host migration across clouds, migration controller and cloud server |
CN111966449A (en) * | 2020-07-17 | 2020-11-20 | 苏州浪潮智能科技有限公司 | Virtual machine backup management method, system, terminal and storage medium |
CN111966449B (en) * | 2020-07-17 | 2022-05-31 | 苏州浪潮智能科技有限公司 | Virtual machine backup management method, system, terminal and storage medium |
CN112214357A (en) * | 2020-10-30 | 2021-01-12 | 上海爱数信息技术股份有限公司 | HDFS data backup and recovery system and backup and recovery method |
CN112214357B (en) * | 2020-10-30 | 2022-12-30 | 上海爱数信息技术股份有限公司 | HDFS data backup and recovery system and backup and recovery method |
CN112527452A (en) * | 2020-12-03 | 2021-03-19 | 北京浪潮数据技术有限公司 | Virtual machine migration method, device and medium across OpenStack |
CN113296716A (en) * | 2021-07-09 | 2021-08-24 | 云宏信息科技股份有限公司 | Virtual machine disk online migration method, computer readable storage medium and computer |
CN113760454A (en) * | 2021-08-13 | 2021-12-07 | 济南浪潮数据技术有限公司 | Method, system, equipment and storage medium for migrating virtual machine across cloud platforms |
CN113821307A (en) * | 2021-09-24 | 2021-12-21 | 济南浪潮数据技术有限公司 | Method, device and equipment for quickly importing virtual machine mirror image |
CN113821307B (en) * | 2021-09-24 | 2024-02-23 | 济南浪潮数据技术有限公司 | Method, device and equipment for quickly importing virtual machine images |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111352700A (en) | Method, system, terminal and storage medium for online migration of virtual machine across clouds | |
CN109558215B (en) | Backup method, recovery method and device of virtual machine and backup server cluster | |
CN111124277B (en) | Deep learning data set caching method, system, terminal and storage medium | |
CN109189546B (en) | Method and device for making online snapshot of virtual machine | |
CN107209705B (en) | Activity rollback for a computing environment | |
CN109168328B (en) | Virtual machine migration method and device and virtualization system | |
CN111669284B (en) | OpenStack automatic deployment method, electronic device, storage medium and system | |
CN104216793A (en) | Application program backing up and restoring method and device | |
CN110737512A (en) | Cross-platform virtual machine online migration method and related components | |
US10255124B1 (en) | Determining abnormal conditions of host state from log files through Markov modeling | |
US11947425B2 (en) | Storage volume snapshot object management | |
JP2021515304A (en) | Methods, computer programs, and equipment for post-failure recovery using checkpoints in key-value stores in a time-series log structure in the system. | |
US11263069B1 (en) | Using unsupervised learning to monitor changes in fleet behavior | |
CN108459960A (en) | Method of automatic configuration, device, equipment and the storage medium of test environment | |
CN114443294A (en) | Big data service component deployment method, system, terminal and storage medium | |
CN111857944A (en) | Method, device, system and computer readable storage medium for virtual machine live migration | |
CN113127258A (en) | Data backup method, device, equipment and medium | |
CN115277398A (en) | Cluster network configuration method and device | |
CN110647289A (en) | Satellite remote sensing cloud computing platform and system | |
CN108984356A (en) | A kind of IT product test method and device | |
US11314605B2 (en) | Selecting optimal disk types for disaster recovery in the cloud | |
CN114217999A (en) | Cloud desktop system and method | |
CN110674006A (en) | Method, system, terminal and storage medium for accurately acquiring resource utilization rate of KVM (keyboard, video and mouse) virtual machine | |
CN113760446A (en) | Resource scheduling method, device, equipment and medium | |
CN112685130A (en) | Virtual machine backup method and device in distributed storage environment and storage medium |
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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20200630 |