WO2018120680A1 - Virtual disk backup system, method, apparatus, service host and storage medium - Google Patents

Virtual disk backup system, method, apparatus, service host and storage medium Download PDF

Info

Publication number
WO2018120680A1
WO2018120680A1 PCT/CN2017/089483 CN2017089483W WO2018120680A1 WO 2018120680 A1 WO2018120680 A1 WO 2018120680A1 CN 2017089483 W CN2017089483 W CN 2017089483W WO 2018120680 A1 WO2018120680 A1 WO 2018120680A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual disk
backup
host
service host
service
Prior art date
Application number
PCT/CN2017/089483
Other languages
French (fr)
Chinese (zh)
Inventor
刘仁仕
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2018120680A1 publication Critical patent/WO2018120680A1/en

Links

Classifications

    • 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/1608Error detection by comparing the output signals of redundant hardware
    • G06F11/1612Error detection by comparing the output signals of redundant hardware where the redundant component is persistent storage
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0662Virtualisation aspects
    • G06F3/0664Virtualisation aspects at device level, e.g. emulation of a storage device or system

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a virtual disk backup system, method, device, service host, and storage medium.
  • VMM Virtual Machine Monitor, virtual machine monitor
  • IaaS services there are two main types of data storage in IaaS services: shared storage and local storage.
  • shared storage In a local storage scheme, once a node fails, such as a physical disk is damaged, all virtual machines on the physical machine will be unavailable. In addition, since there is no redundant backup of the local disk data, if the physical disk is damaged, the physical will be caused. All virtual machines on the machine are unrecoverable. That is to say, the existing data storage method can easily cause the virtual machine to be unusable in the case of physical disk damage.
  • the main purpose of the present invention is to provide a virtual disk backup system, method, device, service host and storage medium, which are intended to solve the existing data storage mode, and in the case of physical disk damage, it is easy to cause all virtual machines on the physical machine. Unable to use technical issues.
  • the present invention provides a virtual disk backup system, where the virtual disk backup system includes a cloud server, a service host, and a backup host;
  • the cloud server is configured to send a virtual disk backup instruction to the service host and the backup host when the service host and the backup host are detected to be started, so that the service host starts a preset synchronization server. a program, and the backup host launches a preset synchronization client program;
  • the service host is configured to intercept a virtual disk write operation of the local virtual disk when receiving the virtual disk backup instruction, and send the intercepted virtual disk write operation to the backup host by using the synchronization server program ;
  • the backup host is configured to write the received virtual disk write operation to the backup virtual disk when the virtual disk write operation is received by the synchronization client program.
  • the present invention further provides a virtual disk backup method, which is applied to a service host, and the virtual disk backup method includes:
  • the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
  • the present invention further provides a virtual disk backup device, which is applied to a service host, and the virtual disk backup device includes:
  • the startup module is configured to start a preset synchronization server program when receiving a virtual disk backup instruction sent by the cloud server;
  • An intercept module for intercepting a virtual disk write operation of a local virtual disk
  • the virtual disk write operation for sending the intercepted to the backup host by the synchronization server program, when the backup host receives the virtual disk write operation through a preset synchronization client program, and receives the virtual disk write operation.
  • the virtual disk write operation is written to the backup virtual disk.
  • the present invention further provides a service host, where the service host includes a processor, a network interface, and a memory, where the virtual disk backup program is stored in the memory;
  • the network interface is configured to connect to the cloud server and the backup host, and perform data communication with the cloud server and the backup host;
  • the processor is configured to execute the virtual disk backup program to implement the following steps:
  • the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
  • the present invention also provides a storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the following steps:
  • the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
  • the cloud server when detecting that the service host and the backup host are started, sends a virtual disk backup command to the service host and the backup host, so that the service host starts a preset synchronization server. a program, and the backup host starts a preset synchronization client program, when receiving the virtual disk backup instruction, the service host intercepts a virtual disk write operation of the local virtual disk, and intercepts the program through the synchronization server program The virtual disk write operation is sent to the backup host, and the backup host writes the received virtual disk write operation to the backup virtual disk when the virtual disk write operation is received by the synchronization client program. in.
  • the invention realizes real-time backup of the local virtual disk of the service host, and even if the physical disk of the service host is damaged, the backup virtual disk of the backup host has already backed up the data, and can continue to provide services for the virtual machine in the service host. To ensure that the virtual machine in the service host can be used normally.
  • FIG. 1 is a schematic diagram of a first structure of a virtual disk backup system according to the present invention.
  • FIG. 2 is a schematic diagram of a second structure of a virtual disk backup system according to the present invention.
  • FIG. 3 is a schematic flowchart of a first embodiment of a virtual disk backup method according to the present invention.
  • FIG. 4 is a schematic diagram of functional modules of a second embodiment of a virtual disk backup method according to the present invention.
  • FIG. 5 is a schematic flowchart of a third embodiment of a virtual disk backup method according to the present invention.
  • FIG. 6 is a schematic diagram of functional modules of a first embodiment of a virtual disk backup device according to the present invention.
  • FIG. 7 is a schematic diagram of functional modules of a third embodiment of a virtual disk backup device according to the present invention.
  • FIG. 8 is a schematic structural diagram of a service host related to a hardware operating environment according to an embodiment of the present invention.
  • the cloud server when detecting that the service host and the backup host are started, sends a virtual disk backup command to the service host and the backup host, so that the service host starts a preset synchronization server program.
  • the backup host starts a preset synchronization client program, and when receiving the virtual disk backup instruction, the service host intercepts a virtual disk write operation of the local virtual disk, and intercepts the program through the synchronization server program.
  • the virtual disk write operation is sent to the backup host, and the backup host writes the received virtual disk write operation to the backup virtual disk when the virtual disk write operation is received by the synchronization client program.
  • the virtual disk In order to solve the existing local storage scheme, in the event of a node failure, such as a physical disk corruption, the virtual disk cannot be used because the local virtual disk data has no redundant backup.
  • the present invention provides a virtual disk backup system.
  • the virtual disk backup system includes a cloud server, a service host, and a backup host;
  • the cloud server is configured to send a virtual disk backup instruction to the service host and the backup host when the service host and the backup host are detected to be started, so that the service host starts a preset synchronization server. a program, and the backup host launches a preset synchronization client program;
  • the service host is configured to intercept a virtual disk write operation of the local virtual disk when receiving the virtual disk backup instruction, and send the intercepted virtual disk write operation to the backup host by using the synchronization server program ;
  • the backup host is configured to write the received virtual disk write operation to the backup virtual disk when the virtual disk write operation is received by the synchronization client program.
  • the cloud server specifies any physical machine in the cluster as the service host, and specifies other preset physical machines from the cluster as the backup host.
  • the preset number can be set according to actual conditions. For example, if the stability of each physical machine in the cluster is good, one can be selected as a backup host, and if it is a physical machine in the cluster. The stability is poor. In order to prevent subsequent backup hosts from failing, multiple physical machines can be selected as backup hosts.
  • the traditional backup host selection method is a fixed choice of one as a backup host, and the service host and the backup host are one-to-one.
  • the limitation is very strong, and it is easy for the service host to use when the backup host fails. happening.
  • a service host can perform backup of the virtual disk by at least one backup host; of course, one backup host can perform backup of the virtual disk for at least one service host. That is, the physical machine of the preset number of arbitrarily selected in the cluster is used as the backup host, which ensures the stability of subsequent data backup. Moreover, a backup host can also serve as a backup host for multiple service hosts at the same time. It is not a memo host that can only be used by one service host, which is beneficial to save system resources.
  • the service host and the backup host After the service host and the backup host are specified, determine the virtual machine included in the service host, and then copy the virtual disk corresponding to the virtual machine to the backup host, so that the service host and the virtual host have the same virtual disk, which facilitates subsequent data. Backup. Further, after the service host and the backup host are designated, the service host and the backup host need to be initialized.
  • the specific initialization operation includes: performing VM disk read/write interception on the service host and the backup host deployment.
  • the module patch VMM program, synchronization server program, synchronization client program, Agent (agent) program after deploying each program to the service host and the backup host, start the service program of the service host and the backup host to complete the initialization operation.
  • the same initialization operation is performed on the service host and the backup host because the identity of the service host and the backup host is not fixed, and can be used as both a service host and a backup host of other physical machines. Subsequent operations can be performed according to specific situations.
  • the service host and the backup host can interact with the cloud server.
  • the service host and the backup host interact with the cloud server through the Agent program, specifically, through the Agent.
  • the program receives the virtual disk backup instruction sent by the cloud server.
  • FIG. 1 is the first virtual disk backup system of the present invention. Schematic:
  • the VMM of the service host 02 is added with a VM disk read/write interception submodule 021, Sync. Server (sync server) program 022 and Agent program 023, Sync is added to backup host 03 Client (synchronization client) program 031 and agent program 032.
  • the VM disk read/write operation intercepting submodule 021 is responsible for intercepting the read and write operations of the VM on the virtual disk, and synchronizing the read and write operations to the synchronization server program 022; the synchronization server program 022 transfers the data to the synchronization client in the backup host.
  • the end program 031, the synchronization client program 031 by calling the virtual disk mirror driver, writes the data in real time to the backup virtual disk of the backup host, realizing real-time backup of the virtual disk image.
  • the Agent program 023 and the Agent program 032 are not only responsible for the interaction with the cloud server 01, but also for the startup, shutdown, and status monitoring of the synchronization server 022 and the synchronization client 031.
  • the cloud server 01 detects that the service host 02 and the backup host 03 are activated in the case of specifying the service host 02 and the backup host 03, and actually detects the Agent program in the service host 02. 023 and the agent program 032 of the backup host 03 are started.
  • the Agent program 023 of the service host 02 is started, and the Agent program 032 of the backup host 03 is started, a virtual disk backup command is sent to the service host 02 and the backup host 03 for the service.
  • the host 02 starts the synchronization server program 022, and the backup host 03 starts the synchronization client program 031.
  • the synchronization server program 022 When the service host 02 receives the virtual disk backup command, the synchronization server program 022 first establishes a communication connection with the VM disk read/write interception submodule 021 to intercept the VM disk read/write interception submodule 021. a virtual disk write operation of the local virtual disk, and the intercepted virtual disk write operation is sent to the synchronization server program 022; at the same time, the service host 02 also synchronizes the synchronization client program 022 with the backup host 03. A communication connection is established, and the intercepted virtual disk write operation is sent to the backup host 03 by the synchronization server program 022.
  • the backup host program 03 When the backup host program 03 receives the virtual disk write operation, the backup host 03 calls a library function of the virtual disk mirror driver to write the received virtual disk read and write operations to the backup virtual disk. Finally, the execution result is fed back to the service host 02 to inform the service host 02 of the result of the data copy.
  • the cloud server when detecting that the service host and the backup host are started, sends a virtual disk backup command to the service host and the backup host, so that the service host initiates a preset synchronization.
  • a server program and the backup host starts a preset synchronization client program, when the service host receives the virtual disk backup instruction, intercepting a virtual disk write operation of the local virtual disk, and using the synchronization server program Transmitting the virtual disk write operation to the backup host, and when the backup host receives the virtual disk write operation by using the synchronization client program, writing the received virtual disk write operation to the backup virtual On the disk.
  • the invention realizes real-time backup of the local virtual disk of the service host, and even if the physical disk of the service host is damaged, the backup virtual disk of the backup host has already backed up the data, and can continue to provide services for the virtual machine in the service host. To ensure that the virtual machine in the service host can be used normally.
  • a second embodiment of the virtual disk backup system of the present invention is proposed based on the first embodiment.
  • the service host is further configured to intercept the local virtual disk when detecting that the local virtual disk fails. Virtual disk read and write operations, and the intercepted virtual disk read and write operations are sent to the backup host by the synchronization server program;
  • the backup host is further configured to invoke the backup virtual disk to perform the virtual disk read and write operation when the virtual disk read and write operation is received by the synchronization client program, and feed back an execution result to the service. Host.
  • the service host 02 senses the local virtual disk blockage through the VM disk read/write interception submodule 021 to determine that the local virtual disk is faulty, and when the local virtual disk is detected to be blocked, the VM is detected by the VM.
  • the disk read/write interception submodule 021 intercepts the virtual disk read and write operations of the local virtual disk, and then sends the intercepted virtual disk read and write operations to the backup host 03 through the synchronization server program 022.
  • the backup virtual disk is invoked to perform the virtual disk read and write operation, that is, the backup host 03
  • the virtual disk image is invoked to perform a specific operation. If the virtual disk read and write operation is a read operation, a read operation is performed in the virtual disk image. If the virtual disk read and write operation is a write operation, a write operation is performed in the virtual disk image. Finally, the execution result is fed back to the service host 02.
  • the virtual disk read/write operation corresponding to the local virtual disk is switched to the backup virtual disk of the backup host 03 in time, and the service host 02 is ensured.
  • the virtual disk read and write operations corresponding to the virtual machine are executed normally.
  • the cloud server is further configured to notify the backup host to start a virtual machine of the backup host based on the backup virtual disk when detecting that the service host is down, for the backup host to be activated according to the startup
  • the virtual machine continues to provide services.
  • the cloud server 01 detects the service host 02.
  • the Agent program 023 is stopped, it is known that the service host 02 is down.
  • the cloud server 01 notifies the backup host 03 to start the backup virtual disk, because the backup host The backup virtual disk of 03 has been backed up with all the virtual disk read and write operations in the service host 02, then the backup host 03 can continue to start the virtual machine of the backup host 03 according to the backup virtual disk to pass The virtual machine that is started continues to provide services.
  • the cloud server 01 when detecting that the service host 02 is down, notifies the backup host 03 to start the backup virtual disk, so that the backup host 03 starts according to the backup virtual disk.
  • the virtual machine continues to provide services to ensure that the backup host 03 can continue to provide services in the event that the service host 02 is down.
  • a fourth embodiment of the virtual disk backup system of the present invention is proposed based on the first embodiment.
  • this embodiment
  • the cloud server is further configured to: when detecting a virtual disk migration request, determine a destination service host to be switched by the service host, and send a virtual disk migration instruction to the service host according to the determined destination service host;
  • the service host is further configured to: when receiving the virtual disk migration instruction, determine a destination service host, and migrate the local virtual disk to the determined destination service host; and when detecting that the local virtual disk migration is completed, pass The synchronization server program sends a migration completion instruction to the backup host;
  • the backup host is further configured to: when the migration completion instruction is received by the synchronization client program, close a communication connection with the service host, and establish a communication connection with the destination service host to continue virtual Disk backup service.
  • the cloud server when the cloud server detects the virtual disk migration request, in order to ensure that the virtual machine in the service host can operate normally, the virtual machine of the service host needs to be migrated to another service host.
  • the triggering mode of the virtual disk migration request includes: when the service host needs to use a large amount of memory, triggering a virtual disk migration request; or when the load of the service host CPU is too large, triggering a virtual disk migration request.
  • FIG. 2 is a schematic diagram of a second structure of the virtual disk backup system of the present invention:
  • the VM migration intercepting submodule 024 is also added by the patching method in the VMM, wherein the VM migration intercepting submodule 024 is responsible for intercepting the VM migration operation, and when the operation of the VM migration is intercepted, the synchronization server program 022 is notified.
  • Sync The server program 022 notifies the synchronization client program 031 in the backup host 03.
  • the backup host can be selected in the cluster, similarly, when the service host is down, when the virtual machine in the service host is migrated to another service host, the same can be selected in the cluster.
  • the physical machine is used as the destination service host to be switched to perform virtual machine migration.
  • a virtual disk migration instruction may be sent to the service host to notify the service host to perform online migration of the virtual machine.
  • the service host 02 when receiving the virtual disk migration instruction sent by the cloud server 01, determines the destination service host, and then migrates the local virtual disk according to the VM migration intercepting submodule 024 to The determined destination service host sends a migration completion instruction to the synchronization server program 022 upon detecting the completion of the local virtual disk migration, and then sends a migration completion instruction to the backup host 03 through the synchronization server program 022.
  • the backup client 03 When the backup client 03 receives the migration completion instruction by the synchronization client program 031, the communication connection with the service host 02 is closed, that is, the communication connection with the synchronization server program 022 of the service host is closed; At the same time, a communication connection with the synchronization server program in the destination service host is established to continue the backup service of the virtual disk.
  • the cloud server is further configured to obtain address information and virtual machine information of the destination service host, and send address information and virtual machine information of the destination service host to the backup host, where the backup host is based on The address information and the virtual machine information of the destination service host establish a communication connection with the destination service host;
  • the cloud server is further configured to notify the target service host to have a virtual machine access, so that the destination service host starts a synchronization server program, so as to establish a communication connection with the backup host by using the synchronization server program.
  • the cloud server 01 acquires the address information and the virtual machine information of the destination service host according to the determined destination service host, and then the destination.
  • the address information and the virtual machine information of the service host are sent to the backup host 02, so that the backup host 02 subsequently establishes a communication connection with the destination service host based on the address information and the virtual machine information of the destination service host;
  • the cloud server 01 further informs the destination service host that the virtual machine is accessed, so that the destination service host starts a synchronization server program, so as to establish a communication connection with the backup host through the synchronization server program.
  • the online migration of the virtual machine is implemented, and when the virtual machine performs online migration, the virtual machine of the local virtual disk can be migrated between any physical machine in the cluster, thereby improving the cloud computing service system. Maintainability is more conducive to load balancing.
  • the mapping between the service host and the backup host is no longer a peer-to-peer (peer-to-peer, peer-to-peer network), but a fully associative mapping relationship.
  • Different virtual disks of one service host can be backed up by different backup disks.
  • the host performs backup so that when a virtual machine using a local virtual disk is migrated from a service host to a new service host, the virtual disk of the virtual machine is still backed up by the original backup host, improving data backup. Flexibility.
  • the present invention further provides a virtual disk backup method applied to a service host.
  • FIG. 3 is a schematic flowchart diagram of a first embodiment of a virtual disk backup method according to the present invention.
  • the virtual disk backup method includes:
  • Step S10 when receiving the virtual disk backup instruction sent by the cloud server, starting a preset synchronization server program
  • Step S20 intercepting a virtual disk write operation of the local virtual disk
  • Step S30 the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, so that when the backup host receives the virtual disk write operation through a preset synchronization client program, it will receive The virtual disk write operation is written to the backup virtual disk.
  • the cloud server specifies any physical machine in the cluster as the service host, and specifies other preset physical machines from the cluster as the backup host.
  • the preset number can be set according to actual conditions. For example, if the stability of each physical machine in the cluster is good, one can be selected as a backup host, and if it is a physical machine in the cluster. The stability is poor. In order to prevent subsequent backup hosts from failing, multiple physical machines can be selected as backup hosts.
  • the traditional backup host selection method is a fixed choice of one as a backup host, and the service host and the backup host are one-to-one.
  • the limitation is very strong, and it is easy for the service host to use when the backup host fails. happening.
  • a service host can perform backup of the virtual disk by at least one backup host; of course, one backup host can perform backup of the virtual disk for at least one service host. That is, the physical machine of the preset number of arbitrarily selected in the cluster is used as the backup host, which ensures the stability of subsequent data backup. Moreover, a backup host can also serve as a backup host for multiple service hosts at the same time. It is not a memo host that can only be used by one service host, which is beneficial to save system resources.
  • the service host and the backup host After the service host and the backup host are specified, determine the virtual machine included in the service host, and then copy the virtual disk corresponding to the virtual machine to the backup host, so that the service host and the virtual host have the same virtual disk, which facilitates subsequent data. Backup. Further, after the service host and the backup host are designated, the service host and the backup host need to be initialized.
  • the specific initialization operation includes: performing VM disk read/write interception on the service host and the backup host deployment.
  • the module patch VMM program, synchronization server program, synchronization client program, Agent (agent) program after deploying each program to the service host and the backup host, start the service program of the service host and the backup host to complete the initialization operation.
  • the same initialization operation is performed on the service host and the backup host because the identity of the service host and the backup host is not fixed, and can be used as both a service host and a backup host of other physical machines. Subsequent operations can be performed according to specific situations.
  • the service host and the backup host can interact with the cloud server.
  • the service host and the backup host interact with the cloud server through the Agent program, specifically, through the Agent.
  • the program receives the virtual disk backup instruction sent by the cloud server.
  • the cloud server detects that the service host and the backup host are started in the case of specifying the service host and the backup host, and actually detects that the Agent program in the service host and the Agent program of the backup host are started. After detecting that the agent program of the service host is started, and the agent program of the backup host is started, sending a virtual disk backup instruction to the service host and the backup host, so that the service host starts a synchronization server program, And the backup host starts the synchronization client program.
  • the synchronization server program When the service host receives the virtual disk backup instruction, the synchronization server program first establishes a communication connection with the VM disk read/write interception submodule to intercept the local virtual disk through the VM disk read/write interception submodule. a virtual disk write operation, and sending the intercepted virtual disk write operation to the synchronization server program; at the same time, the service host also establishes a communication connection between the synchronization server program and the synchronization client program of the backup host, and then through the synchronization The server program sends the intercepted virtual disk write operation to the backup host.
  • the virtual disk mirroring driver library function is invoked to write the received virtual disk read and write operation to the backup virtual disk, and finally The execution result is fed back to the service host to inform the service host of the result of the data copy.
  • the virtual disk backup method in this embodiment starts a virtual disk backup command sent by the cloud server, starts a preset synchronization server program, intercepts a virtual disk write operation of the local virtual disk, and writes the intercepted virtual disk.
  • Sending to the backup host by the synchronization server program when the backup host receives the virtual disk write operation through a preset synchronization client program, writing the received virtual disk write operation to the backup virtual disk in.
  • This embodiment implements a real-time backup of the local virtual disk of the service host. If the physical disk of the service host is damaged, the backup virtual disk of the backup host has already backed up the data, and can continue to provide the virtual machine in the service host. The service ensures that the virtual machine in the service host can be used normally.
  • the virtual disk backup method further includes:
  • Step S40 intercepting a virtual disk read and write operation of the local virtual disk when detecting that the local virtual disk fails
  • Step S50 the intercepted virtual disk read and write operations are sent to the backup host by the synchronization server program, when the backup host receives the virtual disk read and write operations through the synchronization client program.
  • the backup virtual disk is invoked to perform the virtual disk read and write operations, and the execution result is fed back to the service host.
  • the service host senses the local virtual disk blockage through the VM disk read/write interception submodule to determine that the local virtual disk is faulty, and is intercepted by the VM disk read/write interception submodule when the local virtual disk is detected to be blocked.
  • a virtual disk read and write operation of the local virtual disk, and then the intercepted virtual disk read and write operations are sent to the backup host by the synchronization server program.
  • the backup virtual disk is invoked to perform the virtual disk read and write operation, that is, the backup host calls the virtual disk.
  • the mirror performs a specific operation. If the virtual disk read and write operation is a read operation, the read operation is performed in the virtual disk image. If the virtual disk read and write operation is a write operation, the write operation is performed in the virtual disk image, and finally the feedback is performed. Execute the result to the service host.
  • the virtual disk read/write operation corresponding to the local virtual disk is switched to the backup virtual disk of the backup host in time, and the virtual machine corresponding to the service host is ensured.
  • the virtual disk read and write operations are performed normally.
  • the cloud server when detecting that the service host is down, notifies the backup host to start the virtual machine of the backup host based on the backup virtual disk, so that the backup host is activated according to the virtual machine. Continue to provide services.
  • the cloud server detects that the Agent program in the service host stops, it knows that the service host is down.
  • the cloud server notifies the backup host to start the backup virtual disk, because the backup virtual disk of the backup host has backed up all virtual disk read and write operations in the service host. Then, the backup host can continue to start the virtual machine of the backup host according to the backup virtual disk to continue to provide services through the virtual machine that is started.
  • the cloud server when the cloud server detects that the service host is down, the cloud server is notified to start the backup virtual disk, so that the backup host starts the virtual machine according to the backup virtual disk. And continue to provide services to ensure that the backup host can continue to provide services in the event of a service host downtime.
  • the virtual disk backup method further includes:
  • Step S60 when receiving the virtual disk migration instruction sent by the cloud server, determining the destination service host based on the virtual disk migration instruction;
  • Step S70 migrating the local virtual disk to the determined destination service host
  • Step S80 when detecting that the local virtual disk migration is completed, sending, by the synchronization server program, a migration completion instruction to the backup host, where the backup host receives the migration completion instruction by using the synchronization client program.
  • the communication connection with the service host is closed, and a communication connection with the destination service host is established to continue the backup service of the virtual disk.
  • the cloud server when the cloud server detects the virtual disk migration request, in order to ensure that the virtual machine in the service host can operate normally, the virtual machine of the service host needs to be migrated to another service host.
  • the triggering mode of the virtual disk migration request includes: when the service host needs to use a large amount of memory, triggering a virtual disk migration request; or when the load of the service host CPU is too large, triggering a virtual disk migration request.
  • the backup host can be selected in the cluster, similarly, when the service host is down, when the virtual machine in the service host is migrated to another service host, the same can be selected in the cluster.
  • the physical machine is used as the destination service host to be switched to perform virtual machine migration.
  • a virtual disk migration instruction may be sent to the service host to notify the service host to perform online migration of the virtual machine.
  • the service host when receiving the virtual disk migration instruction sent by the cloud server, determines the destination service host, and then migrates the local virtual disk to the determined destination service host according to the VM migration intercepting submodule.
  • the migration completion instruction is sent to the synchronization server program, and the migration completion instruction is sent to the backup host by the synchronization server program.
  • the communication connection with the service host is closed, that is, the communication connection with the synchronization server program in the service host is closed;
  • the communication connection of the server program is synchronized in the destination service host to continue the backup service of the virtual disk.
  • the cloud server also obtains address information and virtual machine information of the destination service host, and sends address information and virtual machine information of the destination service host to the backup host, where the backup host is based on the The address information of the destination service host and the virtual machine information are used to establish a communication connection with the destination service host; and the cloud server further informs the destination service host that the virtual machine accesses for the destination service host to initiate synchronization.
  • a server program for facilitating establishing a communication connection with the backup host through the synchronization server program.
  • the cloud server sends the virtual disk migration instruction to the service host, the address server and the virtual machine information of the destination service host are obtained according to the determined destination service host, and then the address information of the destination service host is virtualized.
  • the machine information is sent to the backup host, so that the backup host subsequently establishes a communication connection with the destination service host based on the address information and the virtual machine information of the destination service host; meanwhile, the cloud server further notifies the
  • the destination service host has a virtual machine access, so that the destination service host starts a synchronization server program, and facilitates establishing a communication connection with the backup host by using the synchronization server program.
  • the online migration of the virtual machine is implemented, and when the virtual machine performs online migration, the virtual machine of the local virtual disk can be migrated between any physical machine in the cluster, thereby improving the cloud computing service system. Maintainability is more conducive to load balancing.
  • the mapping between the service host and the backup host is no longer a peer-to-peer (peer-to-peer, peer-to-peer network), but a fully associative mapping relationship.
  • Different virtual disks of one service host can be backed up by different backup disks.
  • the host performs backup so that when a virtual machine using a local virtual disk is migrated from a service host to a new service host, the virtual disk of the virtual machine is still backed up by the original backup host, improving data backup. Flexibility.
  • the present invention further provides a virtual disk backup device applied to a service host.
  • FIG. 6 is a schematic diagram of functional modules of a first embodiment of a virtual disk backup device 100 according to the present invention.
  • the functional block diagram shown in FIG. 6 is merely an exemplary embodiment of a preferred embodiment, and those skilled in the art will surround the functional modules of the virtual disk backup device 100 shown in FIG. 6.
  • the new functional modules can be easily supplemented; the names of the functional modules are custom names, which are only used to assist in understanding the various program functional blocks of the virtual disk backup device 100, and are not used to limit the technical solution of the present invention.
  • the functionality to be achieved by the functional modules that each define the name is the functionality to be achieved by the functional modules that each define the name.
  • the virtual disk backup device 100 includes:
  • the startup module 10 is configured to start a preset synchronization server program when receiving a virtual disk backup instruction sent by the cloud server;
  • the intercepting module 20 is configured to intercept a virtual disk write operation of the local virtual disk
  • the sending module 30 is configured to send the intercepted virtual disk write operation to the backup host by using the synchronization server program, when the backup host receives the virtual disk write operation by using a preset synchronization client program. The received virtual disk write operation is written to the backup virtual disk.
  • the cloud server specifies any physical machine in the cluster as the service host, and specifies other preset physical machines from the cluster as the backup host.
  • the preset number can be set according to actual conditions. For example, if the stability of each physical machine in the cluster is good, one can be selected as a backup host, and if it is a physical machine in the cluster. The stability is poor. In order to prevent subsequent backup hosts from failing, multiple physical machines can be selected as backup hosts.
  • the traditional backup host selection method is a fixed choice of one as a backup host, and the service host and the backup host are one-to-one.
  • the limitation is very strong, and it is easy for the service host to use when the backup host fails. happening.
  • a service host can perform backup of the virtual disk by at least one backup host; of course, one backup host can perform backup of the virtual disk for at least one service host. That is, the physical machine of the preset number of arbitrarily selected in the cluster is used as the backup host, which ensures the stability of subsequent data backup. Moreover, a backup host can also serve as a backup host for multiple service hosts at the same time. It is not a memo host that can only be used by one service host, which is beneficial to save system resources.
  • the service host and the backup host After the service host and the backup host are specified, determine the virtual machine included in the service host, and then copy the virtual disk corresponding to the virtual machine to the backup host, so that the service host and the virtual host have the same virtual disk, which facilitates subsequent data. Backup. Further, after the service host and the backup host are designated, the service host and the backup host need to be initialized.
  • the specific initialization operation includes: performing VM disk read/write interception on the service host and the backup host deployment.
  • the module patch VMM program, synchronization server program, synchronization client program, Agent (agent) program after deploying each program to the service host and the backup host, start the service program of the service host and the backup host to complete the initialization operation.
  • the same initialization operation is performed on the service host and the backup host because the identity of the service host and the backup host is not fixed, and can be used as both a service host and a backup host of other physical machines. Subsequent operations can be performed according to specific situations.
  • the service host and the backup host can interact with the cloud server.
  • the service host and the backup host interact with the cloud server through the Agent program, specifically, through the Agent.
  • the program receives the virtual disk backup instruction sent by the cloud server.
  • the cloud server detects that the service host and the backup host are started in the case of specifying the service host and the backup host, and actually detects that the Agent program in the service host and the Agent program of the backup host are started. After detecting that the agent program of the service host is started, and the agent program of the backup host is started, sending a virtual disk backup instruction to the service host and the backup host, so that the startup module 10 starts the synchronization server program, and The backup host starts a synchronization client program.
  • the synchronization server program When the intercepting module 20 receives the virtual disk backup instruction, the synchronization server program first establishes a communication connection with the VM disk read/write intercepting submodule to intercept the virtual virtual disk by the VM disk read/write intercepting submodule. Disk write operation, and sending the intercepted virtual disk write operation to the synchronization server program; at the same time, the synchronization server program is also established with the synchronization client program of the backup host, and the sending module 30 passes the synchronization server program. The intercepted virtual disk write operation is sent to the backup host.
  • the virtual disk mirroring driver library function is invoked to write the received virtual disk read and write operation to the backup virtual disk, and finally The execution result is fed back to the service host to inform the service host of the result of the data copy.
  • the startup module 10 starts a preset synchronization server program
  • the intercepting module 20 intercepts the virtual disk write operation of the local virtual disk
  • the sending module 30 And the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received
  • the virtual disk write operation is written to the backup virtual disk.
  • This embodiment implements a real-time backup of the local virtual disk of the service host. If the physical disk of the service host is damaged, the backup virtual disk of the backup host has already backed up the data, and can continue to provide the virtual machine in the service host. The service ensures that the virtual machine in the service host can be used normally.
  • the intercepting module 20 is further configured to intercept a virtual disk read and write operation of the local virtual disk when detecting that the local virtual disk fails;
  • the sending module 30 is further configured to send, by the synchronization server program, the intercepted virtual disk read and write operations to the backup host, where the backup host receives the virtual through the synchronization client program.
  • the backup virtual disk is invoked to perform the virtual disk read and write operations, and the execution result is fed back to the service host.
  • the service host senses the local virtual disk blocking by using the VM disk read/write intercepting submodule to determine that the local virtual disk is faulty.
  • the intercepting module 20 is read by the VM disk.
  • the write intercepting submodule intercepts the virtual disk read and write operations of the local virtual disk, and then the sending module 30 sends the intercepted virtual disk read and write operations to the backup host by the synchronization server program.
  • the backup virtual disk is invoked to perform the virtual disk read and write operation, that is, the backup host calls the virtual disk.
  • the mirror performs a specific operation. If the virtual disk read and write operation is a read operation, the read operation is performed in the virtual disk image. If the virtual disk read and write operation is a write operation, the write operation is performed in the virtual disk image, and finally the feedback is performed. Execute the result to the service host.
  • the virtual disk read/write operation corresponding to the local virtual disk is switched to the backup virtual disk of the backup host in time, and the virtual machine corresponding to the service host is ensured.
  • the virtual disk read and write operations are performed normally.
  • the cloud server when detecting that the service host is down, notifies the backup host to start the virtual machine of the backup host based on the backup virtual disk, so that the backup host is activated according to the virtual machine. Continue to provide services.
  • the cloud server detects that the Agent program in the service host stops, it knows that the service host is down.
  • the cloud server notifies the backup host to start the backup virtual disk, because the backup virtual disk of the backup host has backed up all virtual disk read and write operations in the service host. Then, the backup host can continue to start the virtual machine of the backup host according to the backup virtual disk to continue to provide services through the virtual machine that is started.
  • the cloud server when the cloud server detects that the service host is down, the cloud server is notified to start the backup virtual disk, so that the backup host starts the virtual machine according to the backup virtual disk. And continue to provide services to ensure that the backup host can continue to provide services in the event of a service host downtime.
  • the virtual disk backup device 100 further includes:
  • the determining module 40 is configured to determine, according to the virtual disk migration instruction, the destination service host when receiving the virtual disk migration instruction sent by the cloud server;
  • a migration module 50 configured to migrate a local virtual disk to the determined destination service host
  • the sending module 30 is further configured to send, by the synchronization server program, a migration completion instruction to the backup host, when the local virtual disk migration is completed, for the backup host to receive through the synchronization client program.
  • the migration completion instruction is reached, the communication connection with the service host is closed, and a communication connection with the destination service host is established to continue the backup service of the virtual disk.
  • the cloud server when the cloud server detects the virtual disk migration request, in order to ensure that the virtual machine in the service host can operate normally, the virtual machine of the service host needs to be migrated to another service host.
  • the triggering mode of the virtual disk migration request includes: when the service host needs to use a large amount of memory, triggering a virtual disk migration request; or when the load of the service host CPU is too large, triggering a virtual disk migration request.
  • the backup host can be selected in the cluster, similarly, when the service host is down, when the virtual machine in the service host is migrated to another service host, the same can be selected in the cluster.
  • the physical machine is used as the destination service host to be switched to perform virtual machine migration.
  • a virtual disk migration instruction may be sent to the service host to notify the service host to perform online migration of the virtual machine.
  • the determining module 40 determines the destination service host when receiving the virtual disk migration instruction sent by the cloud server, and then the migration module 50 migrates the local virtual disk to the determined purpose according to the VM migration intercepting submodule.
  • the service host sends a migration completion instruction to the synchronization server program when the local virtual disk migration is detected, and then sends a migration completion instruction to the backup host through the synchronization server program.
  • the communication connection with the service host is closed, that is, the communication connection with the synchronization server program in the service host is closed;
  • the communication connection of the server program is synchronized in the destination service host to continue the backup service of the virtual disk.
  • the cloud server also obtains address information and virtual machine information of the destination service host, and sends address information and virtual machine information of the destination service host to the backup host, where the backup host is based on the The address information of the destination service host and the virtual machine information are used to establish a communication connection with the destination service host; and the cloud server further informs the destination service host that the virtual machine accesses for the destination service host to initiate synchronization.
  • a server program for facilitating establishing a communication connection with the backup host through the synchronization server program.
  • the cloud server sends the virtual disk migration instruction to the service host, the address server and the virtual machine information of the destination service host are obtained according to the determined destination service host, and then the address information of the destination service host is virtualized.
  • the machine information is sent to the backup host, so that the backup host subsequently establishes a communication connection with the destination service host based on the address information and the virtual machine information of the destination service host; meanwhile, the cloud server further notifies the
  • the destination service host has a virtual machine access, so that the destination service host starts a synchronization server program, and facilitates establishing a communication connection with the backup host by using the synchronization server program.
  • the online migration of the virtual machine is implemented, and when the virtual machine performs online migration, the virtual machine of the local virtual disk can be migrated between any physical machine in the cluster, thereby improving the cloud computing service system. Maintainability is more conducive to load balancing.
  • the mapping between the service host and the backup host is no longer a peer-to-peer (peer-to-peer, peer-to-peer network), but a fully associative mapping relationship.
  • Different virtual disks of one service host can be backed up by different backup disks.
  • the host performs backup so that when a virtual machine using a local virtual disk is migrated from a service host to a new service host, the virtual disk of the virtual machine is still backed up by the original backup host, improving data backup. Flexibility.
  • the above startup module 10, the interception module 20, the transmission module 30, the determination module 40, the migration module 50, and the like may be embedded in or independent of the virtual disk backup device in hardware, or may be The software form is stored in the memory of the virtual disk backup device, so that the processor performs the operations corresponding to the above modules.
  • the processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
  • FIG. 8 is a schematic structural diagram of a service host related to a hardware operating environment according to an embodiment of the present invention.
  • the service host in the embodiment of the present invention may be a PC, or may be a terminal device such as a smart phone, a tablet computer, an e-book reader, or a portable computer.
  • the service host may include a processor 1001, such as a CPU, a network interface 1002, and a memory 1003. Connection communication between these components can be achieved via a communication bus.
  • the network interface 1002 may optionally include a standard wired interface (for connecting to a wired network), a wireless interface (such as a WI-FI interface, a Bluetooth interface, an infrared interface, etc. for connecting to a wireless network).
  • the memory 1003 may be a high speed RAM memory or a stable memory (non-volatile) Memory), such as disk storage.
  • the memory 1003 can also optionally be a storage device independent of the aforementioned processor 1001.
  • the service host may also include a user interface, a camera, and an RF (Radio). Frequency, RF) circuits, sensors, audio circuits, WiFi modules, and more.
  • the user interface may include a display, an input unit such as a keyboard, and the optional user interface may also include a standard wired interface (eg, for connecting a wired keyboard, a wired mouse, etc.) and/or a wireless interface (eg, for Connect a wireless keyboard, wireless mouse).
  • service host structure illustrated in FIG. 8 does not constitute a limitation to the service host, and may include more or less components than those illustrated, or some components may be combined, or different component arrangements.
  • the memory 1003 as a storage medium may include an operating system, a network communication module, and a virtual disk backup program.
  • the operating system is a program for managing and controlling the service host hardware and software resources, and supports the operation of the network communication module, the virtual disk backup program, and other programs or software; the network communication module is used to manage and control the network interface 1002.
  • the network interface 1002 is mainly used for connecting the cloud server and the backup host, and performs data communication with the cloud server and the backup host, and the connection manner between the service host and the cloud server is preferably connected through a wireless interface.
  • the connection manner between the service host and the backup host may be connected through a wired interface or a wireless interface; and the processor 1001 may be configured to execute a virtual disk backup program stored in the storage 1003 to implement the following steps:
  • the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
  • processor 1001 can be configured to execute a virtual disk backup program stored in the memory 1003 to implement the following steps:
  • processor 1001 can be configured to execute a virtual disk backup program stored in the memory 1003 to implement the following steps:
  • the present invention provides a storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the following steps:
  • the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
  • the one or more programs may be executed by one or more processors to implement the following steps:
  • the one or more programs may be executed by one or more processors to implement the following steps:
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
  • Implementation Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Abstract

A virtual disk backup system, comprising a cloud server (01), a service host (02) and a backup host (03). The cloud server (01), when detecting that the service host (02) and the backup host (03) are started, sends a virtual disk backup command to the service host (02) and the backup host (03) so that the the service host (02) starts a preset synchronous server program (022) and the backup host (03) starts a preset synchronous client program (031); the service host (02) intercepts a virtual disk write operation of a local virtual disk when receiving the virtual disk backup command, and sends the intercepted virtual disk write operation to the backup host (03) by means of the synchronous server program; and the backup host (03), when receiving the virtual disk write operation by means of the synchronous client program (031), writes the received virtual disk write operation to the backup virtual disk. Thus, a virtual machine in the service host (02) may be normally used even if a physical disk of the service host (02) fails.

Description

虚拟磁盘备份系统、方法、装置、服务主机和存储介质  Virtual disk backup system, method, device, service host and storage medium
本申请要求于2016年12月30日提交中国专利局、申请号为201611270900.3、发明名称为“虚拟磁盘备份系统、方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在申请中。The present application claims priority to Chinese Patent Application No. 201611270900.3, entitled "Virtual Disk Backup System, Method and Apparatus", filed on December 30, 2016, the entire contents of .
技术领域Technical field
本发明涉及计算机技术领域,尤其涉及一种虚拟磁盘备份系统、方法、装置、服务主机和存储介质。The present invention relates to the field of computer technologies, and in particular, to a virtual disk backup system, method, device, service host, and storage medium.
背景技术Background technique
虚拟化技术已经成为IaaS(Infrastructure as a Service,基础设施即服务)层的重要使能技术之一。它通过VMM(Virtual Machine Monitor,虚拟机监控器)软件对物理机的CPU、内存、I/O等设备进行虚拟化,在一台物理机中虚拟出多个VM(Virtual Machine,虚拟机),每个VM都运行一个客户操作系统(Guest OS,客户机)。VMM与一个特权操作系统(Dom0或者Host OS,宿主机)协调,保证位于同一物理机上的各个虚拟机相互隔离。Virtualization technology has become IaaS (Infrastructure as a One of the important enabling technologies of the Service, Infrastructure as a Service layer. It passes VMM (Virtual Machine Monitor, virtual machine monitor) software virtualizes CPU, memory, I/O, etc. of physical machines, and virtualizes multiple VMs in one physical machine (Virtual Machine, virtual machine), each VM runs a guest operating system (Guest OS, client). VMM with a privileged operating system (Dom0 or Host OS, host) coordination to ensure that each virtual machine located on the same physical machine is isolated from each other.
当前,在IaaS服务中,数据存储主要有两类:共享存储和本地存储。本地存储方案中,一旦有节点出现故障,如物理磁盘损坏,该物理机上的所有虚拟机将不可用,另外,由于本地盘数据没有冗余备份,一旦出现物理磁盘损坏的情况,将导致该物理机上的所有虚拟机不可恢复,也就是说,现有的数据存储方式,在物理磁盘损坏的情况下,容易导致虚拟机无法使用。Currently, there are two main types of data storage in IaaS services: shared storage and local storage. In a local storage scheme, once a node fails, such as a physical disk is damaged, all virtual machines on the physical machine will be unavailable. In addition, since there is no redundant backup of the local disk data, if the physical disk is damaged, the physical will be caused. All virtual machines on the machine are unrecoverable. That is to say, the existing data storage method can easily cause the virtual machine to be unusable in the case of physical disk damage.
发明内容Summary of the invention
本发明的主要目的在于提供一种虚拟磁盘备份系统、方法、装置、服务主机和存储介质,旨在解决现有的数据存储方式,在物理磁盘损坏的情况下,容易导致物理机上的所有虚拟机无法使用的技术问题。The main purpose of the present invention is to provide a virtual disk backup system, method, device, service host and storage medium, which are intended to solve the existing data storage mode, and in the case of physical disk damage, it is easy to cause all virtual machines on the physical machine. Unable to use technical issues.
为实现上述目的,本发明提供的一种虚拟磁盘备份系统,所述虚拟磁盘备份系统包括云服务器、服务主机和备份主机;To achieve the above objective, the present invention provides a virtual disk backup system, where the virtual disk backup system includes a cloud server, a service host, and a backup host;
所述云服务器,用于在检测到所述服务主机和所述备份主机启动时,发送虚拟磁盘备份指令至所述服务主机和所述备份主机,以供所述服务主机启动预设的同步服务器程序,以及所述备份主机启动预设的同步客户端程序;The cloud server is configured to send a virtual disk backup instruction to the service host and the backup host when the service host and the backup host are detected to be started, so that the service host starts a preset synchronization server. a program, and the backup host launches a preset synchronization client program;
所述服务主机,用于在接收到所述虚拟磁盘备份指令时,截取本地虚拟磁盘的虚拟磁盘写操作,并通过所述同步服务器程序将截取的所述虚拟磁盘写操作发送至所述备份主机;The service host is configured to intercept a virtual disk write operation of the local virtual disk when receiving the virtual disk backup instruction, and send the intercepted virtual disk write operation to the backup host by using the synchronization server program ;
所述备份主机,用于通过所述同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。The backup host is configured to write the received virtual disk write operation to the backup virtual disk when the virtual disk write operation is received by the synchronization client program.
此外,为实现上述目的,本发明还提供一种虚拟磁盘备份方法,应用于服务主机,所述虚拟磁盘备份方法包括:In addition, in order to achieve the above object, the present invention further provides a virtual disk backup method, which is applied to a service host, and the virtual disk backup method includes:
在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;When receiving the virtual disk backup instruction sent by the cloud server, starting a preset synchronization server program;
截取本地虚拟磁盘的虚拟磁盘写操作;Intercept the virtual disk write operation of the local virtual disk;
将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。And the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
此外,为实现上述目的,本发明还提供一种虚拟磁盘备份装置,应用于服务主机,所述虚拟磁盘备份装置包括:In addition, in order to achieve the above object, the present invention further provides a virtual disk backup device, which is applied to a service host, and the virtual disk backup device includes:
启动模块,用于在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;The startup module is configured to start a preset synchronization server program when receiving a virtual disk backup instruction sent by the cloud server;
截取模块,用于截取本地虚拟磁盘的虚拟磁盘写操作;An intercept module for intercepting a virtual disk write operation of a local virtual disk;
发送模块, 用于将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。Send module, The virtual disk write operation for sending the intercepted to the backup host by the synchronization server program, when the backup host receives the virtual disk write operation through a preset synchronization client program, and receives the virtual disk write operation. The virtual disk write operation is written to the backup virtual disk.
此外,为实现上述目的,本发明还提供一种服务主机,所述服务主机包括处理器、网络接口及存储器,所述存储器中存储有虚拟磁盘备份程序;In addition, in order to achieve the above object, the present invention further provides a service host, where the service host includes a processor, a network interface, and a memory, where the virtual disk backup program is stored in the memory;
所述网络接口用于连接云服务器和备份主机,与所述云服务器和所述备份主机进行数据通信;The network interface is configured to connect to the cloud server and the backup host, and perform data communication with the cloud server and the backup host;
所述处理器用于执行所述虚拟磁盘备份程序,以实现以下步骤:The processor is configured to execute the virtual disk backup program to implement the following steps:
在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;When receiving the virtual disk backup instruction sent by the cloud server, starting a preset synchronization server program;
截取本地虚拟磁盘的虚拟磁盘写操作;Intercept the virtual disk write operation of the local virtual disk;
将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。And the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
此外,为实现上述目的,本发明还提供一种存储介质,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现以下步骤:Moreover, in order to achieve the above object, the present invention also provides a storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the following steps:
在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;When receiving the virtual disk backup instruction sent by the cloud server, starting a preset synchronization server program;
截取本地虚拟磁盘的虚拟磁盘写操作;Intercept the virtual disk write operation of the local virtual disk;
将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。And the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
本发明提出的虚拟磁盘备份系统,云服务器在检测到服务主机和备份主机启动时,发送虚拟磁盘备份指令至所述服务主机和所述备份主机,以供所述服务主机启动预设的同步服务器程序,以及所述备份主机启动预设的同步客户端程序,所述服务主机在接收到所述虚拟磁盘备份指令时,截取本地虚拟磁盘的虚拟磁盘写操作,并通过所述同步服务器程序将截取的所述虚拟磁盘写操作发送至所述备份主机,所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。本发明实现了对服务主机的本地虚拟磁盘做实时备份,后续即使服务主机的物理磁盘出现损坏,也会由于备份主机的备份虚拟磁盘已经备份了数据,可以继续为服务主机中的虚拟机提供服务,保证了服务主机中的虚拟机可以正常使用。In the virtual disk backup system of the present invention, when detecting that the service host and the backup host are started, the cloud server sends a virtual disk backup command to the service host and the backup host, so that the service host starts a preset synchronization server. a program, and the backup host starts a preset synchronization client program, when receiving the virtual disk backup instruction, the service host intercepts a virtual disk write operation of the local virtual disk, and intercepts the program through the synchronization server program The virtual disk write operation is sent to the backup host, and the backup host writes the received virtual disk write operation to the backup virtual disk when the virtual disk write operation is received by the synchronization client program. in. The invention realizes real-time backup of the local virtual disk of the service host, and even if the physical disk of the service host is damaged, the backup virtual disk of the backup host has already backed up the data, and can continue to provide services for the virtual machine in the service host. To ensure that the virtual machine in the service host can be used normally.
附图说明DRAWINGS
图1为本发明虚拟磁盘备份系统第一结构示意图;1 is a schematic diagram of a first structure of a virtual disk backup system according to the present invention;
图2为本发明虚拟磁盘备份系统第二结构示意图;2 is a schematic diagram of a second structure of a virtual disk backup system according to the present invention;
图3为本发明虚拟磁盘备份方法第一实施例的流程示意图;3 is a schematic flowchart of a first embodiment of a virtual disk backup method according to the present invention;
图4为本发明虚拟磁盘备份方法第二实施例的功能模块示意图;4 is a schematic diagram of functional modules of a second embodiment of a virtual disk backup method according to the present invention;
图5为本发明虚拟磁盘备份方法第三实施例的流程示意图;5 is a schematic flowchart of a third embodiment of a virtual disk backup method according to the present invention;
图6为本发明虚拟磁盘备份装置第一实施例的功能模块示意图;6 is a schematic diagram of functional modules of a first embodiment of a virtual disk backup device according to the present invention;
图7为本发明虚拟磁盘备份装置第三实施例的功能模块示意图;7 is a schematic diagram of functional modules of a third embodiment of a virtual disk backup device according to the present invention;
图8是本发明实施例方案涉及硬件运行环境的服务主机的结构示意图。FIG. 8 is a schematic structural diagram of a service host related to a hardware operating environment according to an embodiment of the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明提出的技术方案,云服务器在检测到服务主机和备份主机启动时,发送虚拟磁盘备份指令至所述服务主机和所述备份主机,以供所述服务主机启动预设的同步服务器程序,以及所述备份主机启动预设的同步客户端程序,所述服务主机在接收到所述虚拟磁盘备份指令时,截取本地虚拟磁盘的虚拟磁盘写操作,并通过所述同步服务器程序将截取的所述虚拟磁盘写操作发送至所述备份主机,所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。以解决现有的本地存储方案下,一旦出现节点故障,如物理磁盘损坏的时候,由于本地虚拟磁盘数据没有冗余备份,导致虚拟机无法使用的问题。According to the technical solution of the present invention, when detecting that the service host and the backup host are started, the cloud server sends a virtual disk backup command to the service host and the backup host, so that the service host starts a preset synchronization server program. And the backup host starts a preset synchronization client program, and when receiving the virtual disk backup instruction, the service host intercepts a virtual disk write operation of the local virtual disk, and intercepts the program through the synchronization server program. The virtual disk write operation is sent to the backup host, and the backup host writes the received virtual disk write operation to the backup virtual disk when the virtual disk write operation is received by the synchronization client program. In order to solve the existing local storage scheme, in the event of a node failure, such as a physical disk corruption, the virtual disk cannot be used because the local virtual disk data has no redundant backup.
基于上述问题,本发明提供一种虚拟磁盘备份系统。Based on the above problems, the present invention provides a virtual disk backup system.
在本实施例中,所述虚拟磁盘备份系统包括云服务器、服务主机和备份主机;In this embodiment, the virtual disk backup system includes a cloud server, a service host, and a backup host;
所述云服务器,用于在检测到所述服务主机和所述备份主机启动时,发送虚拟磁盘备份指令至所述服务主机和所述备份主机,以供所述服务主机启动预设的同步服务器程序,以及所述备份主机启动预设的同步客户端程序;The cloud server is configured to send a virtual disk backup instruction to the service host and the backup host when the service host and the backup host are detected to be started, so that the service host starts a preset synchronization server. a program, and the backup host launches a preset synchronization client program;
所述服务主机,用于在接收到所述虚拟磁盘备份指令时,截取本地虚拟磁盘的虚拟磁盘写操作,并通过所述同步服务器程序将截取的所述虚拟磁盘写操作发送至所述备份主机;The service host is configured to intercept a virtual disk write operation of the local virtual disk when receiving the virtual disk backup instruction, and send the intercepted virtual disk write operation to the backup host by using the synchronization server program ;
所述备份主机,用于通过所述同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。The backup host is configured to write the received virtual disk write operation to the backup virtual disk when the virtual disk write operation is received by the synchronization client program.
在本实施例中,在实现虚拟磁盘备份之前,先由云服务器在集群中指定任意的一台物理机作为服务主机,并从集群中指定其它预设台数的物理机作为备份主机。本实施例中,所述预设台数可以根据实际情况进行设置,例如,集群中的各台物理机的稳定性都较好,则可选择一台作为备份主机,若是集群中的各台物理机的稳定性都较差,为了防止后续备份主机也故障,则可选择多台物理机作为备份主机。In this embodiment, before the virtual disk backup is implemented, the cloud server specifies any physical machine in the cluster as the service host, and specifies other preset physical machines from the cluster as the backup host. In this embodiment, the preset number can be set according to actual conditions. For example, if the stability of each physical machine in the cluster is good, one can be selected as a backup host, and if it is a physical machine in the cluster. The stability is poor. In order to prevent subsequent backup hosts from failing, multiple physical machines can be selected as backup hosts.
传统的备份主机选择方式,都是固定的选择一台作为备份主机,并且,服务主机和备份主机是一对一的关系,局限性很强,容易出现备份主机故障时,服务主机也无法使用的情况。The traditional backup host selection method is a fixed choice of one as a backup host, and the service host and the backup host are one-to-one. The limitation is very strong, and it is easy for the service host to use when the backup host fails. Happening.
而本实施例,一个服务主机可以由至少一个备份主机进行虚拟磁盘的备份;当然,一个备份主机可以为至少一个服务主机进行虚拟磁盘的备份。即在集群中任意选择预设台数的物理机作为备份主机,保证了后续数据备份的稳定性。并且,一台备份主机还可以同时作为多台服务主机的备份主机,不是一台备注主机只能给一台服务主机使用,有利于节省系统资源。In this embodiment, a service host can perform backup of the virtual disk by at least one backup host; of course, one backup host can perform backup of the virtual disk for at least one service host. That is, the physical machine of the preset number of arbitrarily selected in the cluster is used as the backup host, which ensures the stability of subsequent data backup. Moreover, a backup host can also serve as a backup host for multiple service hosts at the same time. It is not a memo host that can only be used by one service host, which is beneficial to save system resources.
在指定好服务主机和备份主机之后,确定服务主机中包含的虚拟机,然后将虚拟机对应的虚拟磁盘拷贝到备份主机中,使得服务主机和虚拟主机有相同的虚拟磁盘,便于后续进行数据的备份。进一步地,在指定好服务主机和备份主机之后,还需要对服务主机和备份主机进行初始化,本实施例中,具体地初始化操作包括:对服务主机和备份主机部署打了VM磁盘读写截获子模块补丁的VMM程序,同步服务器程序,同步客户端程序,Agent(代理)程序,在对服务主机和备份主机部署了各个程序之后,启动服务主机和备份主机的Agent程序,以完成初始化操作。本实施例中,之所以对服务主机和备份主机执行相同的初始化操作,是因为服务主机和备份主机的身份不是固定的,既可以作为自己的服务主机,也可以作为其它物理机的备份主机,后续可以根据具体的情况执行相应的操作。After the service host and the backup host are specified, determine the virtual machine included in the service host, and then copy the virtual disk corresponding to the virtual machine to the backup host, so that the service host and the virtual host have the same virtual disk, which facilitates subsequent data. Backup. Further, after the service host and the backup host are designated, the service host and the backup host need to be initialized. In this embodiment, the specific initialization operation includes: performing VM disk read/write interception on the service host and the backup host deployment. The module patch VMM program, synchronization server program, synchronization client program, Agent (agent) program, after deploying each program to the service host and the backup host, start the service program of the service host and the backup host to complete the initialization operation. In this embodiment, the same initialization operation is performed on the service host and the backup host because the identity of the service host and the backup host is not fixed, and can be used as both a service host and a backup host of other physical machines. Subsequent operations can be performed according to specific situations.
在服务主机和备份主机完成初始化操作之后,所述服务主机和备份主机才可以和云服务器进行交互,本实施例中,服务主机和备份主机通过Agent程序与云服务器进行交互,具体地,通过Agent程序接收云服务器发送的虚拟磁盘备份指令。After the service host and the backup host complete the initialization operation, the service host and the backup host can interact with the cloud server. In this embodiment, the service host and the backup host interact with the cloud server through the Agent program, specifically, through the Agent. The program receives the virtual disk backup instruction sent by the cloud server.
本实施例中,由于对服务主机和备份主机部署了各种程序,因此为更好理解,参照图1对本发明的技术方案进行详述,其中,图1为本发明虚拟磁盘备份系统的第一结构示意图:In this embodiment, since various programs are deployed to the service host and the backup host, the technical solution of the present invention is described in detail with reference to FIG. 1 for better understanding. FIG. 1 is the first virtual disk backup system of the present invention. Schematic:
服务主机02的VMM中通过打补丁的方式添加有VM磁盘读写截获子模块021,Sync server(同步服务器)程序022和Agent程序023,备份主机03中添加有Sync client(同步客户端)程序031和Agent程序032。其中,VM磁盘读写操作截获子模块021负责截获VM对虚拟磁盘的读写操作,并将读写操作同步到同步服务器程序022中;同步服务器程序022再将数据传递到备份主机中的同步客户端程序031,同步客户端程序031通过调用虚拟磁盘镜像驱动,将数据实时写入到备份主机的备份虚拟磁盘中,实现对虚拟磁盘镜像的实时备份。值得注意的是,Agent程序023和Agent程序032不仅负责同云服务器01的交互,还会负责同步服务器022和同步客户端031的启动、关闭及状态监测。The VMM of the service host 02 is added with a VM disk read/write interception submodule 021, Sync. Server (sync server) program 022 and Agent program 023, Sync is added to backup host 03 Client (synchronization client) program 031 and agent program 032. The VM disk read/write operation intercepting submodule 021 is responsible for intercepting the read and write operations of the VM on the virtual disk, and synchronizing the read and write operations to the synchronization server program 022; the synchronization server program 022 transfers the data to the synchronization client in the backup host. The end program 031, the synchronization client program 031, by calling the virtual disk mirror driver, writes the data in real time to the backup virtual disk of the backup host, realizing real-time backup of the virtual disk image. It is worth noting that the Agent program 023 and the Agent program 032 are not only responsible for the interaction with the cloud server 01, but also for the startup, shutdown, and status monitoring of the synchronization server 022 and the synchronization client 031.
继续参照图1,云服务器01在指定服务主机02和备份主机03的情况下,检测到所述服务主机02和所述备份主机03启动,实际上是检测到所述服务主机02中的Agent程序023和所述备份主机03的Agent程序032启动。在检测到所述服务主机02的Agent程序023启动,和所述备份主机03的Agent程序032启动时,发送虚拟磁盘备份指令至所述服务主机02和所述备份主机03,以供所述服务主机02启动同步服务器程序022,以及所述备份主机03启动同步客户端程序031。With reference to FIG. 1, the cloud server 01 detects that the service host 02 and the backup host 03 are activated in the case of specifying the service host 02 and the backup host 03, and actually detects the Agent program in the service host 02. 023 and the agent program 032 of the backup host 03 are started. When it is detected that the Agent program 023 of the service host 02 is started, and the Agent program 032 of the backup host 03 is started, a virtual disk backup command is sent to the service host 02 and the backup host 03 for the service. The host 02 starts the synchronization server program 022, and the backup host 03 starts the synchronization client program 031.
所述服务主机02在接收到所述虚拟磁盘备份指令时,先由所述同步服务器程序022与VM磁盘读写截取子模块021建立通信连接,以通过所述VM磁盘读写截取子模块021截取本地虚拟磁盘的虚拟磁盘写操作,并且将截取的虚拟磁盘写操作发送至所述同步服务器程序022;同时,所述服务主机02还会将同步服务器程序022与备份主机03的同步客户端程序031建立通信连接,再通过所述同步服务器程序022将截取的所述虚拟磁盘写操作发送至所述备份主机03。When the service host 02 receives the virtual disk backup command, the synchronization server program 022 first establishes a communication connection with the VM disk read/write interception submodule 021 to intercept the VM disk read/write interception submodule 021. a virtual disk write operation of the local virtual disk, and the intercepted virtual disk write operation is sent to the synchronization server program 022; at the same time, the service host 02 also synchronizes the synchronization client program 022 with the backup host 03. A communication connection is established, and the intercepted virtual disk write operation is sent to the backup host 03 by the synchronization server program 022.
所述备份主机03通过所述同步客户端程序031接收到所述虚拟磁盘写操作时,调用虚拟磁盘镜像驱动的库函数,以将接收到的所述虚拟磁盘读写操作写到备份虚拟磁盘中,最终反馈执行结果至所述服务主机02,以告知所述服务主机02数据拷贝的结果。When the backup host program 03 receives the virtual disk write operation, the backup host 03 calls a library function of the virtual disk mirror driver to write the received virtual disk read and write operations to the backup virtual disk. Finally, the execution result is fed back to the service host 02 to inform the service host 02 of the result of the data copy.
本实施例提出的虚拟磁盘备份系统,云服务器在检测到服务主机和备份主机启动时,发送虚拟磁盘备份指令至所述服务主机和所述备份主机,以供所述服务主机启动预设的同步服务器程序,以及所述备份主机启动预设的同步客户端程序,所述服务主机在接收到所述虚拟磁盘备份指令时,截取本地虚拟磁盘的虚拟磁盘写操作,并通过所述同步服务器程序将截取的所述虚拟磁盘写操作发送至所述备份主机,所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。本发明实现了对服务主机的本地虚拟磁盘做实时备份,后续即使服务主机的物理磁盘出现损坏,也会由于备份主机的备份虚拟磁盘已经备份了数据,可以继续为服务主机中的虚拟机提供服务,保证了服务主机中的虚拟机可以正常使用。In the virtual disk backup system of the embodiment, when detecting that the service host and the backup host are started, the cloud server sends a virtual disk backup command to the service host and the backup host, so that the service host initiates a preset synchronization. a server program, and the backup host starts a preset synchronization client program, when the service host receives the virtual disk backup instruction, intercepting a virtual disk write operation of the local virtual disk, and using the synchronization server program Transmitting the virtual disk write operation to the backup host, and when the backup host receives the virtual disk write operation by using the synchronization client program, writing the received virtual disk write operation to the backup virtual On the disk. The invention realizes real-time backup of the local virtual disk of the service host, and even if the physical disk of the service host is damaged, the backup virtual disk of the backup host has already backed up the data, and can continue to provide services for the virtual machine in the service host. To ensure that the virtual machine in the service host can be used normally.
进一步地,基于第一实施例提出本发明虚拟磁盘备份系统的第二实施例,在本实施例中,所述服务主机,还用于在检测到本地虚拟磁盘出现故障时,截取本地虚拟磁盘的虚拟磁盘读写操作,并通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机;Further, a second embodiment of the virtual disk backup system of the present invention is proposed based on the first embodiment. In this embodiment, the service host is further configured to intercept the local virtual disk when detecting that the local virtual disk fails. Virtual disk read and write operations, and the intercepted virtual disk read and write operations are sent to the backup host by the synchronization server program;
所述备份主机,还用于通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘以执行所述虚拟磁盘读写操作,并反馈执行结果至所述服务主机。The backup host is further configured to invoke the backup virtual disk to perform the virtual disk read and write operation when the virtual disk read and write operation is received by the synchronization client program, and feed back an execution result to the service. Host.
在本实施例中,继续参照图1,所述服务主机02通过VM磁盘读写截获子模块021感知本地虚拟磁盘阻塞,以确定本地虚拟磁盘出现故障,在检测到本地虚拟磁盘堵塞时,由VM磁盘读写截获子模块021截取本地虚拟磁盘的虚拟磁盘读写操作,然后通过所述同步服务器程序022将截取的所述虚拟磁盘读写操作发送至所述备份主机03。In this embodiment, referring to FIG. 1, the service host 02 senses the local virtual disk blockage through the VM disk read/write interception submodule 021 to determine that the local virtual disk is faulty, and when the local virtual disk is detected to be blocked, the VM is detected by the VM. The disk read/write interception submodule 021 intercepts the virtual disk read and write operations of the local virtual disk, and then sends the intercepted virtual disk read and write operations to the backup host 03 through the synchronization server program 022.
所述备份主机03通过所述同步客户端程序031接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘,以执行所述虚拟磁盘读写操作,也就是说,所述备份主机03调用虚拟磁盘镜像执行具体的操作,若该虚拟磁盘读写操作是读操作,就在虚拟磁盘镜像中执行读操作,若该虚拟磁盘读写操作是写操作,就在虚拟磁盘镜像中执行写操作,最终反馈执行结果至所述服务主机02。When the backup host 03 receives the virtual disk read and write operation by the synchronization client program 031, the backup virtual disk is invoked to perform the virtual disk read and write operation, that is, the backup host 03 The virtual disk image is invoked to perform a specific operation. If the virtual disk read and write operation is a read operation, a read operation is performed in the virtual disk image. If the virtual disk read and write operation is a write operation, a write operation is performed in the virtual disk image. Finally, the execution result is fed back to the service host 02.
在本实施例中,相当于是在服务主机02的本地虚拟磁盘出现故障时,将本地虚拟磁盘对应的虚拟磁盘读写操作及时切换至备份主机03的备份虚拟磁盘中执行,保证了服务主机02中虚拟机对应的虚拟磁盘读写操作正常执行。In this embodiment, when the local virtual disk of the service host 02 fails, the virtual disk read/write operation corresponding to the local virtual disk is switched to the backup virtual disk of the backup host 03 in time, and the service host 02 is ensured. The virtual disk read and write operations corresponding to the virtual machine are executed normally.
进一步地,基于第一实施例提出本发明虚拟磁盘备份系统的第三实施例,在本实施例中,Further, a third embodiment of the virtual disk backup system of the present invention is proposed based on the first embodiment. In this embodiment,
所述云服务器,还用于在检测到所述服务主机宕机时,通知所述备份主机基于所述备份虚拟磁盘启动所述备份主机的虚拟机,以供所述备份主机根据启动的所述虚拟机继续提供服务。The cloud server is further configured to notify the backup host to start a virtual machine of the backup host based on the backup virtual disk when detecting that the service host is down, for the backup host to be activated according to the startup The virtual machine continues to provide services.
在本实施例中,继续参照图1,当所述服务主机02出现严重故障导致宕机时,服务主机02中的所有程序都会挂掉,因此所述云服务器01检测到所述服务主机02中的Agent程序023停止时,就知道所述服务主机02宕机,在检测到所述服务主机02宕机时,所述云服务器01通知所述备份主机03启动所述备份虚拟磁盘,由于备份主机03的所述备份虚拟磁盘已经备份有服务主机02中所有的虚拟磁盘读写操作,那么,所述备份主机03即可继续根据所述备份虚拟磁盘启动所述备份主机03的虚拟机,以通过启动的所述虚拟机继续提供服务。In this embodiment, with reference to FIG. 1, when the service host 02 experiences a serious failure and causes a downtime, all programs in the service host 02 are hanged, so the cloud server 01 detects the service host 02. When the Agent program 023 is stopped, it is known that the service host 02 is down. When detecting that the service host 02 is down, the cloud server 01 notifies the backup host 03 to start the backup virtual disk, because the backup host The backup virtual disk of 03 has been backed up with all the virtual disk read and write operations in the service host 02, then the backup host 03 can continue to start the virtual machine of the backup host 03 according to the backup virtual disk to pass The virtual machine that is started continues to provide services.
在本实施例中,所述云服务器01在检测到所述服务主机02宕机时,通知所述备份主机03启动所述备份虚拟磁盘,以供所述备份主机03根据所述备份虚拟磁盘启动虚拟机,并继续提供服务,保证了服务主机02宕机的情况下,备份主机03可以继续提供服务。In this embodiment, when detecting that the service host 02 is down, the cloud server 01 notifies the backup host 03 to start the backup virtual disk, so that the backup host 03 starts according to the backup virtual disk. The virtual machine continues to provide services to ensure that the backup host 03 can continue to provide services in the event that the service host 02 is down.
进一步地,基于第一实施例提出本发明虚拟磁盘备份系统的第四实施例,在本实施例中,Further, a fourth embodiment of the virtual disk backup system of the present invention is proposed based on the first embodiment. In this embodiment,
所述云服务器,还用于在检测到虚拟磁盘迁移请求时,确定所述服务主机待切换的目的服务主机,并根据确定的所述目的服务主机发送虚拟磁盘迁移指令至所述服务主机;The cloud server is further configured to: when detecting a virtual disk migration request, determine a destination service host to be switched by the service host, and send a virtual disk migration instruction to the service host according to the determined destination service host;
所述服务主机,还用于在接收到所述虚拟磁盘迁移指令时,确定目的服务主机,并将本地虚拟磁盘迁移至确定的所述目的服务主机;在检测到本地虚拟磁盘迁移完成时,通过所述同步服务器程序将迁移完成指令发送至所述备份主机;The service host is further configured to: when receiving the virtual disk migration instruction, determine a destination service host, and migrate the local virtual disk to the determined destination service host; and when detecting that the local virtual disk migration is completed, pass The synchronization server program sends a migration completion instruction to the backup host;
所述备份主机,还用于通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,并建立与所述目的服务主机的通信连接,以继续进行虚拟磁盘的备份服务。The backup host is further configured to: when the migration completion instruction is received by the synchronization client program, close a communication connection with the service host, and establish a communication connection with the destination service host to continue virtual Disk backup service.
在本实施例中,所述云服务器在检测到虚拟磁盘迁移请求时,此时为了保证服务主机中的虚拟机可以正常运行,需要将所述服务主机的虚拟机迁移到其它服务主机中,以实现虚拟机的在线迁移。本实施例中,所述虚拟磁盘迁移请求的触发方式包括:服务主机需要使用大量内存时,触发虚拟磁盘迁移请求;或者,服务主机CPU的负载过大时,触发虚拟磁盘迁移请求。In this embodiment, when the cloud server detects the virtual disk migration request, in order to ensure that the virtual machine in the service host can operate normally, the virtual machine of the service host needs to be migrated to another service host. Implement online migration of virtual machines. In this embodiment, the triggering mode of the virtual disk migration request includes: when the service host needs to use a large amount of memory, triggering a virtual disk migration request; or when the load of the service host CPU is too large, triggering a virtual disk migration request.
为了实现虚拟机的在线迁移,参照图2,图2为本发明虚拟磁盘备份系统的第二结构示意图:所述服务主机02的 VMM中通过打补丁的方式还添加有VM迁移截获子模块024,其中,所述VM迁移截获子模块024负责截获VM迁移操作,当截获到VM迁移这一操作时,会告知同步服务器程序022,再由Sync server程序022告知备份主机03中的同步客户端程序031。For the online migration of the virtual machine, referring to FIG. 2, FIG. 2 is a schematic diagram of a second structure of the virtual disk backup system of the present invention: The VM migration intercepting submodule 024 is also added by the patching method in the VMM, wherein the VM migration intercepting submodule 024 is responsible for intercepting the VM migration operation, and when the operation of the VM migration is intercepted, the synchronization server program 022 is notified. Sync The server program 022 notifies the synchronization client program 031 in the backup host 03.
应当理解,由于在选择备份主机时,可以在集群中进行选择,同理,在服务主机宕机时,将服务主机中的虚拟机迁移到其它服务主机时,同样可以在集群中,选择任一台物理机作为待切换的目的服务主机进行虚拟机的迁移。在选择好目的服务主机之后,即可发送虚拟磁盘迁移指令至所述服务主机,以通知所述服务主机将虚拟机进行在线迁移。It should be understood that since the backup host can be selected in the cluster, similarly, when the service host is down, when the virtual machine in the service host is migrated to another service host, the same can be selected in the cluster. The physical machine is used as the destination service host to be switched to perform virtual machine migration. After selecting the destination service host, a virtual disk migration instruction may be sent to the service host to notify the service host to perform online migration of the virtual machine.
在本实施例中,参照图2,所述服务主机02在接收到所述云服务器01发送的虚拟磁盘迁移指令时,确定目的服务主机,然后根据VM迁移截获子模块024将本地虚拟磁盘迁移至确定的所述目的服务主机,在检测到本地虚拟磁盘迁移完成时,将迁移完成指令发送至同步服务器程序022,再通过所述同步服务器程序022将迁移完成指令发送至所述备份主机03。In this embodiment, referring to FIG. 2, when receiving the virtual disk migration instruction sent by the cloud server 01, the service host 02 determines the destination service host, and then migrates the local virtual disk according to the VM migration intercepting submodule 024 to The determined destination service host sends a migration completion instruction to the synchronization server program 022 upon detecting the completion of the local virtual disk migration, and then sends a migration completion instruction to the backup host 03 through the synchronization server program 022.
所述备份主机03通过所述同步客户端程序031接收到所述迁移完成指令时,关闭与所述服务主机02的通信连接,也就是关闭与所述服务主机中同步服务器程序022的通信连接;同时,建立与所述目的服务主机中同步服务器程序的通信连接,以继续进行虚拟磁盘的备份服务。When the backup client 03 receives the migration completion instruction by the synchronization client program 031, the communication connection with the service host 02 is closed, that is, the communication connection with the synchronization server program 022 of the service host is closed; At the same time, a communication connection with the synchronization server program in the destination service host is established to continue the backup service of the virtual disk.
进一步地,为了保证服务主机02将虚拟机迁移到目的服务主机时,可以迁移成功。所述云服务器,还用于获取所述目的服务主机的地址信息和虚拟机信息,并将所述目的服务主机的地址信息和虚拟机信息发送至所述备份主机,以供所述备份主机基于所述目的服务主机的地址信息和虚拟机信息,与所述目的服务主机建立通信连接;Further, in order to ensure that the service host 02 migrates the virtual machine to the destination service host, the migration can be successful. The cloud server is further configured to obtain address information and virtual machine information of the destination service host, and send address information and virtual machine information of the destination service host to the backup host, where the backup host is based on The address information and the virtual machine information of the destination service host establish a communication connection with the destination service host;
所述云服务器,还用于通知所述目的服务主机有虚拟机接入,以供所述目的服务主机启动同步服务器程序,便于通过所述同步服务器程序与所述备份主机建立通信连接。The cloud server is further configured to notify the target service host to have a virtual machine access, so that the destination service host starts a synchronization server program, so as to establish a communication connection with the backup host by using the synchronization server program.
也就是说,所述云服务器01发送虚拟磁盘迁移指令至服务主机02之前,所述云服务器01根据确定目的服务主机,获取所述目的服务主机的地址信息和虚拟机信息,然后将所述目的服务主机的地址信息和虚拟机信息发送至所述备份主机02,以便所述备份主机02后续基于所述目的服务主机的地址信息和虚拟机信息,与所述目的服务主机建立通信连接;同时,所述云服务器01还会通知所述目的服务主机有虚拟机接入,以供所述目的服务主机启动同步服务器程序,便于通过所述同步服务器程序与所述备份主机建立通信连接。That is, before the cloud server 01 sends the virtual disk migration instruction to the service host 02, the cloud server 01 acquires the address information and the virtual machine information of the destination service host according to the determined destination service host, and then the destination. The address information and the virtual machine information of the service host are sent to the backup host 02, so that the backup host 02 subsequently establishes a communication connection with the destination service host based on the address information and the virtual machine information of the destination service host; The cloud server 01 further informs the destination service host that the virtual machine is accessed, so that the destination service host starts a synchronization server program, so as to establish a communication connection with the backup host through the synchronization server program.
在本实施例中,实现了虚拟机的在线迁移,并且,在虚拟机进行在线迁移时,本地虚拟磁盘的虚拟机可以在集群中的任一个物理机间进行迁移,提高了云计算服务系统的可维护性,更利于实现负载均衡。In this embodiment, the online migration of the virtual machine is implemented, and when the virtual machine performs online migration, the virtual machine of the local virtual disk can be migrated between any physical machine in the cluster, thereby improving the cloud computing service system. Maintainability is more conducive to load balancing.
本发明中,服务主机和备份主机之间不再是peer-to-peer(点对点,对等网络)的映射关系,而是全相联的映射关系,一个服务主机的不同虚拟磁盘可以由不同备份主机进行备份,这样当某一台使用本地虚拟磁盘的虚拟机从某一台服务主机迁移到新的服务主机上时,该虚拟机的虚拟磁盘仍然由原备份主机进行备份服务,提高了数据备份的灵活性。 In the present invention, the mapping between the service host and the backup host is no longer a peer-to-peer (peer-to-peer, peer-to-peer network), but a fully associative mapping relationship. Different virtual disks of one service host can be backed up by different backup disks. The host performs backup so that when a virtual machine using a local virtual disk is migrated from a service host to a new service host, the virtual disk of the virtual machine is still backed up by the original backup host, improving data backup. Flexibility.
本发明进一步提供一种虚拟磁盘备份方法,应用于服务主机。The present invention further provides a virtual disk backup method applied to a service host.
参照图3,图3为本发明虚拟磁盘备份方法第一实施例的流程示意图。Referring to FIG. 3, FIG. 3 is a schematic flowchart diagram of a first embodiment of a virtual disk backup method according to the present invention.
在本实施例中,所述虚拟磁盘备份方法包括:In this embodiment, the virtual disk backup method includes:
步骤S10,在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;Step S10, when receiving the virtual disk backup instruction sent by the cloud server, starting a preset synchronization server program;
步骤S20,截取本地虚拟磁盘的虚拟磁盘写操作;Step S20, intercepting a virtual disk write operation of the local virtual disk;
步骤S30,将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。Step S30, the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, so that when the backup host receives the virtual disk write operation through a preset synchronization client program, it will receive The virtual disk write operation is written to the backup virtual disk.
在本实施例中,在实现虚拟磁盘备份之前,先由云服务器在集群中指定任意的一台物理机作为服务主机,并从集群中指定其它预设台数的物理机作为备份主机。本实施例中,所述预设台数可以根据实际情况进行设置,例如,集群中的各台物理机的稳定性都较好,则可选择一台作为备份主机,若是集群中的各台物理机的稳定性都较差,为了防止后续备份主机也故障,则可选择多台物理机作为备份主机。In this embodiment, before the virtual disk backup is implemented, the cloud server specifies any physical machine in the cluster as the service host, and specifies other preset physical machines from the cluster as the backup host. In this embodiment, the preset number can be set according to actual conditions. For example, if the stability of each physical machine in the cluster is good, one can be selected as a backup host, and if it is a physical machine in the cluster. The stability is poor. In order to prevent subsequent backup hosts from failing, multiple physical machines can be selected as backup hosts.
传统的备份主机选择方式,都是固定的选择一台作为备份主机,并且,服务主机和备份主机是一对一的关系,局限性很强,容易出现备份主机故障时,服务主机也无法使用的情况。The traditional backup host selection method is a fixed choice of one as a backup host, and the service host and the backup host are one-to-one. The limitation is very strong, and it is easy for the service host to use when the backup host fails. Happening.
而本实施例,一个服务主机可以由至少一个备份主机进行虚拟磁盘的备份;当然,一个备份主机可以为至少一个服务主机进行虚拟磁盘的备份。即在集群中任意选择预设台数的物理机作为备份主机,保证了后续数据备份的稳定性。并且,一台备份主机还可以同时作为多台服务主机的备份主机,不是一台备注主机只能给一台服务主机使用,有利于节省系统资源。In this embodiment, a service host can perform backup of the virtual disk by at least one backup host; of course, one backup host can perform backup of the virtual disk for at least one service host. That is, the physical machine of the preset number of arbitrarily selected in the cluster is used as the backup host, which ensures the stability of subsequent data backup. Moreover, a backup host can also serve as a backup host for multiple service hosts at the same time. It is not a memo host that can only be used by one service host, which is beneficial to save system resources.
在指定好服务主机和备份主机之后,确定服务主机中包含的虚拟机,然后将虚拟机对应的虚拟磁盘拷贝到备份主机中,使得服务主机和虚拟主机有相同的虚拟磁盘,便于后续进行数据的备份。进一步地,在指定好服务主机和备份主机之后,还需要对服务主机和备份主机进行初始化,本实施例中,具体地初始化操作包括:对服务主机和备份主机部署打了VM磁盘读写截获子模块补丁的VMM程序,同步服务器程序,同步客户端程序,Agent(代理)程序,在对服务主机和备份主机部署了各个程序之后,启动服务主机和备份主机的Agent程序,以完成初始化操作。本实施例中,之所以对服务主机和备份主机执行相同的初始化操作,是因为服务主机和备份主机的身份不是固定的,既可以作为自己的服务主机,也可以作为其它物理机的备份主机,后续可以根据具体的情况执行相应的操作。After the service host and the backup host are specified, determine the virtual machine included in the service host, and then copy the virtual disk corresponding to the virtual machine to the backup host, so that the service host and the virtual host have the same virtual disk, which facilitates subsequent data. Backup. Further, after the service host and the backup host are designated, the service host and the backup host need to be initialized. In this embodiment, the specific initialization operation includes: performing VM disk read/write interception on the service host and the backup host deployment. The module patch VMM program, synchronization server program, synchronization client program, Agent (agent) program, after deploying each program to the service host and the backup host, start the service program of the service host and the backup host to complete the initialization operation. In this embodiment, the same initialization operation is performed on the service host and the backup host because the identity of the service host and the backup host is not fixed, and can be used as both a service host and a backup host of other physical machines. Subsequent operations can be performed according to specific situations.
在服务主机和备份主机完成初始化操作之后,所述服务主机和备份主机才可以和云服务器进行交互,本实施例中,服务主机和备份主机通过Agent程序与云服务器进行交互,具体地,通过Agent程序接收云服务器发送的虚拟磁盘备份指令。After the service host and the backup host complete the initialization operation, the service host and the backup host can interact with the cloud server. In this embodiment, the service host and the backup host interact with the cloud server through the Agent program, specifically, through the Agent. The program receives the virtual disk backup instruction sent by the cloud server.
云服务器在指定服务主机和备份主机的情况下,检测到所述服务主机和所述备份主机启动,实际上是检测到所述服务主机中的Agent程序和所述备份主机的Agent程序启动。在检测到所述服务主机的Agent程序启动,和所述备份主机的Agent程序启动时,发送虚拟磁盘备份指令至所述服务主机和所述备份主机,以供所述服务主机启动同步服务器程序,以及所述备份主机启动同步客户端程序。The cloud server detects that the service host and the backup host are started in the case of specifying the service host and the backup host, and actually detects that the Agent program in the service host and the Agent program of the backup host are started. After detecting that the agent program of the service host is started, and the agent program of the backup host is started, sending a virtual disk backup instruction to the service host and the backup host, so that the service host starts a synchronization server program, And the backup host starts the synchronization client program.
所述服务主机在接收到所述虚拟磁盘备份指令时,先由所述同步服务器程序与VM磁盘读写截取子模块建立通信连接,以通过所述VM磁盘读写截取子模块截取本地虚拟磁盘的虚拟磁盘写操作,并且将截取的虚拟磁盘写操作发送至所述同步服务器程序;同时,所述服务主机还会将同步服务器程序与备份主机的同步客户端程序建立通信连接,再通过所述同步服务器程序将截取的所述虚拟磁盘写操作发送至所述备份主机。When the service host receives the virtual disk backup instruction, the synchronization server program first establishes a communication connection with the VM disk read/write interception submodule to intercept the local virtual disk through the VM disk read/write interception submodule. a virtual disk write operation, and sending the intercepted virtual disk write operation to the synchronization server program; at the same time, the service host also establishes a communication connection between the synchronization server program and the synchronization client program of the backup host, and then through the synchronization The server program sends the intercepted virtual disk write operation to the backup host.
所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘写操作时,调用虚拟磁盘镜像驱动的库函数,以将接收到的所述虚拟磁盘读写操作写到备份虚拟磁盘中,最终反馈执行结果至所述服务主机,以告知所述服务主机数据拷贝的结果。When the backup host receives the virtual disk write operation by using the synchronization client program, the virtual disk mirroring driver library function is invoked to write the received virtual disk read and write operation to the backup virtual disk, and finally The execution result is fed back to the service host to inform the service host of the result of the data copy.
本实施例提出的虚拟磁盘备份方法,在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序,截取本地虚拟磁盘的虚拟磁盘写操作,将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。本实施例实现了对服务主机的本地虚拟磁盘做实时备份,后续即使服务主机的物理磁盘出现损坏,也会由于备份主机的备份虚拟磁盘已经备份了数据,可以继续为服务主机中的虚拟机提供服务,保证了服务主机中的虚拟机可以正常使用。The virtual disk backup method in this embodiment starts a virtual disk backup command sent by the cloud server, starts a preset synchronization server program, intercepts a virtual disk write operation of the local virtual disk, and writes the intercepted virtual disk. Sending to the backup host by the synchronization server program, when the backup host receives the virtual disk write operation through a preset synchronization client program, writing the received virtual disk write operation to the backup virtual disk in. This embodiment implements a real-time backup of the local virtual disk of the service host. If the physical disk of the service host is damaged, the backup virtual disk of the backup host has already backed up the data, and can continue to provide the virtual machine in the service host. The service ensures that the virtual machine in the service host can be used normally.
进一步地,基于第一实施例提出本发明虚拟磁盘备份方法的第三实施例,在本实施例中,参照图4,所述虚拟磁盘备份方法还包括:Further, a third embodiment of the virtual disk backup method of the present invention is proposed based on the first embodiment. In this embodiment, referring to FIG. 4, the virtual disk backup method further includes:
步骤S40,在检测到本地虚拟磁盘出现故障时,截取本地虚拟磁盘的虚拟磁盘读写操作;Step S40, intercepting a virtual disk read and write operation of the local virtual disk when detecting that the local virtual disk fails;
步骤S50,通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘以执行所述虚拟磁盘读写操作,并反馈执行结果至所述服务主机。Step S50, the intercepted virtual disk read and write operations are sent to the backup host by the synchronization server program, when the backup host receives the virtual disk read and write operations through the synchronization client program. The backup virtual disk is invoked to perform the virtual disk read and write operations, and the execution result is fed back to the service host.
在本实施例中,所述服务主机通过VM磁盘读写截获子模块感知本地虚拟磁盘阻塞,以确定本地虚拟磁盘出现故障,在检测到本地虚拟磁盘堵塞时,由VM磁盘读写截获子模块截取本地虚拟磁盘的虚拟磁盘读写操作,然后通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机。In this embodiment, the service host senses the local virtual disk blockage through the VM disk read/write interception submodule to determine that the local virtual disk is faulty, and is intercepted by the VM disk read/write interception submodule when the local virtual disk is detected to be blocked. A virtual disk read and write operation of the local virtual disk, and then the intercepted virtual disk read and write operations are sent to the backup host by the synchronization server program.
所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘,以执行所述虚拟磁盘读写操作,也就是说,所述备份主机调用虚拟磁盘镜像执行具体的操作,若该虚拟磁盘读写操作是读操作,就在虚拟磁盘镜像中执行读操作,若该虚拟磁盘读写操作是写操作,就在虚拟磁盘镜像中执行写操作,最终反馈执行结果至所述服务主机。When the backup host receives the virtual disk read and write operation through the synchronization client program, the backup virtual disk is invoked to perform the virtual disk read and write operation, that is, the backup host calls the virtual disk. The mirror performs a specific operation. If the virtual disk read and write operation is a read operation, the read operation is performed in the virtual disk image. If the virtual disk read and write operation is a write operation, the write operation is performed in the virtual disk image, and finally the feedback is performed. Execute the result to the service host.
在本实施例中,相当于是在服务主机的本地虚拟磁盘出现故障时,将本地虚拟磁盘对应的虚拟磁盘读写操作及时切换至备份主机的备份虚拟磁盘中执行,保证了服务主机中虚拟机对应的虚拟磁盘读写操作正常执行。In this embodiment, when the local virtual disk of the service host fails, the virtual disk read/write operation corresponding to the local virtual disk is switched to the backup virtual disk of the backup host in time, and the virtual machine corresponding to the service host is ensured. The virtual disk read and write operations are performed normally.
进一步地,所述云服务器检测到所述服务主机宕机时,通知所述备份主机基于所述备份虚拟磁盘启动所述备份主机的虚拟机,以供所述备份主机根据启动的所述虚拟机继续提供服务。Further, when detecting that the service host is down, the cloud server notifies the backup host to start the virtual machine of the backup host based on the backup virtual disk, so that the backup host is activated according to the virtual machine. Continue to provide services.
即,所述服务主机出现严重故障导致宕机时,服务主机中的所有程序都会挂掉,因此所述云服务器检测到所述服务主机中的Agent程序停止时,就知道所述服务主机宕机,在检测到所述服务主机宕机时,所述云服务器通知所述备份主机启动所述备份虚拟磁盘,由于备份主机的所述备份虚拟磁盘已经备份有服务主机中所有的虚拟磁盘读写操作,那么,所述备份主机即可继续根据所述备份虚拟磁盘启动所述备份主机的虚拟机,以通过启动的所述虚拟机继续提供服务。That is, when the service host experiences a serious failure and causes a downtime, all programs in the service host are hanged. Therefore, when the cloud server detects that the Agent program in the service host stops, it knows that the service host is down. When detecting that the service host is down, the cloud server notifies the backup host to start the backup virtual disk, because the backup virtual disk of the backup host has backed up all virtual disk read and write operations in the service host. Then, the backup host can continue to start the virtual machine of the backup host according to the backup virtual disk to continue to provide services through the virtual machine that is started.
在本实施例中,相当于所述云服务器在检测到所述服务主机宕机时,通知所述备份主机启动所述备份虚拟磁盘,以供所述备份主机根据所述备份虚拟磁盘启动虚拟机,并继续提供服务,保证了服务主机宕机的情况下,备份主机可以继续提供服务。In this embodiment, when the cloud server detects that the service host is down, the cloud server is notified to start the backup virtual disk, so that the backup host starts the virtual machine according to the backup virtual disk. And continue to provide services to ensure that the backup host can continue to provide services in the event of a service host downtime.
进一步地,基于第一或第二实施例提出本发明虚拟磁盘备份方法的第三实施例,在本实施例中,参照图5,所述虚拟磁盘备份方法还包括:Further, a third embodiment of the virtual disk backup method of the present invention is provided based on the first or second embodiment. In this embodiment, referring to FIG. 5, the virtual disk backup method further includes:
步骤S60,在接收到云服务器发送的虚拟磁盘迁移指令时,基于所述虚拟磁盘迁移指令确定目的服务主机;Step S60, when receiving the virtual disk migration instruction sent by the cloud server, determining the destination service host based on the virtual disk migration instruction;
步骤S70,将本地虚拟磁盘迁移至确定的所述目的服务主机;Step S70, migrating the local virtual disk to the determined destination service host;
步骤S80,在检测到本地虚拟磁盘迁移完成时,通过所述同步服务器程序将迁移完成指令发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,并建立与所述目的服务主机的通信连接,以继续进行虚拟磁盘的备份服务。Step S80, when detecting that the local virtual disk migration is completed, sending, by the synchronization server program, a migration completion instruction to the backup host, where the backup host receives the migration completion instruction by using the synchronization client program. At the same time, the communication connection with the service host is closed, and a communication connection with the destination service host is established to continue the backup service of the virtual disk.
在本实施例中,所述云服务器在检测到虚拟磁盘迁移请求时,此时为了保证服务主机中的虚拟机可以正常运行,需要将所述服务主机的虚拟机迁移到其它服务主机中,以实现虚拟机的在线迁移。本实施例中,所述虚拟磁盘迁移请求的触发方式包括:服务主机需要使用大量内存时,触发虚拟磁盘迁移请求;或者,服务主机CPU的负载过大时,触发虚拟磁盘迁移请求。In this embodiment, when the cloud server detects the virtual disk migration request, in order to ensure that the virtual machine in the service host can operate normally, the virtual machine of the service host needs to be migrated to another service host. Implement online migration of virtual machines. In this embodiment, the triggering mode of the virtual disk migration request includes: when the service host needs to use a large amount of memory, triggering a virtual disk migration request; or when the load of the service host CPU is too large, triggering a virtual disk migration request.
应当理解,由于在选择备份主机时,可以在集群中进行选择,同理,在服务主机宕机时,将服务主机中的虚拟机迁移到其它服务主机时,同样可以在集群中,选择任一台物理机作为待切换的目的服务主机进行虚拟机的迁移。在选择好目的服务主机之后,即可发送虚拟磁盘迁移指令至所述服务主机,以通知所述服务主机将虚拟机进行在线迁移。It should be understood that since the backup host can be selected in the cluster, similarly, when the service host is down, when the virtual machine in the service host is migrated to another service host, the same can be selected in the cluster. The physical machine is used as the destination service host to be switched to perform virtual machine migration. After selecting the destination service host, a virtual disk migration instruction may be sent to the service host to notify the service host to perform online migration of the virtual machine.
在本实施例中,所述服务主机在接收到所述云服务器发送的虚拟磁盘迁移指令时,确定目的服务主机,然后根据VM迁移截获子模块将本地虚拟磁盘迁移至确定的所述目的服务主机,在检测到本地虚拟磁盘迁移完成时,将迁移完成指令发送至同步服务器程序,再通过所述同步服务器程序将迁移完成指令发送至所述备份主机。In this embodiment, when receiving the virtual disk migration instruction sent by the cloud server, the service host determines the destination service host, and then migrates the local virtual disk to the determined destination service host according to the VM migration intercepting submodule. When it is detected that the local virtual disk migration is completed, the migration completion instruction is sent to the synchronization server program, and the migration completion instruction is sent to the backup host by the synchronization server program.
所述备份主机通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,也就是关闭与所述服务主机中同步服务器程序的通信连接;同时,建立与所述目的服务主机中同步服务器程序的通信连接,以继续进行虚拟磁盘的备份服务。When the backup host receives the migration completion instruction by using the synchronization client program, the communication connection with the service host is closed, that is, the communication connection with the synchronization server program in the service host is closed; The communication connection of the server program is synchronized in the destination service host to continue the backup service of the virtual disk.
进一步地,为了保证服务主机将虚拟机迁移到目的服务主机时,可以迁移成功。所述云服务器还会获取所述目的服务主机的地址信息和虚拟机信息,并将所述目的服务主机的地址信息和虚拟机信息发送至所述备份主机,以供所述备份主机基于所述目的服务主机的地址信息和虚拟机信息,与所述目的服务主机建立通信连接;并且,所述云服务器还会通知所述目的服务主机有虚拟机接入,以供所述目的服务主机启动同步服务器程序,便于通过所述同步服务器程序与所述备份主机建立通信连接。Further, in order to ensure that the service host migrates the virtual machine to the destination service host, the migration can be successful. The cloud server also obtains address information and virtual machine information of the destination service host, and sends address information and virtual machine information of the destination service host to the backup host, where the backup host is based on the The address information of the destination service host and the virtual machine information are used to establish a communication connection with the destination service host; and the cloud server further informs the destination service host that the virtual machine accesses for the destination service host to initiate synchronization. a server program for facilitating establishing a communication connection with the backup host through the synchronization server program.
也就是说,所述云服务器发送虚拟磁盘迁移指令至服务主机之前,根据确定目的服务主机,获取所述目的服务主机的地址信息和虚拟机信息,然后将所述目的服务主机的地址信息和虚拟机信息发送至所述备份主机,以便所述备份主机后续基于所述目的服务主机的地址信息和虚拟机信息,与所述目的服务主机建立通信连接;同时,所述云服务器还会通知所述目的服务主机有虚拟机接入,以供所述目的服务主机启动同步服务器程序,便于通过所述同步服务器程序与所述备份主机建立通信连接。That is, before the cloud server sends the virtual disk migration instruction to the service host, the address server and the virtual machine information of the destination service host are obtained according to the determined destination service host, and then the address information of the destination service host is virtualized. The machine information is sent to the backup host, so that the backup host subsequently establishes a communication connection with the destination service host based on the address information and the virtual machine information of the destination service host; meanwhile, the cloud server further notifies the The destination service host has a virtual machine access, so that the destination service host starts a synchronization server program, and facilitates establishing a communication connection with the backup host by using the synchronization server program.
在本实施例中,实现了虚拟机的在线迁移,并且,在虚拟机进行在线迁移时,本地虚拟磁盘的虚拟机可以在集群中的任一个物理机间进行迁移,提高了云计算服务系统的可维护性,更利于实现负载均衡。In this embodiment, the online migration of the virtual machine is implemented, and when the virtual machine performs online migration, the virtual machine of the local virtual disk can be migrated between any physical machine in the cluster, thereby improving the cloud computing service system. Maintainability is more conducive to load balancing.
本发明中,服务主机和备份主机之间不再是peer-to-peer(点对点,对等网络)的映射关系,而是全相联的映射关系,一个服务主机的不同虚拟磁盘可以由不同备份主机进行备份,这样当某一台使用本地虚拟磁盘的虚拟机从某一台服务主机迁移到新的服务主机上时,该虚拟机的虚拟磁盘仍然由原备份主机进行备份服务,提高了数据备份的灵活性。 In the present invention, the mapping between the service host and the backup host is no longer a peer-to-peer (peer-to-peer, peer-to-peer network), but a fully associative mapping relationship. Different virtual disks of one service host can be backed up by different backup disks. The host performs backup so that when a virtual machine using a local virtual disk is migrated from a service host to a new service host, the virtual disk of the virtual machine is still backed up by the original backup host, improving data backup. Flexibility.
需要说明的是,本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。It should be noted that those skilled in the art can understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a storage medium. The storage medium mentioned above may be a read only memory, a magnetic disk or an optical disk or the like.
本发明进一步提供一种虚拟磁盘备份装置,应用于服务主机。The present invention further provides a virtual disk backup device applied to a service host.
参照图6,图6为本发明虚拟磁盘备份装置100第一实施例的功能模块示意图。Referring to FIG. 6, FIG. 6 is a schematic diagram of functional modules of a first embodiment of a virtual disk backup device 100 according to the present invention.
需要强调的是,对本领域的技术人员来说,图6所示功能模块图仅仅是一个较佳实施例的示例图,本领域的技术人员围绕图6所示的虚拟磁盘备份装置100的功能模块,可轻易进行新的功能模块的补充;各功能模块的名称是自定义名称,仅用于辅助理解该虚拟磁盘备份装置100的各个程序功能块,不用于限定本发明的技术方案,本发明技术方案的核心是,各自定义名称的功能模块所要达成的功能。It should be emphasized that, for those skilled in the art, the functional block diagram shown in FIG. 6 is merely an exemplary embodiment of a preferred embodiment, and those skilled in the art will surround the functional modules of the virtual disk backup device 100 shown in FIG. 6. The new functional modules can be easily supplemented; the names of the functional modules are custom names, which are only used to assist in understanding the various program functional blocks of the virtual disk backup device 100, and are not used to limit the technical solution of the present invention. At the heart of the solution is the functionality to be achieved by the functional modules that each define the name.
在本实施例中,所述虚拟磁盘备份装置100包括:In this embodiment, the virtual disk backup device 100 includes:
启动模块10,用于在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;The startup module 10 is configured to start a preset synchronization server program when receiving a virtual disk backup instruction sent by the cloud server;
截取模块20,用于截取本地虚拟磁盘的虚拟磁盘写操作;The intercepting module 20 is configured to intercept a virtual disk write operation of the local virtual disk;
发送模块30,用于将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。The sending module 30 is configured to send the intercepted virtual disk write operation to the backup host by using the synchronization server program, when the backup host receives the virtual disk write operation by using a preset synchronization client program. The received virtual disk write operation is written to the backup virtual disk.
在本实施例中,在实现虚拟磁盘备份之前,先由云服务器在集群中指定任意的一台物理机作为服务主机,并从集群中指定其它预设台数的物理机作为备份主机。本实施例中,所述预设台数可以根据实际情况进行设置,例如,集群中的各台物理机的稳定性都较好,则可选择一台作为备份主机,若是集群中的各台物理机的稳定性都较差,为了防止后续备份主机也故障,则可选择多台物理机作为备份主机。In this embodiment, before the virtual disk backup is implemented, the cloud server specifies any physical machine in the cluster as the service host, and specifies other preset physical machines from the cluster as the backup host. In this embodiment, the preset number can be set according to actual conditions. For example, if the stability of each physical machine in the cluster is good, one can be selected as a backup host, and if it is a physical machine in the cluster. The stability is poor. In order to prevent subsequent backup hosts from failing, multiple physical machines can be selected as backup hosts.
传统的备份主机选择方式,都是固定的选择一台作为备份主机,并且,服务主机和备份主机是一对一的关系,局限性很强,容易出现备份主机故障时,服务主机也无法使用的情况。The traditional backup host selection method is a fixed choice of one as a backup host, and the service host and the backup host are one-to-one. The limitation is very strong, and it is easy for the service host to use when the backup host fails. Happening.
而本实施例,一个服务主机可以由至少一个备份主机进行虚拟磁盘的备份;当然,一个备份主机可以为至少一个服务主机进行虚拟磁盘的备份。即在集群中任意选择预设台数的物理机作为备份主机,保证了后续数据备份的稳定性。并且,一台备份主机还可以同时作为多台服务主机的备份主机,不是一台备注主机只能给一台服务主机使用,有利于节省系统资源。In this embodiment, a service host can perform backup of the virtual disk by at least one backup host; of course, one backup host can perform backup of the virtual disk for at least one service host. That is, the physical machine of the preset number of arbitrarily selected in the cluster is used as the backup host, which ensures the stability of subsequent data backup. Moreover, a backup host can also serve as a backup host for multiple service hosts at the same time. It is not a memo host that can only be used by one service host, which is beneficial to save system resources.
在指定好服务主机和备份主机之后,确定服务主机中包含的虚拟机,然后将虚拟机对应的虚拟磁盘拷贝到备份主机中,使得服务主机和虚拟主机有相同的虚拟磁盘,便于后续进行数据的备份。进一步地,在指定好服务主机和备份主机之后,还需要对服务主机和备份主机进行初始化,本实施例中,具体地初始化操作包括:对服务主机和备份主机部署打了VM磁盘读写截获子模块补丁的VMM程序,同步服务器程序,同步客户端程序,Agent(代理)程序,在对服务主机和备份主机部署了各个程序之后,启动服务主机和备份主机的Agent程序,以完成初始化操作。本实施例中,之所以对服务主机和备份主机执行相同的初始化操作,是因为服务主机和备份主机的身份不是固定的,既可以作为自己的服务主机,也可以作为其它物理机的备份主机,后续可以根据具体的情况执行相应的操作。After the service host and the backup host are specified, determine the virtual machine included in the service host, and then copy the virtual disk corresponding to the virtual machine to the backup host, so that the service host and the virtual host have the same virtual disk, which facilitates subsequent data. Backup. Further, after the service host and the backup host are designated, the service host and the backup host need to be initialized. In this embodiment, the specific initialization operation includes: performing VM disk read/write interception on the service host and the backup host deployment. The module patch VMM program, synchronization server program, synchronization client program, Agent (agent) program, after deploying each program to the service host and the backup host, start the service program of the service host and the backup host to complete the initialization operation. In this embodiment, the same initialization operation is performed on the service host and the backup host because the identity of the service host and the backup host is not fixed, and can be used as both a service host and a backup host of other physical machines. Subsequent operations can be performed according to specific situations.
在服务主机和备份主机完成初始化操作之后,所述服务主机和备份主机才可以和云服务器进行交互,本实施例中,服务主机和备份主机通过Agent程序与云服务器进行交互,具体地,通过Agent程序接收云服务器发送的虚拟磁盘备份指令。After the service host and the backup host complete the initialization operation, the service host and the backup host can interact with the cloud server. In this embodiment, the service host and the backup host interact with the cloud server through the Agent program, specifically, through the Agent. The program receives the virtual disk backup instruction sent by the cloud server.
云服务器在指定服务主机和备份主机的情况下,检测到所述服务主机和所述备份主机启动,实际上是检测到所述服务主机中的Agent程序和所述备份主机的Agent程序启动。在检测到所述服务主机的Agent程序启动,和所述备份主机的Agent程序启动时,发送虚拟磁盘备份指令至所述服务主机和所述备份主机,以供启动模块10启动同步服务器程序,以及所述备份主机启动同步客户端程序。The cloud server detects that the service host and the backup host are started in the case of specifying the service host and the backup host, and actually detects that the Agent program in the service host and the Agent program of the backup host are started. After detecting that the agent program of the service host is started, and the agent program of the backup host is started, sending a virtual disk backup instruction to the service host and the backup host, so that the startup module 10 starts the synchronization server program, and The backup host starts a synchronization client program.
截取模块20在接收到所述虚拟磁盘备份指令时,先由所述同步服务器程序与VM磁盘读写截取子模块建立通信连接,以通过所述VM磁盘读写截取子模块截取本地虚拟磁盘的虚拟磁盘写操作,并且将截取的虚拟磁盘写操作发送至所述同步服务器程序;同时,还会将同步服务器程序与备份主机的同步客户端程序建立通信连接,发送模块30再通过所述同步服务器程序将截取的所述虚拟磁盘写操作发送至所述备份主机。When the intercepting module 20 receives the virtual disk backup instruction, the synchronization server program first establishes a communication connection with the VM disk read/write intercepting submodule to intercept the virtual virtual disk by the VM disk read/write intercepting submodule. Disk write operation, and sending the intercepted virtual disk write operation to the synchronization server program; at the same time, the synchronization server program is also established with the synchronization client program of the backup host, and the sending module 30 passes the synchronization server program. The intercepted virtual disk write operation is sent to the backup host.
所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘写操作时,调用虚拟磁盘镜像驱动的库函数,以将接收到的所述虚拟磁盘读写操作写到备份虚拟磁盘中,最终反馈执行结果至所述服务主机,以告知所述服务主机数据拷贝的结果。When the backup host receives the virtual disk write operation by using the synchronization client program, the virtual disk mirroring driver library function is invoked to write the received virtual disk read and write operation to the backup virtual disk, and finally The execution result is fed back to the service host to inform the service host of the result of the data copy.
本实施例提出的虚拟磁盘备份装置,启动模块10在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序,截取模块20截取本地虚拟磁盘的虚拟磁盘写操作,发送模块30将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。本实施例实现了对服务主机的本地虚拟磁盘做实时备份,后续即使服务主机的物理磁盘出现损坏,也会由于备份主机的备份虚拟磁盘已经备份了数据,可以继续为服务主机中的虚拟机提供服务,保证了服务主机中的虚拟机可以正常使用。In the virtual disk backup device of the embodiment, when the virtual disk backup command sent by the cloud server is received, the startup module 10 starts a preset synchronization server program, and the intercepting module 20 intercepts the virtual disk write operation of the local virtual disk, and the sending module 30 And the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk. This embodiment implements a real-time backup of the local virtual disk of the service host. If the physical disk of the service host is damaged, the backup virtual disk of the backup host has already backed up the data, and can continue to provide the virtual machine in the service host. The service ensures that the virtual machine in the service host can be used normally.
进一步地,基于第一实施例提出本发明虚拟磁盘备份装置的第二实施例,在本实施例中,Further, a second embodiment of the virtual disk backup device of the present invention is proposed based on the first embodiment. In this embodiment,
所述截取模块20,还用于在检测到本地虚拟磁盘出现故障时,截取本地虚拟磁盘的虚拟磁盘读写操作;The intercepting module 20 is further configured to intercept a virtual disk read and write operation of the local virtual disk when detecting that the local virtual disk fails;
所述发送模块30,还用于通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘以执行所述虚拟磁盘读写操作,并反馈执行结果至所述服务主机。The sending module 30 is further configured to send, by the synchronization server program, the intercepted virtual disk read and write operations to the backup host, where the backup host receives the virtual through the synchronization client program. During a disk read and write operation, the backup virtual disk is invoked to perform the virtual disk read and write operations, and the execution result is fed back to the service host.
在本实施例中,所述服务主机通过VM磁盘读写截获子模块感知本地虚拟磁盘阻塞,以确定本地虚拟磁盘出现故障,在检测到本地虚拟磁盘堵塞时,所述截取模块20由VM磁盘读写截获子模块截取本地虚拟磁盘的虚拟磁盘读写操作,然后所述发送模块30通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机。In this embodiment, the service host senses the local virtual disk blocking by using the VM disk read/write intercepting submodule to determine that the local virtual disk is faulty. When the local virtual disk is detected to be blocked, the intercepting module 20 is read by the VM disk. The write intercepting submodule intercepts the virtual disk read and write operations of the local virtual disk, and then the sending module 30 sends the intercepted virtual disk read and write operations to the backup host by the synchronization server program.
所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘,以执行所述虚拟磁盘读写操作,也就是说,所述备份主机调用虚拟磁盘镜像执行具体的操作,若该虚拟磁盘读写操作是读操作,就在虚拟磁盘镜像中执行读操作,若该虚拟磁盘读写操作是写操作,就在虚拟磁盘镜像中执行写操作,最终反馈执行结果至所述服务主机。When the backup host receives the virtual disk read and write operation through the synchronization client program, the backup virtual disk is invoked to perform the virtual disk read and write operation, that is, the backup host calls the virtual disk. The mirror performs a specific operation. If the virtual disk read and write operation is a read operation, the read operation is performed in the virtual disk image. If the virtual disk read and write operation is a write operation, the write operation is performed in the virtual disk image, and finally the feedback is performed. Execute the result to the service host.
在本实施例中,相当于是在服务主机的本地虚拟磁盘出现故障时,将本地虚拟磁盘对应的虚拟磁盘读写操作及时切换至备份主机的备份虚拟磁盘中执行,保证了服务主机中虚拟机对应的虚拟磁盘读写操作正常执行。In this embodiment, when the local virtual disk of the service host fails, the virtual disk read/write operation corresponding to the local virtual disk is switched to the backup virtual disk of the backup host in time, and the virtual machine corresponding to the service host is ensured. The virtual disk read and write operations are performed normally.
进一步地,所述云服务器检测到所述服务主机宕机时,通知所述备份主机基于所述备份虚拟磁盘启动所述备份主机的虚拟机,以供所述备份主机根据启动的所述虚拟机继续提供服务。Further, when detecting that the service host is down, the cloud server notifies the backup host to start the virtual machine of the backup host based on the backup virtual disk, so that the backup host is activated according to the virtual machine. Continue to provide services.
即,所述服务主机出现严重故障导致宕机时,服务主机中的所有程序都会挂掉,因此所述云服务器检测到所述服务主机中的Agent程序停止时,就知道所述服务主机宕机,在检测到所述服务主机宕机时,所述云服务器通知所述备份主机启动所述备份虚拟磁盘,由于备份主机的所述备份虚拟磁盘已经备份有服务主机中所有的虚拟磁盘读写操作,那么,所述备份主机即可继续根据所述备份虚拟磁盘启动所述备份主机的虚拟机,以通过启动的所述虚拟机继续提供服务。That is, when the service host experiences a serious failure and causes a downtime, all programs in the service host are hanged. Therefore, when the cloud server detects that the Agent program in the service host stops, it knows that the service host is down. When detecting that the service host is down, the cloud server notifies the backup host to start the backup virtual disk, because the backup virtual disk of the backup host has backed up all virtual disk read and write operations in the service host. Then, the backup host can continue to start the virtual machine of the backup host according to the backup virtual disk to continue to provide services through the virtual machine that is started.
在本实施例中,相当于所述云服务器在检测到所述服务主机宕机时,通知所述备份主机启动所述备份虚拟磁盘,以供所述备份主机根据所述备份虚拟磁盘启动虚拟机,并继续提供服务,保证了服务主机宕机的情况下,备份主机可以继续提供服务。In this embodiment, when the cloud server detects that the service host is down, the cloud server is notified to start the backup virtual disk, so that the backup host starts the virtual machine according to the backup virtual disk. And continue to provide services to ensure that the backup host can continue to provide services in the event of a service host downtime.
进一步地,基于第一或第二实施例提出本发明虚拟磁盘备份装置的第三实施例,在本实施例中,参照图7,所述虚拟磁盘备份装置100还包括:Further, a third embodiment of the virtual disk backup device of the present invention is proposed based on the first or second embodiment. In this embodiment, referring to FIG. 7, the virtual disk backup device 100 further includes:
确定模块40,用于在接收到云服务器发送的虚拟磁盘迁移指令时,基于所述虚拟磁盘迁移指令确定目的服务主机;The determining module 40 is configured to determine, according to the virtual disk migration instruction, the destination service host when receiving the virtual disk migration instruction sent by the cloud server;
迁移模块50,用于将本地虚拟磁盘迁移至确定的所述目的服务主机;a migration module 50, configured to migrate a local virtual disk to the determined destination service host;
所述发送模块30,还用于在检测到本地虚拟磁盘迁移完成时,通过所述同步服务器程序将迁移完成指令发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,并建立与所述目的服务主机的通信连接,以继续进行虚拟磁盘的备份服务。The sending module 30 is further configured to send, by the synchronization server program, a migration completion instruction to the backup host, when the local virtual disk migration is completed, for the backup host to receive through the synchronization client program. When the migration completion instruction is reached, the communication connection with the service host is closed, and a communication connection with the destination service host is established to continue the backup service of the virtual disk.
在本实施例中,所述云服务器在检测到虚拟磁盘迁移请求时,此时为了保证服务主机中的虚拟机可以正常运行,需要将所述服务主机的虚拟机迁移到其它服务主机中,以实现虚拟机的在线迁移。本实施例中,所述虚拟磁盘迁移请求的触发方式包括:服务主机需要使用大量内存时,触发虚拟磁盘迁移请求;或者,服务主机CPU的负载过大时,触发虚拟磁盘迁移请求。In this embodiment, when the cloud server detects the virtual disk migration request, in order to ensure that the virtual machine in the service host can operate normally, the virtual machine of the service host needs to be migrated to another service host. Implement online migration of virtual machines. In this embodiment, the triggering mode of the virtual disk migration request includes: when the service host needs to use a large amount of memory, triggering a virtual disk migration request; or when the load of the service host CPU is too large, triggering a virtual disk migration request.
应当理解,由于在选择备份主机时,可以在集群中进行选择,同理,在服务主机宕机时,将服务主机中的虚拟机迁移到其它服务主机时,同样可以在集群中,选择任一台物理机作为待切换的目的服务主机进行虚拟机的迁移。在选择好目的服务主机之后,即可发送虚拟磁盘迁移指令至所述服务主机,以通知所述服务主机将虚拟机进行在线迁移。It should be understood that since the backup host can be selected in the cluster, similarly, when the service host is down, when the virtual machine in the service host is migrated to another service host, the same can be selected in the cluster. The physical machine is used as the destination service host to be switched to perform virtual machine migration. After selecting the destination service host, a virtual disk migration instruction may be sent to the service host to notify the service host to perform online migration of the virtual machine.
在本实施例中,确定模块40在接收到所述云服务器发送的虚拟磁盘迁移指令时,确定目的服务主机,然后迁移模块50根据VM迁移截获子模块将本地虚拟磁盘迁移至确定的所述目的服务主机,在检测到本地虚拟磁盘迁移完成时,所述发送模块30将迁移完成指令发送至同步服务器程序,再通过所述同步服务器程序将迁移完成指令发送至所述备份主机。In this embodiment, the determining module 40 determines the destination service host when receiving the virtual disk migration instruction sent by the cloud server, and then the migration module 50 migrates the local virtual disk to the determined purpose according to the VM migration intercepting submodule. The service host sends a migration completion instruction to the synchronization server program when the local virtual disk migration is detected, and then sends a migration completion instruction to the backup host through the synchronization server program.
所述备份主机通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,也就是关闭与所述服务主机中同步服务器程序的通信连接;同时,建立与所述目的服务主机中同步服务器程序的通信连接,以继续进行虚拟磁盘的备份服务。When the backup host receives the migration completion instruction by using the synchronization client program, the communication connection with the service host is closed, that is, the communication connection with the synchronization server program in the service host is closed; The communication connection of the server program is synchronized in the destination service host to continue the backup service of the virtual disk.
进一步地,为了保证服务主机将虚拟机迁移到目的服务主机时,可以迁移成功。所述云服务器还会获取所述目的服务主机的地址信息和虚拟机信息,并将所述目的服务主机的地址信息和虚拟机信息发送至所述备份主机,以供所述备份主机基于所述目的服务主机的地址信息和虚拟机信息,与所述目的服务主机建立通信连接;并且,所述云服务器还会通知所述目的服务主机有虚拟机接入,以供所述目的服务主机启动同步服务器程序,便于通过所述同步服务器程序与所述备份主机建立通信连接。Further, in order to ensure that the service host migrates the virtual machine to the destination service host, the migration can be successful. The cloud server also obtains address information and virtual machine information of the destination service host, and sends address information and virtual machine information of the destination service host to the backup host, where the backup host is based on the The address information of the destination service host and the virtual machine information are used to establish a communication connection with the destination service host; and the cloud server further informs the destination service host that the virtual machine accesses for the destination service host to initiate synchronization. a server program for facilitating establishing a communication connection with the backup host through the synchronization server program.
也就是说,所述云服务器发送虚拟磁盘迁移指令至服务主机之前,根据确定目的服务主机,获取所述目的服务主机的地址信息和虚拟机信息,然后将所述目的服务主机的地址信息和虚拟机信息发送至所述备份主机,以便所述备份主机后续基于所述目的服务主机的地址信息和虚拟机信息,与所述目的服务主机建立通信连接;同时,所述云服务器还会通知所述目的服务主机有虚拟机接入,以供所述目的服务主机启动同步服务器程序,便于通过所述同步服务器程序与所述备份主机建立通信连接。That is, before the cloud server sends the virtual disk migration instruction to the service host, the address server and the virtual machine information of the destination service host are obtained according to the determined destination service host, and then the address information of the destination service host is virtualized. The machine information is sent to the backup host, so that the backup host subsequently establishes a communication connection with the destination service host based on the address information and the virtual machine information of the destination service host; meanwhile, the cloud server further notifies the The destination service host has a virtual machine access, so that the destination service host starts a synchronization server program, and facilitates establishing a communication connection with the backup host by using the synchronization server program.
在本实施例中,实现了虚拟机的在线迁移,并且,在虚拟机进行在线迁移时,本地虚拟磁盘的虚拟机可以在集群中的任一个物理机间进行迁移,提高了云计算服务系统的可维护性,更利于实现负载均衡。In this embodiment, the online migration of the virtual machine is implemented, and when the virtual machine performs online migration, the virtual machine of the local virtual disk can be migrated between any physical machine in the cluster, thereby improving the cloud computing service system. Maintainability is more conducive to load balancing.
本发明中,服务主机和备份主机之间不再是peer-to-peer(点对点,对等网络)的映射关系,而是全相联的映射关系,一个服务主机的不同虚拟磁盘可以由不同备份主机进行备份,这样当某一台使用本地虚拟磁盘的虚拟机从某一台服务主机迁移到新的服务主机上时,该虚拟机的虚拟磁盘仍然由原备份主机进行备份服务,提高了数据备份的灵活性。 In the present invention, the mapping between the service host and the backup host is no longer a peer-to-peer (peer-to-peer, peer-to-peer network), but a fully associative mapping relationship. Different virtual disks of one service host can be backed up by different backup disks. The host performs backup so that when a virtual machine using a local virtual disk is migrated from a service host to a new service host, the virtual disk of the virtual machine is still backed up by the original backup host, improving data backup. Flexibility.
需要说明的是,在硬件实现上,以上启动模块10、截取模块20、发送模块30、确定模块40以及迁移模块50等可以以硬件形式内嵌于或独立于虚拟磁盘备份装置中,也可以以软件形式存储于虚拟磁盘备份装置的存储器中,以便于处理器执行以上各个模块对应的操作。该处理器可以为中央处理单元(CPU)、微处理器、单片机等。It should be noted that, in hardware implementation, the above startup module 10, the interception module 20, the transmission module 30, the determination module 40, the migration module 50, and the like may be embedded in or independent of the virtual disk backup device in hardware, or may be The software form is stored in the memory of the virtual disk backup device, so that the processor performs the operations corresponding to the above modules. The processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
参照图8,图8是本发明实施例方案涉及硬件运行环境的服务主机的结构示意图。Referring to FIG. 8, FIG. 8 is a schematic structural diagram of a service host related to a hardware operating environment according to an embodiment of the present invention.
本发明实施例服务主机可以是PC,也可以是智能手机、平板电脑、电子书阅读器、便携计算机等终端设备。The service host in the embodiment of the present invention may be a PC, or may be a terminal device such as a smart phone, a tablet computer, an e-book reader, or a portable computer.
如图8所示,该服务主机可以包括:处理器1001,例如CPU,网络接口1002,存储器1003。这些组件之间的连接通信可以通过通信总线实现。网络接口1002可选的可以包括标准的有线接口(用于连接有线网络)、无线接口(如WI-FI接口、蓝牙接口、红外线接口等,用于连接无线网络)。存储器1003可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1003可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 8, the service host may include a processor 1001, such as a CPU, a network interface 1002, and a memory 1003. Connection communication between these components can be achieved via a communication bus. The network interface 1002 may optionally include a standard wired interface (for connecting to a wired network), a wireless interface (such as a WI-FI interface, a Bluetooth interface, an infrared interface, etc. for connecting to a wireless network). The memory 1003 may be a high speed RAM memory or a stable memory (non-volatile) Memory), such as disk storage. The memory 1003 can also optionally be a storage device independent of the aforementioned processor 1001.
可选地,服务主机还可以包括用户接口、摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、WiFi模块等等。用户接口可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口还可以包括标准的有线接口(例如用于连接有线键盘、有线鼠标等)和/或无线接口(例如用于连接无线键盘、无线鼠标)。Optionally, the service host may also include a user interface, a camera, and an RF (Radio). Frequency, RF) circuits, sensors, audio circuits, WiFi modules, and more. The user interface may include a display, an input unit such as a keyboard, and the optional user interface may also include a standard wired interface (eg, for connecting a wired keyboard, a wired mouse, etc.) and/or a wireless interface (eg, for Connect a wireless keyboard, wireless mouse).
本领域技术人员可以理解,图8中示出的服务主机结构并不构成对服务主机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。It will be understood by those skilled in the art that the service host structure illustrated in FIG. 8 does not constitute a limitation to the service host, and may include more or less components than those illustrated, or some components may be combined, or different component arrangements.
如图8所示,作为一种存储介质的存储器1003可以包括操作系统、网络通信模块以及虚拟磁盘备份程序。其中,操作系统是管理和控制服务主机硬件与软件资源的程序,支持网络通信模块、虚拟磁盘备份程序以及其他程序或软件的运行;网络通信模块用于管理和控制网络接口1002。As shown in FIG. 8, the memory 1003 as a storage medium may include an operating system, a network communication module, and a virtual disk backup program. The operating system is a program for managing and controlling the service host hardware and software resources, and supports the operation of the network communication module, the virtual disk backup program, and other programs or software; the network communication module is used to manage and control the network interface 1002.
在图8所示的服务主机中,网络接口1002主要用于连接云服务器和备份主机,与云服务器和备份主机进行数据通信,所述服务主机与云服务器的连接方式优选通过无线接口进行连接,所述服务主机与备份主机的连接方式可通过有线接口或无线接口连接;而处理器1001可以用于执行存储器1003中存储的虚拟磁盘备份程序,以实现以下步骤:In the service host shown in FIG. 8, the network interface 1002 is mainly used for connecting the cloud server and the backup host, and performs data communication with the cloud server and the backup host, and the connection manner between the service host and the cloud server is preferably connected through a wireless interface. The connection manner between the service host and the backup host may be connected through a wired interface or a wireless interface; and the processor 1001 may be configured to execute a virtual disk backup program stored in the storage 1003 to implement the following steps:
在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;When receiving the virtual disk backup instruction sent by the cloud server, starting a preset synchronization server program;
截取本地虚拟磁盘的虚拟磁盘写操作;Intercept the virtual disk write operation of the local virtual disk;
将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。And the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
进一步地,所述处理器1001可以用于执行存储器1003中存储的虚拟磁盘备份程序,以实现以下步骤:Further, the processor 1001 can be configured to execute a virtual disk backup program stored in the memory 1003 to implement the following steps:
在检测到本地虚拟磁盘出现故障时,截取本地虚拟磁盘的虚拟磁盘读写操作;Intercepting the virtual disk read and write operations of the local virtual disk when it detects that the local virtual disk fails;
通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘以执行所述虚拟磁盘读写操作,并反馈执行结果至所述服务主机。And sending, by the synchronization server program, the intercepted virtual disk read and write operations to the backup host, when the backup host receives the virtual disk read and write operations through the synchronization client program, calling the The virtual disk is backed up to perform the virtual disk read and write operations, and the execution result is fed back to the service host.
进一步地,所述处理器1001可以用于执行存储器1003中存储的虚拟磁盘备份程序,以实现以下步骤:Further, the processor 1001 can be configured to execute a virtual disk backup program stored in the memory 1003 to implement the following steps:
在接收到云服务器发送的虚拟磁盘迁移指令时,基于所述虚拟磁盘迁移指令确定目的服务主机;Upon receiving the virtual disk migration instruction sent by the cloud server, determining the destination service host based on the virtual disk migration instruction;
将本地虚拟磁盘迁移至确定的所述目的服务主机;Migrating a local virtual disk to the determined destination service host;
在检测到本地虚拟磁盘迁移完成时,通过所述同步服务器程序将迁移完成指令发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,并建立与所述目的服务主机的通信连接,以继续进行虚拟磁盘的备份服务。Upon detecting completion of the local virtual disk migration, sending, by the synchronization server program, a migration completion instruction to the backup host, for the backup host to close when receiving the migration completion instruction by the synchronization client program A communication connection with the service host and establishing a communication connection with the destination service host to continue the backup service of the virtual disk.
本发明提供了一种存储介质,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现以下步骤:The present invention provides a storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the following steps:
在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;When receiving the virtual disk backup instruction sent by the cloud server, starting a preset synchronization server program;
截取本地虚拟磁盘的虚拟磁盘写操作;Intercept the virtual disk write operation of the local virtual disk;
将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。And the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
进一步地,所述一个或者多个程序可被一个或者多个处理器执行,以实现以下步骤:Further, the one or more programs may be executed by one or more processors to implement the following steps:
在检测到本地虚拟磁盘出现故障时,截取本地虚拟磁盘的虚拟磁盘读写操作;Intercepting the virtual disk read and write operations of the local virtual disk when it detects that the local virtual disk fails;
通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘以执行所述虚拟磁盘读写操作,并反馈执行结果至所述服务主机。And sending, by the synchronization server program, the intercepted virtual disk read and write operations to the backup host, when the backup host receives the virtual disk read and write operations through the synchronization client program, calling the The virtual disk is backed up to perform the virtual disk read and write operations, and the execution result is fed back to the service host.
进一步地,所述一个或者多个程序可被一个或者多个处理器执行,以实现以下步骤:Further, the one or more programs may be executed by one or more processors to implement the following steps:
在接收到云服务器发送的虚拟磁盘迁移指令时,基于所述虚拟磁盘迁移指令确定目的服务主机;Upon receiving the virtual disk migration instruction sent by the cloud server, determining the destination service host based on the virtual disk migration instruction;
将本地虚拟磁盘迁移至确定的所述目的服务主机;Migrating a local virtual disk to the determined destination service host;
在检测到本地虚拟磁盘迁移完成时,通过所述同步服务器程序将迁移完成指令发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,并建立与所述目的服务主机的通信连接,以继续进行虚拟磁盘的备份服务。Upon detecting completion of the local virtual disk migration, sending, by the synchronization server program, a migration completion instruction to the backup host, for the backup host to close when receiving the migration completion instruction by the synchronization client program A communication connection with the service host and establishing a communication connection with the destination service host to continue the backup service of the virtual disk.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其它要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It is to be understood that the term "comprises", "comprising", or any other variants thereof, is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes those elements. It also includes other elements not explicitly listed, or elements that are inherent to such a process, method, article, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present invention are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其它相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and are not intended to limit the scope of the present invention, and the equivalent structure or equivalent process transformations made by the description of the present invention and the drawings are directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of the present invention.

Claims (18)

  1. 一种虚拟磁盘备份系统,其特征在于,所述虚拟磁盘备份系统包括云服务器、服务主机和备份主机; A virtual disk backup system, comprising: a cloud server, a service host, and a backup host;
    所述云服务器,用于在检测到所述服务主机和所述备份主机启动时,发送虚拟磁盘备份指令至所述服务主机和所述备份主机,以供所述服务主机启动预设的同步服务器程序,以及所述备份主机启动预设的同步客户端程序;The cloud server is configured to send a virtual disk backup instruction to the service host and the backup host when the service host and the backup host are detected to be started, so that the service host starts a preset synchronization server. a program, and the backup host launches a preset synchronization client program;
    所述服务主机,用于在接收到所述虚拟磁盘备份指令时,截取本地虚拟磁盘的虚拟磁盘写操作,并通过所述同步服务器程序将截取的所述虚拟磁盘写操作发送至所述备份主机;The service host is configured to intercept a virtual disk write operation of the local virtual disk when receiving the virtual disk backup instruction, and send the intercepted virtual disk write operation to the backup host by using the synchronization server program ;
    所述备份主机,用于通过所述同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。The backup host is configured to write the received virtual disk write operation to the backup virtual disk when the virtual disk write operation is received by the synchronization client program.
  2. 如权利要求1所述的虚拟磁盘备份系统,其特征在于,所述服务主机,还用于在检测到本地虚拟磁盘出现故障时,截取本地虚拟磁盘的虚拟磁盘读写操作,并通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机;The virtual disk backup system according to claim 1, wherein the service host is further configured to intercept a virtual disk read and write operation of the local virtual disk and detect the synchronization when the local virtual disk fails. The server program sends the intercepted virtual disk read and write operations to the backup host;
    所述备份主机,还用于通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘以执行所述虚拟磁盘读写操作,并反馈执行结果至所述服务主机。The backup host is further configured to invoke the backup virtual disk to perform the virtual disk read and write operation when the virtual disk read and write operation is received by the synchronization client program, and feed back an execution result to the service. Host.
  3. 如权利要求1所述的虚拟磁盘备份系统,其特征在于,所述云服务器,还用于在检测到所述服务主机宕机时,通知所述备份主机基于所述备份虚拟磁盘启动所述备份主机的虚拟机,以供所述备份主机根据启动的所述虚拟机继续提供服务。The virtual disk backup system according to claim 1, wherein the cloud server is further configured to notify the backup host to start the backup based on the backup virtual disk when detecting that the service host is down a virtual machine of the host for the backup host to continue to provide services according to the virtual machine that is started.
  4. 如权利要求1所述的虚拟磁盘备份系统,其特征在于,所述云服务器,还用于在检测到虚拟磁盘迁移请求时,确定所述服务主机待切换的目的服务主机,并根据确定的所述目的服务主机发送虚拟磁盘迁移指令至所述服务主机;The virtual disk backup system according to claim 1, wherein the cloud server is further configured to: when detecting a virtual disk migration request, determine a destination service host to be switched by the service host, and according to the determined Describe that the service host sends a virtual disk migration instruction to the service host;
    所述服务主机,还用于在接收到所述虚拟磁盘迁移指令时,确定目的服务主机,并将本地虚拟磁盘迁移至确定的所述目的服务主机;在检测到本地虚拟磁盘迁移完成时,通过所述同步服务器程序将迁移完成指令发送至所述备份主机;The service host is further configured to: when receiving the virtual disk migration instruction, determine a destination service host, and migrate the local virtual disk to the determined destination service host; and when detecting that the local virtual disk migration is completed, pass The synchronization server program sends a migration completion instruction to the backup host;
    所述备份主机,还用于通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,并建立与所述目的服务主机的通信连接,以继续进行虚拟磁盘的备份服务。The backup host is further configured to: when the migration completion instruction is received by the synchronization client program, close a communication connection with the service host, and establish a communication connection with the destination service host to continue virtual Disk backup service.
  5. 如权利要求4所述的虚拟磁盘备份系统,其特征在于,所述云服务器,还用于获取所述目的服务主机的地址信息和虚拟机信息,并将所述目的服务主机的地址信息和虚拟机信息发送至所述备份主机,以供所述备份主机基于所述目的服务主机的地址信息和虚拟机信息,与所述目的服务主机建立通信连接;The virtual disk backup system according to claim 4, wherein the cloud server is further configured to acquire address information and virtual machine information of the destination service host, and to virtualize address information of the destination service host and The machine information is sent to the backup host, so that the backup host establishes a communication connection with the destination service host based on the address information and the virtual machine information of the destination service host;
    所述云服务器,还用于通知所述目的服务主机有虚拟机接入,以供所述目的服务主机启动同步服务器程序,便于通过所述同步服务器程序与所述备份主机建立通信连接。The cloud server is further configured to notify the target service host to have a virtual machine access, so that the destination service host starts a synchronization server program, so as to establish a communication connection with the backup host by using the synchronization server program.
  6. 如权利要求1所述的虚拟磁盘备份系统,其特征在于,一个服务主机可以由至少一个备份主机进行虚拟磁盘的备份;一个备份主机可以为至少一个服务主机进行虚拟磁盘的备份。The virtual disk backup system of claim 1 , wherein one service host can perform backup of the virtual disk by at least one backup host; and one backup host can perform backup of the virtual disk for at least one service host.
  7. 一种虚拟磁盘备份方法,其特征在于,应用于服务主机,所述虚拟磁盘备份方法包括:A virtual disk backup method is applied to a service host, and the virtual disk backup method includes:
    在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;When receiving the virtual disk backup instruction sent by the cloud server, starting a preset synchronization server program;
    截取本地虚拟磁盘的虚拟磁盘写操作;Intercept the virtual disk write operation of the local virtual disk;
    将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。And the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
  8. 如权利要求7所述的虚拟磁盘备份方法,其特征在于,所述虚拟磁盘备份方法还包括:The virtual disk backup method of claim 7, wherein the virtual disk backup method further comprises:
    在检测到本地虚拟磁盘出现故障时,截取本地虚拟磁盘的虚拟磁盘读写操作;Intercepting the virtual disk read and write operations of the local virtual disk when it detects that the local virtual disk fails;
    通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘以执行所述虚拟磁盘读写操作,并反馈执行结果至所述服务主机。And sending, by the synchronization server program, the intercepted virtual disk read and write operations to the backup host, when the backup host receives the virtual disk read and write operations through the synchronization client program, calling the The virtual disk is backed up to perform the virtual disk read and write operations, and the execution result is fed back to the service host.
  9. 如权利要求7所述的虚拟磁盘备份方法,其特征在于,所述虚拟磁盘备份方法还包括:The virtual disk backup method of claim 7, wherein the virtual disk backup method further comprises:
    在接收到云服务器发送的虚拟磁盘迁移指令时,基于所述虚拟磁盘迁移指令确定目的服务主机;Upon receiving the virtual disk migration instruction sent by the cloud server, determining the destination service host based on the virtual disk migration instruction;
    将本地虚拟磁盘迁移至确定的所述目的服务主机;Migrating a local virtual disk to the determined destination service host;
    在检测到本地虚拟磁盘迁移完成时,通过所述同步服务器程序将迁移完成指令发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,并建立与所述目的服务主机的通信连接,以继续进行虚拟磁盘的备份服务。Upon detecting completion of the local virtual disk migration, sending, by the synchronization server program, a migration completion instruction to the backup host, for the backup host to close when receiving the migration completion instruction by the synchronization client program A communication connection with the service host and establishing a communication connection with the destination service host to continue the backup service of the virtual disk.
  10. 一种虚拟磁盘备份装置,其特征在于,应用于服务主机,所述虚拟磁盘备份装置包括:A virtual disk backup device is applied to a service host, and the virtual disk backup device includes:
    启动模块,用于在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;The startup module is configured to start a preset synchronization server program when receiving a virtual disk backup instruction sent by the cloud server;
    截取模块,用于截取本地虚拟磁盘的虚拟磁盘写操作;An intercept module for intercepting a virtual disk write operation of a local virtual disk;
    发送模块, 用于将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。Send module, The virtual disk write operation for sending the intercepted to the backup host by the synchronization server program, when the backup host receives the virtual disk write operation through a preset synchronization client program, and receives the virtual disk write operation. The virtual disk write operation is written to the backup virtual disk.
  11. 如权利要求10所述的虚拟磁盘备份装置,其特征在于,所述截取模块,还用于在检测到本地虚拟磁盘出现故障时,截取本地虚拟磁盘的虚拟磁盘读写操作;The virtual disk backup device of claim 10, wherein the intercepting module is further configured to intercept a virtual disk read and write operation of the local virtual disk when detecting that the local virtual disk fails;
    所述发送模块,还用于通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘以执行所述虚拟磁盘读写操作,并反馈执行结果至所述服务主机。The sending module is further configured to send, by the synchronization server program, the intercepted virtual disk read and write operations to the backup host, where the backup host receives the virtual disk through the synchronization client program. During a read and write operation, the backup virtual disk is invoked to perform the virtual disk read and write operations, and the execution result is fed back to the service host.
  12. 如权利要求10所述的虚拟磁盘备份装置,其特征在于,所述虚拟磁盘备份装置还包括:The virtual disk backup device of claim 10, wherein the virtual disk backup device further comprises:
    确定模块,用于在接收到云服务器发送的虚拟磁盘迁移指令时,基于所述虚拟磁盘迁移指令确定目的服务主机;a determining module, configured to determine a destination service host based on the virtual disk migration instruction when receiving a virtual disk migration instruction sent by the cloud server;
    迁移模块,用于将本地虚拟磁盘迁移至确定的所述目的服务主机;a migration module, configured to migrate a local virtual disk to the determined destination service host;
    所述发送模块,还用于在检测到本地虚拟磁盘迁移完成时,通过所述同步服务器程序将迁移完成指令发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,并建立与所述目的服务主机的通信连接,以继续进行虚拟磁盘的备份服务。The sending module is further configured to send, by using the synchronization server program, a migration completion instruction to the backup host when the local virtual disk migration is completed, to be received by the backup host by using the synchronization client program. When the migration completes the instruction, the communication connection with the service host is closed, and a communication connection with the destination service host is established to continue the backup service of the virtual disk.
  13. 一种服务主机,其特征在于,所述服务主机包括处理器、网络接口及存储器,所述存储器中存储有虚拟磁盘备份程序;A service host, comprising: a processor, a network interface, and a memory, wherein the memory stores a virtual disk backup program;
    所述网络接口用于连接云服务器和备份主机,与所述云服务器和所述备份主机进行数据通信;The network interface is configured to connect to the cloud server and the backup host, and perform data communication with the cloud server and the backup host;
    所述处理器用于执行所述虚拟磁盘备份程序,以实现以下步骤:The processor is configured to execute the virtual disk backup program to implement the following steps:
    在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;When receiving the virtual disk backup instruction sent by the cloud server, starting a preset synchronization server program;
    截取本地虚拟磁盘的虚拟磁盘写操作;Intercept the virtual disk write operation of the local virtual disk;
    将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。And the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
  14. 如权利要求13所述的服务主机,其特征在于,所述处理器还用于执行所述虚拟磁盘备份程序,以实现以下步骤:The service host of claim 13, wherein the processor is further configured to execute the virtual disk backup program to implement the following steps:
    在检测到本地虚拟磁盘出现故障时,截取本地虚拟磁盘的虚拟磁盘读写操作;Intercepting the virtual disk read and write operations of the local virtual disk when it detects that the local virtual disk fails;
    通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘以执行所述虚拟磁盘读写操作,并反馈执行结果至服务主机。And sending, by the synchronization server program, the intercepted virtual disk read and write operations to the backup host, when the backup host receives the virtual disk read and write operations through the synchronization client program, calling the The virtual disk is backed up to perform the virtual disk read and write operations, and the execution result is fed back to the service host.
  15. 如权利要求13所述的服务主机,其特征在于,所述处理器还用于执行所述虚拟磁盘备份程序,以实现以下步骤:The service host of claim 13, wherein the processor is further configured to execute the virtual disk backup program to implement the following steps:
    在接收到云服务器发送的虚拟磁盘迁移指令时,基于所述虚拟磁盘迁移指令确定目的服务主机;Upon receiving the virtual disk migration instruction sent by the cloud server, determining the destination service host based on the virtual disk migration instruction;
    将本地虚拟磁盘迁移至确定的所述目的服务主机;Migrating a local virtual disk to the determined destination service host;
    在检测到本地虚拟磁盘迁移完成时,通过所述同步服务器程序将迁移完成指令发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,并建立与所述目的服务主机的通信连接,以继续进行虚拟磁盘的备份服务。Upon detecting completion of the local virtual disk migration, sending, by the synchronization server program, a migration completion instruction to the backup host, for the backup host to close when receiving the migration completion instruction by the synchronization client program A communication connection with the service host and establishing a communication connection with the destination service host to continue the backup service of the virtual disk.
  16. 一种存储介质,其特征在于,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现以下步骤:A storage medium characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following steps:
    在接收到云服务器发送的虚拟磁盘备份指令时,启动预设的同步服务器程序;When receiving the virtual disk backup instruction sent by the cloud server, starting a preset synchronization server program;
    截取本地虚拟磁盘的虚拟磁盘写操作;Intercept the virtual disk write operation of the local virtual disk;
    将截取的所述虚拟磁盘写操作通过所述同步服务器程序发送至备份主机,以供所述备份主机通过预设的同步客户端程序接收到所述虚拟磁盘写操作时,将接收到的所述虚拟磁盘写操作写到备份虚拟磁盘中。And the intercepted virtual disk write operation is sent to the backup host by the synchronization server program, where the backup host receives the virtual disk write operation through a preset synchronization client program, and the received The virtual disk write operation is written to the backup virtual disk.
  17. 如权利要求16所述的存储介质,其特征在于,所述一个或者多个程序还可被一个或者多个处理器执行,以实现以下步骤:The storage medium of claim 16 wherein said one or more programs are further executable by one or more processors to implement the following steps:
    在检测到本地虚拟磁盘出现故障时,截取本地虚拟磁盘的虚拟磁盘读写操作;Intercepting the virtual disk read and write operations of the local virtual disk when it detects that the local virtual disk fails;
    通过所述同步服务器程序将截取的所述虚拟磁盘读写操作发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述虚拟磁盘读写操作时,调用所述备份虚拟磁盘以执行所述虚拟磁盘读写操作,并反馈执行结果至服务主机。And sending, by the synchronization server program, the intercepted virtual disk read and write operations to the backup host, when the backup host receives the virtual disk read and write operations through the synchronization client program, calling the The virtual disk is backed up to perform the virtual disk read and write operations, and the execution result is fed back to the service host.
  18. 如权利要求16所述的存储介质,其特征在于,所述一个或者多个程序还可被一个或者多个处理器执行,以实现以下步骤:The storage medium of claim 16 wherein said one or more programs are further executable by one or more processors to implement the following steps:
    在接收到云服务器发送的虚拟磁盘迁移指令时,基于所述虚拟磁盘迁移指令确定目的服务主机;Upon receiving the virtual disk migration instruction sent by the cloud server, determining the destination service host based on the virtual disk migration instruction;
    将本地虚拟磁盘迁移至确定的所述目的服务主机;Migrating a local virtual disk to the determined destination service host;
    在检测到本地虚拟磁盘迁移完成时,通过所述同步服务器程序将迁移完成指令发送至所述备份主机,以供所述备份主机通过所述同步客户端程序接收到所述迁移完成指令时,关闭与所述服务主机的通信连接,并建立与所述目的服务主机的通信连接,以继续进行虚拟磁盘的备份服务。 Upon detecting completion of the local virtual disk migration, sending, by the synchronization server program, a migration completion instruction to the backup host, for the backup host to close when receiving the migration completion instruction by the synchronization client program A communication connection with the service host and establishing a communication connection with the destination service host to continue the backup service of the virtual disk.
PCT/CN2017/089483 2016-12-30 2017-06-22 Virtual disk backup system, method, apparatus, service host and storage medium WO2018120680A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611270900.3A CN107038096B (en) 2016-12-30 2016-12-30 Virtual disk standby system, method and apparatus
CN201611270900.3 2016-12-30

Publications (1)

Publication Number Publication Date
WO2018120680A1 true WO2018120680A1 (en) 2018-07-05

Family

ID=59530861

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/089483 WO2018120680A1 (en) 2016-12-30 2017-06-22 Virtual disk backup system, method, apparatus, service host and storage medium

Country Status (2)

Country Link
CN (1) CN107038096B (en)
WO (1) WO2018120680A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362432A (en) * 2019-07-23 2019-10-22 深信服科技股份有限公司 A kind of backup method, device, equipment and storage medium
CN112527596A (en) * 2020-12-03 2021-03-19 福建省索菲特智能工程有限公司 Method for judicial supervision safety monitoring
CN113778629A (en) * 2021-09-22 2021-12-10 江苏安超云软件有限公司 Real-time backup method based on local storage in cloud platform and application
CN113821300A (en) * 2021-08-26 2021-12-21 济南浪潮数据技术有限公司 Virtual machine management method and related device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107995319B (en) * 2018-01-08 2021-05-18 迈普通信技术股份有限公司 Virtual device configuration method and network device
CN108304281A (en) * 2018-02-28 2018-07-20 南京铱迅信息技术股份有限公司 A kind of method that virtual machine is backed up in realtime
CN110324375B (en) * 2018-03-29 2020-12-04 华为技术有限公司 Information backup method and related equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080177809A1 (en) * 2007-01-24 2008-07-24 Hitachi, Ltd. Storage control device to backup data stored in virtual volume
CN103713860A (en) * 2014-01-03 2014-04-09 浪潮(北京)电子信息产业有限公司 Method and system for building virtual disk base on basis of backup architecture
CN104809020A (en) * 2013-11-20 2015-07-29 华为技术有限公司 Snapshot generating method, system and device
CN105224391A (en) * 2015-10-12 2016-01-06 浪潮(北京)电子信息产业有限公司 A kind of online backup method and system of virtual machine
CN106250267A (en) * 2016-07-22 2016-12-21 浪潮(北京)电子信息产业有限公司 The data back up method of a kind of virtual machine and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7356573B2 (en) * 2005-07-08 2008-04-08 Cisco Technology, Inc. Apparatus and methods for data tapping in a storage area network
CN102855163B (en) * 2011-06-27 2016-03-30 华为软件技术有限公司 A kind of memory database hot-standby method and main frame

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080177809A1 (en) * 2007-01-24 2008-07-24 Hitachi, Ltd. Storage control device to backup data stored in virtual volume
CN104809020A (en) * 2013-11-20 2015-07-29 华为技术有限公司 Snapshot generating method, system and device
CN103713860A (en) * 2014-01-03 2014-04-09 浪潮(北京)电子信息产业有限公司 Method and system for building virtual disk base on basis of backup architecture
CN105224391A (en) * 2015-10-12 2016-01-06 浪潮(北京)电子信息产业有限公司 A kind of online backup method and system of virtual machine
CN106250267A (en) * 2016-07-22 2016-12-21 浪潮(北京)电子信息产业有限公司 The data back up method of a kind of virtual machine and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362432A (en) * 2019-07-23 2019-10-22 深信服科技股份有限公司 A kind of backup method, device, equipment and storage medium
CN110362432B (en) * 2019-07-23 2023-12-29 深信服科技股份有限公司 Backup method, device, equipment and storage medium
CN112527596A (en) * 2020-12-03 2021-03-19 福建省索菲特智能工程有限公司 Method for judicial supervision safety monitoring
CN113821300A (en) * 2021-08-26 2021-12-21 济南浪潮数据技术有限公司 Virtual machine management method and related device
CN113778629A (en) * 2021-09-22 2021-12-10 江苏安超云软件有限公司 Real-time backup method based on local storage in cloud platform and application

Also Published As

Publication number Publication date
CN107038096A (en) 2017-08-11
CN107038096B (en) 2018-01-19

Similar Documents

Publication Publication Date Title
WO2018120680A1 (en) Virtual disk backup system, method, apparatus, service host and storage medium
WO2018120681A1 (en) Data synchronization method, device and system, data processing server, and storage medium
WO2019127971A1 (en) Image synchronization method for image registry, system, device, and storage medium
WO2015020471A1 (en) Method and apparatus for distributing data in hybrid cloud environment
WO2017088664A1 (en) Data processing method and apparatus for cluster file system
WO2018076868A1 (en) Data synchronization method, device and system, storage medium and server
WO2015102220A1 (en) Storage system having security storage device and management method therefor
WO2015016516A1 (en) Method and device for managing tab window indicating application group including heterogeneous applications
WO2015041436A1 (en) Method of managing control right, client device therefor, and master device therefor
WO2015109804A1 (en) Dual-server hot-backup disaster recovery system for network service in virtualization environment and method therefor
WO2018076812A1 (en) Data request response method and device, storage medium, server and system
WO2016013906A1 (en) Electronic apparatus for executing virtual machine and method for executing virtual machine
WO2018233370A1 (en) Method, system, device, and computer readable storage medium for synchronizing image
WO2019103280A1 (en) Electronic device and method for managing computing resources of at least one cloud server for providing cloud service
WO2016065619A1 (en) Data traffic management method and device
WO2019078617A1 (en) Electronic apparatus and method for voice recognition
WO2018076840A1 (en) Data sharing method, device, storage medium and server
WO2021118125A1 (en) Secure container construction device and method executable by android application, and computer-readable recording medium on which program thereof is recorded
WO2020149520A1 (en) Firmware updating method, and electronic apparatus and storage media for same
EP3539046A1 (en) Electronic device and method for managing data in electronic device
WO2020073450A1 (en) Multi-split air conditioner, and control method and device thereof, and computer readable storage medium
WO2017118170A1 (en) Method and system for customizing launcher of mobile terminal
WO2021025497A1 (en) Electronic device and method for sharing data thereof
WO2023033588A1 (en) System for controlling data flow in virtualization terminal, and method thereof
WO2020253125A1 (en) Log management method, apparatus, and device, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17886353

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 08.10.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17886353

Country of ref document: EP

Kind code of ref document: A1