Fault tolerance method, device and system for virtual machine
By setting storage areas and cache areas in the storage pool of the virtual machine fault-tolerant system, periodically update the changed data and rolling back and restored data during fault-tolerant switching, the problems of high performance consumption and large network overhead in the synchronization process in the prior art are solved, and efficient virtual machine fault tolerance is achieved.
Patent Information
- Application Number
- CN202411961805.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-29
AI Technical Summary
The existing virtual machine fault tolerance technology has problems such as high performance consumption, large network overhead, and increased service delay during the synchronization process. Especially in the scenario where there are many storage resources between the main and standby virtual machines, the network bandwidth occupies a high level, affecting the fault tolerance efficiency.
By setting the storage area and the cache area in the storage pool, the changed data in the cache area is periodically updated. When the main and backup virtual machines perform fault-tolerant switching, in response to the storage restore information sent by the backup virtual machine, the changed data in the cache area is rolled back and restored to the storage area to restore the data in the storage area to the previous synchronization point.
In the process of fault-tolerant switching between primary and secondary virtual machines, it reduces network overhead, reduces service latency, improves fault-tolerant efficiency, and provides a fault-tolerant mechanism for the storage pool shared by primary and secondary virtual machines.
Smart Images

Figure CN119902853A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application belong to the technical field of virtual machines, and in particular, relate to a virtual machine fault tolerance method, device, and system. Background Art
[0002] Virtual machine fault tolerance is a technology in the field of virtualization. Its purpose is to switch services to the backup virtual machine to avoid service interruption when the primary virtual machine fails.
[0003] MicroCheckpoint is a virtual machine fault tolerance solution. MicroCheckpoint uses regular high-frequency millisecond-level virtual machine memory and state synchronization. Each synchronization requires pausing the virtual machine, which results in higher performance consumption and, to a certain extent, greater delays to the business. This solution does not involve disk data processing.
[0004] COLO (COarse-grained LOck-stepping) is another fault-tolerant solution. COLO dynamically determines whether to synchronize the virtual machine memory and state by increasing the network packet response and request situation, and realizes the synchronization of two independent local disk data between the primary and standby virtual machines by adopting block device replication technology. Although this solution reduces the performance consumption in the synchronization process to a certain extent and provides a method for processing disk data, it has certain disadvantages, including: the synchronization of disk data is limited to the two independent local storages of the primary and standby virtual machines; the network overhead of the solution is also huge, and it is necessary to plan a network including memory synchronization network, storage synchronization network, network packet forwarding network, and heartbeat network. In the scenario where there are a large number of storage resources between the primary and standby servers, the memory synchronization network and the storage synchronization network need to occupy a large network bandwidth during the synchronization process, and have high requirements for the network environment; during the synchronization process, it is necessary to transmit disk change data during the virtual machine pause time, but the disk change data is often large, which increases the time required for virtual machine pause to a certain extent, thereby increasing service delays during fault-tolerant operation. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a virtual machine fault tolerance method, device, and system, which are used to periodically update the changed data in the cache area before the primary and standby virtual machines perform fault tolerance switching. When the primary and standby virtual machines perform fault tolerance switching, the system can respond to the storage restoration information sent by the standby virtual machine to use the changed data to restore the data in the storage area to the last synchronization time point, thereby realizing a fault tolerance mechanism for the storage pool shared by the primary and standby virtual machines.
[0006] A first aspect of an embodiment of the present application provides a virtual machine fault tolerance method, which is applied to a storage pool in a virtual machine fault tolerance system, wherein the virtual machine fault tolerance system further comprises: a master-end device and a backup-end device connected to the storage pool; the master-end device runs a master virtual machine, and the backup-end device runs a backup virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the backup virtual machine; the cache area is used to cache changed data; the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the method comprises:
[0007] In response to the received storage restoration information, the changed data in the cache area is rolled back and restored to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point; the storage restoration information is generated by the standby virtual machine after determining that the primary virtual machine meets the preset fault-tolerant switching conditions;
[0008] In the case where the storage restoration information is not received, in response to the received cache clearing information, the changed data is deleted so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point; the cache clearing information is generated by the master device when the current time reaches the synchronization time point.
[0009] A second aspect of an embodiment of the present application provides a virtual machine fault tolerance method, which is applied to a master-end device in a virtual machine fault tolerance system, wherein the virtual machine fault tolerance system further comprises: a storage pool connected to the master-end device, and a standby-end device connected to the storage pool; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, and the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the method comprises:
[0010] When the current time reaches the synchronization time point, the master virtual machine is controlled to switch to a paused state and cache clearing information is generated; the cache clearing information is used to instruct the storage pool to delete the changed data so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
[0011] A third aspect of an embodiment of the present application provides a virtual machine fault tolerance method, which is applied to a standby device in a virtual machine fault tolerance system, wherein the virtual machine fault tolerance system further comprises: a storage pool connected to the standby device, and a master device connected to the storage pool; the master device runs a master virtual machine, and the standby device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, and the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the method comprises:
[0012] When it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions, storage restoration information is generated; the storage restoration information is used to instruct the storage pool to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point.
[0013] A fourth aspect of an embodiment of the present application provides a virtual machine fault tolerance device, the device is located in a storage pool in a virtual machine fault tolerance system, the virtual machine fault tolerance system further includes: a master-end device and a standby-end device connected to the storage pool; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data; the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the device includes:
[0014] A storage restoration information processing module, configured to, in response to the received storage restoration information, roll back and restore the changed data to the storage area so that the data in the storage area is restored to the last synchronization time point; the storage restoration information is generated by the standby virtual machine when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions;
[0015] The cache clearing information processing module is used to delete the changed data in response to the received cache clearing information when the storage restoration information is not received, so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
[0016] A fifth aspect of an embodiment of the present application provides a virtual machine fault tolerance device, which is applied to a master-end device in a virtual machine fault tolerance system, wherein the virtual machine fault tolerance system further comprises: a storage pool connected to the master-end device, and a standby-end device connected to the storage pool; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, and the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the device comprises:
[0017] A cache clearing information generation module is used to control the master virtual machine to switch to a pause state and generate cache clearing information when the current time reaches a synchronization time point; the cache clearing information is used to instruct the storage pool to delete the changed data so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
[0018] A sixth aspect of the embodiments of the present application provides a virtual machine fault tolerance device, which is applied to a standby device in a virtual machine fault tolerance system, wherein the virtual machine fault tolerance system further comprises: a storage pool connected to the standby device, and a master device connected to the storage pool; the master device runs a master virtual machine, and the standby device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, and the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the device comprises:
[0019] A storage restoration information generation module is used to generate storage restoration information when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions; the storage restoration information is used to instruct the storage pool to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point.
[0020] A seventh aspect of the embodiments of the present application provides a virtual machine fault tolerance system, comprising: a master-end device and a standby-end device connected to each other, and a storage pool connected to the master-end device and the standby-end device; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data; the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point;
[0021] The master-end device comprises: a cache clearing information generating module, which is used to control the master virtual machine to switch to a pause state and generate cache clearing information when the current time reaches the synchronization time point; the cache clearing information is used to instruct the storage pool to delete the changed data so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and changed at the next synchronization time point;
[0022] The standby device comprises: a storage restoration information generation module, which is used to generate storage restoration information when it is determined that the primary virtual machine meets the preset fault-tolerant switching condition; the storage restoration information is used to instruct the storage pool to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point;
[0023] The storage pool includes:
[0024] A storage restoration information processing module, configured to, in response to the received storage restoration information, roll back and restore the changed data to the storage area so that the data in the storage area is restored to the last synchronization time point; the storage restoration information is generated by the standby virtual machine when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions;
[0025] The cache clearing information processing module is used to delete the changed data in response to the received cache clearing information when the storage restoration information is not received, so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
[0026] An eighth aspect of an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the virtual machine fault tolerance method as described in the first aspect, the second aspect, or the third aspect above.
[0027] A ninth aspect of an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed, the virtual machine fault tolerance method as described in the first aspect, the second aspect, or the third aspect is executed.
[0028] A tenth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the virtual machine fault tolerance method as described in the first aspect, the second aspect, or the third aspect above is implemented.
[0029] The embodiments of the present application have the following beneficial effects:
[0030] In an embodiment of the present application, a storage area and a cache area are set up through the storage pool; the storage area is used to store write data sent by the primary virtual machine or the backup virtual machine; the cache area is used to cache changed data; the changed data is the data stored in the storage area at the last synchronization time point and has been changed at the current time point; the storage pool can respond to the received storage restoration information to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point; the storage restoration information is generated by the backup virtual machine after determining that the primary virtual machine meets the preset fault-tolerant switching conditions, so that the storage pool can respond to the cache clearing information sent by the primary virtual machine before the primary and backup virtual machines perform fault-tolerant switching, so that when the current time reaches the synchronization time point, the data stored at the last synchronization time point and has been changed at the current time point is deleted, and the data stored at the last synchronization time point and has been changed at the current time point is not received. In the case of the storage restoration information, in response to the received cache clearing information, the changed data is deleted so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point; the cache clearing information is generated by the master device when the current time reaches the synchronization time point, and the synchronization time points are periodically distributed, so that when the cache clearing information is received, the new changed data can be stored in the cache area, and the new changed data is the data that has been changed in the storage area from the current time point to the next synchronization time point, so as to realize the periodic update of the changed data, and when the primary and standby virtual machines perform fault-tolerant switching, it can respond to the storage restoration information sent by the standby virtual machine to use the changed data to restore the data in the storage area to the previous synchronization time point, so as to realize a fault-tolerant mechanism for the storage pool shared by the primary and standby virtual machines. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 This is a schematic diagram of a virtual machine fault tolerance system provided by an embodiment of the present application;
[0033] Figure 2 is a schematic diagram of a virtual machine fault tolerance method provided in an embodiment of the present application;
[0034] Figure 3 This is a schematic diagram of a working process of a master-end device in a single synchronization cycle provided by an embodiment of the present application;
[0035] Figure 4 This is a schematic diagram of a synchronization time point and a fault-tolerant switching opportunity provided by an embodiment of the present application;
[0036] Figure 5 It is a schematic diagram of a storage pool processing process of writing data provided by an embodiment of the present application;
[0037] Figure 6 is a schematic diagram of another virtual machine fault tolerance method provided in an embodiment of the present application;
[0038] Figure 7 It is a schematic diagram of another virtual machine fault tolerance method provided in an embodiment of the present application;
[0039] Figure 8 It is a schematic diagram of a virtual machine fault tolerance device provided in an embodiment of the present application;
[0040] Fig. 9 This is a schematic diagram of another virtual machine fault tolerance device provided in an embodiment of the present application;
[0041] Fig.10 It is a schematic diagram of another virtual machine fault tolerance device provided in an embodiment of the present application;
[0042] Fig.11 is another schematic diagram of a virtual machine fault tolerance system provided in an embodiment of the present application;
[0043] Fig.12 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0045] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0046] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0047] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0048] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0049] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0050] A virtual machine (VM) is a computer system implemented by software. A virtual machine simulates a complete computer hardware environment, so that operating systems and other applications can be run on the virtual machine just like running on a physical computer.
[0051] A physical machine refers to an actual hardware device, usually an independent computer or server, with hardware components such as a processor (CPU), memory (RAM), hard disk, and network interface. Unlike a virtual machine, a physical machine does not rely on virtualization technology, but directly runs operating systems and applications. One or more virtual machines can be run on a physical machine through the corresponding software.
[0052] The technical solution of the present application is described below through specific embodiments.
[0053] Reference Figure 1 , shows a virtual machine fault-tolerant system provided by an embodiment of the present application, which is applied to a storage pool in the virtual machine fault-tolerant system, and the virtual machine fault-tolerant system further includes: a master-end device and a backup-end device connected to the storage pool; the master-end device runs a master virtual machine, and the backup-end device runs a backup virtual machine;
[0054] The master device and the standby device involved in the embodiment of the present application are physical machines. The master device and the standby device can run virtual machines to provide the same service. When an abnormality occurs in the master device and the virtual machine running on it cannot provide the corresponding service normally, the standby device takes over the master device, that is, the virtual machine running on the standby device takes over the virtual machine running on the master device to maintain the corresponding service.
[0055] The storage pool may be composed of one or more storage devices, which may store data and provide data read and write services. In an embodiment of the present application, the storage pool provides data read and write services to the primary virtual machine or the backup virtual machine. If the primary virtual machine is in a running state and the backup virtual machine is in a suspended state, the storage pool provides data read and write services to the primary virtual machine; when the backup virtual machine takes over the primary virtual machine, the storage pool provides data read and write services to the backup virtual machine, and at this time the backup virtual machine can also be identified as the primary virtual machine.
[0056] The storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the primary virtual machine or the backup virtual machine. The cache area is used to cache changed data; the changed data is the data stored in the storage area at the last synchronization time point and has been changed at the current time point.
[0057] The master device may periodically synchronize with the backup device. Specifically, the master device may maintain a synchronization cycle, where the synchronization cycle is the time interval between adjacent synchronization time points, and the synchronization time point is a check point time node.
[0058] The changed data is used to roll back the storage area to the last synchronization time point. Therefore, when the master device determines that the current time has reached the synchronization time point, it instructs the storage pool to delete the current changed data so that at the next moment, the cache area can record the new changed data between the current synchronization time point and the next synchronization time point before reaching the next synchronization time point. If the master virtual machine fails before reaching the next synchronization time, the storage area can be rolled back to the most recent historical synchronization time point (i.e., the current synchronization time point mentioned above) through the new changed data.
[0059] Reference Figure 2 , shows a schematic diagram of a virtual machine fault tolerance method provided by an embodiment of the present application, which can be applied to Figure 1 The virtual machine fault tolerance system shown; the method may specifically include the following steps:
[0060] Step 201, in response to the received storage restoration information, roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point; the storage restoration information is generated by the backup virtual machine when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions.
[0061] When the standby device determines that a hardware failure has occurred in the primary device, or that the primary virtual machine cannot provide services normally, and that the primary virtual machine meets the fault-tolerant switching conditions, the standby device sends storage restoration information to the storage pool so that the storage pool uses the changed data to roll back and restore the storage area, so that the storage area is rolled back to the state of the last synchronization time point.
[0062] Step 202, in the case where the storage restoration information is not received, in response to the received cache clearing information, the changed data is deleted so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point; the cache clearing information is generated by the master device when the current time reaches the synchronization time point.
[0063] If the cache clearing information is received from the primary virtual machine without receiving the storage restoration information, it means that the primary and standby virtual machines have not undergone fault-tolerant switching, the primary virtual machine is in operation, and the storage pool needs to cache the new changed data in the cache area, that is, cache the data stored in the storage area at the current synchronization time point and changed at the next synchronization time point in the cache area to obtain the new changed data, so that if the primary and standby virtual machines undergo fault-tolerant switching before the next synchronization time point, the storage area can be rolled back and restored with the new changed data in response to the storage restoration information sent by the standby virtual machine.
[0064] It should be noted that since the primary virtual machine will send cache clearing information when the synchronization time point is reached, that is, before the primary and standby virtual machines undergo fault-tolerant switching, the storage pool will execute step 202 multiple times at intervals so that the storage pool can periodically update the changed data according to the cycle of the synchronization time point, and after receiving the cache clearing information, the new changed data will be recorded.
[0065] In an embodiment of the present application, a storage area and a cache area are set up through the storage pool; the storage area is used to store write data sent by the primary virtual machine or the backup virtual machine; the cache area is used to cache changed data; the changed data is the data stored in the storage area at the last synchronization time point and has been changed at the current time point; the storage pool can respond to the received storage restoration information to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point; the storage restoration information is generated by the backup virtual machine after determining that the primary virtual machine meets the preset fault-tolerant switching conditions, so that the storage pool can respond to the cache clearing information sent by the primary virtual machine before the primary and backup virtual machines perform fault-tolerant switching, so that when the current time reaches the synchronization time point, the data stored at the last synchronization time point and changed at the current time point is deleted, and if the backup virtual machine is not received In the case of the storage restoration information, in response to the received cache clearing information, the changed data is deleted so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point; the cache clearing information is generated by the master device when the current time reaches the synchronization time point, and the synchronization time points are periodically distributed, so that when the cache clearing information is received, the new changed data can be stored in the cache area, and the new changed data is the data that has been changed in the storage area from the current time point to the next synchronization time point, so as to realize the periodic update of the changed data, and when the primary and standby virtual machines perform fault-tolerant switching, it can respond to the storage restoration information sent by the standby virtual machine to use the changed data to restore the data in the storage area to the previous synchronization time point, so as to realize a fault-tolerant mechanism for the storage pool shared by the primary and standby virtual machines.
[0066] In some implementations of the embodiments of the present application, the storage area and the cache area have the same data address; the storage pool further includes mapping information; the mapping information records the data address and a change identifier with the data address; the mapping information records the data address and a change identifier with the data address; in response to the received storage restoration information, rolling back and restoring the changed data to the storage area includes:
[0067] In response to the received storage restoration information, determining that the data address corresponding to the change mark in the mapping information that has been changed is the address to be rolled back;
[0068] The data corresponding to the address to be rolled back in the buffer area overwrites the data corresponding to the address to be rolled back in the storage area.
[0069] The mapping information records each data address and its corresponding change identifier. The storage pool can determine the data address where data has changed in the storage area from the last synchronization time node to the current time based on the change identifier. After receiving the storage restoration information, the address where data has changed is the address to be rolled back. The storage area is rolled back to the state of the last synchronization time point by overwriting the data corresponding to the address to be rolled back in the cache area with the data of the address to be rolled back in the storage area.
[0070] In some implementations of the embodiments of the present application, the storage area and the cache area have the same data address; the method further includes:
[0071] Determining a write address for the write data;
[0072] Determine a data address consistent with the write address as a target address;
[0073] If the data corresponding to the target address in the storage area has not been changed, cache the data corresponding to the target address in the storage area to the data corresponding to the target address in the cache area, and save the written data in the target address in the storage area;
[0074] If the data corresponding to the target address in the storage area has been changed, the write data is saved in the target address in the storage area.
[0075] When receiving the write data sent by the master virtual machine, the storage pool determines the address to be written of the write data. The address to be written is generated by the master virtual machine and sent to the storage pool, or the address to be written is obtained by mapping the storage pool according to the address to be processed sent by the master virtual machine.
[0076] If the data corresponding to the target address in the storage area has not been changed, the data corresponding to the target address in the storage area is cached to the data corresponding to the target address in the cache area, and the write data is saved in the target address of the storage area, so that the changed data contains the data that has been changed in the storage area after the last synchronization time point.
[0077] It should be noted that if the written data is the same as the data corresponding to the target address in the storage area, there is no need to save the data corresponding to the target address in the storage area to the cache area.
[0078] If the data corresponding to the target address in the storage area has not been changed, and the data corresponding to the target address in the current storage area is empty (i.e., there is no specific data content), then there is no need to save the data corresponding to the target address in the storage area to the cache area. If the data corresponding to the target address in the storage area has been changed, there is no need to save the data corresponding to the target address in the storage area to the cache area, and the write data is directly saved in the target address in the storage area.
[0079] In some implementations of the embodiments of the present application, the storage pool further includes mapping information; the mapping information records the data address and a change identifier of the data address; after determining that the data address consistent with the write address is the target address, the method further includes:
[0080] If the change flag corresponding to the target address is unchanged, determining that the data corresponding to the target address in the storage area has not been changed;
[0081] If the change flag corresponding to the target address is changed, it is determined that the data corresponding to the target address in the storage area has been changed.
[0082] In a specific implementation, the change flag can be set to a first value or a second value. If the change flag is the first value, the change flag is determined to be unchanged. If the change flag is the second value, the change flag is determined to be changed. When receiving write data, the value of the change flag in the mapping information can be read according to the address to be written to identify whether the data corresponding to the target address in the storage area has been changed.
[0083] In some implementations of the embodiments of the present application, after the data corresponding to the target address in the storage area is saved in the target address in the cache area, the method further includes: updating a change flag corresponding to the target address to changed.
[0084] If the data corresponding to the target address in the storage area is saved in the target address in the cache area, it means that the original data of the target address in the memory has been changed. Therefore, the change flag corresponding to the target address is set to changed in the mapping information, so that when the write data corresponding to the target address is received next time, it can be determined that the data corresponding to the target address of the storage area is the changed data.
[0085] It should be noted that if the data corresponding to the target address in the storage area has not been changed, and the data corresponding to the target address in the current storage area is empty (that is, there is no specific data content), although there is no need to cache the specific data to the cache area, it is necessary to set the change flag corresponding to the target address to changed in the mapping information.
[0086] In an embodiment of the present application, the storage pool can also receive a data read request sent by the primary virtual machine, determine that the data address corresponding to the data read request is the read address, and return the data stored in the read address of the storage area to the primary virtual machine to complete the data read request.
[0087] In some implementations of the embodiments of the present application, the master device is used to control the primary virtual machine to switch to a pause state and obtain the data to be synchronized of the primary virtual machine within a target time interval when the current time reaches the synchronization time point; generate the cache clearing information; send the data to be synchronized to the standby virtual machine; the target time interval is the time between the last synchronization time point and the completion of the switching of the primary virtual machine to the pause state; the data to be synchronized includes memory dirty page data;
[0088] The standby device is used to control the standby virtual machine to update its own memory state using the memory dirty page data and generate the storage restoration information when it is determined that the primary virtual machine meets the preset fault-tolerant switching condition.
[0089] The master device can determine whether the current time is a synchronization time point, and when the current time is a synchronization time point, control the master virtual machine to switch to a pause state so that it does not generate new memory dirty pages, and read the current memory dirty pages of the master virtual machine. It can be understood that the currently acquired memory dirty page data is the memory dirty page generated between the last synchronization time point and the completion of the master virtual machine switching to the pause state.
[0090] The primary device sends the data to be synchronized including the memory dirty page data to the standby virtual machine, so that when the standby virtual machine switches from the paused state to the running state, the standby device uses the data to be synchronized to synchronize the standby virtual machine to the state of the primary virtual machine at the last synchronization time point.
[0091] After sending the data to be synchronized and the cache clearing information, the master device switches the master virtual machine to the running state so that it can continue to provide services until the next synchronization time point is reached, so as to avoid the master virtual machine making data changes to the storage area after the master device sends the data to be synchronized and before clearing the changed data, resulting in the changed data not matching the data to be synchronized.
[0092] When the standby device determines that a hardware failure has occurred in the master device, or that the master virtual machine cannot provide services normally, and determines that the master virtual machine meets the fault-tolerant switching conditions, the standby device uses the most recently received memory dirty page data to update the memory state of the standby virtual machine, so that the memory state of the standby virtual machine is synchronized to the memory state of the master virtual machine at the last synchronization time point. The standby device sends storage restoration information to the storage pool, so that the storage pool uses the changed data to roll back and restore the storage area, so that the storage area is rolled back to the state at the last synchronization time point, and the memory state of the standby virtual machine is consistent with the storage area state of the storage pool.
[0093] In one implementation of the embodiment of the present application, the memory dirty page data is generated by the following steps:
[0094] The master device reads the first memory dirty page of the master virtual machine from the last synchronization time point to the current synchronization time point;
[0095] The master device reads a second memory dirty page from the current synchronization time point to the current time when the master virtual machine is in a paused state;
[0096] The master device generates memory dirty page data based on the first memory dirty page and the second memory dirty page.
[0097] The master-end device can pre-cache the memory dirty pages generated after the master virtual machine switched from the paused state to the running state at the last synchronization time point to the current synchronization time point, that is, the first memory dirty page, so as to reduce the data that needs to be cached after the master virtual machine is paused, and reduce the time required for the master virtual machine to switch from the running state to the paused state. Then obtain the newly added memory dirty pages during the switching of the master virtual machine from the running state to the paused state, that is, the second memory dirty page. The first memory dirty page and the second memory dirty page are used as memory dirty page data, thereby extracting the memory dirty page data of the master virtual machine from the last synchronization time point to the paused state, so that the standby-end device can obtain the memory dirty page data generated by the master-end device in the complete synchronization cycle.
[0098] Reference Figure 3 , shows a workflow of a master-end device in a single synchronization cycle provided by an embodiment of the present application, including:
[0099] 1. The master device pre-caches the memory dirty page data (first memory page) from the last synchronization time point to the current synchronization time point, reducing the amount of memory that needs to be cached after suspending the master virtual machine and reducing the time required to suspend the master virtual machine.
[0100] 2. The master device controls the master virtual machine to switch to the pause state.
[0101] 3. The master device caches the newly added dirty page data (second memory page) from the current synchronization time point to the current time point again.
[0102] 4. Transfer the secondary dirty page data and the current hardware status to the standby virtual machine and wait for the transfer to complete.
[0103] 5. Send cache clearing information to the storage pool. That is, clear the mapping of disk data persisted in the storage cache space after the last cycle, and start recording the new data of the new synchronization cycle (current cycle).
[0104] 6. The master device controls the master virtual machine to switch to the running state.
[0105] 7. Continue running and wait for the next synchronization cycle.
[0106] In the embodiment of the present application, steps 1 to 6 can be completed within millimeter level, and the service interruption is not perceived. The time between adjacent synchronization time points can be set according to actual needs, for example, set to several seconds.
[0107] Reference Figure 4 , shows a schematic diagram of a synchronization time point and fault-tolerant switching timing provided by an embodiment of the present application, in which the master device sends data to be synchronized to the backup device at the synchronization time point CT2. The time when the master virtual machine crashes is the fault-tolerant time point FT, and the backup virtual machine synchronizes the memory state of the backup virtual machine at the fault-tolerant time point using the data to be synchronized sent by the master device at the synchronization time point CT2, and sends storage restoration information to the storage pool, so that the storage pool uses the changed data recorded from the synchronization time point CT2 to the fault-tolerant time point FT for rollback. Since the change record contains the data that has been changed at the last synchronization time point (synchronization time point CT2) relative to the current time (fault-tolerant time point FT), the storage pool can use the changed data to roll back the storage area to its state at the synchronization time point CT2, that is, at the fault-tolerant time point FT, the memory state of the standby virtual machine is consistent with the memory state of the primary virtual machine at the synchronization time point CT2, and the state of the storage area is consistent with its state at the synchronization time point CT2. After fault-tolerant switching is implemented, the memory state of the standby virtual machine matches the state of the storage area, and the state of the storage area is consistent with its state at the last synchronization time node. After fault-tolerant switching is implemented, the memory state of the virtual machine is consistent with the storage state of the storage pool, and the overall RPO (Recovery Point Objective) of fault-tolerant switching is one synchronization cycle (the time between adjacent synchronization time points).
[0108] In some implementations, the data to be synchronized also includes hardware status information of the primary virtual machine; when the standby device determines that the primary virtual machine meets the preset fault-tolerant switching conditions, it also uses the hardware status information to set the hardware status of the standby virtual machine, so that during the fault-tolerant switching, the memory status and hardware status of the standby virtual machine are consistent with the status of the primary virtual machine at the last synchronization time point. Figure 4 For example, at the fault-tolerant time point FT, the standby device uses the hardware status information sent by the master device at the synchronization time point CT2 to configure the hardware status of the standby virtual machine, so that the hardware status of the standby virtual machine is consistent with the hardware status of the master virtual machine at the synchronization time point CT2.
[0109] Reference Figure 5 , shows a schematic diagram of a storage pool processing process for writing data provided by an embodiment of the present application. One or more source data volumes can be divided in the storage area of the storage pool. A source data set is mounted on the primary virtual machine and the backup virtual machine at the same time. The storage pool constructs a cache volume (COW volume, COW is Copy-On-Write) with the same address in the cache area for each source data volume, as well as the corresponding mapping information (in Figure 5 For example, the mapping information may be a mapping table), and the processing process includes:
[0110] 1. Receive a write command (for example: Addr1 = DDD), where Addr1 is the target address and DDD is the write data.
[0111] 2. Determine whether the change flag of the target address has been changed according to the mapping table (mapping information). Figure 5 As shown, the change flag of Addr1 in the mapping table is unchanged (0), then step 3 is executed.
[0112] 3. Save the data BBB stored in Addr1 in the source data set to Addr1 in the cache area.
[0113] 4. Change the change flag of Addr1 in the mapping table to changed (1).
[0114] 5. Save the data DDD to Addr1 in the source data volume.
[0115] In another case, if the change flag of Addr1 in the above step 2 is changed (1), there is no need to think only of the above steps 3 and 4, and step 5 can be directly executed.
[0116] Reference Figure 6, shows a schematic diagram of another virtual machine fault tolerance method provided by an embodiment of the present application, the embodiment of the present application is applied to a master-end device in a virtual machine fault tolerance system, the virtual machine fault tolerance system also includes: a storage pool connected to the master-end device, a standby-end device connected to the storage pool; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, the changed data is the data stored in the storage area at the last synchronization time point and has been changed at the current time point; the embodiment of the present application includes the following steps:
[0117] Step 601, when the current time reaches the synchronization time point, controls the main virtual machine to switch to a pause state and generates cache clearing information; the cache clearing information is used to instruct the storage pool to delete the changed data so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
[0118] In some implementations of the embodiments of the present application, the following is also included:
[0119] When the current time reaches the synchronization time point, control the master virtual machine to switch to a pause state and obtain the data to be synchronized of the master virtual machine within the target time interval;
[0120] The data to be synchronized is sent to the standby virtual machine; the target time interval is the time between the last synchronization time point and the time when the primary virtual machine completes the switching pause state; the data to be synchronized includes memory dirty page data.
[0121] Reference Figure 7 , shows a schematic diagram of another virtual machine fault tolerance method provided by an embodiment of the present application, the embodiment of the present application is applied to a standby device in a virtual machine fault tolerance system, the virtual machine fault tolerance system also includes: a storage pool connected to the standby device, a master device connected to the storage pool; the master device runs a master virtual machine, and the standby device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, the changed data is the data stored in the storage area at the last synchronization time point and has been changed at the current time point; the method includes:
[0122] Step 701, after determining that the primary virtual machine meets the preset fault-tolerant switching conditions, generates storage restoration information; the storage restoration information is used to instruct the storage pool to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point.
[0123] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0124] Reference Figure 8 , shows a schematic diagram of a virtual machine fault tolerance device provided by an embodiment of the present application, the device is located in a storage pool in a virtual machine fault tolerance system, the virtual machine fault tolerance system also includes: a master-end device and a standby-end device connected to the storage pool; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data; the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the device includes:
[0125] The storage restoration information processing module 801 is used to respond to the received storage restoration information, roll back and restore the changed data to the storage area, so that the data in the storage area is restored to the last synchronization time point; the storage restoration information is generated by the standby virtual machine when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions;
[0126] The cache clearing information processing module 802 is used to delete the changed data in response to the received cache clearing information when the storage restoration information is not received, so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
[0127] In some implementations of the embodiments of the present application, the storage area and the cache area have the same data address; the storage pool further includes mapping information; the mapping information records the data address and a change identifier with the data address; the mapping information records the data address and a change identifier with the data address; the storage restoration information processing module 801 includes:
[0128] A to-be-rolled-back address determination submodule, configured to determine, in response to the received storage restoration information, a data address corresponding to a change mark in the mapping information that has been changed as an address to be rolled back;
[0129] The data overwriting submodule is used to overwrite the data corresponding to the address to be rolled back in the storage area with the data corresponding to the address to be rolled back in the cache area.
[0130] In some implementations of the embodiments of the present application, the storage area and the cache area have the same data address; and the device further includes:
[0131] A write address determination module, used to determine the write address of the write data;
[0132] A target address determination module, used to determine a data address consistent with the write address as a target address;
[0133] A write data processing module is used to cache the data corresponding to the target address in the storage area to the data corresponding to the target address in the cache area if the data corresponding to the target address in the storage area has not been changed, and save the write data in the target address in the storage area; if the data corresponding to the target address in the storage area has been changed, save the write data in the target address in the storage area.
[0134] In some implementations of the embodiments of the present application, the storage pool further includes mapping information; the mapping information records the data address and a change identifier of the data address; after determining that the data address consistent with the write address is the target address, the device further includes:
[0135] A change status determination module is used to determine that the data corresponding to the target address in the storage area has not changed if the change identifier corresponding to the target address is unchanged; if the change identifier corresponding to the target address is changed, determine that the data corresponding to the target address in the storage area has changed.
[0136] In some implementations of the embodiments of the present application, the device further includes:
[0137] A change identification updating module is used to update the change identification corresponding to the target address to changed after saving the data corresponding to the target address in the storage area in the target address of the cache area.
[0138] Reference Fig. 9, shows a schematic diagram of another virtual machine fault tolerance device provided by an embodiment of the present application, which is applied to a master-end device in a virtual machine fault tolerance system, wherein the virtual machine fault tolerance system further comprises: a storage pool connected to the master-end device, and a standby-end device connected to the storage pool; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, and the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the device comprises:
[0139] The cache clearing information generation module 901 is used to control the main virtual machine to switch to a paused state and generate cache clearing information when the current time reaches the synchronization time point; the cache clearing information is used to instruct the storage pool to delete the changed data so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
[0140] Reference Fig.10 , shows a schematic diagram of another virtual machine fault tolerance device provided by an embodiment of the present application, which is applied to a standby device in a virtual machine fault tolerance system, wherein the virtual machine fault tolerance system further comprises: a storage pool connected to the standby device, and a master device connected to the storage pool; the master device runs a master virtual machine, and the standby device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, and the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the device comprises:
[0141] The storage restoration information generation module 1001 is used to generate storage restoration information when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions; the storage restoration information is used to instruct the storage pool to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point.
[0142] Reference Fig.11, shows another schematic diagram of a virtual machine fault-tolerant system provided by an embodiment of the present application, a master-end device 1110 and a standby-end device 1120 connected to each other, and a storage pool 1130 connected to the master-end device 1110 and the standby-end device 1120; the master-end device 1110 runs a master virtual machine, and the standby-end device 1120 runs a standby virtual machine; the storage pool 1130 is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data; the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point;
[0143] The master device 1110 includes: a cache clearing information generating module 901, which is used to control the master virtual machine to switch to a pause state and generate cache clearing information when the current time reaches the synchronization time point; the cache clearing information is used to instruct the storage pool to delete the changed data so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and changed at the next synchronization time point;
[0144] The standby device 1120 includes: a storage restoration information generation module 1001, which is used to generate storage restoration information when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions; the storage restoration information is used to instruct the storage pool to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point;
[0145] The storage pool 1130 includes:
[0146] The storage restoration information processing module 801 is used to respond to the received storage restoration information, roll back and restore the changed data to the storage area, so that the data in the storage area is restored to the last synchronization time point; the storage restoration information is generated by the standby virtual machine when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions;
[0147] The cache clearing information processing module 802 is used to delete the changed data in response to the received cache clearing information when the storage restoration information is not received, so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
[0148] As for the system embodiment, since it is basically similar to the device embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the device embodiment part.
[0149] Reference Fig.12, shows a schematic diagram of an electronic device provided by an embodiment of the present application. Fig.12 As shown, the electronic device 1200 in the embodiment of the present application includes: a processor 1210, a memory 1220, and a computer program 1221 stored in the memory 1220 and executable on the processor 1210. When the processor 1210 executes the computer program 1221, the steps in each embodiment of the above virtual machine fault tolerance method are implemented, such as Figure 2 Steps 201 to 202 are shown.
[0150] Exemplarily, the computer program 1221 may be divided into one or more modules / units, which are stored in the memory 1220 and executed by the processor 1210 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which may be used to describe the execution process of the computer program 1221 in the electronic device 1200.
[0151] The electronic device 1200 may include, but is not limited to, a processor 1210 and a memory 1220. Those skilled in the art will appreciate that Fig.12 It is only an example of the electronic device 1200 and does not constitute a limitation of the electronic device 1200. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 1200 may also include input and output devices, network access devices, buses, etc.
[0152] The processor 1210 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0153] The memory 1220 may be an internal storage unit of the electronic device 1200, such as a hard disk or memory of the electronic device 1200. The memory 1220 may also be an external storage device of the electronic device 1200, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 1200. Further, the memory 1220 may also include both an internal storage unit of the electronic device 1200 and an external storage device. The memory 1220 is used to store the computer program 1221 and other programs and data required by the electronic device 1200. The memory 1220 may also be used to temporarily store data that has been output or is to be output.
[0154] The embodiment of the present application further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the virtual machine fault tolerance method as described in the above embodiments is implemented.
[0155] The embodiment of the present application further discloses a computer program product, including a computer program. When the computer program is executed, the virtual machine fault tolerance method as described in the above embodiments is executed.
[0156] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A virtual machine fault tolerance method, characterized in that: A storage pool applied to a virtual machine fault-tolerant system, the virtual machine fault-tolerant system further comprising: a master-end device and a standby-end device connected to the storage pool; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data; the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the method comprises: In response to the received storage restoration information, the changed data in the cache area is rolled back and restored to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point; the storage restoration information is generated by the standby virtual machine after determining that the primary virtual machine meets the preset fault-tolerant switching conditions; In the case where the storage restoration information is not received, in response to the received cache clearing information, the changed data is deleted so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point; the cache clearing information is generated by the master device when the current time reaches the synchronization time point.
2. The method according to claim 1, characterized in that The storage area and the cache area have the same data address; the storage pool further includes mapping information; the mapping information records the data address and a change identifier with respect to the data address; the mapping information records the data address and a change identifier with respect to the data address; The step of rolling back and restoring the changed data to the storage area in response to the received storage restoration information includes: In response to the received storage restoration information, determining that the data address corresponding to the change mark in the mapping information that has been changed is the address to be rolled back; The data corresponding to the address to be rolled back in the buffer area overwrites the data corresponding to the address to be rolled back in the storage area.
3. The method according to claim 1 or 2, characterized in that: The storage area and the cache area have the same data address; the method further comprises: Determining a write address for the write data; Determine a data address consistent with the write address as a target address; If the data corresponding to the target address in the storage area has not been changed, cache the data corresponding to the target address in the storage area to the data corresponding to the target address in the cache area, and save the written data in the target address in the storage area; If the data corresponding to the target address in the storage area has been changed, the write data is saved in the target address in the storage area.
4. A virtual machine fault tolerance method, characterized in that: A master-end device applied to a virtual machine fault-tolerant system, the virtual machine fault-tolerant system further comprising: a storage pool connected to the master-end device, and a standby-end device connected to the storage pool; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, the changed data being data stored in the storage area at the last synchronization time point and changed at the current time point; the method comprises: When the current time reaches the synchronization time point, the master virtual machine is controlled to switch to a paused state and cache clearing information is generated; the cache clearing information is used to instruct the storage pool to delete the changed data so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
5. A virtual machine fault tolerance method, characterized in that: A standby device applied to a virtual machine fault-tolerant system, the virtual machine fault-tolerant system further comprising: a storage pool connected to the standby device, a master device connected to the storage pool; the master device runs a master virtual machine, and the standby device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, the changed data being data stored in the storage area at the last synchronization time point and changed at the current time point; the method comprises: When it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions, storage restoration information is generated; the storage restoration information is used to instruct the storage pool to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point.
6. A virtual machine fault tolerance device, characterized in that: The device is located in a storage pool in a virtual machine fault-tolerant system, and the virtual machine fault-tolerant system further includes: a master-end device and a standby-end device connected to the storage pool; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data; the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the device includes: A storage restoration information processing module, configured to, in response to the received storage restoration information, roll back and restore the changed data to the storage area so that the data in the storage area is restored to the last synchronization time point; the storage restoration information is generated by the standby virtual machine when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions; The cache clearing information processing module is used to delete the changed data in response to the received cache clearing information when the storage restoration information is not received, so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
7. A virtual machine fault tolerance device, characterized in that: A master-end device applied to a virtual machine fault-tolerant system, the virtual machine fault-tolerant system further comprising: a storage pool connected to the master-end device, a standby-end device connected to the storage pool; the master-end device runs a master virtual machine, the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, the changed data is data stored in the storage area at the last synchronization time point and has been changed at the current time point; the device comprises: A cache clearing information generation module is used to control the master virtual machine to switch to a pause state and generate cache clearing information when the current time reaches a synchronization time point; the cache clearing information is used to instruct the storage pool to delete the changed data so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
8. A virtual machine fault tolerance device, characterized in that: A standby device applied to a virtual machine fault-tolerant system, the virtual machine fault-tolerant system further comprising: a storage pool connected to the standby device, a master device connected to the storage pool; the master device runs a master virtual machine, the standby device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; the cache area is used to cache changed data, the changed data being data stored in the storage area at the last synchronization time point and changed at the current time point; the device comprises: A storage restoration information generation module is used to generate storage restoration information when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions; the storage restoration information is used to instruct the storage pool to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point.
9. A virtual machine fault-tolerant system, characterized in that: include: A master-end device and a standby-end device connected to each other, and a storage pool connected to the master-end device and the standby-end device; the master-end device runs a master virtual machine, and the standby-end device runs a standby virtual machine; the storage pool is provided with a storage area and a cache area; the storage area is used to store write data sent by the master virtual machine or the standby virtual machine; The buffer area is used to cache the changed data; The changed data is data stored in the storage area at the last synchronization time point and changed at the current time point; The master-end device comprises: a cache clearing information generating module, which is used to control the master virtual machine to switch to a pause state and generate cache clearing information when the current time reaches the synchronization time point; the cache clearing information is used to instruct the storage pool to delete the changed data so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and changed at the next synchronization time point; The standby device comprises: a storage restoration information generation module, which is used to generate storage restoration information when it is determined that the primary virtual machine meets the preset fault-tolerant switching condition; the storage restoration information is used to instruct the storage pool to roll back and restore the changed data in the cache area to the storage area, so that the data in the storage area is restored to the data at the last synchronization time point; The storage pool includes: A storage restoration information processing module, configured to, in response to the received storage restoration information, roll back and restore the changed data to the storage area so that the data in the storage area is restored to the last synchronization time point; the storage restoration information is generated by the standby virtual machine when it is determined that the primary virtual machine meets the preset fault-tolerant switching conditions; The cache clearing information processing module is used to delete the changed data in response to the received cache clearing information when the storage restoration information is not received, so that the cache area caches new changed data, and the new changed data is the data stored in the storage area at the current synchronization time point and has been changed at the next synchronization time point.
10. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 3, the method according to claim 4, or the method according to claim 5.