Xen full-virtualization agent-free real-time backup method and system and storage medium

By intercepting and recording the asynchronous I/O requests of the virtual machine in the Xen full virtualization environment and generating a global identity vector table, real-time monitoring and backup of the virtual machine disk files is realized, and the problem of data loss in the existing technology is solved. Improves business continuity and operational resilience.

CN119003248AActive Publication Date: 2024-11-22SICHUAN UNIV
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411216916.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-11-22
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

True agentless real-time continuous data protection has not been implemented in Xen fully virtualized environments. Existing backup methods rely on timed snapshots, resulting in system failures during backup intervals that can lead to large amounts of data loss, and lack of real-time backup technology.

Method used

By executing the backup driver in the production host operating system, obtaining the PID of the tapdisk process and its disk file descriptors to generate a global identity vector table, intercepting asynchronous I/O requests, parsing and recording disk write location information and data changes, and creating Backup structure and send asynchronously to the backup service program to realize real-time monitoring and backup of virtual machine disk files.

Benefits of technology

Implement continuous protection of virtual machine data, shorten business interruption time, provide faster recovery time and shorter data loss window, simplify management and reduce resource usage, improve backup driver execution efficiency and new virtual machines dynamic update capability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003248A_ABST
    Figure CN119003248A_ABST
Patent Text Reader

Abstract

The invention relates to a Xen full-virtualization agent-free real-time backup method and system and a storage medium, and belongs to the technical field of data disaster recovery backup. The method comprises the following steps: initializing a backup drive; intercepting an asynchronous I / O request; acquiring write-in position information, a disk file path and disk file change data; creating and loading a backup structure body, and writing data of the backup structure body into a kernel buffer area for temporary storage; and asynchronously sending the data in the kernel buffer area to a backup service program. The system comprises an initialization module; an interception module; a data acquisition module; a data loading module; and a sending module. According to the method, continuous data protection is carried out on the virtual machine using the full virtualization technology in the Xen, changes can be captured in real time and synchronized to backup storage when the virtual machine runs, and the risk of data loss is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data disaster recovery and backup, and relates to a Xen full virtualization agentless real-time backup method, system and storage medium. Background Art

[0002] Xen is an open source virtualization technology that supports paravirtualization and full virtualization. Full virtualization relies on hardware with virtualization extensions, such as Intel VT or AMD-V, which enables Xen to simulate the physical hardware environment at the virtualization layer. This feature allows Xen to run unmodified operating systems, including various versions of Windows and other standard operating systems, providing excellent flexibility and wide compatibility.

[0003] Compared with paravirtualization, the main advantage of full virtualization is its high compatibility with different operating systems and its easy management and maintenance. Although this may mean a certain performance sacrifice in some cases, in general, Xen's full virtualization technology provides an ideal solution for environments that need to flexibly deploy and run standard operating systems.

[0004] Agentless real-time backup technology for virtual machines is an efficient data backup solution. Real-time backup can continuously capture and record any changes in the data in the virtual machine, ensuring that the backup data is always up to date, greatly reducing the risk of data loss. At the same time, the agentless backup method avoids the need to install backup agent software inside the virtual machine, simplifies the backup process, and reduces dependence on virtual machine configuration.

[0005] Capturing data changes in virtual machines in a virtualized environment requires parsing the system's I / O methods. In a Xen fully virtualized environment, disk I / O requests generated by virtual machines are processed by the virtual machine management program Xen hypervisor, and finally handed over to the host dom0 to actually write to the disk. The I / O request is first initiated by the client operating system running in the virtual machine domU. This operating system does not know that it is running in a virtual environment, so it handles I / O requests like on a physical machine. When the domU device layer passes down the I / O request, the Xen Hypervisor intercepts these I / O requests from the virtual machine, and the Xen hypervisor handles these requests through a virtual disk controller (such as IDE or SCSI controller). At this time, tapdisk runs in the user space of dom0 as a backend service, responsible for managing and accessing virtual disk image files. When tapdisk receives disk read and write requests from virtual machines, it converts these requests into corresponding physical storage operations, such as reading or modifying data in disk image files. When tapdisk's conversion operation is completed, the I / O request is submitted to the host dom0 kernel for actual write physical hardware operations.

[0006] At present, in Xen virtualization technology, true agentless real-time continuous data protection has not yet been achieved. Most existing Xen virtual machine backup methods rely on using public interfaces to perform scheduled snapshot backups of virtual machines. This method is to take a snapshot of the disk state of the virtual machine at the beginning of the backup to capture an exact copy of the data, and take another snapshot after a fixed interval. The shorter the interval between snapshots, the less data may be lost. Prior art such as Xen-based agentless virtualization backup and recovery method with publication number CN108182128A (application date December 29, 2017) and Xen-based agentless backup and restoration method and system with publication number CN106598787A (application date December 31, 2016) both use a scheduled backup method based on virtual machine snapshots to protect Xen virtual machine data. However, although this scheduled backup method provides a certain degree of data protection, system failures occurring during the backup interval may still result in a large amount of data loss. So far, data backup technology in Xen virtualization environments has not yet involved research on real-time backup.

[0007] Now, real-time backup technology is urgently needed in Xen. However, due to the unique I / O mode of virtual machines under the Xen fully virtualized architecture, the existing real-time protection technology cannot be fully applied to this environment. Therefore, how to continuously protect the data of virtual machines in the Xen fully virtualized environment and realize an efficient and low-interference real-time backup method has become a technical problem that needs to be solved urgently. Summary of the invention

[0008] In order to solve the technical problems in the above background technology, the present invention provides a Xen full virtualization agentless real-time backup method, system and storage medium. The technical solution is as follows: In a first aspect, a Xen full virtualization agentless real-time backup method is provided, which is executed by a backup driver located in an operating system of a production host machine, and the method comprises the following steps: During initialization, a global identification vector table is generated by obtaining the PIDs of all tapdisk processes in the host machine and their corresponding disk file descriptors, wherein the global identification vector table includes a disk file identification vector and its corresponding virtual machine disk file path; Intercept the asynchronous I / O requests sent by the user program to the host kernel, obtain the PID and process name of the current process, and filter the asynchronous I / O requests of non-tapdisk processes; Parse the asynchronous I / O request to obtain the disk write location information, match the virtual machine disk file path of the current process according to the global identification vector table, and then obtain the disk file change data according to the disk write data address in the asynchronous I / O request; Create a backup structure, write the disk write location information, the virtual machine disk file path of the current process, and the disk file change data into the backup structure, and then write the structure data into the kernel buffer for temporary storage, where the kernel buffer is created during initialization; Send the data in the kernel buffer to the backup service program asynchronously.

[0009] In a second aspect, a Xen full virtualization agentless real-time backup method is provided, which is used for a backup server to process backup data from a backup driver in an operating system of a production host machine. The method comprises the steps of: The backup service program receives the backup structure data transmitted from the backup driver; The backup service program writes the received backup structure data into a receiving structure with the same structure as the backup structure, and then writes the target content in the receiving structure into a log file; the backup structure is formed by writing the disk write position information, the virtual machine disk file path of the current process and the disk file change data; the backup driver is used to write the structure data into the kernel buffer for temporary storage, and the kernel buffer is created during initialization; the backup driver is also used to parse the asynchronous I / O request to obtain the disk write position information, match the virtual machine disk file path of the current process according to the global identification vector table, and then obtain the disk file change data according to the disk write data address in the asynchronous I / O request; the backup driver is also used to intercept the asynchronous I / O request transmitted by the user program to the host kernel, obtain the PID and process name of the current process, and filter the asynchronous I / O requests of non-tapdisk processes; the backup driver is also used to obtain and generate a global identification vector table through the PID of all tapdisk processes in the host and their corresponding disk file descriptors during initialization, wherein the global identification vector table contains the disk file identification vector and its corresponding virtual machine disk file path.

[0010] In a third aspect, a Xen full virtualization agentless real-time backup system is provided, which is executed by a backup driver located in the operating system of the production host, and the system includes: An initialization module is used to obtain and generate a global identification vector table through the PIDs of all tapdisk processes in the host machine and their corresponding disk file descriptors during initialization, wherein the global identification vector table includes a disk file identification vector and its corresponding virtual machine disk file path; The interception module is used to intercept the asynchronous I / O requests transmitted by the user program to the host kernel, obtain the PID and process name of the current process, and filter the asynchronous I / O requests of non-tapdisk processes; The data acquisition module is used to parse the asynchronous I / O request to obtain the disk write location information, match the virtual machine disk file path of the current process according to the global identification vector table, and then obtain the disk file change data according to the disk write data address in the asynchronous I / O request; The data loading module is used to create a backup structure, write the disk write location information, the virtual machine disk file path of the current process and the disk file change data into the backup structure, and then write the structure data into the kernel buffer for temporary storage, wherein the kernel buffer is created during initialization; The sending module is used to asynchronously send the data in the kernel buffer to the backup service program.

[0011] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the agentless real-time backup method of Xen full virtualization as described above is implemented.

[0012] The beneficial effects of the present invention are: (1) The present invention realizes continuous protection of virtual machine data by continuously monitoring and automatically backing up the disk files of the production system, so that when a system failure occurs or the disk data is damaged, the recovery process can be accelerated and the service interruption time can be shortened, thereby enhancing the continuous operation capability of the business and ensuring the stable operation of the business system; (2) The present invention can perform real-time data protection for all virtual machines running in a Xen full virtualization environment by installing a backup driver only in the host machine, without installing a backup agent in all virtual machines. It can provide a faster recovery time (RTO) and a shorter data loss window (RPO), and has the advantages of simple deployment, simplified management, and reduced resource usage. (3) The present invention creates a global identification vector table when the backup driver is initialized, which greatly simplifies the process of the backup driver identifying the disk file when intercepting the disk file change data, and can dynamically update the global identification vector table for the newly created virtual machine when the backup driver is running, effectively improving the execution efficiency of the backup driver; (4) The present invention utilizes the I / O characteristics of virtual machines in a Xen full virtualization environment to design a method for intercepting disk change data. The backup driver can efficiently obtain the change data asynchronously written to the disk in the host kernel by monitoring the operation of tapdisk on the disk file, with little impact on the virtual machine request processing program running in the host user space. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 This is a flow chart of the agentless real-time backup method for Xen full virtualization at the production end in Example 1 of the present invention.

[0015] Figure 2 This is an I / O route architecture diagram of a virtual machine in a Xen full virtualization environment in Example 1 of the present invention.

[0016] Figure 3 This is a flow chart of the agentless real-time backup method for Xen full virtualization used for backing up the server in Example 2 of the present invention.

[0017] Figure 4 This is a schematic diagram of the structure of the agentless real-time backup system of the Xen full virtualization technology used for the production end in Example 3 of the present invention.

[0018] Figure 5 This is a schematic diagram of the structure of the initialization module in Example 3 of the present invention.

[0019] Figure 6 It is a structural diagram of the interception module in Example 3 of the present invention.

[0020] Figure 7 This is a structural diagram of the data acquisition module in Example 3 of the present invention.

[0021] Figure 8 This is a schematic diagram of the structure of the data loading module in Example 3 of the present invention.

[0022] In the accompanying drawings, the components represented by the reference numerals are listed as follows: 3001. Initialization module, 3002. Interception module, 3003. Data acquisition module, 3004. Data loading module, 3005. Sending module, 30011. Query unit, 30012. Disk file path construction unit, 30013. Identification vector table generation unit, 30021. Detection point setting unit, 30022. Blocking unit, 30023. Parameter acquisition unit, 30024. Filtering unit, 30031. Disk write position information acquisition unit, 30032. Identification vector calculation unit, 30033. Matching unit, 30034. Change data acquisition unit, 30041. Backup structure creation unit, 30042. Data loading unit, 30043. Data transfer unit, 30044. Sending thread wake-up unit. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0024] Example 1

[0025] In this embodiment, if Figure 1 As shown, a Xen full virtualization agentless real-time backup method is provided, which is executed by a backup driver located in the operating system of the production host machine, and the method includes the steps of: S101. During initialization, obtain and generate a global identification vector table through the PIDs of all tapdisk processes in the host machine and their corresponding disk file descriptors, wherein the global identification vector table includes a disk file identification vector and its corresponding virtual machine disk file path.

[0026] It is worth mentioning that the tapdisk program is an important component in the Xen virtualization environment. It is located in the user space of the host machine and is mainly responsible for managing the disk I / O operations of the virtual machine, such as disk image management, I / O request forwarding, snapshots, and backups. Figure 2 As shown in the figure, the I / O request generated by the domU user program is passed to the system call for processing I / O operations in the domU kernel space for processing. Through the system call, the application I / O in the user space can enter the system kernel for execution and then write to the physical device of the block layer. However, since domU cannot directly operate the disk, the I / O request generated by the domU user program is passed by the device driver to dom0, where the hardware device simulated by QEMU processes the I / O request and then passes it to the tapdisk program for operation. After tapdisk converts the request into a format that can be processed by the physical device, it passes the request to the asynchronous I / O queue. The operating system calls the asynchronous I / O write function to write the data to the virtual machine disk file. Finally, the physical driver of the dom0 kernel writes the virtual machine disk file data to the physical disk.

[0027] When a virtual machine uses multi-disk management or tapdisk performs backup and snapshot functions, tapdisk may open multiple disk files. At the same time, there is usually more than one virtual machine in a host machine, and different virtual machines are managed by different tapdisk processes, and one virtual machine corresponds to two different tapdisk processes. For such a complex disk file management environment, it is necessary to establish a global identification vector table for the process and its opened disk files to correspond one to one, so that the backup driver can quickly determine the disk files processed by tapdisk during the data capture process.

[0028] It is also worth mentioning that the global identification vector table is created when the backup driver is initialized, which contains the disk file identification vector and the virtual machine disk file path. The disk file identification vector is obtained by bitwise operation of the tapdisk process PID and the disk file descriptor. The virtual machine disk file path needs to be obtained from the file descriptor list of the tapdisk process. The disk file opened by the tapdisk process is a temporary file soft link created by Xen, which points to the real file where the host machine actually writes data.

[0029] Optionally, the step S101 includes: S1011. During initialization, traverse the process list, search for a process named tapdisk, and obtain its process PID after finding the tapdisk process; S1012. Obtain process structure information according to the tapdisk process PID, traverse the file descriptor table of the tapdisk process, query the disk file used by the virtual machine and its disk file descriptor, and then construct the virtual machine disk file path; S1013. Perform bitwise operation on the tapdisk process PID and the disk file descriptor to obtain the virtual machine disk identification vector of the process, and then write the virtual machine disk identification vector and its corresponding virtual machine disk file path into the global identification vector table.

[0030] It is worth noting that using the tapdisk process PID and the disk file descriptor to perform bitwise operations to obtain the disk file identification vector can effectively save table space and improve the recognition efficiency of disk files during the interception process.

[0031] S102: intercepting the asynchronous I / O request transmitted by the user program to the host kernel, obtaining the PID and process name of the current process, and filtering the asynchronous I / O requests of non-tapdisk processes.

[0032] Optionally, the step S102 includes: S1021. When tapdisk converts the disk write request from the virtual machine into the corresponding physical storage operation and submits the disk write request to the dom0 kernel for asynchronous I / O processing, the asynchronous I / O write function is set as the detection point of the interception tool; S1022. When the interception tool detects that the asynchronous I / O write function is about to run, it immediately blocks the execution of the asynchronous I / O write function and then triggers the callback processing function of the interception tool; S1023. The interception tool takes out the parameters of the asynchronous I / O write function from the register as the parameters of the callback processing function; S1024. Get the PID and process name of the current process in the callback function. If it is the tapdisk process, proceed to the next step. If not, end the callback function.

[0033] It is worth mentioning that the interception tool uses Kprobes in the Linux kernel, which is used to dynamically track and monitor function calls and variables in the kernel. Kprobes has very little impact on system performance. The asynchronous I / O write function running in the host kernel is set as the detection point of Kprobes, so that the backup driver can intercept the disk write operation of the tapdisk process and obtain the data changes on the disk.

[0034] It is also worth mentioning that after the virtual machine I / O request handler tapdisk in the user space converts the disk write request from the virtual machine into the corresponding physical storage operation, it will transmit the I / O request to the asynchronous I / O queue in the kernel space, and hand it over to the asynchronous I / O handler in the kernel to write it into the physical disk. The asynchronous method allows multiple virtual machines to process I / O concurrently, while significantly improving the performance and response speed of I / O processing of a single virtual machine. Using the asynchronous I / O write function as the detection point can make the backup driver's change data interception operation more efficient and faster, while having less impact on the running virtual machine.

[0035] S103. Parse the asynchronous I / O request to obtain disk write location information, match the virtual machine disk file path of the current process according to the global identification vector table, and then obtain disk file change data according to the disk write data address in the asynchronous I / O request.

[0036] Optionally, the step S103 includes: S1031. Parse the asynchronous I / O request to obtain disk write position information, wherein the disk write position information includes: disk file descriptor, write offset and write length; S1032. Perform bitwise operations using the current process PID and the disk file descriptor in the disk write location information to obtain the virtual machine disk identification vector of the current process; S1033. Use the virtual machine disk identification vector of the current process to match in the global identification vector table. If the match is successful, the virtual machine disk file path is obtained; if the match fails, the current process structure information is obtained according to the current process PID, and the file descriptor table of the current process is traversed. After querying the disk file used by the virtual machine, the virtual machine disk file path is constructed, and then the obtained current virtual machine disk identification vector and virtual machine disk file path are written into the global identification vector table; S1034. Determine whether the asynchronous I / O write function uses the scatter / gather I / O method based on the intercepted parameter value. If so, obtain the disk file change data one by one according to the disk write data array; if not, obtain the disk file change data directly according to the disk write data address, wherein the disk write data array stores multiple segments of disk write data addresses and write offsets.

[0037] It is worth noting that in step S1033, when matching the virtual machine disk identification vector of the current process in the global identification vector table, if the match is unsuccessful, it means that the current tapdisk process is newly created by the system, and there may be newly started or newly created virtual machines in the system. At this time, the global identification vector table needs to be updated.

[0038] It is also worth mentioning that the scatter / gather I / O method is a data transmission technology in a computer system, which is used to improve the data efficiency of multiple non-contiguous storage areas. This technology is widely used in processing network communications and high-performance file system operations. When the asynchronous I / O write function uses the scatter / gather I / O method, it uses a disk write data array to store the write data addresses and write offsets of multiple non-contiguous storage areas. This way, one I / O request can process multiple segments of data, which can reduce the number of I / O requests initiated by the virtual machine and thus improve I / O efficiency. When the backup driver processes the I / O request of this I / O method, it needs to retrieve the write data address and write offset one by one from the disk write data array.

[0039] S104. Create a backup structure, write the disk write location information, the virtual machine disk file path of the current process and the disk file change data into the backup structure, and then write the structure data into the kernel buffer for temporary storage, wherein the kernel buffer is created during initialization.

[0040] Optionally, the step S104 includes: S1041. Create a backup structure, the backup structure sequentially including: disk write information, the virtual machine disk file path of the current process and a disk file change data structure array, wherein the disk file change data structure array includes data length and actual disk write data; S1042. Write the acquired disk write information, the virtual machine disk file path of the current process, and the disk file change data into the backup structure; S1043. After the data contained in the backup structure is loaded, the backup structure is written to the kernel buffer for temporary storage, wherein the kernel buffer is created during initialization; S1044. End the execution of the callback function of the interception tool and wake up the asynchronous sending thread at the same time.

[0041] S105. Asynchronously send the data in the kernel buffer to the backup service program.

[0042] This embodiment designs a method for intercepting disk change data based on the virtual machine I / O execution route in the Xen full virtualization technology. It utilizes the characteristics of the asynchronous I / O queue of the host machine after the I / O request of the virtual machine is processed by the tapdisk process and then submitted to the host machine. The data to be written to the disk is intercepted in the host machine kernel, and copies of these data are sent to the backup server for backup. In addition, the global identification vector table is used to quickly identify the virtual machine disk files in the process of intercepting disk change data.

[0043] Example 2 In this embodiment, if Figure 3As shown, a Xen full virtualization agentless real-time backup method is provided, which is applied to a backup server to process backup data from a production terminal. The method includes the following steps: S201. The backup service program receives the backup structure data transmitted from the backup driver; S202. The backup service program writes the received backup structure data into a receiving structure that has the same structure as the backup structure, and then writes the target content in the receiving structure into a log file; the backup structure is formed by writing the disk write position information, the virtual machine disk file path of the current process, and the disk file change data; the backup driver is used to write the structure data into the kernel buffer for temporary storage, and the kernel buffer is created during initialization; the backup driver is also used to parse the asynchronous I / O request to obtain the disk write position information, match the virtual machine disk file path of the current process according to the global identification vector table, and then obtain the disk file change data according to the disk write data address in the asynchronous I / O request; the backup driver is also used to intercept the asynchronous I / O request transmitted by the user program to the host kernel, obtain the PID and process name of the current process, and filter the asynchronous I / O requests of non-tapdisk processes; the backup driver is also used to obtain and generate a global identification vector table through the PID of all tapdisk processes in the host and their corresponding disk file descriptors during initialization, wherein the global identification vector table contains the disk file identification vector and its corresponding virtual machine disk file path.

[0044] It is worth mentioning that the backup service program uses the receiving structure to stamp the target data belonging to the same I / O request with the same timestamp according to the page mark therein, and then writes it into the target log file so that when it is necessary to restore to a specified time point in the future, the I / O data at that time point can be located.

[0045] In this embodiment, the backup data from the production end is organized into a log format and saved in a log file, laying a foundation for subsequent data recovery.

[0046] Example 3 In this embodiment, if Figure 4 As shown, a non-agent real-time backup system of Xen full virtualization technology is provided, which is applied to the production end, and the system includes: Initialization module 3001, used to obtain and generate a global identification vector table through the PIDs of all tapdisk processes in the host machine and their corresponding disk file descriptors during initialization, wherein the global identification vector table includes a disk file identification vector and its corresponding virtual machine disk file path; The interception module 3002 is used to intercept the asynchronous I / O request transmitted by the user program to the host kernel, obtain the PID and process name of the current process, and filter the asynchronous I / O requests of non-tapdisk processes; The data acquisition module 3003 is used to parse the asynchronous I / O request to obtain the disk write location information, match the virtual machine disk file path of the current process according to the global identification vector table, and then obtain the disk file change data according to the disk write data address in the asynchronous I / O request; The data loading module 3004 is used to create a backup structure, write the disk write location information, the virtual machine disk file path of the current process and the disk file change data into the backup structure, and then write the structure data into the kernel buffer for temporary storage, wherein the kernel buffer is created during initialization; The sending module 3005 is used to asynchronously send the data in the kernel buffer to the backup service program.

[0047] Optional, such as Figure 5 As shown, the initialization module 3001 includes: The query unit 30011 is used to traverse the process list during initialization, search for a process named tapdisk, and obtain its process PID after finding the tapdisk process; The disk file path construction unit 30012 is used to obtain process structure information according to the tapdisk process PID, traverse the file descriptor table of the tapdisk process, query the disk file used by the virtual machine and its disk file descriptor, and then construct the virtual machine disk file path; The identification vector table generation unit 30013 is used to perform bit operations on the tapdisk process PID and the disk file descriptor to obtain the virtual machine disk identification vector of the process, and then write the virtual machine disk identification vector and its corresponding virtual machine disk file path into the global identification vector table.

[0048] Optional, such as Figure 6 As shown, the interception module 3002 includes: The detection point setting unit 30021 is used to set the asynchronous I / O write function as the detection point of the interception tool when tapdisk converts the disk write request from the virtual machine into the corresponding physical storage operation and submits the disk write request to the dom0 kernel for asynchronous I / O processing flow; The blocking unit 30022 is used to immediately block the execution of the asynchronous I / O write function when the interception tool detects that the asynchronous I / O write function is about to run, and then trigger the callback processing function of the interception tool; The parameter acquisition unit 30023 is used for the interception tool to obtain the parameters of the asynchronous I / O write function from the register as the parameters of the callback processing function; The filtering unit 30024 is used to obtain the PID and process name of the current process in the callback function. If it is a tapdisk process, proceed to the next step. If not, terminate the callback function.

[0049] Optional, such as Figure 7 As shown, the data acquisition module 3003 includes: The disk write position information acquisition unit 30031 is used to parse the asynchronous I / O request to obtain the disk write position information, wherein the disk write position information includes: a disk file descriptor, a write offset and a write length; The identification vector calculation unit 30032 is used to perform bit operation using the current process PID and the disk file descriptor in the disk write position information to obtain the virtual machine disk identification vector of the current process; The matching unit 30033 is used to match the virtual machine disk identification vector of the current process in the global identification vector table. If the match is successful, the virtual machine disk file path is obtained; if the match fails, the current process structure information is obtained according to the current process PID, the file descriptor table of the current process is traversed, and the disk file used by the virtual machine is queried to construct the virtual machine disk file path, and then the obtained current virtual machine disk identification vector and virtual machine disk file path are written into the global identification vector table; The change data acquisition unit 30034 is used to determine whether the asynchronous I / O write function uses the scatter / gather I / O mode according to the intercepted parameter value. If so, the disk file change data is acquired one by one according to the disk write data array; if not, the disk file change data is acquired directly according to the disk write data address, wherein the disk write data array stores multiple segments of disk write data addresses and write offsets; Optional, such as Figure 8 As shown, the data loading module 3004 includes: The backup structure creation unit 30041 is used to create a backup structure, wherein the backup structure sequentially includes: disk writing information, the virtual machine disk file path of the current process, and a disk file change data structure array, wherein the disk file change data structure array includes data length and actual disk writing data; The data loading unit 30042 is used to write the acquired disk writing information, the virtual machine disk file path of the current process and the disk file change data into the backup structure; The data transfer unit 30043 is used to write the backup structure into the kernel buffer for temporary storage after the data contained in the backup structure is loaded, wherein the kernel buffer is created during initialization; The sending thread awakening unit 30044 is used to end the execution of the callback function of the interception tool and wake up the asynchronous sending thread at the same time.

[0050] The technical solution of this embodiment includes an initialization module 3001 for initializing the backup driver; an interception module 3002 for intercepting asynchronous I / O functions; a data acquisition module 3003 for acquiring disk change data, write location information, and virtual machine disk file path; a data loading module 3004 for writing disk write location information, the virtual machine disk file path of the current process, and disk file change data into the kernel buffer for temporary storage; and a sending module 3005 for sending kernel buffer data to the backup server. This embodiment can monitor the I / O data of the virtual machine in real time through the backup driver in the Xen full virtualization environment, continuously capture the data changes of the virtual machine disk file, and continuously send the change data to the backup server for backup, thereby providing real-time data protection for virtual machines running in the Xen full virtualization, reducing data loss, and improving business continuity and operational resilience.

[0051] Example 4 In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the agentless real-time backup method for Xen full virtualization described in Embodiment 1 is implemented.

[0052] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium includes, but is not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0053] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A Xen full virtualization agentless real-time backup method, characterized in that: The process is executed by the backup driver in the operating system of the production host and includes the following steps: During initialization, a global identification vector table is generated by obtaining the PIDs of all tapdisk processes in the host machine and their corresponding disk file descriptors, wherein the global identification vector table includes a disk file identification vector and its corresponding virtual machine disk file path; Intercept the asynchronous I / O requests sent by the user program to the host kernel, obtain the PID and process name of the current process, and filter the asynchronous I / O requests of non-tapdisk processes; Parse the asynchronous I / O request to obtain the disk write location information, match the virtual machine disk file path of the current process according to the global identification vector table, and then obtain the disk file change data according to the disk write data address in the asynchronous I / O request; Create a backup structure, write the disk write location information, the virtual machine disk file path of the current process, and the disk file change data into the backup structure, and then write the structure data into the kernel buffer for temporary storage, where the kernel buffer is created during initialization; Send the data in the kernel buffer to the backup service program asynchronously.

2. The agentless real-time backup method for Xen full virtualization according to claim 1, characterized in that: The step of obtaining and generating a global identification vector table through the PIDs of all tapdisk processes in the host machine and their corresponding disk file descriptors during initialization includes: During initialization, traverse the process list and search for the process named tapdisk. After finding the tapdisk process, obtain its process PID. Obtain process structure information based on the tapdisk process PID, traverse the file descriptor table of the tapdisk process, query the disk file used by the virtual machine and its disk file descriptor, and then construct the virtual machine disk file path; The tapdisk process PID is used to perform bitwise operations on the disk file descriptor to obtain the virtual machine disk identification vector of the process, and then the virtual machine disk identification vector and its corresponding virtual machine disk file path are written into the global identification vector table.

3. The agentless real-time backup method for Xen full virtualization according to claim 1, characterized in that: The step of intercepting the asynchronous I / O request transmitted by the user program to the host kernel, obtaining the PID and process name of the current process, and filtering the asynchronous I / O request of the non-tapdisk process includes: When tapdisk converts the disk write request from the virtual machine into the corresponding physical storage operation and submits the disk write request to the dom0 kernel for asynchronous I / O processing, the asynchronous I / O write function is set as the detection point of the interception tool; When the interception tool detects that the asynchronous I / O write function is about to run, it immediately blocks the execution of the asynchronous I / O write function and then triggers the callback processing function of the interception tool; The interception tool takes the parameters of the asynchronous I / O write function from the register as the parameters of the callback processing function; Get the PID and process name of the current process in the callback function. If it is the tapdisk process, proceed to the next step. If not, end the callback function.

4. The agentless real-time backup method for Xen full virtualization according to claim 1, characterized in that: The step of parsing the asynchronous I / O request to obtain disk write location information, matching the virtual machine disk file path of the current process according to the global identification vector table, and then obtaining the disk file change data according to the disk write data address in the asynchronous I / O request includes: Parsing the asynchronous I / O request to obtain disk write position information, wherein the disk write position information includes: a disk file descriptor, a write offset, and a write length; Use the current process PID and the disk file descriptor in the disk write location information to perform bit operations to obtain the virtual machine disk identification vector of the current process; Use the virtual machine disk identification vector of the current process to match in the global identification vector table. If the match is successful, the virtual machine disk file path is obtained; if the match fails, the current process structure information is obtained according to the current process PID, and the file descriptor table of the current process is traversed. After querying the disk file used by the virtual machine, the virtual machine disk file path is constructed, and then the obtained current virtual machine disk identification vector and virtual machine disk file path are written into the global identification vector table; Determine whether the asynchronous I / O write function uses the scatter / gather I / O method according to the intercepted parameter value. If so, obtain the disk file change data one by one according to the disk write data array; if not, obtain the disk file change data directly according to the disk write data address, wherein the disk write data array stores multiple segments of disk write data addresses and write offsets.

5. The agentless real-time backup method for Xen full virtualization according to claim 1, characterized in that: The steps of creating a backup structure, writing disk write location information, the virtual machine disk file path of the current process and disk file change data into the backup structure, and then writing the structure data into the kernel buffer for temporary storage include: Create a backup structure, the backup structure sequentially including: disk write information, the virtual machine disk file path of the current process and a disk file change data structure array, wherein the disk file change data structure array includes data length and actual disk write data; Write the acquired disk writing information, the virtual machine disk file path of the current process, and the disk file change data into the backup structure; After the data contained in the backup structure is loaded, the backup structure is written into the kernel buffer for temporary storage, wherein the kernel buffer is created during initialization; End the callback function of the interception tool and wake up the asynchronous sending thread.

6. A method for real-time agentless backup of Xen full virtualization, characterized in that: Applied to the backup server, processing the backup data from the backup driver in the operating system of the production host, including the following steps: The backup service program receives the backup structure data transmitted from the backup driver; The backup service program writes the received backup structure data into a receiving structure with the same structure as the backup structure, and then writes the target content in the receiving structure into a log file; the backup structure is formed by writing the disk write position information, the virtual machine disk file path of the current process and the disk file change data; the backup driver is used to write the structure data into the kernel buffer for temporary storage, and the kernel buffer is created during initialization; the backup driver is also used to parse the asynchronous I / O request to obtain the disk write position information, match the virtual machine disk file path of the current process according to the global identification vector table, and then obtain the disk file change data according to the disk write data address in the asynchronous I / O request; the backup driver is also used to intercept the asynchronous I / O request transmitted by the user program to the host kernel, obtain the PID and process name of the current process, and filter the asynchronous I / O requests of non-tapdisk processes; the backup driver is also used to obtain and generate a global identification vector table through the PID of all tapdisk processes in the host and their corresponding disk file descriptors during initialization, wherein the global identification vector table contains the disk file identification vector and its corresponding virtual machine disk file path.

7. A Xen full virtualization agentless real-time backup system, characterized in that: The system is executed by a backup driver located in the operating system of the host machine at the production end, and the system includes: An initialization module is used to obtain and generate a global identification vector table through the PIDs of all tapdisk processes in the host machine and their corresponding disk file descriptors during initialization, wherein the global identification vector table includes a disk file identification vector and its corresponding virtual machine disk file path; The interception module is used to intercept the asynchronous I / O requests transmitted by the user program to the host kernel, obtain the PID and process name of the current process, and filter the asynchronous I / O requests of non-tapdisk processes; The data acquisition module is used to parse the asynchronous I / O request to obtain the disk write location information, match the virtual machine disk file path of the current process according to the global identification vector table, and then obtain the disk file change data according to the disk write data address in the asynchronous I / O request; The data loading module is used to create a backup structure, write the disk write location information, the virtual machine disk file path of the current process and the disk file change data into the backup structure, and then write the structure data into the kernel buffer for temporary storage, wherein the kernel buffer is created during initialization; The sending module is used to asynchronously send the data in the kernel buffer to the backup service program.

8. The Xen full virtualization agentless real-time backup system according to claim 7, characterized in that: The initialization module comprises: The query unit is used to traverse the process list during initialization, search for the process named tapdisk, and obtain its process PID after finding the tapdisk process; Construct a disk file path unit, which is used to obtain process structure information according to the tapdisk process PID, traverse the file descriptor table of the tapdisk process, query the disk file used by the virtual machine and its disk file descriptor, and then construct the virtual machine disk file path; The identification vector table generation unit is used to perform bit operations with the tapdisk process PID and the disk file descriptor to obtain the virtual machine disk identification vector of the process, and then write the virtual machine disk identification vector and its corresponding virtual machine disk file path into the global identification vector table.

9. The Xen full virtualization agentless real-time backup system according to claim 7, characterized in that: The interception module comprises: A detection point setting unit, used for setting an asynchronous I / O write function as a detection point of an interception tool when tapdisk converts a disk write request from a virtual machine into a corresponding physical storage operation and submits the disk write request to the dom0 kernel for an asynchronous I / O processing flow; The blocking unit is used to immediately block the execution of the asynchronous I / O write function when the interception tool detects that the asynchronous I / O write function is about to run, and then trigger the callback processing function of the interception tool; The parameter acquisition unit is used to intercept the tool to take out the parameters of the asynchronous I / O write function from the register as the parameters of the callback processing function; The filter unit is used to obtain the PID and process name of the current process in the callback function. If it is the tapdisk process, proceed to the next step. If not, terminate the callback function. In addition, the data acquisition module includes: A disk write position information obtaining unit, used for parsing an asynchronous I / O request to obtain disk write position information, wherein the disk write position information includes: a disk file descriptor, a write offset and a write length; The identification vector calculation unit is used to perform bit operations using the current process PID and the disk file descriptor in the disk write position information to obtain the virtual machine disk identification vector of the current process; A matching unit is used to match the virtual machine disk identification vector of the current process in the global identification vector table. If the match is successful, the virtual machine disk file path is obtained; if the match fails, the current process structure information is obtained according to the current process PID, the file descriptor table of the current process is traversed, and the disk file used by the virtual machine is queried to construct the virtual machine disk file path, and then the obtained current virtual machine disk identification vector and virtual machine disk file path are written into the global identification vector table; a change data acquisition unit, used to determine whether the asynchronous I / O write function uses the scatter / gather I / O mode according to the intercepted parameter value, and if so, to acquire the disk file change data one by one according to the disk write data array; if not, to directly acquire the disk file change data according to the disk write data address, wherein the disk write data array stores multiple segments of disk write data addresses and write offsets; In addition, the data loading module includes: A backup structure creation unit, used to create a backup structure, wherein the backup structure sequentially includes: disk write information, a virtual machine disk file path of the current process, and a disk file change data structure array, wherein the disk file change data structure array includes a data length and actual disk write data; A data loading unit is used to write the acquired disk writing information, the virtual machine disk file path of the current process and the disk file change data into the backup structure; The data transfer unit is used to write the backup structure into the kernel buffer for temporary storage after the data contained in the backup structure is loaded, wherein the kernel buffer is created during initialization; The sending thread wake-up unit is used to end the execution of the callback function of the interception tool and wake up the asynchronous sending thread at the same time.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the agentless real-time backup method for Xen full virtualization as claimed in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method for acquiring corresponding disk file of virtual machine disk

    CN105573671A

  • Proxy-free virtualized backup recovery method based on XEN

    CN108182128A

  • Snapshot-free operating system online backup method, device and equipment and storage medium

    CN112698987A

  • Streaming data access method, device and system, electronic equipment and storage medium

    CN115905747A

  • Agent-free CDP method and system for Hyper-V and storage medium

    CN117762695A