CN115033337A - Virtual machine memory migration method, device, equipment and storage medium - Google Patents

Virtual machine memory migration method, device, equipment and storage medium Download PDF

Info

Publication number
CN115033337A
CN115033337A CN202210432945.5A CN202210432945A CN115033337A CN 115033337 A CN115033337 A CN 115033337A CN 202210432945 A CN202210432945 A CN 202210432945A CN 115033337 A CN115033337 A CN 115033337A
Authority
CN
China
Prior art keywords
copy
migration
iteration
memory
dirty
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
CN202210432945.5A
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.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies 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 New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN202210432945.5A priority Critical patent/CN115033337A/en
Publication of CN115033337A publication Critical patent/CN115033337A/en
Pending legal-status Critical Current

Links

Images

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/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
    • 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/45583Memory management, e.g. access or allocation

Abstract

The invention discloses a virtual machine memory migration method, a virtual machine memory migration device, virtual machine memory migration equipment and a storage medium, which are used for improving the virtual machine memory migration efficiency. In the process of pre-copy iteration, false dirty pages are identified through hash values of memory pages, transmission of the false dirty pages is avoided, the pre-copy iteration, stop copy and post-copy processes are further combined, optimized switching conditions from a pre-copy migration iteration stage to a post-copy stage are preset, and switching is automatically executed after the preset switching conditions are met. The invention can avoid excessive useless pre-copy iteration, can shorten the migration duration to the utmost extent, reduces the bandwidth occupation, and improves the migration efficiency of the memory data in the virtual machine.

Description

Virtual machine memory migration method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of communication and cloud computing, in particular to a virtual machine memory migration method, device, equipment and storage medium.
Background
The memory write intensive load refers to a load type that a service carried by a virtual machine needs to write data into a memory frequently, and such a load usually has a high memory dirty writing speed, and a large number of memory dirty pages which need to be transmitted repeatedly are generated during virtual machine migration. The resulting migration failure or long down time often has more serious consequences.
The virtual machine Pre-copy (Pre-copy) migration method is one of the main modes of virtual machine migration, and the Pre-copy migration method sends memory data to a migration destination virtual machine through a cycle, sends all memory data in the first cycle of the cycle, and then sends a dirty page in the previous cycle of Pre-copy in each cycle. And the last round is a halt copying stage, the source host is suspended, the memory updating is stopped, and the dirty pages are integrally copied to the target virtual machine.
The pre-copy migration method transmits the memory page of the virtual machine from the source node to the destination node in a multi-round iteration mode. The primary goal of pre-copy migration is to reduce downtime so that the user and upper-level applications are barely aware of the migration occurring. However, when the traffic running in the virtual machine to be migrated is a memory write-intensive load type, the pre-copy migration is challenging because such a load not only usually occupies a large system memory space, but also writes dirty memory at a fast speed, and the resulting large-memory dirty pages need to be frequently transferred during the pre-copy migration process, resulting in a large data transfer amount and a long migration time. Longer migration times often result in delays and missed optimal migration opportunities, thereby defeating the goals of load balancing, system maintenance, etc. that are expected to be achieved. In addition, the speed of the memory write-intensive load to generate dirty pages may be even greater than the network bandwidth that can be used by the migration process, especially in a migration scenario where the network source is not rich enough, in which case the pre-copy migration process cannot converge to the final stop-copy stage, and therefore the migration cannot be completed by the expected stop time. In addition, the lengthy downtime may cause other serious problems, such as interruption of TCP connection and influence on system consistency. However, if the migration is not completed in this way, the data center is more seriously damaged if the migration operation is cancelled or the migration fails.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, a device and a storage medium for migrating a virtual machine memory, which are used to improve the virtual machine memory migration efficiency.
Based on one aspect of the embodiments of the present invention, the present invention provides a method for migrating a memory of a virtual machine, where the method is applied to a host of the virtual machine, and the method includes:
in the first round of iteration of the pre-copy iteration stage, carrying out migration of a full amount of memory pages, calculating a hash value for each memory page and recording the hash value of the memory page when each memory page is migrated and transmitted;
performing next round of pre-copy iteration and removing false dirty pages marked by dirty page bitmaps by comparing the current hash value with the historical hash value of the memory page in each round of pre-copy iteration process;
and executing the stop copy when the stop copy time condition is met.
Further, the method further comprises:
when the condition of the shutdown copy time is not met, judging whether a migration switching condition is met;
and executing a post-copy stage of virtual machine migration when the migration switching condition is met.
Based on another aspect of the embodiments of the present invention, the present invention further provides a virtual machine memory migration apparatus, including:
a pre-copy iteration module for performing pre-copy iteration; the method comprises the steps that in the first round of iteration of a pre-copy iteration stage, migration of a whole number of memory pages is carried out, when each memory page is migrated and transmitted, a hash value is calculated for each memory page, and the hash value of each memory page is recorded; in each subsequent pre-copy iteration process, false dirty pages marked by dirty page bitmaps are removed by comparing the current hash value and the historical hash value of the memory pages, and only the true dirty pages are migrated;
the halt judging module is used for judging whether a halt copying time condition is met or not;
and the shutdown module is used for executing shutdown copying when a shutdown copying time condition is met.
Further, the apparatus further comprises:
the switching judgment module is used for judging whether the migration switching condition is met or not when the halt copying time condition is not met;
and the post-copying module is used for executing a post-copying stage of virtual machine migration when the migration switching condition is met.
Further, in an embodiment of the present invention, the migration switching condition is: the number of the dirty pages newly generated in the pre-copying iteration process of the round is not more than the number of the dirty pages transmitted in the previous round.
Further, in an embodiment of the present invention, the migration switching condition is: the quantity of the dirty pages newly generated in the pre-copying iteration process of the round is not more than that of the dirty pages transmitted in the previous round, and the quantity of the dirty pages newly generated in the pre-copying iteration process of the round is the minimum value in a preset pre-copying iteration sliding window.
In order to improve the migration efficiency of a virtual machine bearing memory write-intensive loads, in the process of pre-copy iteration, false dirty pages are identified through hash values of memory pages, transmission of the false dirty pages is avoided, the pre-copy iteration, stop copy and post-copy processes are further combined for use, the optimized switching condition from the pre-copy migration iteration stage to the post-copy stage is preset, and the switching is automatically executed after the preset switching condition is met. The method and the device can avoid excessive useless pre-copy iteration, can shorten the migration duration to the maximum extent, reduce the bandwidth occupation, and improve the migration efficiency of the memory data in the virtual machine.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments of the present invention or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings may be obtained according to the drawings of the embodiments of the present invention.
FIG. 1 is a schematic diagram of a pre-copy iteration using a coarse-grained dirty page tracking mechanism with a first iteration to generate a false dirty page;
fig. 2 is a flowchart illustrating steps of a virtual machine memory migration method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device for implementing the virtual machine memory migration method according to an embodiment of the present invention.
Detailed Description
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of the invention. As used in the embodiments of the present invention, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used to describe various information in embodiments of the present invention, the information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of embodiments of the present invention. Depending on the context, moreover, the word "if" as used may be interpreted as "at … …" or "when … …" or "in response to a determination".
The inventor finds through experiments and analysis that a certain number of 'false dirty pages' exist in the internal dirty pages transmitted in the pre-copy migration process, and the proportion of the false dirty pages contained in the partial load is high. Not only is it unnecessary to repeatedly transmit such false dirty pages, but a significant amount of network resources are wasted. One of the main reasons for the "false dirty pages" is that there are a large number of "write-while-dirty" write requests sent to memory in a computer system, which are caused by the widely-existing silent store (silent store) instruction.
Taking KVM, Xen and other virtualization platforms as examples, these virtualization platforms all adopt a similar mechanism to track and record the memory dirty pages generated during the virtual machine migration process, and they all adopt a dirty page bitmap to mark the dirty pages, and during the initialization phase of the pre-copy migration, all the memory pages of the virtual machine are set to be in a read-only mode, so that in the following migration process, when the system sends a write operation to a certain memory page, a page write error is triggered. When monitoring the write operation to the memory pages, the operating system sets bit positions corresponding to the dirty pages in the dirty page bitmap to mark that the memory pages have been subjected to the write operation. All memory pages marked as dirty pages by the dirty page bitmap need to be transmitted again in the next iteration. However, a memory page marked by a dirty page bitmap does not necessarily have a change in content, i.e. a write request sent to a memory page does not necessarily actually modify the data of the page, and thus many "false dirty pages" are generated which are "written but not dirty", which is the main reason why most of the "false dirty pages" are generated during the migration process.
Another reason for generating "false dirty pages" is that the dirty page tracking mechanism used in the virtual machine migration process has a certain defect, and the granularity of recording the dirty pages is coarse. Taking a virtualization platform with KVM combined with QEMU (a fast virtualization emulator) architecture as an example, the virtualization platform is mainly composed of a KVM kernel module and a QEMU virtualization emulator located in a user space. During the migration of the virtual machine, the kernel space and the user space respectively maintain a dirty page bitmap. The dirty page bitmap (kernel dirty page bitmap) maintained by the kernel space is responsible for tracking write requests sent by the operating system to the memory pages, and the bit positions of the dirty page bitmaps corresponding to the memory pages are set to 1, which records all memory pages written by the operating system in a round of pre-copy iteration process. After a round of iteration process is finished, the QEMU synchronizes the dirty page bitmap in the kernel space to a dirty page bitmap (user dirty page bitmap for short) maintained by itself through an "ioctl" system call interface provided by the KVM, and the synchronization operation of the dirty page bitmap resets the kernel dirty page bitmap at the same time, so as to start to record the dirty pages generated in the next round of iteration. In the next iteration, the migration thread uses the dirty page bitmap synchronized to the user space for dirty page transmission. As can be seen from the above description, the granularity of the dirty page tracking mechanism used by the migration process is large, which is an iteration of a round of pre-copying. It is this coarser granularity of the dirty page tracking mechanism that also results in the generation of false dirty pages.
Fig. 1 is a schematic diagram of a first iteration of pre-copy iteration using a coarse-grained dirty page tracking mechanism to generate a false dirty page, and it can be seen from the above description that the granularity of the dirty page tracking mechanism used in the migration process is larger, and the granularity is one iteration of pre-copy. It is this coarser granularity of the dirty page tracking mechanism that also results in the generation of false dirty pages. The reason for the generation of "false dirty pages" is explained below by taking the first iteration of the pre-copy as an example in conjunction with the figure, and the principle is similar for the other iterations.
In the first iteration process of the migration process, the migration thread will sequentially transmit each memory page in the client address space according to the order of addresses from low to high. Suppose that during the period of time when the cursor indicating the transfer position moves from address P to P', four memory pages ABCD receive the write request sent by the system, so that these 4 pages are marked as dirty in the dirty page bitmap of the kernel space. It is assumed that none of the 4 pages are the previously discussed memory pages that are written without being dirty, i.e., the write requests modify the data content of the 4 memory pages. However, in the above process, only pages a and B are true dirty pages, while pages C and D are "false dirty pages" because pages a and B are dirty written after transmission in this iteration, and pages C and D are dirty written before they are transmitted in this iteration, so when pages C and D are transmitted to the destination end node, the transmitted content is new dirty memory data, unless pages C and D are dirty written again after this transmission, so memory pages C and D are "false dirty pages" for the next iteration.
Based on the analysis of the migration process of the virtual machine bearing the memory write-intensive load, it can be found that a certain number of 'false dirty pages' exist in the memory dirty pages transmitted in the pre-copy migration process of the virtual machine migration, and the proportion of the false dirty pages generated by some memory write-intensive load services is very high, so that the migration efficiency is reduced and a large amount of network resources are wasted by repeatedly transmitting the false dirty pages in the migration process.
In order to improve the migration efficiency of a virtual machine bearing a memory write-intensive load, the invention provides a virtual machine memory migration method, which is characterized in that in the process of pre-copy iteration, false dirty pages are identified through hash values of memory pages, the false dirty pages are prevented from being transmitted, the pre-copy iteration, stop copy and post-copy processes are further combined for use, optimized switching conditions from a pre-copy migration iteration stage to a post-copy stage are preset, and switching is automatically executed after the preset switching conditions are met. The method and the device can avoid excessive useless pre-copy iteration, can shorten the migration duration to the maximum extent, reduce the bandwidth occupation, and improve the migration efficiency of the memory data in the virtual machine.
Fig. 2 is a schematic step flow diagram of a virtual machine memory migration method according to an embodiment of the present invention, where the virtual machine memory migration method provided by the present invention is divided into two stages, a first stage is a pre-copy iteration stage, and a second stage is a post-copy stage. The pre-copy iteration stage is generally composed of a plurality of rounds of pre-copy iteration processes according to the service load condition, and when a preset switching condition is reached, the pre-copy iteration stage is switched to the post-copy migration stage. The method comprises the following steps:
step 201, in the first iteration of the pre-copy iteration stage, migrating a full amount of memory pages, and when each memory page is migrated and transmitted, calculating hash values for the memory pages and recording the hash values of the memory pages.
The invention adopts the hash value of the memory page to judge whether the content of the memory page changes between two pre-copying iteration processes, and can identify which memory pages are false dirty pages by using a method of calculating and comparing the hash value, thereby avoiding the transmission of the false dirty pages in the next iteration. Compared with byte-by-byte comparison of memory data, the method for judging whether the content of the memory page changes through the hash value has an obvious advantage that the memory overhead caused by the storage of the hash value is low. Taking SHA1 hash as an example, for a memory page with a size of 4KB, the length of SHA1 hash value is only 20 bytes, so the memory overhead required for storing SHA1 hash value is only 1/200 of virtual machine memory space, and the memory overhead is small.
Step 202, carrying out next round of pre-copy iteration, and in each round of pre-copy iteration process, removing false dirty pages marked by dirty page bitmaps by comparing the current hash value and the historical hash value of the memory pages, and only migrating true dirty pages;
before the memory page is migrated according to the dirty page bitmap, the hash value of the dirty page marked by the dirty page bitmap is calculated again, whether the marked dirty page is a false dirty page or not is judged, if the hash value is not changed, the content of the memory page is not changed, and the memory page is indicated to be a false dirty page, so that the current pre-copy iteration process skips the page and does not transmit the page. If the hash values are different, it is apparent that the memory page is changed and is a real dirty page, the memory page needs to be transferred to the migration destination virtual machine, and after the transfer is completed, the old hash value needs to be replaced with the newly calculated hash value, because the comparison may be performed again in the next iteration. After each round of pre-copy iterations is completed, the dirty page bitmap is reset.
Step 203, judging whether a stop copying time condition is met, if not, executing step 204, otherwise, executing step 206;
after the pre-copy iteration process is finished, the shutdown copy is executed to complete the final migration process. In the shutdown copy stage, the source host is suspended, the memory update is stopped, and the migration program copies the dirty pages to the destination virtual machine as a whole.
The pre-copy iteration cannot be cycled indefinitely, so that a downtime condition needs to be configured, which is a small time parameter and may not be perceived by a user.
Step 204, judging whether the migration switching condition is met, if so, executing step 205; otherwise, continuing to execute the next round of pre-copy iteration, namely executing step 202;
according to the previous analysis of the memory write-intensive load of the virtual machine in the memory migration process, the memory write-intensive load often causes that the virtual machine memory migration cannot be completed within the preset downtime. Although the migration performance of such loads can be improved by performing hash comparison on the hash values recorded in the memory pages, it cannot be guaranteed that all loads can successfully complete migration. Therefore, in order to ensure the successful completion of the migration process, the present invention proposes a virtual machine memory migration method combining a pre-copy iteration process and a post-copy process (post-copy), which generally consists of several rounds of pre-copy iterations plus one post-copy stage. The migration method combining the two methods can transmit most of the memory data in the pre-copy migration stage, so that the memory data amount required to be transmitted in the post-copy migration stage can be reduced. The combination of the copy migration method ensures that the migration process can be completed within a limited time, and shortens the duration of the post-copy migration phase.
In an embodiment of the present invention, the number of the dirty pages newly generated in the pre-copy iteration process of the current round is not greater than the number of the dirty pages transmitted in the previous round, and the number of the dirty pages newly generated in the pre-copy iteration process of the current round is used as a migration switching condition from the pre-copy iteration stage to the post-copy stage, that is, when each pre-copy iteration process is finished, the number of the dirty pages newly generated in the pre-copy iteration process of the current round is compared with the number of the dirty pages transmitted in the previous round, when the number of the dirty pages newly generated is not greater than the number of the dirty pages transmitted in the previous round, a turning point indicating that an increase trend of the remaining number of the dirty pages occurs is determined, and when the turning point occurs, the pre-copy iteration process is switched to the post-copy stage.
However, the random fluctuation of the number of the dirty pages in the actual migration process is counted, which indicates that the number of the dirty pages newly generated may tend to a stable range by performing a plurality of pre-copy iterations, so that the post-copy stage is further shortened to a certain extent, and the total migration time is also correspondingly prolonged. Therefore, after the turning point appears, in another embodiment of the present invention, the migration switching condition is further improved, in this embodiment, after the turning point appears, the pre-copy iteration is continued, and when each subsequent pre-copy iteration is finished, if the number of dirty pages newly generated in the process of the pre-copy iteration of this round is the minimum value in the preset pre-copy iteration sliding window, the migration switching condition is satisfied, and then the migration process is switched to enter the post-copy stage at this time. The size of the pre-copy iteration sliding window can be set according to actual conditions in specific implementation, for example, the size of the sliding window can be set to 3.
Step 205, executing Post-Copy stage of virtual machine migration, namely Post-Copy;
operations performed by the post-copy phase include: the method comprises the steps of firstly transmitting information such as the existing CPU state, registers and, options, non-pageable memory of the virtual machine to a target virtual machine, and quickly starting the virtual machine at a target server regardless of dirty pages. Meanwhile, the source server will also dynamically push the remaining memory (memory) to the destination server. But when the virtual machine runs and calls to the memory which is not transmitted yet, page-fault is triggered.
postcopy handles these page-faults based on the userfaulfd' kernel mechanism provided by the linux kernel. The userff can enable the migrated destination virtual machine to obtain the information of the page fault in a user space (userpace) through the file descriptor fd. In short, when the destination virtual machine calls the memory that has not been completely transmitted on the destination server, the userfaultfd can fetch the memory information from the source server and transmit the memory information to the destination server, so that the virtual machine continues to operate.
The Post-copy algorithm process can also be divided into three steps:
(1) copying and transmitting a minimum data set which can enable the virtual machine to run on the target host and comprises system states such as vcpu and the like to the target host by the source host;
(2) the source host suspends the running of the virtual machine, and the target host resumes the running of the virtual machine after receiving the minimum data set which can be run by the virtual machine
(3) The target host acquires the needed memory page from the source host through the network.
And step 206, executing a shutdown copy phase.
The processing steps of the virtual machine memory migration method provided by the invention are ended. According to the content, the invention provides the mixed copy migration method which can remove the false dirty pages and combines the pre-copy iteration method and the post-copy method, aiming at the problem that the memory write-intensive load is difficult to migrate due to the fact that the dirty pages are generated at a high speed. In the virtual machine pre-copy migration process, a part of the load has a high-proportion false dirty page, and the repeated transmission of the false dirty pages wastes network bandwidth resources. The migration performance of the virtual machine running the memory write-intensive load is remarkably improved, the hybrid copy migration method not only ensures the successful migration of all loads, but also remarkably shortens the duration of a post-copy migration stage, and therefore the negative influence of the inherent defects of the post-copy algorithm on the migration is reduced.
Fig. 3 is a schematic structural diagram of an electronic device for implementing a virtual machine memory migration method according to an embodiment of the present invention, where the device 300 includes: a processor 310, such as a Central Processing Unit (CPU), a communication bus 320, a communication interface 340, and a storage medium 330. Wherein the processor 310 and the storage medium 330 may communicate with each other through a communication bus 320. The storage medium 330 stores a computer program, and when the computer program is executed by the processor 310, the computer program can implement the functions of one or more steps of the virtual machine memory migration method provided by the present invention.
The storage medium may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. In addition, the storage medium may be at least one memory device located remotely from the processor. The Processor may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
It should be recognized that embodiments of the present invention can be realized and implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory memory. The method may be implemented in a computer program using standard programming techniques, including a non-transitory storage medium configured with the computer program, where the storage medium so configured causes a computer to operate in a specific and predefined manner. Each program may be implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose. Further, operations of processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and/or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) collectively executed on one or more processors, by hardware, or combinations thereof. The computer program includes a plurality of instructions executable by one or more processors.
Further, the method may be implemented in any type of computing platform operatively connected to a suitable interface, including but not limited to a personal computer, mini computer, mainframe, workstation, networked or distributed computing environment, separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and the like. Aspects of the invention may be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated onto a computing platform, such as a hard disk, optically read and/or write storage media, RAM, ROM, etc., so that it is readable by a programmable computer, which when read by the computer can be used to configure and operate the computer to perform the procedures described herein. Further, the machine-readable code, or portions thereof, may be transmitted over a wired or wireless network. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein.
The above description is only an example of the present invention, and is not intended to limit the present invention. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A virtual machine memory migration method is applied to a host machine of a virtual machine, and comprises the following steps:
in the first round of iteration of the pre-copy iteration stage, carrying out migration of a full amount of memory pages, calculating a hash value for each memory page and recording the hash value of the memory page when each memory page is migrated and transmitted;
performing next round of pre-copy iteration and removing false dirty pages marked by dirty page bitmaps by comparing the current hash value with the historical hash value of the memory pages in each round of pre-copy iteration process;
and executing the stop copy when the stop copy time condition is met.
2. The method of claim 1, further comprising:
when the condition of the shutdown copy time is not met, judging whether a migration switching condition is met;
and executing a post-copy stage of virtual machine migration when the migration switching condition is met.
3. The method of claim 2,
the migration switching conditions are as follows: the number of the dirty pages newly generated in the pre-copying iteration process of the round is not more than the number of the dirty pages transmitted in the previous round.
4. The method of claim 2,
the migration switching conditions are as follows: the number of the dirty pages newly generated in the pre-copying iteration process of the round is not larger than the number of the dirty pages transmitted in the previous round, and the number of the dirty pages newly generated in the pre-copying iteration process of the round is the minimum value in a preset pre-copying iteration sliding window.
5. A virtual machine memory migration apparatus, the apparatus comprising:
a pre-copy iteration module for performing a pre-copy iteration; the method comprises the steps that in the first round of iteration of a pre-copy iteration stage, migration of a whole number of memory pages is carried out, when each memory page is migrated and transmitted, a hash value is calculated for each memory page, and the hash value of each memory page is recorded; in each subsequent pre-copy iteration process, false dirty pages marked by dirty page bitmaps are removed by comparing the current hash value and the historical hash value of the memory pages, and only the true dirty pages are migrated;
the halt judging module is used for judging whether a halt copying time condition is met or not;
and the shutdown module is used for executing shutdown copying when a shutdown copying time condition is met.
6. The apparatus of claim 5, further comprising:
the switching judgment module is used for judging whether the migration switching condition is met or not when the condition of the shutdown copy time is not met;
and the post-copying module is used for executing a post-copying stage of virtual machine migration when the migration switching condition is met.
7. The apparatus of claim 6,
the migration switching conditions are as follows: the quantity of the dirty pages newly generated in the pre-copying iteration process of the round is not more than that of the dirty pages transmitted in the previous round.
8. The apparatus of claim 6,
the migration switching conditions are as follows: the number of the dirty pages newly generated in the pre-copying iteration process of the round is not larger than the number of the dirty pages transmitted in the previous round, and the number of the dirty pages newly generated in the pre-copying iteration process of the round is the minimum value in a preset pre-copying iteration sliding window.
9. An electronic device is characterized by comprising a processor, a communication interface, a storage medium and a communication bus, wherein the processor, the communication interface and the storage medium are communicated with each other through the communication bus;
a storage medium for storing a computer program;
a processor for performing the method of any one of claims 1 to 4 when executing a computer program stored on a storage medium.
10. A storage medium on which a computer program is stored which, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
CN202210432945.5A 2022-04-24 2022-04-24 Virtual machine memory migration method, device, equipment and storage medium Pending CN115033337A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210432945.5A CN115033337A (en) 2022-04-24 2022-04-24 Virtual machine memory migration method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210432945.5A CN115033337A (en) 2022-04-24 2022-04-24 Virtual machine memory migration method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115033337A true CN115033337A (en) 2022-09-09

Family

ID=83118549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210432945.5A Pending CN115033337A (en) 2022-04-24 2022-04-24 Virtual machine memory migration method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115033337A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117193948A (en) * 2023-11-07 2023-12-08 中航金网(北京)电子商务有限公司 Virtual machine migration method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117193948A (en) * 2023-11-07 2023-12-08 中航金网(北京)电子商务有限公司 Virtual machine migration method and device

Similar Documents

Publication Publication Date Title
US10552199B2 (en) System and method for binary throttling for live migration of virtual machines
US20180246751A1 (en) Techniques to select virtual machines for migration
CN110609730B (en) Method and equipment for realizing interrupt transparent transmission between virtual processors
US8612973B2 (en) Method and system for handling interrupts within computer system during hardware resource migration
US9875057B2 (en) Method of live migration
US20190294462A1 (en) System and method for dynamic throttling for live migration of virtual machines
US11831410B2 (en) Intelligent serverless function scaling
US20210144177A1 (en) Implementing a service mesh in the hypervisor
US10552209B2 (en) System and method for throttling for live migration of virtual machines
EP3798826A1 (en) Methods of hardware and software coordinated opt-in to advanced features on hetero isa platforms
CN115033337A (en) Virtual machine memory migration method, device, equipment and storage medium
US11275600B2 (en) Virtualized I/O
CN114090171A (en) Virtual machine creation method, migration method and computer readable medium
KR920003044B1 (en) Control system for guest execution of virtual computer system
CN112631994A (en) Data migration method and system
KR102315102B1 (en) Method, device, apparatus, and medium for booting a virtual machine
US10509567B2 (en) System and method for migrating storage while in use
US11461131B2 (en) Hosting virtual machines on a secondary storage system
US20230021883A1 (en) Migrating virtual machines in cluster memory systems
US10540112B2 (en) System and method for migrating virtual machines with storage while in use
CN115136133A (en) Single use execution environment for on-demand code execution
CN112181601A (en) Memory pre-copying and virtual machine migration method and system based on dirtying rate prediction
US20140059389A1 (en) Computer and memory inspection method
CN113486040B (en) Data storage method, device, equipment and medium
US11681527B2 (en) Electronic device and multiplexing method of spatial

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