CN107704311A - A kind of virutal machine memory moving method and its device - Google Patents

A kind of virutal machine memory moving method and its device Download PDF

Info

Publication number
CN107704311A
CN107704311A CN201710892864.2A CN201710892864A CN107704311A CN 107704311 A CN107704311 A CN 107704311A CN 201710892864 A CN201710892864 A CN 201710892864A CN 107704311 A CN107704311 A CN 107704311A
Authority
CN
China
Prior art keywords
data
physical machine
compressed data
target physical
sending
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.)
Pending
Application number
CN201710892864.2A
Other languages
Chinese (zh)
Inventor
曾鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710892864.2A priority Critical patent/CN107704311A/en
Publication of CN107704311A publication Critical patent/CN107704311A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution 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)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses a kind of virutal machine memory moving method and its device.This method, including:By obtaining first data of the virtual machine in source physical machine memory storage;First data are subjected to multithreading compression, obtain first compressed data;First compressed data is subjected to multithreading transmission to target physical machine.Realize and transmit the first data to target physical machine simultaneously on multiple threads, the time of internal memory migration is carried out so as to save virtual machine from source physical machine to target physical machine.

Description

Virtual machine memory migration method and device
Technical Field
The present invention relates to computer technologies, and in particular, to a method and an apparatus for migrating a virtual machine memory.
Background
Virtual machine migration refers to migrating a virtual machine from one physical machine to another physical machine for running, wherein migration of the virtual machine between different physical machines is divided into two types: offline migration and online migration.
In the prior art of online migration, based on memory migration of a virtual machine, firstly, all memory pages of the virtual machine are marked as "dirty pages", and then, memory migration is performed through a multi-round memory iterative synchronization process. After a plurality of iterations, if the number of the residual dirty pages is less than the preset minimum value or the iteration number is greater than the preset maximum value, the virtual machine stops the iteration and the copying of the residual dirty pages, and the virtual machine is pulled up at the target host to finish the migration.
However, when the memory data is large, a large amount of data needs to be transmitted, which results in a long migration time of the virtual machine.
Disclosure of Invention
In order to solve the above technical problems, the present invention provides a virtual machine memory migration method and device thereof, which are used to solve the problem of low efficiency of data acquisition.
In order to achieve the object of the present invention, the present invention provides a virtual machine memory migration method, including:
acquiring first data stored in a memory of a source physical machine by a virtual machine;
performing multi-thread compression on the first data to obtain first compressed data;
and sending the first compressed data to a target physical machine in a multi-thread mode.
Further, after the multi-threaded sending of the first compressed data to the target physical machine, the method further includes:
performing multi-thread compression on second data to obtain the second compressed data;
verifying the second compressed data and the first compressed data, and determining verified difference data;
and sending the difference data to the target physical machine in a multi-thread mode.
Further, after the multi-threaded sending of the first compressed data to the target physical machine, the method further includes:
and storing the first compressed data into a cache space, wherein the cache space comprises a space set in the source physical machine.
Further, the method also comprises the following steps:
setting the level and the number of multithread compression; or
And setting the level and the number of multithreading decompression, wherein the multithreading decompression comprises the decompression of the received data by the target physical machine.
Further, after the multi-thread compression is performed on the first data and the first compressed data is obtained, the method further includes:
and sending the first compressed data to a target physical machine is executed through a libvirt migration interface.
The invention provides a virtual machine memory migration device, which comprises:
the acquisition module is used for acquiring first data stored in a memory of a source physical machine by a virtual machine;
the processing module is used for carrying out multi-thread compression on the first data to obtain the first compressed data;
and the sending module is used for sending the first compressed data to a target physical machine in a multi-thread mode.
Further, the processing module is further configured to perform multi-thread compression on second data to obtain the second compressed data; verifying the second compressed data and the first compressed data, and determining verified difference data;
the sending module is further configured to send the difference data to the target physical machine in a multi-thread manner.
Further, the processing module is further configured to store the first compressed data in a cache space, where the cache space includes a space set in the source physical machine.
Furthermore, the processing module is further configured to set a level and a number of the multithread compression; or setting the level and the number of multithreading decompression, wherein the multithreading decompression comprises the decompression of the received data by the target physical machine.
Further, the sending module is configured to execute sending the first compressed data to a target physical machine through a libvirt migration interface.
The invention provides a method and a device for migrating a memory of a virtual machine, which are characterized in that first data stored in the memory of a source physical machine of the virtual machine are obtained; performing multi-thread compression on the first data to obtain first compressed data; and sending the first compressed data to a target physical machine in a multi-thread mode. The first data are transmitted to the target physical machine on the multiple threads simultaneously, and therefore the time for memory migration of the virtual machine from the source physical machine to the target physical machine is saved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
Fig. 1 is a flowchart illustrating a virtual machine memory migration method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a virtual machine memory migration apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The virtual machine memory migration method provided by the embodiment of the invention can be particularly applied to the online migration of the virtual machine memory. The virtual machine memory migration method provided in this embodiment may be executed by a virtual machine memory migration device, where the virtual machine memory migration device may be integrated in a physical machine or separately configured, and the virtual machine memory migration device may be implemented in a software and/or hardware manner. The following describes the virtual machine memory migration method and apparatus provided in this embodiment in detail.
Fig. 1 is a flowchart illustrating a virtual machine memory migration method according to an embodiment of the present invention; as shown in fig. 1, an execution subject of this embodiment may be a virtual machine memory migration apparatus, and the virtual machine memory migration method provided by the present invention includes:
step 101, obtaining first data stored in a memory of a source physical machine by a virtual machine.
The applicable scenarios of this embodiment include: the virtual machine migrates data stored in memory of one physical machine, namely a source physical machine, to another physical machine, namely a target physical machine, and runs, wherein the source physical machine can comprise a host machine in the virtual machine.
And 102, performing multi-thread compression on the first data to obtain the first compressed data.
And 103, carrying out multi-thread transmission on the first compressed data to a target physical machine.
Specifically, the first data can be transmitted to the target physical machine on a plurality of threads simultaneously through multi-thread compression of the first data, so that the time for memory migration from the source physical machine to the target physical machine is saved.
In this embodiment, first data stored in a memory of a source physical machine is obtained; performing multi-thread compression on the first data to obtain first compressed data; and sending the first compressed data to a target physical machine in a multi-thread mode. The first data are transmitted to the target physical machine on the multiple threads simultaneously, and therefore the time for memory migration of the virtual machine from the source physical machine to the target physical machine is saved.
Further, on the basis of the foregoing embodiment, after the multi-thread sending of the first compressed data to the target physical machine, the method further includes:
performing multi-thread compression on second data to obtain the second compressed data;
verifying the second compressed data and the first compressed data, and determining verified difference data;
and sending the difference data to the target physical machine in a multi-thread mode.
In this embodiment, the second data includes data stored in a memory of a source physical machine by a current virtual machine, the first compressed data includes memory data migrated from the source physical machine to a target physical machine by a previous virtual machine, and the second compressed data and the first compressed data are verified to determine verified difference data; on the basis of the previous migration, only the difference data is migrated, so that the migration data volume is saved, and the migration time is saved. Furthermore, the difference data is transmitted in a multi-thread mode, and migration time is further saved.
Preferably, after the multithread sending of the first compressed data to the target physical machine, the method further includes:
and storing the first compressed data into a cache space, wherein the cache space comprises a space set in the source physical machine.
Further, on the basis of the above embodiment, the present embodiment further includes:
setting the level and the number of multithread compression; or
And setting the level and the number of multithreading decompression, wherein the multithreading decompression comprises the decompression of the received data by the target physical machine.
Further, on the basis of the foregoing embodiment, after the performing multi-thread compression on the first data and obtaining the first compressed data, the method further includes:
and sending the first compressed data to a target physical machine is executed through a libvirt migration interface.
FIG. 2 is a schematic structural diagram of a virtual machine memory migration apparatus according to an embodiment of the present invention; as shown in fig. 2, the virtual machine memory migration apparatus provided in the present invention includes: an acquisition module 21, a processing module 22 and a sending module 23. Wherein,
an obtaining module 21, configured to obtain first data stored in a memory of a source physical machine by a virtual machine;
a processing module 22, configured to perform multi-thread compression on the first data to obtain the first compressed data;
and the sending module 23 is configured to send the first compressed data to a target physical machine in a multi-thread manner.
In the embodiment, first data stored in a memory of a source physical machine by a virtual machine is acquired; performing multi-thread compression on the first data to obtain first compressed data; and sending the first compressed data to a target physical machine in a multi-thread mode. The first data are transmitted to the target physical machine on the multiple threads simultaneously, and therefore the time for memory migration of the virtual machine from the source physical machine to the target physical machine is saved.
Further, on the basis of the foregoing embodiment, the processing module 22 is further configured to perform multi-thread compression on second data to obtain the second compressed data; verifying the second compressed data and the first compressed data, and determining verified difference data;
the sending module 23 is further configured to send the difference data to the target physical machine in a multi-thread manner.
Further, on the basis of the foregoing embodiment, the processing module 22 is further configured to store the first compressed data into a cache space, where the cache space includes a space set in the source physical machine.
Further, on the basis of the above embodiment, the processing module 22 is further configured to set a level and a number of multithread compression; or setting the level and the number of multithreading decompression, wherein the multithreading decompression comprises the decompression of the received data by the target physical machine.
Further, on the basis of the foregoing embodiment, the sending module 23 is configured to execute sending the first compressed data to the target physical machine through a libvirt migration interface.
In this embodiment, the second data includes data stored in a memory of a source physical machine by a current virtual machine, the first compressed data includes memory data migrated from the source physical machine to a target physical machine by a previous virtual machine, and the second compressed data and the first compressed data are verified to determine verified difference data; on the basis of the previous migration, only the difference data is migrated, so that the migration data volume is saved, and the migration time is saved. Furthermore, the difference data is transmitted in a multi-thread mode, and migration time is further saved.
Although the embodiments of the present invention have been described above, the above description is only for the convenience of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for migrating a memory of a virtual machine is characterized by comprising the following steps:
acquiring first data stored in a memory of a source physical machine by a virtual machine;
performing multi-thread compression on the first data to obtain first compressed data;
and sending the first compressed data to a target physical machine in a multi-thread mode.
2. The method of claim 1, wherein after the multi-threaded sending of the first compressed data to a target physical machine, further comprising:
performing multi-thread compression on second data to obtain the second compressed data;
verifying the second compressed data and the first compressed data, and determining verified difference data;
and sending the difference data to the target physical machine in a multi-thread mode.
3. The method of claim 2, wherein after the multi-threaded sending of the first compressed data to the target physical machine, further comprising:
and storing the first compressed data into a cache space, wherein the cache space comprises a space set in the source physical machine.
4. The method according to any one of claims 1-3, further comprising:
setting the level and the number of multithread compression; or
And setting the level and the number of multithreading decompression, wherein the multithreading decompression comprises the decompression of the received data by the target physical machine.
5. The method of claim 4, wherein after the multithreading compression of the first data to obtain the first compressed data, further comprising:
and sending the first compressed data to a target physical machine is executed through a libvirt migration interface.
6. A virtual machine memory migration apparatus, comprising:
the acquisition module is used for acquiring first data stored in a memory of a source physical machine by a virtual machine;
the processing module is used for carrying out multi-thread compression on the first data to obtain the first compressed data;
and the sending module is used for sending the first compressed data to a target physical machine in a multi-thread mode.
7. The apparatus of claim 6, wherein the processing module is further configured to perform multi-thread compression on second data to obtain the second compressed data; verifying the second compressed data and the first compressed data, and determining verified difference data;
the sending module is further configured to send the difference data to the target physical machine in a multi-thread manner.
8. The apparatus of claim 7, wherein the processing module is further configured to store the first compressed data in a cache space, and wherein the cache space comprises a space configured in the source physical machine.
9. The apparatus according to any of claims 6-8, wherein the processing module is further configured to set a level and a number of multithread compression; or setting the level and the number of multithreading decompression, wherein the multithreading decompression comprises the decompression of the received data by the target physical machine.
10. The apparatus of claim 9, wherein the sending module is configured to perform the sending the first compressed data to a target physical machine through a libvirt migration interface.
CN201710892864.2A 2017-09-27 2017-09-27 A kind of virutal machine memory moving method and its device Pending CN107704311A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710892864.2A CN107704311A (en) 2017-09-27 2017-09-27 A kind of virutal machine memory moving method and its device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710892864.2A CN107704311A (en) 2017-09-27 2017-09-27 A kind of virutal machine memory moving method and its device

Publications (1)

Publication Number Publication Date
CN107704311A true CN107704311A (en) 2018-02-16

Family

ID=61176200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710892864.2A Pending CN107704311A (en) 2017-09-27 2017-09-27 A kind of virutal machine memory moving method and its device

Country Status (1)

Country Link
CN (1) CN107704311A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081552A (en) * 2009-12-01 2011-06-01 华为技术有限公司 Method, device and system for transferring from physical machine to virtual machine on line
CN103353850A (en) * 2013-06-13 2013-10-16 华为技术有限公司 Virtual machine thermal migration memory processing method, device and system
US9183015B2 (en) * 2011-12-19 2015-11-10 Vmware, Inc. Hibernate mechanism for virtualized java virtual machines
CN105138394A (en) * 2015-09-21 2015-12-09 上海爱数软件有限公司 Method for thermally migrating K virtual machine (KVM) and system
CN105404521A (en) * 2014-05-30 2016-03-16 广州市动景计算机科技有限公司 Incremental upgrading method and relevant device
CN105446790A (en) * 2014-07-15 2016-03-30 华为技术有限公司 Virtual machine migration method and device
CN105893114A (en) * 2016-04-05 2016-08-24 浪潮电子信息产业股份有限公司 Virtual machine migration method, target host machine and source host machine
CN106227580A (en) * 2016-07-18 2016-12-14 浪潮(北京)电子信息产业有限公司 The dynamic migration method of a kind of virtual machine and system
CN106528330A (en) * 2016-10-29 2017-03-22 华为技术有限公司 Data backup method, node and data backup system
CN106874403A (en) * 2017-01-18 2017-06-20 武汉天喻教育科技有限公司 The system and method for differential synchronization is carried out to compressed file

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102081552A (en) * 2009-12-01 2011-06-01 华为技术有限公司 Method, device and system for transferring from physical machine to virtual machine on line
US9183015B2 (en) * 2011-12-19 2015-11-10 Vmware, Inc. Hibernate mechanism for virtualized java virtual machines
CN103353850A (en) * 2013-06-13 2013-10-16 华为技术有限公司 Virtual machine thermal migration memory processing method, device and system
CN105404521A (en) * 2014-05-30 2016-03-16 广州市动景计算机科技有限公司 Incremental upgrading method and relevant device
CN105446790A (en) * 2014-07-15 2016-03-30 华为技术有限公司 Virtual machine migration method and device
CN105138394A (en) * 2015-09-21 2015-12-09 上海爱数软件有限公司 Method for thermally migrating K virtual machine (KVM) and system
CN105893114A (en) * 2016-04-05 2016-08-24 浪潮电子信息产业股份有限公司 Virtual machine migration method, target host machine and source host machine
CN106227580A (en) * 2016-07-18 2016-12-14 浪潮(北京)电子信息产业有限公司 The dynamic migration method of a kind of virtual machine and system
CN106528330A (en) * 2016-10-29 2017-03-22 华为技术有限公司 Data backup method, node and data backup system
CN106874403A (en) * 2017-01-18 2017-06-20 武汉天喻教育科技有限公司 The system and method for differential synchronization is carried out to compressed file

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
LEOUFUNG: "QEMU-KVM中的多线程压缩迁移技术", 《HTTPS://WWW.LINUXPROBE.COM/QEMU-KVM-MIGRATION.HTML》 *
刘海坤: "虚拟机在线迁移性能优化关键技术研究", 《万方平台》 *
潘红芳: "《智能分级存储系统的研究》", 31 May 2014, 吉林大学出版社 *

Similar Documents

Publication Publication Date Title
CN104881494B (en) The methods, devices and systems synchronous with Redis server progress data
CN109886859B (en) Data processing method, system, electronic device and computer readable storage medium
US11704036B2 (en) Deduplication decision based on metrics
US9727942B2 (en) Selective utilization of graphics processing unit (GPU) based acceleration in database management
US10656850B2 (en) Efficient volume replication in a storage system
CN104199784B (en) A kind of data migration method and device based on classification storage
CN104077234B (en) A kind of dynamic adjusting method of embedded system subregion and device
US20210224131A1 (en) Dynamic container-based application resource tuning and resizing
CN112433812B (en) Virtual machine cross-cluster migration method, system, equipment and computer medium
CN105700956A (en) Distributed job processing method and system
CN107704568B (en) Method and device for adding test data
CN111049889B (en) Static resource uploading method and device, integrated server and system
US20240045787A1 (en) Code inspection method under weak memory ordering architecture and corresponding device
Mestre et al. Adaptive sorted neighborhood blocking for entity matching with mapreduce
CN110264452A (en) A kind of workpiece inspection method, device, equipment and storage medium
CN110955390B (en) Data processing method, device, electronic equipment and storage medium
CN110990133A (en) Edge computing service migration method and device, electronic equipment and medium
US20180011886A1 (en) Parallel transfers of electronic data
CN104866388B (en) Data processing method and device
US9298769B1 (en) Method and apparatus to facilitate discrete-device accelertaion of queries on structured data
CN106681837B (en) Data elimination method and device based on data table
CN107515724B (en) Method and apparatus for reproducing input and output of storage system
CN107704311A (en) A kind of virutal machine memory moving method and its device
CN116954906A (en) Node capacity expansion and contraction method, system, terminal and medium in graph database cluster
CN108334393B (en) iOS end view resource multiplexing method, storage medium, equipment and system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180216