Continuous data protection method for application programming interface for IO filtering
Technical Field
The invention belongs to the technical field of data storage and backup, and particularly relates to a continuous data protection method for any I/O request, wherein GuestOS (guest operating system) of a Virtual Machine on an ESxi host is captured by VMware VAIO (vSphere APIs for I/O Filtering), and the GuestOS (guest operating system) is sent to a VMDK (Virtual Machine Disk).
Background
As the exponential growth of user data, users need to use more and more server devices to calculate and store data, in which case the operating costs of the users are increasing. To reduce operating costs, more and more users use virtual machines on virtualized platforms to compute and store data. The VMware ESxi is a server virtualization platform leading in the industry, and users can create different virtual machines on the VMware ESxi virtualization platform according to own requirements.
With the continuous improvement of the informatization level, data becomes the basis for the survival of enterprises, the loss caused by data loss is increasingly serious, and users pay more and more attention to data security. Although the traditional continuous data protection method can be applied to the virtual machine of the VMware ESXi virtualization platform, the method mainly has the following defects:
(1) a client agent needs to be installed on a virtual machine (a production environment of a client), and thus resources (including a CPU, a memory, and the like) of the production virtual machine are occupied, and performance of the production virtual machine is affected. An I/O filter driver module of the client-side agent program runs in a kernel space of the operating system, an I/O request of the virtual disk is captured based on a kernel-level file system of the operating system, and the kernel of the operating system is crashed due to the fault of the I/O filter driver module.
(2) The data backup program of the client agent needs to interpret the file system of the disk, partition or logical volume. Windows and Linux systems have many file systems, and the file systems are too complex to interpret.
(3) The version of the operating system is too much. To support different types of operating systems (Windows, Linux, etc.), different releases of operating systems (CentOS, RedHat, Oracle, Ubuntu, SUSE, nookylin, Kylin, Debian, Linx, etc.), and different system kernel versions, data vendors are required to expend significant development costs to adapt client agents to meet different customer production systems.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a continuous data protection method for an application programming interface for IO filtering, which only needs to newly build a virtual machine and install a VIB plug-in program on a host computer without additionally installing any program on a production virtual machine, wherein the newly built virtual machine is used for installing a client agent program; the VIB plug-in program provides I/O filter function to work in the user space of the ESxi host, and the failure of the plug-in program can not cause the system kernel of the ESxi host to crash.
In order to achieve the purpose, the invention is realized by the following technical scheme:
the invention discloses a continuous data protection method for an application programming interface for IO filtering, which comprises the following steps of:
(1) creating a virtual machine on a host for installing and running a client agent program;
(2) mounting the virtual disk equipment on the server to the host by using an Internet small computer system interface protocol;
(3) carrying out full backup and incremental backup on a virtual machine disk on a host by using a virtual disk development kit; writing effective data of a virtual machine disk on a host into a virtual disk mounted on the host by a server by using a virtual disk development kit interface;
(4) installing a VIB plug-in program on a host, wherein the VIB plug-in program provides an I/O filter function and is used for processing an I/O request sent to a virtual disk by a guest operating system of a virtual machine; the I/O filter captures an I/O request sent to a disk of the virtual machine by a guest operating system of the virtual machine on the host, adds the captured I/O request to an I/O queue, and then writes the I/O request into the virtual disk mounted on the host by the server; recording the I/O request which cannot be processed and completed in time into a bitmap file;
(5) and synchronizing the I/O requests in the I/O queue or the I/O requests recorded in the bitmap file to a virtual disk mounted on the host by the server.
In the step (2), the virtual disk device on the server is mounted on the host by using an internet small computer system interface protocol, and the specific steps are as follows:
(2-1) the client agent program inquires the information of the virtual machine and the virtual machine disk on the host machine and sends the inquired information to the server through a TCP/IP socket;
(2-2) the server agent program of the server creates virtual disk equipment on the server according to the received virtual machine disk information, and maps the virtual disk to be an iSCSI target;
(2-3) the client agent program configures iSCSI for the host according to the IP address of the server; after the iSCSI configuration is completed, the virtual disk device mounted by the server can be seen in the corresponding directory of the host.
In step (4), a VIB plug-in is installed on the host, the VIB plug-in provides an I/O filter function, connects the virtual machine disk protected by the continuous data to the I/O filter plug-in, and then can start to process the I/O request sent by the guest operating system of the virtual machine to the virtual machine disk, the specific steps are as follows:
(4-1) a guest operating system of a virtual machine on the host machine sending an I/O request to a virtual machine disk;
(4-2) the kernel vSphere I/O filter framework module of the host starts to process the I/O request; after the processing is finished, sending the I/O request to an I/O filter module of the user space;
(4-3) the I/O filter module of the user space starting to process an I/O request; after the processing is finished, adding the I/O request into a work queue of a host system, sending a continuous request, and then returning the I/O request to a kernel vSphere I/O filter frame module of the host;
(4-4) the kernel vSphere I/O filter framework module of the host continues to process the I/O request, and then sends the I/O request to the disk device driver;
(4-5) the disk device driver completes the I/O request and returns the result to the kernel vSphere I/O filter framework module of the host;
(4-6) the kernel vSphere I/O filter framework module of the host sending the completed request to the I/O filter module of the user space again;
(4-7) the I/O filter module of the user space completes processing the I/O request, sends out a completion request, and then informs the kernel vSphere I/O filter framework module of the host that the I/O request processing is completed;
(4-8) the kernel vSphere I/O filter framework module of the host continues to execute the I/O request, and then returns the processing result of the I/O request to the guest operating system of the virtual machine VM.
In step (4-3), the method for processing the I/O request by the I/O filter of the user space is as follows:
and adding the I/O request captured in real time into an I/O queue, or recording the offset position and the size of the I/O request in the disk of the virtual machine into a bitmap file, and recording a corresponding counter.
In the step (5), the concrete steps are as follows:
(5-1) setting the state of the virtual machine disk according to a counter recorded in a bitmap file;
and (5-2) synchronizing the I/O request recorded in the bitmap file to the virtual disk mounted to the host by the server or synchronizing the I/O request in the I/O queue to the virtual disk mounted to the host by the server according to the state of the virtual machine disk.
The client agent backup program of the invention does not need to explain the file system of a disk, a partition or a logic volume, and directly utilizes the virtual disk development kit of VMware to obtain the effective data of the virtual machine disk. The invention can capture any I/O request sent to the disk of the virtual machine by the guest operating system of the virtual machine on the ESxi host in real time only by installing a VIB plug-in program on the ESxi host without additionally installing any program or plug-in on the production virtual machine. The plug-in runs in the user space of the ESxi host computer, and the production virtual machine of the user cannot be influenced.
Drawings
FIG. 1 is a communication flow diagram among the ESxi host, the CDP server and the Agent virtual machine.
FIG. 2 is a schematic diagram of the I/O flow from the guest operating system of a virtual machine to the disk of the virtual machine on the ESxi host.
Detailed Description
In order to make the technical means, the creation characteristics, the achievement purposes and the effects of the invention easy to understand, the invention is further described with the specific embodiments.
Referring to fig. 1, a method for continuous data protection of an application programming interface for IO filtering according to the present invention specifically includes the following steps:
(1) and mounting the virtual disk device on the server to the ESxi host by using an iSCSI protocol. The specific implementation steps are as follows:
(1-1) the client agent program inquires the information of the virtual machine and the disk of the virtual machine on the host machine and sends the inquired information to the server through the TCP/IP socket.
(1-2) the server-side agent program of the server creates virtual disk equipment on the server according to the received virtual machine disk information, and maps the virtual disk to an iSCSI target.
(1-3) the client agent configures iSCSI for the host according to the IP address of the server. After iSCSI configuration is completed, the virtual disk device mounted by the server can be seen in the corresponding directory of the host.
(2) The client agent program utilizes VMware VDDK technology to backup the virtual machine disk on the host, including full backup and incremental backup. And directly writing valid data of the virtual machine disk on the ESxi into the virtual disk mounted on the host by the server by utilizing the VDDK interface.
(3) A VIB plug-in is installed on the host computer, and works in user space to provide I/O filter functions. A VMDK (Virtual Machine Disk) that needs to be continuously data protected is connected to the I/O filter plug-in, and the I/O filter can then capture in real time the I/O requests sent to the Virtual Machine Disk by the guest operating system of the Virtual Machine on the host, write the captured I/O requests to the Virtual Disk mounted by the server on the host. Referring to fig. 2, the specific implementation steps are as follows:
(3-1) the guest operating system of a VM (Virtual Machine) on the ESxi sends an I/O request to the VMDK.
(3-2) the kernel vSphere I/O filter framework module of the ESxi host starts to process the I/O request, and after the processing is finished, the I/O request is sent to I/O Filtering of the user space.
(3-3) I/O Filtering of the user space starts processing the I/O request. And adding the I/O request captured in real time into an I/O queue or a bitmap file, after the processing is finished, adding the I/O request into a work queue of the ESxi system, sending a Continue request, and returning the I/O request to a kernel vSphere I/O filter framework module of the ESxi host.
(3-4) the kernel vSphere I/O filter framework module of the ESxi host continues to process the I/O request and then sends the I/O request to the disk device driver.
(3-5) the disk device driver completes the I/O request and returns the result to the vSphere I/O filter framework module.
(3-6) the kernel vSphere I/O filter framework module of the ESXi host sends the completed request to the I/O filter again.
(3-7) I/O Filtering processing I/O request Completion of the user space, sending out Completion request, and then informing a kernel vSphere I/O filter framework module of the ESxi host that I/O request processing is completed.
(3-8) the kernel vSphere I/O filter framework module of the host continues to execute the I/O request, and returns the processing result of the I/O request to the guest operating system of the virtual machine VM.
(4) And synchronizing the I/O request in the I/O queue or the I/O request recorded in the bitmap file to a virtual disk mounted on the ESxi host by the CDP server.
The foregoing shows and describes the general principles and broad features of the present invention and advantages thereof. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.