Virtual machine memory snapshot method and device, electronic equipment and readable medium

By building a distributed memory file system in a virtualization platform and utilizing RDMA technology, the problems of long downtime and limited capacity during virtual machine memory snapshots are solved, and efficient memory snapshots and large-capacity support are achieved.

CN119045948APending Publication Date: 2024-11-29GUANGZHOU BINGO SOFTWARE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411103523.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-11-29

Smart Images

  • Figure CN119045948A_ABST
    Figure CN119045948A_ABST
Patent Text Reader

Abstract

The invention provides a virtual machine memory snapshot method and device, electronic equipment and a readable medium, and the method comprises the steps that a virtualization platform controller receives and responds to a virtual machine memory snapshot request sent by a user side, and applies for a memory with the same capacity as a virtual machine memory file from a distributed memory management cluster device, the distributed memory management cluster device enables the applied memories to form a distributed memory file system and mount the distributed memory file system on a directory of a host machine, and a virtualization component libvirt receives and responds to a virtual machine memory snapshot request sent by a virtualization platform controller, intercepts a virtual machine memory file and writes the virtual machine memory file into the distributed memory file system; and the distributed memory management cluster device writes the memory file of the virtual machine into the persistent storage, unloads the distributed memory file system on the host machine and releases the node memory of the virtual machine. According to the method, the memory snapshot time of the virtual machine is shortened, the service interruption duration is greatly shortened, and the capacity upper limit of the memory snapshot of the virtual machine is also improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data backup, and in particular to a virtual machine memory snapshot method, a virtual machine memory snapshot device, an electronic device and a computer-readable medium. Background Art

[0002] RDMA (Remote Direct Memory Access): Remote direct memory access (RDMA) is direct memory access from the memory of one computer to the memory of another computer without involving the operating system intervention of either computer, thereby improving memory remote read and write performance.

[0003] Distributed memory file system: A distributed memory file system is a distributed file system that is designed to use memory as the main storage medium and distribute memory across multiple computer nodes to achieve high data availability, scalability, and fault tolerance. Compared with traditional disk-based file systems, distributed memory file systems generally have higher performance in access speed and throughput.

[0004] Memory snapshots are very important in daily virtualization scenarios. They are one of the important means of system backup and recovery. By capturing a snapshot of the current memory state, the system can quickly recover to the previous state when needed, which is essential to ensure the continuity and availability of the system. Memory snapshots can be used for debugging and testing purposes. Developers can capture memory snapshots during program execution and analyze the snapshots to understand the system status when errors or exceptions occur. This helps to quickly locate and resolve software errors and improve software quality and stability. Memory snapshots can also help the system quickly recover to the state before the failure when a failure occurs. Whether it is a software crash, hardware failure or other unexpected situation, memory snapshots can provide an effective recovery mechanism to reduce system downtime and data loss risks.

[0005] Existing memory snapshot technologies usually involve saving the virtual machine's memory state to persistent storage so that the virtual machine's state can be quickly restored later, such as the implementation solutions of manufacturers such as VMware and Hyper-V. Another optimized solution is to use the memory on the local host machine to create a tmpfs file to cache the virtual machine's memory file, and then asynchronously write it to persistent storage.

[0006] The above memory snapshot method has the following disadvantages and shortcomings:

[0007] 1) The traditional memory snapshot method saves the memory directly to persistent storage. Due to the low IO throughput of persistent storage, it will cause the virtual machine to downtime for a long time, directly leading to long business interruption and great losses for customers.

[0008] 2) Using an optimized method, converting the memory on the local host into tmpfs to cache memory files and then asynchronously writing them to persistent storage can shorten the service interruption time. However, the upper limit of tmpfs capacity is limited by the free memory capacity on the local host. If a virtual machine with a large memory is encountered, snapshots cannot be taken. Summary of the invention

[0009] In view of the above problems, the present invention is proposed to provide a virtual machine memory snapshot method and a corresponding virtual machine memory snapshot device, an electronic device and a computer-readable medium that overcome the above problems or at least partially solve the above problems.

[0010] The present invention discloses a virtual machine memory snapshot method, the method comprising:

[0011] The virtualization platform controller receives and responds to the virtual machine memory snapshot request sent by the user side, and applies to the distributed memory management cluster device for memory that is equal to the capacity of the virtual machine memory file;

[0012] The distributed memory management cluster device composes a distributed memory file system with the memory with the same capacity as the virtual machine memory file requested from the virtual machine node in the virtualization cluster, and mounts it to the host machine directory;

[0013] The virtualization platform controller sends a virtual machine memory snapshot request to the virtualization component libvirt;

[0014] The virtualization component libvirt responds to the virtual machine memory snapshot request, intercepts the virtual machine memory file and writes the virtual machine memory file into the distributed memory file system;

[0015] The distributed memory management cluster device writes the virtual machine memory files stored in the distributed memory file system into the persistent storage, uninstalls the distributed memory file system on the host machine, and releases memory to each virtual machine node.

[0016] Optionally, the distributed memory management cluster device includes a metadata controller, a page table memory, and an executor. The distributed memory management cluster device forms a distributed memory file system with the memory with the same capacity as the virtual machine memory file requested from the virtual machine node in the virtualization cluster, and mounts it to the host directory, including:

[0017] The metadata controller applies for free memory from the virtual machine node in the virtualization cluster according to the virtual machine memory file capacity, and records the page table mapping relationship of the applied virtual machine node free memory to the page table memory; the page table mapping relationship is the mapping information between the file block and each node memory;

[0018] The executor uses the free memory of the virtual machine nodes to form a distributed memory file system and mounts it to the host directory.

[0019] Optionally, the executor forms a distributed memory file system with the requested free memory of the virtual machine node and mounts it to the host directory, including:

[0020] When in a concurrent memory snapshot scenario, the executor organizes the free memory applied for by each virtual machine node into a distributed memory file system corresponding to the virtual machine node, and mounts it to the host directory.

[0021] Optionally, the metadata controller applies for free memory from the virtual machine node in the virtualization cluster according to the virtual machine memory file capacity, and records the page table mapping relationship of the applied free memory of the virtual machine node to the page table memory; the page table mapping relationship is the mapping information between the file block and each node memory, including:

[0022] The metadata controller applies for free memory from the virtual machine nodes in the virtualization cluster according to the capacity of the virtual machine memory file, divides the virtual machine memory file into file blocks that are the same as the free memory capacity of each virtual machine node, generates a page table mapping relationship between each file block and the corresponding virtual machine node free memory, and records the page table mapping relationship in the page table memory.

[0023] Optionally, the virtualization component libvirt responds to the virtual machine memory snapshot request, intercepts the virtual machine memory file and writes the virtual machine memory file into the distributed memory file system, including:

[0024] The virtualization component libvirt responds to the virtual machine memory snapshot request and intercepts the virtual machine memory file;

[0025] According to the page table mapping relationship, the virtual machine memory file content is segmented, and a local write operation is performed on the local virtual machine node and / or the content is written to the remote virtual machine node through RDMA network accelerated transmission.

[0026] Optionally, the method further comprises:

[0027] When the virtualization component libvirt accelerates the transmission of virtual machine memory file contents to the remote virtual machine node through the RDMA network, the virtualization platform controller creates an exclusive RDMA communication channel for each memory snapshot task of the remote virtual machine node.

[0028] Optionally, the method further comprises:

[0029] When in a concurrent memory snapshot scenario, the virtualization platform controller sets the maximum concurrency number of memory snapshot tasks according to the number of RDMA hardware device communication channels, and controls the concurrent execution of tasks according to the maximum concurrency number. Tasks exceeding the maximum concurrency number queue up and wait for idle communication channels.

[0030] The present invention also discloses a virtual machine memory snapshot device, the device comprising:

[0031] A memory application module is used for the virtualization platform controller to receive and respond to a virtual machine memory snapshot request sent by a user side, and to apply to the distributed memory management cluster device for memory that is equal to the capacity of the virtual machine memory file;

[0032] A distributed memory file system composition module is used for the distributed memory management cluster device to compose a distributed memory file system with the memory with the same capacity as the virtual machine memory file obtained from the virtual machine node in the virtualization cluster, and mount it to the host directory;

[0033] A memory snapshot request sending module is used for the virtualization platform controller to send a virtual machine memory snapshot request to the virtualization component libvirt;

[0034] A memory file capture and write module is used for the virtualization component libvirt to respond to the virtual machine memory snapshot request, capture the virtual machine memory file and write the virtual machine memory file into the distributed memory file system;

[0035] The memory file persistent storage module is used for the distributed memory management cluster device to write the virtual machine memory files stored in the distributed memory file system into the persistent storage, unload the distributed memory file system on the host machine, and release memory to each virtual machine node.

[0036] Optionally, the distributed memory management cluster device includes a metadata controller, a page table memory, and the distributed memory file system component module includes:

[0037] A page table mapping relationship recording submodule is used for the metadata controller to apply for free memory from the virtual machine node in the virtualization cluster according to the virtual machine memory file capacity, and record the page table mapping relationship of the applied virtual machine node free memory to the page table memory; the page table mapping relationship is the mapping information between the file block and each node memory;

[0038] The distributed memory file system composition submodule is used by the executor to compose a distributed memory file system with the applied free memory of the virtual machine node and mount it to the host directory.

[0039] Optionally, the distributed memory file system component submodule includes:

[0040] The distributed memory file system composition unit is used for, when in a concurrent memory snapshot scenario, the executor respectively composes the free memory applied for by each virtual machine node into a distributed memory file system corresponding to the virtual machine node, and mounts it to the host directory.

[0041] Optionally, the page table mapping relationship recording submodule includes:

[0042] A page table mapping relationship recording unit is used for the metadata controller to apply for free memory from the virtual machine nodes in the virtualization cluster according to the virtual machine memory file capacity, divide the virtual machine memory file into file blocks that are the same as the free memory capacity of each virtual machine node, and generate a page table mapping relationship between each file block and the corresponding virtual machine node free memory, and record the page table mapping relationship in the page table memory.

[0043] Optionally, the memory file interception and writing module includes:

[0044] A memory file interception submodule is used for the virtualization component libvirt to respond to the virtual machine memory snapshot request and intercept the virtual machine memory file;

[0045] The memory file writing submodule is used to divide the virtual machine memory file content according to the page table mapping relationship, and perform a local write operation on the local virtual machine node and / or write to the remote virtual machine node through RDMA network accelerated transmission.

[0046] Optionally, the device further comprises:

[0047] The exclusive RDMA communication channel creation module is used for the virtualization platform controller to create an exclusive RDMA communication channel for each memory snapshot task of the remote virtual machine node when the virtualization component libvirt accelerates the transmission of the virtual machine memory file content to the remote virtual machine node through the RDMA network.

[0048] Optionally, the device further comprises:

[0049] The task concurrency number determination module is used to set the maximum concurrency number of memory snapshot tasks according to the number of RDMA hardware device communication channels when in a concurrent memory snapshot scenario, and control the concurrent execution of tasks according to the maximum concurrency number. Tasks exceeding the maximum concurrency number are queued and wait for idle communication channels.

[0050] The present invention also discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0051] The memory is used to store computer programs;

[0052] The processor is used to implement the virtual machine memory snapshot method of the present invention when executing the program stored in the memory.

[0053] The present invention also discloses one or more computer-readable media, on which instructions are stored, and when executed by one or more processors, the processors execute the virtual machine memory snapshot method as described in the present invention.

[0054] The present invention includes the following advantages:

[0055] The virtual machine memory snapshot method of the present invention receives and responds to the virtual machine memory snapshot request sent by the user side through the virtualization platform controller, applies for the memory with the same capacity as the virtual machine memory file from the distributed memory management cluster device, the distributed memory management cluster device forms a distributed memory file system with the memory with the same capacity as the virtual machine memory file applied from the virtual machine node in the virtualization cluster and mounts it on the host machine directory, the virtualization platform controller sends the virtual machine memory snapshot request to the virtualization component libvirt, the virtualization component libvirt responds to the virtual machine memory snapshot request, intercepts the virtual machine memory file and writes the virtual machine memory file into the distributed memory file system, the distributed memory management cluster device writes the virtual machine memory file stored in the distributed memory file system into the persistent storage, uninstalls the distributed memory file system on the host machine, and releases the memory to each virtual machine node. The method of the present invention accelerates the time of the virtual machine memory snapshot, greatly reduces the service interruption duration, and also increases the capacity upper limit of the virtual machine memory snapshot. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 This is a flowchart of a virtual machine memory snapshot method provided by an embodiment of the present invention;

[0057] Figure 2 It is a flow chart of virtual machine memory snapshot of a virtualization platform provided by an embodiment of the present invention;

[0058] Figure 3 It is a virtual machine memory snapshot flow chart of a distributed memory management cluster device and a virtualization component libvirt provided by an embodiment of the present invention;

[0059] Figure 4 is a schematic diagram of a concurrent memory snapshot scenario provided by an embodiment of the present invention;

[0060] Figure 5 It is a structural block diagram of a virtual machine memory snapshot device provided by an embodiment of the present invention;

[0061] Figure 6 is a block diagram of an electronic device provided by an embodiment of the present invention;

[0062] Figure 7 It is a schematic diagram of a computer-readable medium provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0063] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0064] Reference Figure 1 , shows a flowchart of a virtual machine memory snapshot method provided in an embodiment of the present invention, which may specifically include the following steps:

[0065] Step 101, the virtualization platform controller receives and responds to a virtual machine memory snapshot request sent by a user side, and applies to a distributed memory management cluster device for memory that is the same as the capacity of the virtual machine memory file;

[0066] Step 102, the distributed memory management cluster device composes a distributed memory file system with the memory with the same capacity as the virtual machine memory file requested from the virtual machine node in the virtualization cluster, and mounts it to the host directory;

[0067] Step 103: The virtualization platform controller sends a virtual machine memory snapshot request to the virtualization component libvirt;

[0068] Step 104, the virtualization component libvirt responds to the virtual machine memory snapshot request, intercepts the virtual machine memory file and writes the virtual machine memory file into the distributed memory file system;

[0069] Step 105 , the distributed memory management cluster device writes the virtual machine memory file stored in the distributed memory file system into persistent storage, uninstalls the distributed memory file system on the host machine, and releases memory to each virtual machine node.

[0070] The virtual machine memory snapshot method of the present invention can be applied to a virtualization platform, and a virtual machine memory snapshot is realized through a virtualization platform controller, a distributed memory management cluster device, and a virtualization component libvirt. The distributed memory management cluster device uses the idle memory resources of each node in the virtualization cluster, dynamically divides the space on demand, and forms a distributed memory file system. Due to the rapid development of RDMA technology, RDMA technology can achieve a very high transmission speed, which can even be higher than the local memory read and write speed. The distributed memory file system based on RDMA can achieve the effect of excellent performance reading and writing. The distributed memory file system implements a standard file read and write interface for the virtualization component libvirt to output memory files. When the memory file is saved to the file system, the data of the memory file will be scattered and asynchronously saved to each node. After all the data is saved, it will be asynchronously output to the persistent storage by the device. After the snapshot is saved, the memory space of each node will be recovered and released. This can not only speed up the time of the virtual machine memory snapshot, greatly reduce the service interruption duration, but also increase the upper limit of the capacity of the virtual machine memory snapshot.

[0071] Specifically, refer to Figure 2 , the virtual machine memory snapshot process is as follows:

[0072] 1) The user requests a memory snapshot of the virtual machine from the virtualization platform controller;

[0073] 2) The virtualization platform controller applies to the distributed memory management cluster device for a memory capacity that is the same as the memory size of the virtual machine;

[0074] 3) After the distributed memory management cluster device successfully applies for memory in each virtual machine node, it forms a distributed memory file system and mounts it to a directory on the host machine;

[0075] 4) The virtualization platform controller sends a snapshot request to the virtualization component Libvirt;

[0076] 5) The Libvirt component intercepts the memory IO of the virtual machine to obtain the virtual machine memory file;

[0077] 6) The Libvirt component outputs the virtual machine's memory file to the specified distributed memory file system;

[0078] 7) After the memory file is written to the distributed memory file system, the libvirt component restores the memory IO to the virtual machine, and the distributed memory management cluster device asynchronously writes the memory file in the memory file system to the persistent storage;

[0079] 8) After the memory file is written to the persistent storage, the distributed memory management cluster device unloads the distributed memory file system and releases memory to each virtual machine node.

[0080] The virtual machine memory snapshot method of the embodiment of the present invention directly applies for memory from the distributed memory management cluster device through the virtualization platform controller, and constructs a distributed memory file system to temporarily store virtual machine memory data, thereby avoiding the bottleneck of I / O operations directly saved to persistent storage in traditional snapshot methods, thereby significantly accelerating the speed of memory snapshots, reducing the interruption time of virtual machine business operations caused by snapshot operations, and improving business continuity and availability. In addition, the distributed memory management cluster device has a strong expansion capability and can support large-capacity memory resource applications, breaking through the limitation of traditional snapshot methods that are limited by the memory capacity of a single machine. It also effectively and reasonably utilizes memory fragments in the cluster, improving the overall performance of the cluster, especially in large-scale virtualization cluster scenarios, where its beneficial effects are more obvious.

[0081] In one embodiment of the present invention, a distributed memory management cluster device includes a metadata controller, a page table memory, and an executor. The distributed memory management cluster device forms a distributed memory file system with the memory with the same capacity as the virtual machine memory file requested from the virtual machine node in the virtualization cluster, and mounts it to the host directory, including:

[0082] The metadata controller applies for free memory from the virtual machine node in the virtualization cluster according to the virtual machine memory file capacity, and records the page table mapping relationship of the applied virtual machine node free memory to the page table memory; the page table mapping relationship is the mapping information between the file block and each node memory;

[0083] The executor uses the free memory of the virtual machine nodes to form a distributed memory file system and mounts it to the host directory.

[0084] In one embodiment of the present invention, the metadata controller applies for free memory from the virtual machine node in the virtualization cluster according to the virtual machine memory file capacity, and records the page table mapping relationship of the applied virtual machine node free memory to the page table memory; the page table mapping relationship is the mapping information between the file block and each node memory, including:

[0085] The metadata controller applies for free memory from the virtual machine nodes in the virtualization cluster according to the capacity of the virtual machine memory file, divides the virtual machine memory file into file blocks that are the same as the free memory capacity of each virtual machine node, generates a page table mapping relationship between each file block and the corresponding virtual machine node free memory, and records the page table mapping relationship in the page table memory.

[0086] In one embodiment of the present invention, the virtualization component libvirt responds to the virtual machine memory snapshot request, intercepts the virtual machine memory file and writes the virtual machine memory file into the distributed memory file system, including:

[0087] The virtualization component libvirt responds to the virtual machine memory snapshot request and intercepts the virtual machine memory file;

[0088] According to the page table mapping relationship, the virtual machine memory file content is segmented, and a local write operation is performed on the local virtual machine node and / or the content is written to the remote virtual machine node through RDMA network accelerated transmission.

[0089] Reference Figure 3 The process of implementing virtual machine free memory application and virtual machine memory file snapshot by the distributed memory management cluster device and the virtualization component libvirt of the present invention is as follows:

[0090] 1) The metadata controller in the distributed memory management cluster device initiates an application for free memory from each virtual machine node in the virtualization cluster;

[0091] 2) The metadata controller records the page table mapping relationship of each virtual machine node in the page table memory in the distributed memory management cluster device, including recording the key information of the file block and each node memory, such as file ID, stored node location, file block starting address, memory starting address, file block size, etc. The file ID corresponds to the virtual machine ID in the platform database, so that the corresponding relationship can be retrieved more quickly in subsequent file operations; the file block starting address is the address of the current file block in the file, which forms a combined primary key with the file ID to ensure the uniqueness of different file blocks in the same file; the node position is the unique ID generated by the platform for each node; the memory starting address is the relative starting address of the file block in the memory, used in conjunction with the memory page; the memory page is the page address of the operating system for memory paging, used in conjunction with the memory starting address; the file block size describes the size of the file block, and the end address can be calculated in conjunction with the starting address;

[0092] 3) After applying for memory, the executor in the distributed memory management cluster device starts mounting the distributed memory file system on the host machine;

[0093] 4) The Libvirt component intercepts the memory IO of the virtual machine to obtain the virtual machine memory file and starts writing the virtual machine memory file to the distributed memory file system;

[0094] 5) The contents of the virtual machine memory files are scattered according to the information on the page table memory and asynchronously sent to each virtual machine node in the cluster. Data written to the local virtual machine node is written directly, and data written to the remote virtual machine node is written through the RDMA network to accelerate transmission;

[0095] 6) After the distributed memory management cluster device finds the file in the distributed memory file system according to the virtual machine ID, it directly copies the file and writes it to the persistent storage. During the writing process, the metadata controller quickly finds the location of all file blocks according to the virtual machine ID, then quickly pulls and assembles the data of each node through the RDMA network, and finally outputs it to the persistent storage;

[0096] 7) After the virtual machine memory file is saved to persistent storage, the executor unmounts the file system on the host machine;

[0097] 8) The metadata controller deletes the mapping of the page table memory;

[0098] 9) The executor finally releases memory to each virtual machine node.

[0099] In one embodiment of the present invention, the executor forms a distributed memory file system with the applied free memory of the virtual machine node and mounts it to the host directory, including:

[0100] When in a concurrent memory snapshot scenario, the executor organizes the free memory applied for by each virtual machine node into a distributed memory file system corresponding to the virtual machine node, and mounts it to the host directory.

[0101] After the metadata controller applies for memory, the executor will apply for free memory of the virtual machine node to form a distributed memory file system and mount it to the host directory. There are two situations. One is that the free memory of all virtual machine nodes applied for forms a distributed memory file system, which can be used for shared reading and writing of multiple virtual machine snapshot tasks; the other is that when in a concurrent memory snapshot scenario, the distributed memory file system is not shared reading and writing, but the executor creates its own distributed file system for each virtual machine, and respectively forms the free memory applied for by each virtual machine node into the distributed memory file system corresponding to the virtual machine node, so that the data reading and writing between each concurrent task are isolated from each other, refer to Figure 4 .

[0102] In one embodiment of the present invention, the method further comprises:

[0103] When the virtualization component libvirt accelerates the transmission of virtual machine memory file contents to the remote virtual machine node through the RDMA network, the virtualization platform controller creates an exclusive RDMA communication channel for each memory snapshot task of the remote virtual machine node.

[0104] Since RDMA hardware devices are divided into channels, the virtualization platform controller will create an exclusive RDMA communication channel for each virtual machine's memory snapshot task. Figure 4, so that multiple tasks will not reuse the same channel, so that the transmission speed between each task does not affect each other.

[0105] In one embodiment of the present invention, the method further comprises:

[0106] When in a concurrent memory snapshot scenario, the virtualization platform controller sets the maximum concurrency number of memory snapshot tasks according to the number of RDMA hardware device communication channels, and controls the concurrent execution of tasks according to the maximum concurrency number. Tasks exceeding the maximum concurrency number queue up and wait for idle communication channels.

[0107] The number of communication channels of RDMA hardware devices from different manufacturers varies. The virtualization platform controller can dynamically obtain the number of communication channels on the RDMA hardware as the maximum concurrency number of memory snapshot tasks. If the number of concurrent tasks exceeds the maximum concurrency number, the remaining tasks will be placed in the waiting queue until there is an idle communication channel.

[0108] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0109] Reference Figure 5 , shows a structural block diagram of a virtual machine memory snapshot device provided in an embodiment of the present invention, which may specifically include the following modules:

[0110] The memory application module 501 is used for the virtualization platform controller to receive and respond to the virtual machine memory snapshot request sent by the user side, and apply to the distributed memory management cluster device for memory that is the same as the capacity of the virtual machine memory file;

[0111] A distributed memory file system composition module 502 is used for the distributed memory management cluster device to compose a distributed memory file system with the memory with the same capacity as the virtual machine memory file obtained from the virtual machine node in the virtualization cluster, and mount it to the host directory;

[0112] The memory snapshot request sending module 503 is used for the virtualization platform controller to send a virtual machine memory snapshot request to the virtualization component libvirt;

[0113] A memory file capture and write module 504, which is used for the virtualization component libvirt to respond to the virtual machine memory snapshot request, capture the virtual machine memory file and write the virtual machine memory file into the distributed memory file system;

[0114] The memory file persistent storage module 505 is used for the distributed memory management cluster device to write the virtual machine memory file stored in the distributed memory file system into persistent storage, uninstall the distributed memory file system on the host machine, and release memory to each virtual machine node.

[0115] Optionally, the distributed memory management cluster device includes a metadata controller, a page table memory, and the distributed memory file system component module includes:

[0116] A page table mapping relationship recording submodule is used for the metadata controller to apply for free memory from the virtual machine node in the virtualization cluster according to the virtual machine memory file capacity, and record the page table mapping relationship of the applied virtual machine node free memory to the page table memory; the page table mapping relationship is the mapping information between the file block and each node memory;

[0117] The distributed memory file system composition submodule is used by the executor to compose a distributed memory file system with the applied free memory of the virtual machine node and mount it to the host directory.

[0118] Optionally, the distributed memory file system component submodule includes:

[0119] The distributed memory file system composition unit is used for, when in a concurrent memory snapshot scenario, the executor respectively composes the free memory applied for by each virtual machine node into a distributed memory file system corresponding to the virtual machine node, and mounts it to the host directory.

[0120] Optionally, the page table mapping relationship recording submodule includes:

[0121] A page table mapping relationship recording unit is used for the metadata controller to apply for free memory from the virtual machine nodes in the virtualization cluster according to the virtual machine memory file capacity, divide the virtual machine memory file into file blocks that are the same as the free memory capacity of each virtual machine node, and generate a page table mapping relationship between each file block and the corresponding virtual machine node free memory, and record the page table mapping relationship in the page table memory.

[0122] Optionally, the memory file interception and writing module includes:

[0123] A memory file interception submodule is used for the virtualization component libvirt to respond to the virtual machine memory snapshot request and intercept the virtual machine memory file;

[0124] The memory file writing submodule is used to divide the virtual machine memory file content according to the page table mapping relationship, and perform a local write operation on the local virtual machine node and / or write to the remote virtual machine node through RDMA network accelerated transmission.

[0125] Optionally, the device further comprises:

[0126] The exclusive RDMA communication channel creation module is used for the virtualization platform controller to create an exclusive RDMA communication channel for each memory snapshot task of the remote virtual machine node when the virtualization component libvirt accelerates the transmission of the virtual machine memory file content to the remote virtual machine node through the RDMA network.

[0127] Optionally, the device further comprises:

[0128] The task concurrency number determination module is used to set the maximum concurrency number of memory snapshot tasks according to the number of RDMA hardware device communication channels when in a concurrent memory snapshot scenario, and control the concurrent execution of tasks according to the maximum concurrency number. Tasks exceeding the maximum concurrency number are queued and wait for idle communication channels.

[0129] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0130] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0131] Memory 603, used for storing computer programs;

[0132] The processor 601 is used to implement the virtual machine memory snapshot method described in the above embodiment when executing the program stored in the memory 603.

[0133] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0134] The communication interface is used for communication between the above terminal and other devices.

[0135] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0136] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0137] like Figure 7 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 701 is further provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the virtual machine memory snapshot method described in the above embodiment.

[0138] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is executed on a computer, the computer executes the virtual machine memory snapshot method described in the above embodiment.

[0139] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0140] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0141] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0142] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A virtual machine memory snapshot method, characterized in that: The method comprises: The virtualization platform controller receives and responds to the virtual machine memory snapshot request sent by the user side, and applies to the distributed memory management cluster device for memory that is equal to the capacity of the virtual machine memory file; The distributed memory management cluster device composes a distributed memory file system with the memory with the same capacity as the virtual machine memory file requested from the virtual machine node in the virtualization cluster, and mounts it to the host machine directory; The virtualization platform controller sends a virtual machine memory snapshot request to the virtualization component libvirt; The virtualization component libvirt responds to the virtual machine memory snapshot request, intercepts the virtual machine memory file and writes the virtual machine memory file into the distributed memory file system; The distributed memory management cluster device writes the virtual machine memory files stored in the distributed memory file system into the persistent storage, uninstalls the distributed memory file system on the host machine, and releases memory to each virtual machine node.

2. The method according to claim 1, characterized in that The distributed memory management cluster device includes a metadata controller, a page table memory, and an executor. The distributed memory management cluster device forms a distributed memory file system with the memory with the same capacity as the virtual machine memory file requested from the virtual machine node in the virtualization cluster, and mounts it to the host directory, including: The metadata controller applies for free memory from the virtual machine node in the virtualization cluster according to the virtual machine memory file capacity, and records the page table mapping relationship of the applied virtual machine node free memory to the page table memory; the page table mapping relationship is the mapping information between the file block and each node memory; The executor uses the free memory of the virtual machine nodes to form a distributed memory file system and mounts it to the host directory.

3. The method according to claim 2, characterized in that The executor uses the free memory of the requested virtual machine nodes to form a distributed memory file system and mounts it to the host directory, including: When in a concurrent memory snapshot scenario, the executor organizes the free memory applied for by each virtual machine node into a distributed memory file system corresponding to the virtual machine node, and mounts it to the host directory.

4. The method according to claim 2, characterized in that: The metadata controller applies for free memory from the virtual machine node in the virtualization cluster according to the virtual machine memory file capacity, and records the page table mapping relationship of the applied free memory of the virtual machine node in the page table memory; The page table mapping relationship is the mapping information between the file block and each node memory, including: The metadata controller applies for free memory from the virtual machine nodes in the virtualization cluster according to the capacity of the virtual machine memory file, divides the virtual machine memory file into file blocks that are the same as the free memory capacity of each virtual machine node, generates a page table mapping relationship between each file block and the corresponding virtual machine node free memory, and records the page table mapping relationship in the page table memory.

5. The method according to claim 2, characterized in that: The virtualization component libvirt responds to the virtual machine memory snapshot request, intercepts the virtual machine memory file and writes the virtual machine memory file into the distributed memory file system, including: The virtualization component libvirt responds to the virtual machine memory snapshot request and intercepts the virtual machine memory file; According to the page table mapping relationship, the virtual machine memory file content is segmented, and a local write operation is performed on the local virtual machine node and / or the content is written to the remote virtual machine node through RDMA network accelerated transmission.

6. The method according to claim 5, characterized in that The method further comprises: When the virtualization component libvirt accelerates the transmission of virtual machine memory file contents to the remote virtual machine node through the RDMA network, the virtualization platform controller creates an exclusive RDMA communication channel for each memory snapshot task of the remote virtual machine node.

7. The method according to claim 1, characterized in that The method further comprises: When in a concurrent memory snapshot scenario, the virtualization platform controller sets the maximum concurrency number of memory snapshot tasks according to the number of RDMA hardware device communication channels, and controls the concurrent execution of tasks according to the maximum concurrency number. Tasks exceeding the maximum concurrency number queue up and wait for idle communication channels.

8. A virtual machine memory snapshot device, characterized in that: The device comprises: A memory application module is used for the virtualization platform controller to receive and respond to a virtual machine memory snapshot request sent by a user side, and to apply to the distributed memory management cluster device for memory that is equal to the capacity of the virtual machine memory file; A distributed memory file system composition module is used for the distributed memory management cluster device to compose a distributed memory file system with the memory with the same capacity as the virtual machine memory file obtained from the virtual machine node in the virtualization cluster, and mount it to the host directory; A memory snapshot request sending module is used for the virtualization platform controller to send a virtual machine memory snapshot request to the virtualization component libvirt; A memory file capture and write module is used for the virtualization component libvirt to respond to the virtual machine memory snapshot request, capture the virtual machine memory file and write the virtual machine memory file into the distributed memory file system; The memory file persistent storage module is used for the distributed memory management cluster device to write the virtual machine memory files stored in the distributed memory file system into the persistent storage, unload the distributed memory file system on the host machine, and release memory to each virtual machine node.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the virtual machine memory snapshot method according to any one of claims 1 to 7 when executing the program stored in the memory.

10. One or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to execute the virtual machine memory snapshot method according to any one of claims 1 to 7.