CN111984365B - Virtual machine virtual disk dual-live implementation method and system - Google Patents

Virtual machine virtual disk dual-live implementation method and system Download PDF

Info

Publication number
CN111984365B
CN111984365B CN202010709945.6A CN202010709945A CN111984365B CN 111984365 B CN111984365 B CN 111984365B CN 202010709945 A CN202010709945 A CN 202010709945A CN 111984365 B CN111984365 B CN 111984365B
Authority
CN
China
Prior art keywords
disk
data
virtual
log
disks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010709945.6A
Other languages
Chinese (zh)
Other versions
CN111984365A (en
Inventor
方浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010709945.6A priority Critical patent/CN111984365B/en
Publication of CN111984365A publication Critical patent/CN111984365A/en
Application granted granted Critical
Publication of CN111984365B publication Critical patent/CN111984365B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2056Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant by mirroring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Hardware Redundancy (AREA)

Abstract

The invention provides a method and a system for realizing double-activity of virtual disks of a virtual machine, wherein a log disk and a data disk are arranged in each virtual disk, so that data in the two virtual disks are kept consistent, a main branch and a secondary branch are arranged on the two log disks, when the virtual machine reads data, the data are preferentially obtained and loaded from the main log disk, after the failure recovery occurs, bitmaps of the two virtual disks are read at the failure time, difference data are obtained, and data recovery is carried out, so that the double-activity switching of the virtual disks is ensured, the automatic switching to the other storage work after the failure of one storage back end of the virtual machine can be met, and the working storage back end can still be switched to work after the failure of the storage is recovered. The invention does not depend on the double-active function of the storage back end, the storage back end can be from different storage models, the backup and double-active functions of the virtual machine data are provided in the aspect of virtualization, a uniform backup disaster tolerance scheme is provided, and the reliability of the virtual machine is greatly improved.

Description

Virtual machine virtual disk dual-live implementation method and system
Technical Field
The invention relates to the technical field of virtual machines, in particular to a virtual disk double-live realization method and system of a virtual machine.
Background
According to the location, the deployment mode and the like of disaster tolerance, the disaster tolerance can be divided into disaster tolerance and dual activities in the same city, which means that data redundancy of a production system and a disaster backup system in the disaster backup system is realized, and when the production system fails, the disaster backup system is automatically switched to, so that the data of the production system is not influenced.
In a traditional scenario, on a virtualization or cloud platform, a dual-active scheme for a virtual machine to store data is generally provided by a storage device. And when the server or the storage fails, the double-active function of the storage is triggered to achieve the double-active of the application or the data of the virtual machine. However, in a data center, storage devices for different manufacturers and homes, that is, heterogeneous storage devices, may exist, and due to compatibility of different manufacturers, the dual-active function of different manufacturers and different storage devices cannot be achieved between the storage devices.
Disclosure of Invention
The invention aims to provide a method and a system for realizing double liveness of a virtual disk of a virtual machine, which aim to solve the problem that the double liveness of storage equipment cannot be realized because different storage equipment cannot be compatible with each other in the prior art, realize automatic switching to another storage operation after one storage back end of the virtual machine fails, and improve the reliability of the virtual machine.
In order to achieve the technical purpose, the invention provides a virtual machine virtual disk dual-live implementation method, which comprises the following operations:
setting two virtual disks, wherein each virtual disk is provided with a log disk and a data disk, the data written into the data disk is recorded in the log disk by using a bitmap, the data in the two virtual disks are kept consistent, a main part and an auxiliary part are set for the two log disks, and when reading data, a virtual machine preferentially acquires and loads the data from the main log disk;
when a certain virtual disk fails, upgrading the log disk of another virtual disk into a main log disk, marking the failure time of the failed virtual disk in the main log disk, setting a backup recovery thread in a Qemu process to monitor whether the failed virtual disk is recovered to be normal or not, and reading bitmaps of the two virtual disks at the failure time after the failed virtual disk is recovered to be normal, acquiring difference data and recovering the data;
and after the power failure of the server and the storage is recovered, the virtual machine reads data, detects bitmaps of the two log disks, and triggers data recovery after detecting the difference data.
Preferably, the log disk of the two virtual disks is a master log disk when initialized, after counting read-write response time of data sent by the two log disks in the virtual machine, if a certain log disk is faster, the log disk is the master log disk, the log disk with slow IO response is an auxiliary log disk, and when the read-write data of the virtual machine has an error in the certain log disk, the read-write data of the virtual machine is degraded to the auxiliary log disk.
Preferably, the master log disk records the failure time of the failed log disk and whether information is recovered.
Preferably, the data recovery process after the disk is recovered to normal is as follows:
if the failure of the virtual disk B is recovered, reading A, B bitmaps of the two virtual disks in the failure, taking out the difference data, gradually copying the data, suspending the virtual machine when the A, B two virtual disks reach the mirror image state, deleting the failure record of the virtual disk B in the log disk in the virtual disk A, and marking the recovery process to be finished.
The invention also provides a virtual machine virtual disk double-live implementation system, which comprises:
the dual-active deployment module is used for setting two virtual disks, a log disk and a data disk are arranged in each virtual disk, data written into the data disk are recorded in the log disk by using a bitmap, the data in the two virtual disks are kept consistent, a main point and a secondary point are arranged on the two log disks, and when data are read, a virtual machine preferentially obtains and loads the data from the main log disk;
the failure recovery module is used for upgrading the log disk of another virtual disk into a main log disk when a certain virtual disk fails, marking the failure time of the failed virtual disk in the main log disk, setting a backup recovery thread in a Qemu process to monitor whether the failed virtual disk is recovered to be normal or not, and reading bitmaps of the two virtual disks of the failure time after the failed virtual disk is recovered to be normal, acquiring differential data and recovering data;
And the power failure recovery module is used for detecting bitmaps of the two log disks when the server and the storage are subjected to power failure recovery and the virtual machine reads data, and triggering data recovery after detecting the difference data.
Preferably, the log disk of the two virtual disks is a master log disk when initialized, after counting read-write response time of data sent by the two log disks in the virtual machine, if a certain log disk is faster, the log disk is the master log disk, the log disk with slow IO response is an auxiliary log disk, and when the read-write data of the virtual machine has an error in the certain log disk, the read-write data of the virtual machine is degraded to the auxiliary log disk.
Preferably, the master log disk records the failure time of the failed log disk and whether information is recovered.
The invention also provides a virtual machine virtual disk dual-live implementation device, which comprises:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the virtual machine virtual disk dual-live realization method.
The invention also provides a readable storage medium for storing a computer program, wherein the computer program is used for realizing the virtual disk double-live realization method of the virtual machine when being executed by a processor.
The effect provided in the summary of the invention is only the effect of the embodiment, not all the effects of the invention, and one of the above technical solutions has the following advantages or beneficial effects:
compared with the prior art, the invention provides a log disk mechanism, which is characterized in that a log disk and a data disk are arranged in each virtual disk, so that data in the two virtual disks are kept consistent, a main sub-disk is arranged on the two log disks, when a virtual machine reads data, the data is preferentially acquired and loaded from the main log disk, after failure recovery occurs, bitmaps of the two virtual disks in failure time are read, differential data are acquired, and data recovery is carried out, so that the double-active switching of the virtual disks is ensured, the automatic switching to the other storage work after the failure of one storage back end of the virtual machine can be met, and the work of the storage back end can still be switched after the failure of the storage is recovered. The invention does not depend on the double-active function of the storage back end, the storage back end can be from different storage models, the backup and double-active functions of the virtual machine data are provided in the aspect of virtualization, a uniform backup disaster tolerance scheme is provided, the invention has great advantages, and the reliability of the virtual machine is greatly improved.
Drawings
Fig. 1 is a flowchart of a method for implementing virtual disk double live in a virtual machine according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a dual live deployment scenario of a virtual machine according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a failure state of one of the virtual disks according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a fully powered down state provided in an embodiment of the present invention;
fig. 5 is a block diagram of a virtual machine virtual disk dual-active implementation system provided in an embodiment of the present invention.
Detailed Description
In order to clearly explain the technical features of the present invention, the following detailed description of the present invention is provided with reference to the accompanying drawings. The following disclosure provides many different embodiments, or examples, for implementing different features of the invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. It should be noted that the components illustrated in the figures are not necessarily drawn to scale. Descriptions of well-known components and processing techniques and procedures are omitted so as to not unnecessarily limit the invention.
The following describes a method and a system for implementing dual live of a virtual disk of a virtual machine according to an embodiment of the present invention in detail with reference to the accompanying drawings.
As shown in fig. 1, the present invention discloses a method for implementing dual live of virtual disks of a virtual machine, wherein the method comprises the following operations:
setting two virtual disks, wherein a log disk and a data disk are arranged in each virtual disk, data written into the data disk are recorded in the log disk by using a bitmap, the data in the two virtual disks are kept consistent, a main part and a secondary part are arranged on the two log disks, and when data is read, a virtual machine preferentially acquires and loads the data from the main log disk;
when a certain virtual disk fails, upgrading the log disk of another virtual disk into a main log disk, marking the failure time of the failed virtual disk in the main log disk, setting a backup recovery thread in a Qemu process to monitor whether the failed virtual disk is recovered to be normal or not, and reading bitmaps of the two virtual disks at the failure time after the failed virtual disk is recovered to be normal, acquiring difference data and recovering the data;
and after the power failure recovery of the server and the storage, the virtual machine reads data, detects bitmaps of the two log disks, and triggers data recovery after detecting the difference data.
As shown in fig. 2, the dual live virtual disk of the virtual machine includes two parts: the system comprises a Journal log disk and a Volume data disk, wherein the Journal disk and the Volume disk are added in pairs, each virtual disk for adding data of a virtual machine can provide a Journal disk by default, and two virtual disks of double activities can come from different storage devices.
The Journal disk and the Volume disk are LUNs (Logical Unit Number) or files.
The Journal disk is used for processing a data recovery scene under a storage failure or host power failure scene. Because the virtual machine is sending data, when a related fault occurs, some data can exist and is not written into the virtual disk, and when the virtual machine is started again, the data in the double-live virtual disks needs to be restored to a consistent state according to the related data recorded in the Journal disk.
The Journal disc records data that has been written to the Volume disc using a BitMap (BitMap). One BitMap represents 256K of data, and only a write operation and written data are recorded in the Journal disk, while the offset and length of the write operation are recorded. The concept of adding the main copy to the two Journal disks is that the two Journal disks are simultaneously the main copy during initialization, after the read-write response time of the data sent by the virtual machine by the two Journal disks is counted, if the speed of a certain Journal disk is faster, the Journal disk is the main copy, the Journal disk with slow IO response is the secondary copy, and when the read-write data of the virtual machine has errors on the certain Journal disk, the Journal disk is degraded into the secondary copy. When the virtual machine reads data, the data is preferentially acquired from the main copy and loaded, namely the data is returned from the storage with better performance as much as possible. The Journal disk of the master copy records information such as the failure time and recovery of the Journal disk.
The double-active scheme based on the Journal disk only processes IO error scenes, namely disk faults and physical link faults, and simultaneously receives IO error codes when IO is issued in the Qemu process. In the process of reading and writing, the consistency of the read-write data is trusted, namely the data is correct in the process of issuing normal Qemu is not considered, and a double-active data storage scheme with strong consistency is adopted, namely the write-back success is realized in the process of Qemu after the data of the primary copy and the data of the secondary copy are both written successfully.
A backup recovery mechanism is added in the Qemu, a recovery thread is added in the Qemu process, and the thread is mainly used for processing data recovery work after the data recovery is carried out again after storage failure, so that the consistency of the stored data of the two copies is guaranteed. And the recovery thread regularly monitors the states of the Journal disk and the Volume disk, and simultaneously sends an SCSI TUR instruction to the disk stored in the Journal disk and the Volume disk, wherein the SCSI TUR instruction is used for verifying whether the disk is normal, when the disk fails, the TUR instruction fails to return, and when the return succeeds, a backup recovery mechanism is triggered.
The backup recovery process has different processing methods according to different virtual machine scenes, and the process and the mechanism are as follows:
as shown in fig. 3, the virtual machine process is normal, and only when there is a storage failure:
And if the B storage fails, upgrading the Journal disk stored in the A to the primary copy storage. And marking the IO processing completion without upwards returning the failure due to the IO failure sent to the storage B, marking the failure by the Journal disk stored in the storage A, recording the failure time, and subsequently, if the storage state of the storage B is abnormal, enabling the virtual machine not to send data to the storage B. And a backup recovery thread in the Qemu process monitors whether the storage of the B is normal or not, and if so, a recovery logic is triggered. In the recovery logic, referring to a Qemu driving mirror image mechanism, reading bitmaps of A and B in the failure, taking out difference data, gradually copying the data, suspending the virtual machine when the A normally supports the service and reaches a mirror image state, deleting a B failure record in a Journal disk in the A storage, and marking the end of the recovery flow. After recovery, Qemu again writes the data while issuing the data to A, B.
As shown in fig. 4, when the server and the storage are powered off during the operation of the virtual machine:
when the virtual machine reads data after the storage is recovered again after power failure, firstly detecting a bitmap in a Journal disk, detecting a difference data item, and triggering a recovery flow. In the recovery process, infight input and output of the Qemu process blocks QemuIO to issue, recovery of Journal data of the two copies is triggered, the secondary copy is covered by taking data in the primary copy as a reference, and after the covering is finished, the Journal state of the primary copy and the secondary copy is marked to be normal. After recovery, Qemu writes the data again while issuing the data to A, B.
The embodiment of the invention provides a log disk mechanism, which is characterized in that a log disk and a data disk are arranged in each virtual disk, so that data in the two virtual disks are kept consistent, a main branch and a secondary branch are arranged on the two log disks, when a virtual machine reads data, the data are preferentially acquired and loaded from the main log disk, after fault recovery occurs, bitmaps of the two virtual disks in fault time are read, differential data are acquired, and data recovery is carried out, so that double-active switching of the virtual disks is ensured, automatic switching to another storage operation after one storage back end of the virtual machine is in fault can be met, and meanwhile, the storage back end of the operation can still be switched to work after the storage fault is recovered. The invention does not depend on the double-active function of the storage back end, the storage back end can be from different storage models, the backup and double-active functions of the virtual machine data are provided in the aspect of virtualization, a uniform backup disaster recovery scheme is provided, great advantages are achieved, and the reliability of the virtual machine is greatly improved.
As shown in fig. 5, an embodiment of the present invention further discloses a system for implementing dual live of virtual disks in a virtual machine, where the system includes:
the dual-active deployment module is used for setting two virtual disks, a log disk and a data disk are arranged in each virtual disk, data written into the data disk are recorded in the log disk by using a bitmap, the data in the two virtual disks are kept consistent, a main part and a secondary part are arranged on the two log disks, and when data are read, a virtual machine preferentially acquires and loads the data from the main log disk;
The failure recovery module is used for upgrading the log disk of another virtual disk into a main log disk when a certain virtual disk fails, marking the failure time of the failed virtual disk in the main log disk, setting a backup recovery thread in a Qemu process to monitor whether the failed virtual disk is recovered normally, and reading bitmaps of the two virtual disks of the failure time after the failed virtual disk is recovered normally, acquiring difference data and recovering data;
and the power failure recovery module is used for detecting bitmaps of the two log disks and triggering data recovery after detecting the difference data when the virtual machine reads data after the server and the storage power failure recovery.
The double-live virtual disk of the virtual machine comprises two parts: the system comprises a Journal log disk and a Volume data disk, wherein the Journal disk and the Volume disk are added in pairs, each virtual disk for adding data of a virtual machine can provide a Journal disk by default, and two virtual disks of double activities can come from different storage devices.
The Journal disk and the Volume disk are LUNs (Logical Unit Number) or files.
The Journal disk is used for processing a data recovery scene under a storage failure or host power failure scene. Because the virtual machine is sending data, when a related fault occurs, some data can exist and is not written into the virtual disk, and when the virtual machine is started again, the data in the double-live virtual disks needs to be restored to a consistent state according to the related data recorded in the Journal disk.
The Journal disc records data that has been written to the Volume disc using a BitMap (BitMap). One BitMap represents 256K of data, and only a write operation and written data are recorded in the Journal disc, while the offset and length of the write operation are recorded. The concept of adding the main copy to the two Journal disks is that the two Journal disks are simultaneously used as the main copy during initialization, after the read-write response time of data issued by the two Journal disks in the virtual machine is counted, if the speed of a certain Journal disk is faster, the Journal disk is used as the main copy, the Journal disk with slow IO response is used as the secondary copy, and when the read-write data of the virtual machine has errors in the certain Journal disk, the Journal disk is degraded into the secondary copy. When the virtual machine reads data, the virtual machine preferentially acquires and loads the data from the primary copy, namely returns the data from the storage with better performance as much as possible. The Journal disk of the master copy has information such as the time of failure and whether or not the Journal disk is restored recorded.
The double-active scheme based on the Journal disk only processes IO error scenes, namely disk failure and physical link failure, and simultaneously receives IO error codes when IO is issued in the Qemu process. In the process of reading and writing, the consistency of the read-write data is trusted, namely the data is correct in the process of issuing normal Qemu is not considered, and a double-active data storage scheme with strong consistency is adopted, namely the write-back success is realized in the process of Qemu after the data of the primary copy and the data of the secondary copy are both written successfully.
A backup recovery mechanism is added in the Qemu, a recovery thread is added in the Qemu process, and the thread is mainly used for processing data recovery work after the data recovery is carried out again after storage failure, so that the consistency of the stored data of the two copies is guaranteed. And the recovery thread regularly monitors the states of the Journal disk and the Volume disk, and simultaneously sends an SCSI TUR instruction to the disk stored in the Journal disk and the Volume disk, wherein the SCSI TUR instruction is used for verifying whether the disk is normal, when a fault occurs, the TUR instruction fails to return, and when the return succeeds, a backup recovery mechanism is triggered.
The backup recovery process has different processing methods according to different virtual machine scenes, and the process and the mechanism are as follows:
the virtual machine process is normal, and only when a certain storage fault exists:
and if the B storage fails, upgrading the Journal disk stored in the A to the primary copy storage. And marking the IO processing completion without upwards returning the failure due to the IO failure sent to the storage B, marking the failure by the Journal disk stored in the storage A, recording the failure time, and subsequently, if the storage state of the storage B is abnormal, enabling the virtual machine not to send data to the storage B. And a backup recovery thread in the Qemu process monitors whether the storage of the B is normal or not, and if so, a recovery logic is triggered. In the recovery logic, referring to a Qemu driving mirror image mechanism, reading bitmaps of A and B in the failure, taking out difference data, gradually copying the data, suspending the virtual machine when the A normally supports the service and reaches a mirror image state, deleting a B failure record in a Journal disk in the A storage, and marking the end of the recovery flow. After recovery, Qemu writes the data again while issuing the data to A, B.
In the running of the virtual machine, when the power of the server and the storage is completely cut off:
when the virtual machine reads data after the storage is recovered again after power failure, firstly detecting a bitmap in a Journal disk, detecting a difference data item, and triggering a recovery flow. In the recovery process, infight input and output of the Qemu process blocks QemuIO to issue, recovery of Journal data of the two copies is triggered, the secondary copy is covered by taking data in the primary copy as a reference, and after the covering is finished, the Journal state of the primary copy and the secondary copy is marked to be normal. After recovery, Qemu writes the data again while issuing the data to A, B.
The embodiment of the invention also discloses a virtual machine virtual disk dual-live realizing device, which comprises:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the virtual machine virtual disk dual-live realization method.
The embodiment of the invention also discloses a readable storage medium for storing the computer program, wherein the computer program realizes the virtual disk double-live realization method of the virtual machine when being executed by the processor.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (7)

1. A virtual machine virtual disk double-live implementation method is characterized by comprising the following operations:
setting two virtual disks, wherein each virtual disk is provided with a log disk and a data disk, the data written into the data disk is recorded in the log disk by using a bitmap, the data in the two virtual disks are kept consistent, a main part and an auxiliary part are set for the two log disks, and when reading data, a virtual machine preferentially acquires and loads the data from the main log disk; when the log disks in the two virtual disks are initialized, the log disks are simultaneously main log disks, after the read-write response time of data sent by the two log disks under the virtual machine is counted, if a certain log disk is faster, the log disks are main log disks, the log disks with slow IO response are auxiliary log disks, and when the read-write data of the virtual machine has errors in the certain log disks, the read-write data of the virtual machine are degraded into the auxiliary log disks;
when a certain virtual disk fails, upgrading the log disk of another virtual disk into a main log disk, marking the failure time of the failed virtual disk in the main log disk, setting a backup recovery thread in a Qemu process to monitor whether the failed virtual disk is recovered to be normal or not, and reading bitmaps of the two virtual disks at the failure time after the failed virtual disk is recovered to be normal, acquiring difference data and recovering the data;
And after the power failure of the server and the storage is recovered, the virtual machine reads data, detects bitmaps of the two log disks, and triggers data recovery after detecting the difference data.
2. The method as claimed in claim 1, wherein the master log disk records failure time of the failure log disk and information about whether to recover.
3. The method for implementing the double-live of the virtual disk of the virtual machine according to claim 1, wherein when the disk is recovered to be normal, the data recovery process is as follows:
if the failure of the virtual disk B is recovered, reading A, B bitmaps of the two virtual disks in the failure, taking out the difference data, gradually copying the data, suspending the virtual machine when the A, B two virtual disks reach the mirror image state, deleting the failure record of the virtual disk B in the log disk in the virtual disk A, and marking the recovery process to be finished.
4. A virtual machine and virtual disk dual-live implementation system is characterized in that the system comprises:
the dual-active deployment module is used for setting two virtual disks, a log disk and a data disk are arranged in each virtual disk, data written into the data disk are recorded in the log disk by using a bitmap, the data in the two virtual disks are kept consistent, a main point and a secondary point are arranged on the two log disks, and when data are read, a virtual machine preferentially obtains and loads the data from the main log disk; when the log disks in the two virtual disks are initialized, the log disks are simultaneously main log disks, after the read-write response time of data sent by the two log disks under the virtual machine is counted, if a certain log disk is faster, the log disks are main log disks, the log disks with slow IO response are auxiliary log disks, and when the read-write data of the virtual machine has errors in the certain log disks, the read-write data of the virtual machine is degraded into the auxiliary log disks;
The failure recovery module is used for upgrading the log disk of another virtual disk into a main log disk when a certain virtual disk fails, marking the failure time of the failed virtual disk in the main log disk, setting a backup recovery thread in a Qemu process to monitor whether the failed virtual disk is recovered normally, and reading bitmaps of the two virtual disks of the failure time after the failed virtual disk is recovered normally, acquiring difference data and recovering data;
and the power failure recovery module is used for detecting bitmaps of the two log disks when the server and the storage are subjected to power failure recovery and the virtual machine reads data, and triggering data recovery after detecting the difference data.
5. The virtual machine virtual disk double-live implementation system according to claim 4, wherein the master log disk records failure time of a failure log disk and information about whether to recover.
6. A virtual machine virtual disk dual-live implementation device is characterized by comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the virtual machine virtual disk double live implementation method according to any one of claims 1 to 3.
7. A readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the virtual machine virtual disk double-live implementation method according to any one of claims 1 to 3.
CN202010709945.6A 2020-07-22 2020-07-22 Virtual machine virtual disk dual-live implementation method and system Active CN111984365B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010709945.6A CN111984365B (en) 2020-07-22 2020-07-22 Virtual machine virtual disk dual-live implementation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010709945.6A CN111984365B (en) 2020-07-22 2020-07-22 Virtual machine virtual disk dual-live implementation method and system

Publications (2)

Publication Number Publication Date
CN111984365A CN111984365A (en) 2020-11-24
CN111984365B true CN111984365B (en) 2022-05-31

Family

ID=73438079

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010709945.6A Active CN111984365B (en) 2020-07-22 2020-07-22 Virtual machine virtual disk dual-live implementation method and system

Country Status (1)

Country Link
CN (1) CN111984365B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113608683B (en) * 2021-06-30 2024-05-07 山东海量信息技术研究院 Dual-live-disk cleaning method, system and related device
CN114422393B (en) * 2021-12-28 2023-06-13 中国信息通信研究院 Method and device for determining lossless network performance, electronic equipment and storage medium
CN117453146B (en) * 2023-12-22 2024-04-05 芯能量集成电路(上海)有限公司 Data reading method, system, eFlash controller and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609365A (en) * 2012-02-15 2012-07-25 合一网络技术(北京)有限公司 Virtual disk system and file storage method based on virtual disk system
CN103065102A (en) * 2012-12-26 2013-04-24 中国人民解放军国防科学技术大学 Data encryption mobile storage management method based on virtual disk
US20150304455A1 (en) * 2013-03-06 2015-10-22 Vmware, Inc. Method and system for providing a roaming remote desktop
CN106802840A (en) * 2017-01-19 2017-06-06 郑州云海信息技术有限公司 A kind of virtual machine backup, restoration methods and device
CN110187998A (en) * 2019-05-09 2019-08-30 上海爱数信息技术股份有限公司 The application disaster tolerance system and method stored based on virtual platform and ceph

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609365A (en) * 2012-02-15 2012-07-25 合一网络技术(北京)有限公司 Virtual disk system and file storage method based on virtual disk system
CN103065102A (en) * 2012-12-26 2013-04-24 中国人民解放军国防科学技术大学 Data encryption mobile storage management method based on virtual disk
US20150304455A1 (en) * 2013-03-06 2015-10-22 Vmware, Inc. Method and system for providing a roaming remote desktop
CN106802840A (en) * 2017-01-19 2017-06-06 郑州云海信息技术有限公司 A kind of virtual machine backup, restoration methods and device
CN110187998A (en) * 2019-05-09 2019-08-30 上海爱数信息技术股份有限公司 The application disaster tolerance system and method stored based on virtual platform and ceph

Also Published As

Publication number Publication date
CN111984365A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN111984365B (en) Virtual machine virtual disk dual-live implementation method and system
US8943358B2 (en) Storage system, apparatus, and method for failure recovery during unsuccessful rebuild process
US9009526B2 (en) Rebuilding drive data
US9053075B2 (en) Storage control device and method for controlling storages
US7310711B2 (en) Hard disk drive with support for atomic transactions
JP4821448B2 (en) RAID controller and RAID device
JP2006268503A (en) Computer system, disk unit and data update control method
CN104050056A (en) File system backup of multi-storage-medium device
US20070033361A1 (en) Apparatus, system, and method for fastcopy target creation
US20050076263A1 (en) Data I/O system using a plurality of mirror volumes
WO2017097233A1 (en) Fault tolerance method for data storage load and iptv system
JP2006190039A (en) Information processing system and primary storage device
CN111240903A (en) Data recovery method and related equipment
CN116414616A (en) SSD (solid state disk) fault recovery method, SSD and SSD system
CN101169705B (en) Method for implementing file class mirror-image under multiple hard disk based on nude file system
US7529776B2 (en) Multiple copy track stage recovery in a data storage system
US20090177916A1 (en) Storage system, controller of storage system, control method of storage system
JP2001125815A (en) Back-up data management system
US8862846B2 (en) Control apparatus, control method, and storage apparatus
EP2313829A1 (en) Recovery control in mirrored disks
JP2004213470A (en) Disk array device, and data writing method for disk array device
CN116501259A (en) Disk group dual-activity synchronization method and device, computer equipment and storage medium
JP2001142650A (en) Method and device for controlling array disk
JP2001075741A (en) Disk control system and data maintenance method
US11573729B2 (en) Storage device and storage control method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant