WO2020015709A1 - Virtual machine mirror image file processing method and device - Google Patents

Virtual machine mirror image file processing method and device Download PDF

Info

Publication number
WO2020015709A1
WO2020015709A1 PCT/CN2019/096593 CN2019096593W WO2020015709A1 WO 2020015709 A1 WO2020015709 A1 WO 2020015709A1 CN 2019096593 W CN2019096593 W CN 2019096593W WO 2020015709 A1 WO2020015709 A1 WO 2020015709A1
Authority
WO
WIPO (PCT)
Prior art keywords
client
file
virtual machine
backup
image file
Prior art date
Application number
PCT/CN2019/096593
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 WO2020015709A1 publication Critical patent/WO2020015709A1/en

Links

Images

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/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances

Definitions

  • Virtualization technology can realize the efficient use of physical machine hardware resources.
  • physical machines and their operating systems are collectively called host machines, and virtual machines and their operating systems are collectively called clients. Because the guest needs to read and write a large number of virtual machine image files when the client is started, there are often situations where the virtual machine image file is damaged and the guest cannot be started, which affects the user experience.
  • FIG. 1 shows a first block schematic diagram of a host machine provided by the present disclosure.
  • FIG. 2 shows a flowchart of a method for processing a virtual machine image file applied to a first client provided by the present disclosure.
  • FIG. 3 shows a flowchart of a virtual machine image file processing method applied to a host machine provided by the present disclosure.
  • FIG. 4 shows a second block diagram of a host machine provided by the present disclosure.
  • FIG. 5 shows a block diagram of a first virtual machine image file processing apparatus provided by the present disclosure.
  • FIG. 6 shows a block diagram of a second virtual machine image file processing apparatus provided by the present disclosure.
  • Icons 10-host machine; 20-client; 101-processor; 102-memory; 103-bus; 104-communication interface; 200- first virtual machine image file processing device; 201- first execution module; 202- Sending module; 203- first receiving module; 204- second execution module; 300- second virtual machine image file processing device; 301- second receiving module; 302- file backup module; 303- file generation module; 304- create Module; 305-detection module; 306-third receiving module; 307-file recovery module; 308-query module; 309-file acquisition module; 310-execution module.
  • FIG. 1 is a schematic block diagram of a host machine 10 provided by the present disclosure.
  • the host machine 10 runs at least one client 20, and the client 20 is a virtual hardware system running on the host machine 10, also called a virtual machine, which has a CPU (Central Processing Unit), memory, a network card, a hard disk, etc.
  • Hardware which is divided and virtualized from the physical hardware resources of the host machine 10 running the client 20, is not a real physical entity.
  • the host machine 10 may be, but is not limited to, a personal computer (PC), a physical server, etc.
  • the first client is any one of the at least one client 20, in other words, any one running on the host machine 10
  • the client 20 may be referred to as a first client.
  • the information of the client 20 is stored in a hardware configuration file and a virtual machine image file.
  • the hardware configuration file stores the number of CPUs, memory capacity, number of network cards / types of the client 20, and the virtual machine image file of the client on the host machine.
  • Information such as the storage path on 10, and the virtual machine image file store information such as the boot program of the client 20 and the operating system data file.
  • KVM Kernel-based Virtual Machine
  • the startup process of the client 20 consists of two parts: 1. KVM on the host 10 Create a virtual machine hardware environment such as CPU, memory, and IO devices according to the hardware configuration file (eg, virtual machine xml configuration file); 2. Load the boot program and operating system data file of the virtual machine image file to complete the startup process of the guest 20 operating system .
  • the hardware configuration file e.g, virtual machine xml configuration file
  • the boot program and operating system data file of the virtual machine image file to complete the startup process of the guest 20 operating system .
  • the virtual machine image file has a complex structure, and the client 20 often writes to it during the running process, this easily leads to damage to the virtual machine image file.
  • the virtual machine image file will be damaged.
  • the virtual machine image file is a black box.
  • the host machine 10 has difficulty in knowing the content of the virtual machine image file and cannot repair the damaged virtual machine image file. This means that once the virtual machine The machine image file is damaged and the client 20 will fail to start.
  • the virtual machine image file is usually backed up and restored using the backup file after it is damaged.
  • the backup and restoration of the virtual machine image file can only be performed by the host administrator (host user), and it is not possible to ensure that the client files saved in the backup virtual machine image file are complete, so that the subsequent use of the backup virtual machine image file When recovering, the client 20 is likely to be abnormal or even fail to start.
  • a backup operation can be performed on the client 20 when the client 20 is running normally, and the client 20 can be restored according to the backup client 20 when the client 20 starts abnormally.
  • the backup operation to the client 20 is to back up the hardware configuration file and the virtual machine image file that store all the information of the client 20
  • the recovery operation to the client 20 is to back up the hardware configuration file and the virtual machine image file. Copy over the original file. Because the information in the hardware configuration file is highly stable, and the information in the virtual machine image file is constantly changing during the operation of the client 20, as long as the accuracy of the backup virtual machine image file is ensured, the client 20 can be guaranteed Reliable startup.
  • the present disclosure provides a virtual machine image file processing method and device, which are described in detail below.
  • FIG. 2 is a schematic flowchart of a method for processing a virtual machine image file provided by the present disclosure. The method is applied to a first client. The following describes each step of the method for processing a virtual machine image file for a first client.
  • step S101 in response to the user's file backup operation, the data writing transaction in the first client is stopped.
  • the file backup operation may be a trigger operation of a user of the first client to back up the virtual machine image file of the first client.
  • the user of the first client triggers the file backup operation, for example, the user of the first client enters an instruction characterizing the file backup operation, or clicks a control characterizing the file backup operation.
  • the first client After the user triggers the file backup operation, the first client first stops the data writing transaction in the first client.
  • the data writing transaction may be a transaction in which the file system of the first client writes data into the virtual machine image file. In other words, the file system of the first client no longer writes data into the virtual machine image file. In this way, it can be at least partially ensured that the virtual machine image file backed up by the host machine 10 is a complete first client file.
  • Step S102 Send a file backup request to the host machine, so that the host machine backs up the virtual machine image file of the first client according to the file backup request.
  • a file backup request is initiated to the host machine 10.
  • the file backup request may be a confirmation instruction for backing up the virtual machine image file of the first client.
  • the host machine 10 After receiving the file backup request, start copying the virtual machine image file to the backup directory of the first client that is established in advance.
  • the backup directory can store the backup virtual machine image file and the name, storage time, and time of the backup virtual machine image file.
  • a backup directory of each client 20 running on the host machine 10 may be established in advance, and the backup directory is configured to store at least one backup virtual machine image file corresponding to the client 20 and each backup virtual machine image file. Name, storage time, storage path of the backup virtual machine image file on the host machine 10, and the like.
  • Step S103 Receive a backup completion instruction fed back by the host, and restart the data writing transaction in the first client according to the backup completion instruction.
  • the host 10 feeds back the backup completion instruction to the first client.
  • the first client restarts the data writing transaction, that is, allows The file system of the first client writes data into the virtual machine image file.
  • the present disclosure may further include step S104.
  • Step S104 In response to the user's file recovery operation, send a file recovery request to the host machine, so that the host machine recovers the virtual machine image file of the first client according to the file recovery request.
  • the file restoration operation may be an operation triggered after a user of the first client obtains a backup directory of the first client stored by the host machine 10 and selects a backup virtual machine image file to be restored from the backup directory.
  • Or may be an operation triggered by a user of the first client after entering information such as a name of a backup virtual machine image file to be restored.
  • the first client After the user of the first client triggers the file recovery operation, the first client sends a file recovery request to the host machine 10, and the file recovery request may include the name of the file to be recovered.
  • the host computer 10 After receiving the file restoration request, the host computer 10 first closes the first client according to the file restoration request; then, according to the name of the file to be restored, from the backup directory corresponding to the first client, a A backup virtual machine image file name, using the backup virtual machine image file corresponding to the backup virtual machine image file name as a target backup virtual machine image file, and replacing the current virtual machine image file of the first client with the target backup virtual machine image file, To restore the virtual machine image file of the first client; finally, after the restoration of the virtual machine image file of the first client is completed, start the first client.
  • file backup request and file restoration request in the present disclosure can be transmitted via the aforementioned communication channel developed by the serial port protocol.
  • the backup / recovery process of the virtual machine image file is usually performed by the host machine 10, and the user of the client 20 can only operate the client 20 and cannot see the file system of the host machine 10.
  • the process of backing up / restoring the virtual machine image file can only be triggered by the user of the host machine 10, especially when multiple clients 20 are running on the host machine 10 and the users of each client 20 are different, the host will be greatly increased.
  • the maintenance workload of the users of the host 10 results in poor maintenance efficiency. For example, the users of the host 10 cannot back up / restore the virtual machine image files of the respective clients 20 in a timely manner.
  • the user of the client 20 can independently complete the backup / restore operation of the virtual machine image file of the client 20 without the assistance of the user of the host machine 10, thereby reducing the
  • the maintenance workload improves the maintenance efficiency of the user of the host machine 10, reduces the degree of coupling between the host machine 10 and the client 20, and improves security.
  • the client may write data to the virtual machine image file in parallel, resulting in the backup virtual machine image file finally obtained by the host machine. Is incomplete.
  • the file system of the client 20 is first prohibited from writing data to the virtual machine image file, and then a file backup request is sent to the host machine 10 After receiving the file backup request, the host machine 10 backs up the virtual machine image file of the client 20 and feeds back the backup completion instruction to the client 20 after the backup is completed.
  • the client 20 After receiving the backup completion instruction, the client 20 allows the first The client's file system writes data to the virtual machine image file, so that it can ensure that the virtual machine image file backed up by the host machine 10 is a complete client file, which can at least partially effectively prevent the incomplete backup virtual machine from being restored.
  • the image file causes the client 20 to be abnormal or even fail to start.
  • FIG. 3 is a schematic flowchart of another method for processing a virtual machine image file provided by the present disclosure.
  • the method can be applied to the host machine 10.
  • Each step of the method for processing a virtual machine image file for the host machine 10 will be described below.
  • Step S201 Receive a file backup request sent by a first client, where the file backup request is generated by the first client in response to a user's file backup operation, and the first client stops data in the first client in response to the file backup operation Write transaction.
  • a user of the first client triggers a file backup operation when the first client is normally running.
  • the first client first stops data writing transactions in the first client, that is, prohibits the first client.
  • the client's file system writes data to the virtual machine image file; and then sends a file backup request to the host machine 10.
  • the file backup request may be a confirmation instruction for backing up the virtual machine image file of the first client.
  • step S202 the virtual machine image file of the first client is backed up to obtain a backup virtual machine image file according to the file backup request, and the backup completion instruction is fed back to the first client after the backup is completed to restart the data writing in the first client.
  • a backup directory for each client 20 running on the host machine 10 may be established in advance.
  • the backup directory is used to store at least one backup virtual machine image file of the client 20 and the name of each backup virtual machine image file, The storage time, the storage path of the backup virtual machine image file on the host machine 10, and the like.
  • the host 10 after receiving the file backup request sent by the first client, the host 10 starts to copy the virtual machine image file of the first client and stores the backup virtual machine image file to a backup directory corresponding to the first client. In addition, information such as the name of the backup virtual machine image file, the storage time, and the storage path on the host machine 10 are also stored. After the copying is completed, the host 10 feeds back the backup completion instruction to the first client, so that the first client restarts the data writing transaction, that is, allows the file system of the first client to write data to the virtual machine image file.
  • the host machine 10 when the client 20 cannot be started, the host machine 10 is required to use the backup virtual machine image file of the client 20 to restore the current virtual machine image file, but the backup virtual machine image file may not be reliable. It will cause the client 20 to fail to start successfully after the virtual machine image file is restored, and it is necessary to repeatedly restore the virtual machine image file. As a result, the client 20 cannot provide external services for a long time. At the same time, the host machine 10 and the client machine are reduced. The coupling degree of 20 and the maintenance workload of 10 users of the host machine. Therefore, after the host machine 10 backs up the virtual machine image file of the first client, the reliability check of the backup virtual machine image file can be performed to reduce the service interruption time of the first client due to accident to a minimum.
  • the backup is skillfully detected by judging whether the backup virtual machine image file can successfully start the first client.
  • the reliability of the virtual machine image file is running. If you stop it, it will cause service interruption. Therefore, you can re-create a second client similar to the first client to complete the reliability check of the backup virtual machine image file.
  • the disclosure may further include steps S203 to S205.
  • Step S203 Obtain a hardware configuration file of the first client, and generate a detection configuration file according to the hardware configuration file.
  • the specific information may be, for example, but not limited to, a UUID (Universally Unique Identifier), a virtual machine name, a serial port channel name between the host 10 and the first client, and the like.
  • the specific information may be called For conflict information.
  • the conflict information in the hardware configuration file of the first client may be modified to obtain a detection configuration file, so as to avoid a conflict between the second client and the first client generated subsequently.
  • Step S204 Create a second client according to the detection configuration file and the backup virtual machine image file.
  • step S205 the second client is controlled to start.
  • the second client is successfully started, it is determined that the backup virtual machine image file passes the reliability detection and a reliability flag is added.
  • whether the second client is successfully started can be detected by whether the handshake between the host 10 and the second client is successful. Specifically, a handshake time (for example, 5 minutes) can be set. After the second client, if the host 10 and the second client successfully shake hands within the handshake time, it is determined that the backup virtual machine image file passes the reliability check. When the backup virtual machine image file passes the reliability test, a reliability mark is added to identify the backup virtual machine image file as reliable, and the second client is deleted.
  • a handshake time for example, 5 minutes
  • the hardware configuration file and the backup virtual machine image file can be copied, and a detection configuration is generated according to the copied hardware configuration file. File, and a second guest is created based on the detection configuration file and the copied backup virtual machine image file. Correspondingly, after the reliability test is completed, the test configuration file and the copied backup virtual machine image file may be deleted.
  • a file restoration request may be sent to the host machine 10, so that the host machine 10 uses the backup virtual machine image file of the backup first client to restore the virtual machine image file of the first client, therefore, the present disclosure further includes step S206 ⁇ Step S207.
  • Step S206 Receive a file recovery request sent by the first client, where the file recovery request is generated by the first client in response to a file recovery operation of the user.
  • the first client when the first client can be started, but the user data of the first client is incomplete (for example, the database is corrupted, etc.), or some important business processes (for example, the data sending and receiving process, etc.) cannot be started, the first A user of a client may trigger a file recovery operation.
  • the file recovery operation may be that the user of the first client obtains a backup directory of the first client stored by the host machine 10 and selects a backup virtual machine to be restored from the backup directory. Action triggered after mirroring the file.
  • the first client After receiving the file recovery operation, the first client sends a file recovery request to the host machine 10.
  • step S207 the first client is shut down according to the file restoration request, and the virtual machine image file of the first client is restored, and then the first client is restarted.
  • the file restoration request may include a name of a file to be restored, and at least one backup virtual machine image file corresponding to the first client and a name of each backup virtual machine image file are stored in the host machine 10 in advance.
  • the host machine 10 After receiving the file restoration request sent by the first client, the host machine 10 first closes the first client; then, based on the name of the file to be restored and the name of each backup virtual machine image file, from at least one backup virtual machine image file Determine the backup virtual machine image file to be restored, and use the backup virtual machine image file to be restored to replace the current virtual machine image file of the first client; after the replacement is completed, start the first client.
  • the present disclosure further includes steps S208 to S210.
  • Step S208 When it is detected that the first client cannot be started, query whether at least one backup virtual machine image file corresponding to the first client exists a backup virtual machine image file with a reliability mark.
  • the host 10 can determine whether the first client is successfully started by shaking hands with the first client. If the host 10 and the first client fail to shake hands within a preset handshake time (for example, 3-5 minutes), the host 10 determines The first client cannot be started successfully. At this time, the host machine 10 can query whether there is a backup virtual machine image file with a reliability mark in the backup directory corresponding to the first client, that is, whether there is a reliable backup virtual machine image file. If there is a backup virtual machine image file with a reliability flag in the at least one backup virtual machine image file corresponding to the first client, step S209 is performed.
  • Step S209 Obtain the backup virtual machine image file with the latest storage time from all the backup virtual machine image files with the reliability mark as the target virtual machine image file.
  • the host machine 10 when the host machine 10 detects the existence of a backup virtual machine image file with a reliability mark in the backup directory corresponding to the first client, it obtains the storage time of each backup virtual machine image file with a reliability mark. By using the backup virtual machine image file with the latest storage time as the target virtual machine image file, and then using the target virtual machine image file to restore the first client, the first client can be restored to the state before the exception occurred.
  • Step S210 Restore the virtual machine image file of the first client according to the target virtual machine image file.
  • the first client is closed first, and then the current virtual machine image file of the first client is replaced with the target virtual machine image file, and after the replacement of the target virtual machine image file is completed , Restart the first client.
  • the method for processing a virtual machine image file provided by the present disclosure firstly, after the host machine 10 completes the backup operation of the virtual machine image file, it automatically performs a reliability check on the backup virtual machine image file, and backs up the virtual machine image that has passed the reliability test. Add a reliability flag to the file.
  • the first client when it is detected that the first client cannot be started, the first client can be restored by using the backup virtual machine image file with the reliability flag and the latest storage time, so that the first client can be detected
  • the machine fails to start, it directly finds the corresponding reliable backup virtual machine image file to restore the current virtual machine image file, thereby effectively reducing the time that the first client cannot provide services, and the entire process can eliminate the need for the host machine 10 users to participate, reducing the host The maintenance workload of the host 10 users.
  • FIG. 4 is a schematic block diagram of a host machine 10 provided by the present disclosure.
  • the host machine 10 includes a processor 101, a memory 102, a bus 103, and a communication interface 104.
  • the processor 101, the memory 102, and the communication interface 104 are connected through the bus 103; the processor 101 is configured to execute executable modules stored in the memory 102, For example, computer programs.
  • the memory 102 may include high-speed random access memory (RAM: Random Access Memory), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM Random Access Memory
  • non-volatile memory such as at least one disk memory.
  • a communication connection between the network element of the system and at least one other network element is achieved through at least one communication interface 104 (which may be wired or wireless).
  • the bus 103 may be an ISA bus, a PCI bus, an EISA bus, or the like. In FIG. 4, only one bidirectional arrow is used, but it does not mean that there is only one bus or one type of bus.
  • the memory 102 is configured to store programs, such as the first virtual machine image file processing device 200 shown in FIG. 5 and the second virtual machine image file processing device 300 shown in FIG. 6.
  • the first virtual machine image file processing device 200 and the second virtual machine image file processing device 300 each include at least one operating system that can be stored in the memory 102 in the form of software or firmware or solidified in the host machine 10 (operating system, OS) software function module.
  • OS operating system
  • the processor 101 may be an integrated circuit chip and has a signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 101 or an instruction in the form of software.
  • the above-mentioned processor 101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (Network Processor) (NP), etc .; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), field programmable gate array (FPGA), complex programmable logic device (Complex Programmable Logic Device, CPLD) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
  • CPU central processing unit
  • NP Network Processor
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • CPLD complex programmable logic device
  • CPLD Complex Programmable Logic Device
  • the present disclosure also provides a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed by the processor 101, the method for processing a virtual machine image file disclosed in the foregoing embodiment is implemented.
  • FIG. 5 illustrates a block diagram of a first virtual machine image file processing apparatus 200 provided by the present disclosure.
  • the first virtual machine image file processing apparatus 200 is applied to a first client, and is functionally divided, and may include a first execution module 201, a sending module 202, a first receiving module 203, and a second execution module 204.
  • the first execution module 201 is configured to stop a data writing transaction in the first client in response to a user file backup operation.
  • the sending module 202 is configured to send a file backup request to the host machine, so that the host machine backs up the virtual machine image file of the first client according to the file backup request.
  • the first receiving module 203 is configured to receive a backup completion instruction fed back by the host, and restart the data writing transaction in the first client according to the backup completion instruction.
  • the second execution module 204 is configured to send a file restoration request to the host machine in response to a file restoration operation of the user, so that the host machine restores the virtual machine image file of the first client according to the file restoration request.
  • FIG. 6 illustrates a block diagram of a second virtual machine image file processing apparatus 300 provided by the present disclosure.
  • the second virtual machine image file processing device 300 is applied to the host machine 10 and is functionally divided, and may include a second receiving module 301, a file backup module 302, a file generating module 303, a creating module 304, a detecting module 305, and a third receiving device.
  • Module 306 file recovery module 307, query module 308, file acquisition module 309, and execution module 310.
  • the second receiving module 301 is configured to receive a file backup request sent by the first client, wherein the file backup request is generated by the first client in response to a file backup operation of the user, and the first client stops the first response to the file backup operation. Data write transactions from the client.
  • the file backup module 302 is configured to perform a backup of the virtual machine image file of the first client to obtain a backup virtual machine image file according to the file backup request, and feed back a backup completion instruction to the first client to restart the first client after the backup is completed. Data in a write transaction.
  • the file generating module 303 is configured to obtain a hardware configuration file of the first client, and generate a detection configuration file according to the hardware configuration file.
  • the creating module 304 is configured to create a second client according to the detection configuration file and the backup virtual machine image file.
  • the detection module 305 is configured to control the startup of the second client. When it is detected that the startup of the second client is successful, it is determined that the backup virtual machine image file passes the reliability detection and adds a reliability flag.
  • the third receiving module 306 is configured to receive a file recovery request sent by the first client, where the file recovery request is generated by the first client in response to a user's file recovery operation.
  • the file recovery module 307 is configured to shut down the first client according to the file recovery request, and recover the virtual machine image file of the first client and restart the first client.
  • the querying module 308 is configured to query whether there is a backup virtual machine image file with a reliability flag in at least one backup virtual machine image file corresponding to the first client when it is detected that the first client cannot be started.
  • the query module 308 queries that there is a backup virtual machine image file with a reliability mark in the at least one backup virtual machine image file corresponding to the first client, the query is performed by the file acquisition module 309.
  • the file obtaining module 309 is configured to obtain storage from all backup virtual machine image files with reliability marks when there are backup virtual machine image files with reliability marks in at least one backup virtual machine image file corresponding to the first client.
  • the latest backup virtual machine image file is used as the target virtual machine image file.
  • the execution module 310 is configured to restore the virtual machine image file of the first client according to the target virtual machine image file.
  • the user of the client can independently complete the backup / restore operation of the virtual machine image file of the client without the assistance of the host user, reducing the host
  • the user's maintenance workload reduces the coupling between the host and the client and improves security.
  • the client's file system is first prohibited from writing data to the virtual machine image file before sending a file backup request to the host, and after receiving the backup completion instruction sent by the host, it is allowed
  • the file system of the first client writes data into the virtual machine image file, thereby effectively avoiding the situation that the guest is abnormal or even unable to start due to the restoration of an incomplete backup virtual machine image file.
  • the reliability of the backup virtual machine image file is checked, thereby avoiding the subsequent use of the backup virtual machine image one by one because it is impossible to determine whether each backup virtual machine image file is reliable.
  • each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, which contains one or more components for implementing a specified logical function Executable instructions.
  • the functions marked in the blocks may also occur in a different order than those marked in the drawings.
  • each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or action. , Or it can be implemented with a combination of dedicated hardware and computer instructions.
  • the functional modules in the various embodiments of the present disclosure may be integrated together to form an independent part, or each of the modules may exist alone, or two or more modules may be integrated to form an independent part.
  • the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present disclosure is essentially a part that contributes to the existing technology or a part of the technical solution may be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in various embodiments of the present disclosure.
  • the foregoing storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes .
  • relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is any such actual relationship or order among them.
  • the terms "including”, “comprising”, or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also those that are not explicitly listed Or other elements inherent to such a process, method, article, or device. Without more restrictions, the elements defined by the sentence “including a " do not exclude the existence of other identical elements in the process, method, article, or equipment including the elements.
  • a method and device for processing a virtual machine image file provided by the present disclosure can complete the backup and / or restore operation of a virtual machine image file only triggered by a client user, which reduces the maintenance workload of the host machine user.
  • the problem that the guest cannot start due to incomplete or abnormal backup virtual machine image files is effectively improved, and the problem that the service is interrupted for too long is effectively improved.

Abstract

The present disclosure relates to the technical field of virtualization, and provided thereby are a virtual machine mirror image file processing method and apparatus, which are applied to a method for processing a virtual machine mirror image file of a first client, comprising: responding to a file backup operation of a user, and stopping a data write-in transaction in a first client; sending a file backup request to a host computer such that the host computer backs up a virtual machine mirror image file of the first client according to the file backup request; receiving a backup completion instruction fed back by the host computer, and restarting the data write-in transaction in the first client according to the backup completion instruction. The present disclosure may reduce the amount of maintenance work by a user of a host computer, thereby increasing the maintenance efficiency of users of host computers; in addition, reliability in starting up a client may further be effectively ensured.

Description

虚拟机镜像文件处理方法及装置Method and device for processing virtual machine image file
相关申请的交叉引用Cross-reference to related applications
本申请要求于2018年07月20日提交中国专利局的申请号为2018108037549,名称为“虚拟机镜像文件处理方法及装置”,其全部内容通过引用结合在本申请中。This application requires that the application number of 2018108037549, which is filed on July 20, 2018, of the Chinese Patent Office, and which is called "Virtual Machine Image File Processing Method and Device", the entire contents of which are incorporated herein by reference.
背景技术Background technique
随着虚拟化和云计算技术的发展,越来越多的物理机采用虚拟化技术,虚拟化技术可以实现对物理机硬件资源的高效使用。在支持虚拟化的环境中,物理机及其操作系统统称为宿主机,虚拟机及其操作系统统称为客户机。由于客户机启动时需要对虚拟机镜像文件进行大量读写,故经常存在虚拟机镜像文件损坏导致客户机无法启动的情形,影响用户体验。With the development of virtualization and cloud computing technology, more and more physical machines adopt virtualization technology. Virtualization technology can realize the efficient use of physical machine hardware resources. In an environment that supports virtualization, physical machines and their operating systems are collectively called host machines, and virtual machines and their operating systems are collectively called clients. Because the guest needs to read and write a large number of virtual machine image files when the client is started, there are often situations where the virtual machine image file is damaged and the guest cannot be started, which affects the user experience.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本公开的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to explain the technical solution of the present disclosure more clearly, the drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be used. It is regarded as a limitation on the scope. For a person of ordinary skill in the art, other related drawings can be obtained according to these drawings without paying creative labor.
图1示出了本公开提供的宿主机的第一方框示意图。FIG. 1 shows a first block schematic diagram of a host machine provided by the present disclosure.
图2示出了本公开提供的应用于第一客户机的虚拟机镜像文件处理方法流程图。FIG. 2 shows a flowchart of a method for processing a virtual machine image file applied to a first client provided by the present disclosure.
图3示出了本公开提供的应用于宿主机的虚拟机镜像文件处理方法流程图。FIG. 3 shows a flowchart of a virtual machine image file processing method applied to a host machine provided by the present disclosure.
图4示出了本公开提供的宿主机的第二方框示意图。FIG. 4 shows a second block diagram of a host machine provided by the present disclosure.
图5示出了本公开提供的第一虚拟机镜像文件处理装置的方框示意图。FIG. 5 shows a block diagram of a first virtual machine image file processing apparatus provided by the present disclosure.
图6示出了本公开提供的第二虚拟机镜像文件处理装置的方框示意图。FIG. 6 shows a block diagram of a second virtual machine image file processing apparatus provided by the present disclosure.
图标:10-宿主机;20-客户机;101-处理器;102-存储器;103-总线;104-通信接口;200-第一虚拟机镜像文件处理装置;201-第一执行模块;202-发送模块;203-第一接收模块;204-第二执行模块;300-第二虚拟机镜像文件处理装置;301-第二接收模块;302-文件备份模块;303-文件生成模块;304-创建模块;305-检测模块;306-第三接收模块;307-文件恢复模块;308-查询模块;309-文件获取模块;310-执行模块。Icons: 10-host machine; 20-client; 101-processor; 102-memory; 103-bus; 104-communication interface; 200- first virtual machine image file processing device; 201- first execution module; 202- Sending module; 203- first receiving module; 204- second execution module; 300- second virtual machine image file processing device; 301- second receiving module; 302- file backup module; 303- file generation module; 304- create Module; 305-detection module; 306-third receiving module; 307-file recovery module; 308-query module; 309-file acquisition module; 310-execution module.
具体实施方式detailed description
下面将结合本公开中附图,对本公开中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供 的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。The technical solutions in the present disclosure will be described clearly and completely in combination with the accompanying drawings in the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, but not all the embodiments. The components of the present disclosure, which are generally described and illustrated in the drawings herein, may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely to indicate selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本公开的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。It should be noted that similar reference numerals and letters indicate similar items in the following drawings, so once an item is defined in one drawing, it need not be further defined and explained in subsequent drawings. Meanwhile, in the description of the present disclosure, the terms “first”, “second”, and the like are only used to distinguish descriptions, and cannot be understood to indicate or imply relative importance.
请参照图1,图1示出了本公开提供的宿主机10的方框示意图。宿主机10上运行至少一个客户机20,客户机20是运行于宿主机10上的虚拟硬件系统,又称虚拟机,其具有CPU(Central Processing Unit,中央处理器)、内存、网卡、硬盘等硬件,这些硬件是从运行客户机20的宿主机10的物理硬件资源中划分并虚拟而来的,并非是真正的物理实体。宿主机10的操作系统和客户机20的操作系统之间有一个以串口协议开发的通信通道,可供宿主机10的操作系统和客户机20的操作系统之间传递信息。宿主机10可以是,但不限于个人电脑(personal computer,PC)、物理服务器等等,第一客户机是至少一个客户机20中的任意一个,换句话说,宿主机10上运行的任意一个客户机20可以称为第一客户机。Please refer to FIG. 1, which is a schematic block diagram of a host machine 10 provided by the present disclosure. The host machine 10 runs at least one client 20, and the client 20 is a virtual hardware system running on the host machine 10, also called a virtual machine, which has a CPU (Central Processing Unit), memory, a network card, a hard disk, etc. Hardware, which is divided and virtualized from the physical hardware resources of the host machine 10 running the client 20, is not a real physical entity. There is a communication channel developed by the serial port protocol between the operating system of the host machine 10 and the operating system of the client 20, which can be used to transfer information between the operating system of the host machine 10 and the operating system of the client 20. The host machine 10 may be, but is not limited to, a personal computer (PC), a physical server, etc. The first client is any one of the at least one client 20, in other words, any one running on the host machine 10 The client 20 may be referred to as a first client.
客户机20的信息被存储在一个硬件配置文件和一个虚拟机镜像文件中,硬件配置文件存储客户机20的CPU个数、内存容量、网卡数量/类型以及客户机的虚拟机镜像文件在宿主机10上的存储路径等信息,虚拟机镜像文件存储客户机20的引导程序及操作系统数据文件等信息。The information of the client 20 is stored in a hardware configuration file and a virtual machine image file. The hardware configuration file stores the number of CPUs, memory capacity, number of network cards / types of the client 20, and the virtual machine image file of the client on the host machine. Information such as the storage path on 10, and the virtual machine image file store information such as the boot program of the client 20 and the operating system data file.
KVM(Kernel-basedVirtual Machine,基于内核的虚拟机)是一个开源的系统虚拟化模块,在支持KVM虚拟化的环境中,客户机20的启动过程由两部分组成:1.宿主机10上的KVM根据硬件配置文件(如,虚拟机xml配置文件)创建CPU、内存、IO设备等虚拟机硬件环境;2.加载虚拟机镜像文件的引导程序、操作系统数据文件完成客户机20操作系统的启动过程。在这一过程中,由于虚拟机镜像文件结构复杂,而客户机20在运行过程中会经常对其进行写入操作,这容易导致虚拟机镜像文件损坏。此外,如果运行过程中出现宿主机异常断电、客户机或宿主机异常重启、客户机被恢复至数据不全的虚拟机镜像文件版本等情况,将导致虚拟机镜像文件损坏。对宿主机10而言,虚拟机镜像文件是一个黑盒子,换句话说,宿主机10难以获知虚拟机镜像文件的内容,也就无法对损坏的虚拟机镜像文件进行修复,这意味着一旦虚拟机镜像文件损坏,客户机20将无法启动。KVM (Kernel-based Virtual Machine) is an open source system virtualization module. In an environment that supports KVM virtualization, the startup process of the client 20 consists of two parts: 1. KVM on the host 10 Create a virtual machine hardware environment such as CPU, memory, and IO devices according to the hardware configuration file (eg, virtual machine xml configuration file); 2. Load the boot program and operating system data file of the virtual machine image file to complete the startup process of the guest 20 operating system . In this process, because the virtual machine image file has a complex structure, and the client 20 often writes to it during the running process, this easily leads to damage to the virtual machine image file. In addition, if the host is powered off abnormally, the client or the host is restarted abnormally, or the client is restored to the incomplete virtual machine image file version, the virtual machine image file will be damaged. For the host machine 10, the virtual machine image file is a black box. In other words, the host machine 10 has difficulty in knowing the content of the virtual machine image file and cannot repair the damaged virtual machine image file. This means that once the virtual machine The machine image file is damaged and the client 20 will fail to start.
为了改善这一问题,通常会对虚拟机镜像文件进行备份,并在其损坏后利用备份文件进行恢复。但是,虚拟机镜像文件的备份和恢复只能由宿主机管理员(宿主机用户)操作,并且无法确保备份虚拟机镜像文件中保存的客户机文件是完整的,这样后续使用备份虚拟 机镜像文件进行恢复时,很可能会出现客户机20异常、甚至无法启动的情形。To improve this problem, the virtual machine image file is usually backed up and restored using the backup file after it is damaged. However, the backup and restoration of the virtual machine image file can only be performed by the host administrator (host user), and it is not possible to ensure that the client files saved in the backup virtual machine image file are complete, so that the subsequent use of the backup virtual machine image file When recovering, the client 20 is likely to be abnormal or even fail to start.
为确保客户机20的正常启动,可以在客户机20正常运行时对其进行备份操作,并在客户机20出现启动异常时按照备份的客户机20进行恢复。In order to ensure the normal startup of the client 20, a backup operation can be performed on the client 20 when the client 20 is running normally, and the client 20 can be restored according to the backup client 20 when the client 20 starts abnormally.
在本公开中,对客户机20的备份操作就是备份存储客户机20的所有信息的硬件配置文件和虚拟机镜像文件,对客户机20的恢复操作就是将备份的硬件配置文件和虚拟机镜像文件拷贝覆盖原有文件。由于硬件配置文件中的信息稳定性很高,而虚拟机镜像文件中的信息在客户机20运行过程中是不断变化的,故只要确保备份虚拟机镜像文件的准确性,就能保证客户机20可靠启动。In the present disclosure, the backup operation to the client 20 is to back up the hardware configuration file and the virtual machine image file that store all the information of the client 20, and the recovery operation to the client 20 is to back up the hardware configuration file and the virtual machine image file. Copy over the original file. Because the information in the hardware configuration file is highly stable, and the information in the virtual machine image file is constantly changing during the operation of the client 20, as long as the accuracy of the backup virtual machine image file is ensured, the client 20 can be guaranteed Reliable startup.
为了至少部分地改善上述问题,本公开提供一种虚拟机镜像文件处理方法及装置,下面进行详细描述。In order to at least partially improve the foregoing problems, the present disclosure provides a virtual machine image file processing method and device, which are described in detail below.
请参照图2,图2示出了本公开提供的一种虚拟机镜像文件处理方法的流程示意图,该方法应用于第一客户机。下面对应用于第一客户机的虚拟机镜像文件处理方法的各个步骤进行描述。Please refer to FIG. 2, which is a schematic flowchart of a method for processing a virtual machine image file provided by the present disclosure. The method is applied to a first client. The following describes each step of the method for processing a virtual machine image file for a first client.
步骤S101,响应用户的文件备份操作,停止第一客户机中的数据写入事务。In step S101, in response to the user's file backup operation, the data writing transaction in the first client is stopped.
在本公开中,文件备份操作可以是第一客户机的用户对第一客户机的虚拟机镜像文件进行备份的触发操作。第一客户机正常运行时,第一客户机的用户触发文件备份操作,例如,第一客户机的用户输入表征文件备份操作的指令,或者点击表征文件备份操作的控件等。In the present disclosure, the file backup operation may be a trigger operation of a user of the first client to back up the virtual machine image file of the first client. When the first client is running normally, the user of the first client triggers the file backup operation, for example, the user of the first client enters an instruction characterizing the file backup operation, or clicks a control characterizing the file backup operation.
第一客户机在用户触发文件备份操作之后,首先停止第一客户机中的数据写入事务,数据写入事务可以是第一客户机的文件系统向虚拟机镜像文件中写入数据的事务,换言之,第一客户机的文件系统不再向虚拟机镜像文件中写入数据。这样,就能至少部分地确保宿主机10备份的虚拟机镜像文件是完整的第一客户机文件。After the user triggers the file backup operation, the first client first stops the data writing transaction in the first client. The data writing transaction may be a transaction in which the file system of the first client writes data into the virtual machine image file. In other words, the file system of the first client no longer writes data into the virtual machine image file. In this way, it can be at least partially ensured that the virtual machine image file backed up by the host machine 10 is a complete first client file.
步骤S102,向宿主机发送文件备份请求,以使宿主机依据文件备份请求将第一客户机的虚拟机镜像文件进行备份。Step S102: Send a file backup request to the host machine, so that the host machine backs up the virtual machine image file of the first client according to the file backup request.
在本公开中,停止第一客户机中的数据写入事务之后,向宿主机10发起文件备份请求,文件备份请求可以是对第一客户机的虚拟机镜像文件进行备份的确认指令,宿主机10接收到文件备份请求之后,开始拷贝虚拟机镜像文件到预先建立的第一客户机的备份目录中,备份目录可以存储备份虚拟机镜像文件以及该备份虚拟机镜像文件的名称、存储时间、在宿主机10上的存储路径等等。作为一种实施方式,可以预先建立宿主机10上运行的每个客户机20的备份目录,备份目录配置成存储对应客户机20的至少一个备份虚拟机镜像文件以及每个备份虚拟机镜像文件的名称、存储时间和该备份虚拟机镜像文件在宿主机10上 的存储路径等。In the present disclosure, after stopping the data writing transaction in the first client, a file backup request is initiated to the host machine 10. The file backup request may be a confirmation instruction for backing up the virtual machine image file of the first client. The host machine 10 After receiving the file backup request, start copying the virtual machine image file to the backup directory of the first client that is established in advance. The backup directory can store the backup virtual machine image file and the name, storage time, and time of the backup virtual machine image file. The storage path on the host machine 10 and so on. As an implementation manner, a backup directory of each client 20 running on the host machine 10 may be established in advance, and the backup directory is configured to store at least one backup virtual machine image file corresponding to the client 20 and each backup virtual machine image file. Name, storage time, storage path of the backup virtual machine image file on the host machine 10, and the like.
步骤S103,接收宿主机反馈的备份完成指令,依据备份完成指令重启第一客户机中的数据写入事务。Step S103: Receive a backup completion instruction fed back by the host, and restart the data writing transaction in the first client according to the backup completion instruction.
在本公开中,第一客户机的虚拟机镜像文件拷贝完成之后,宿主机10向第一客户机反馈备份完成指令,第一客户机接收到备份完成指令之后,重启数据写入事务,即允许第一客户机的文件系统向虚拟机镜像文件中写入数据。In the present disclosure, after the copy of the virtual machine image file of the first client is completed, the host 10 feeds back the backup completion instruction to the first client. After receiving the backup completion instruction, the first client restarts the data writing transaction, that is, allows The file system of the first client writes data into the virtual machine image file.
当第一客户机能够启动,但是第一客户机的用户数据不完整(例如,数据库损坏等)、或者一些重要的业务进程(例如,数据收发进程等)无法启动时,需要利用宿主机10备份的第一客户机的备份虚拟机镜像文件对第一客户机的虚拟机镜像文件进行恢复,因此,本公开还可以包括步骤S104。When the first client can be started, but the user data of the first client is incomplete (for example, the database is damaged, etc.), or some important business processes (for example, the data sending and receiving process) cannot be started, the host machine 10 needs to be used for backup. The backup virtual machine image file of the first client restores the virtual machine image file of the first client. Therefore, the present disclosure may further include step S104.
步骤S104,响应用户的文件恢复操作,向宿主机发送文件恢复请求,以使宿主机依据文件恢复请求对第一客户机的虚拟机镜像文件进行恢复。Step S104: In response to the user's file recovery operation, send a file recovery request to the host machine, so that the host machine recovers the virtual machine image file of the first client according to the file recovery request.
在本公开中,文件恢复操作可以是第一客户机的用户获取宿主机10存储的第一客户机的备份目录,并从该备份目录中选择一个待恢复的备份虚拟机镜像文件后触发的操作,也可以是第一客户机的用户输入待恢复的备份虚拟机镜像文件的名称等信息后触发的操作。In the present disclosure, the file restoration operation may be an operation triggered after a user of the first client obtains a backup directory of the first client stored by the host machine 10 and selects a backup virtual machine image file to be restored from the backup directory. , Or may be an operation triggered by a user of the first client after entering information such as a name of a backup virtual machine image file to be restored.
第一客户机的用户触发文件恢复操作之后,第一客户机向宿主机10发送文件恢复请求,文件恢复请求可以包括待恢复文件名称。宿主机10接收到文件恢复请求之后,首先,依据文件恢复请求关闭第一客户机;然后,依据待恢复文件名称,从第一客户机对应的备份目录中,确定出与待恢复文件名称一致的备份虚拟机镜像文件名称,将该备份虚拟机镜像文件名称对应的备份虚拟机镜像文件作为目标备份虚拟机镜像文件,并利用目标备份虚拟机镜像文件替换第一客户机的当前虚拟机镜像文件,以恢复第一客户机的虚拟机镜像文件;最后,第一客户机的虚拟机镜像文件恢复完成之后,启动第一客户机。After the user of the first client triggers the file recovery operation, the first client sends a file recovery request to the host machine 10, and the file recovery request may include the name of the file to be recovered. After receiving the file restoration request, the host computer 10 first closes the first client according to the file restoration request; then, according to the name of the file to be restored, from the backup directory corresponding to the first client, a A backup virtual machine image file name, using the backup virtual machine image file corresponding to the backup virtual machine image file name as a target backup virtual machine image file, and replacing the current virtual machine image file of the first client with the target backup virtual machine image file, To restore the virtual machine image file of the first client; finally, after the restoration of the virtual machine image file of the first client is completed, start the first client.
值得说明的是,本公开中的上述文件备份请求和文件恢复请求可以经由前述的以串口协议开发的通信通道进行传输。It is worth noting that the above-mentioned file backup request and file restoration request in the present disclosure can be transmitted via the aforementioned communication channel developed by the serial port protocol.
现有技术中,对虚拟机镜像文件的备份/恢复过程通常是由宿主机10进行,而客户机20用户只能操作客户机20,无法看到宿主机10的文件系统,所以对客户机20的虚拟机镜像文件进行备份/恢复的过程,只能由宿主机10用户来触发,尤其是宿主机10上运行多个客户机20且每个客户机20的用户不同时,就会大大增加宿主机10用户的维护工作量,从而导致维护效率差,例如无法宿主机10用户将无法及时对各个客户机20的虚拟机镜像文件进行备份/恢复。而本公开提供的虚拟机镜像文件处理方法,客户机20的用户无需宿主机10用户的协助即可独立完成对客户机20的虚拟机镜像文件的备份/恢复操作,减少了宿 主机10用户的维护工作量,提高了宿主机10用户的维护效率,降低了宿主机10与客户机20之间的耦合度,提升了安全性。In the prior art, the backup / recovery process of the virtual machine image file is usually performed by the host machine 10, and the user of the client 20 can only operate the client 20 and cannot see the file system of the host machine 10. The process of backing up / restoring the virtual machine image file can only be triggered by the user of the host machine 10, especially when multiple clients 20 are running on the host machine 10 and the users of each client 20 are different, the host will be greatly increased. The maintenance workload of the users of the host 10 results in poor maintenance efficiency. For example, the users of the host 10 cannot back up / restore the virtual machine image files of the respective clients 20 in a timely manner. With the virtual machine image file processing method provided by the present disclosure, the user of the client 20 can independently complete the backup / restore operation of the virtual machine image file of the client 20 without the assistance of the user of the host machine 10, thereby reducing the The maintenance workload improves the maintenance efficiency of the user of the host machine 10, reduces the degree of coupling between the host machine 10 and the client 20, and improves security.
另外,现有技术中,在宿主机对客户机的虚拟机镜像文件进行备份的过程中,客户机可能在并行地向虚拟机镜像文件写入数据,导致宿主机最终得到的备份虚拟机镜像文件是不完整的。而本公开提供的虚拟机镜像文件处理方法中,客户机20用户触发文件备份操作之后,首先禁止客户机20的文件系统向虚拟机镜像文件中写入数据,再发送文件备份请求给宿主机10;宿主机10接收到文件备份请求之后,对客户机20的虚拟机镜像文件进行备份,并在备份完成之后向客户机20反馈备份完成指令,客户机20接收到备份完成指令之后,允许第一客户机的文件系统向虚拟机镜像文件中写入数据,这样就能确保宿主机10备份的虚拟机镜像文件是完整的客户机文件,可以至少部分地有效避免由于恢复了不完整的备份虚拟机镜像文件导致客户机20异常、甚至无法启动的情形。In addition, in the prior art, during the process of the host machine backing up the virtual machine image file of the client, the client may write data to the virtual machine image file in parallel, resulting in the backup virtual machine image file finally obtained by the host machine. Is incomplete. In the method for processing a virtual machine image file provided by the present disclosure, after a user of the client 20 triggers a file backup operation, the file system of the client 20 is first prohibited from writing data to the virtual machine image file, and then a file backup request is sent to the host machine 10 After receiving the file backup request, the host machine 10 backs up the virtual machine image file of the client 20 and feeds back the backup completion instruction to the client 20 after the backup is completed. After receiving the backup completion instruction, the client 20 allows the first The client's file system writes data to the virtual machine image file, so that it can ensure that the virtual machine image file backed up by the host machine 10 is a complete client file, which can at least partially effectively prevent the incomplete backup virtual machine from being restored. The image file causes the client 20 to be abnormal or even fail to start.
请参照图3,图3示出了本公开提供的另一种虚拟机镜像文件处理方法的流程示意图,该方法可以应用于宿主机10。下面对应用于宿主机10的虚拟机镜像文件处理方法的各个步骤进行描述。Please refer to FIG. 3, which is a schematic flowchart of another method for processing a virtual machine image file provided by the present disclosure. The method can be applied to the host machine 10. Each step of the method for processing a virtual machine image file for the host machine 10 will be described below.
步骤S201,接收第一客户机发送的文件备份请求,其中,文件备份请求是第一客户机响应用户的文件备份操作产生的,且第一客户机响应文件备份操作停止第一客户机中的数据写入事务。Step S201: Receive a file backup request sent by a first client, where the file backup request is generated by the first client in response to a user's file backup operation, and the first client stops data in the first client in response to the file backup operation Write transaction.
在本公开中,第一客户机的用户在第一客户机正常运行时触发文件备份操作,第一客户机响应文件触发操作,首先停止第一客户机中的数据写入事务,即禁止第一客户机的文件系统向虚拟机镜像文件中写入数据;之后再发送文件备份请求给宿主机10,文件备份请求可以是对第一客户机的虚拟机镜像文件进行备份的确认指令。In the present disclosure, a user of the first client triggers a file backup operation when the first client is normally running. In response to the file triggering operation, the first client first stops data writing transactions in the first client, that is, prohibits the first client. The client's file system writes data to the virtual machine image file; and then sends a file backup request to the host machine 10. The file backup request may be a confirmation instruction for backing up the virtual machine image file of the first client.
步骤S202,依据文件备份请求将第一客户机的虚拟机镜像文件进行备份得到备份虚拟机镜像文件,并在备份完成后反馈备份完成指令至第一客户机以重启第一客户机中的数据写入事务。In step S202, the virtual machine image file of the first client is backed up to obtain a backup virtual machine image file according to the file backup request, and the backup completion instruction is fed back to the first client after the backup is completed to restart the data writing in the first client. Into business.
在本公开中,可以预先建立宿主机10上运行的每个客户机20的备份目录,备份目录用于存储客户机20的至少一个备份虚拟机镜像文件以及每个备份虚拟机镜像文件的名称、存储时间和该备份虚拟机镜像文件在宿主机10上的存储路径等。In this disclosure, a backup directory for each client 20 running on the host machine 10 may be established in advance. The backup directory is used to store at least one backup virtual machine image file of the client 20 and the name of each backup virtual machine image file, The storage time, the storage path of the backup virtual machine image file on the host machine 10, and the like.
在本公开中,宿主机10接收到第一客户机发送的文件备份请求之后,开始拷贝第一客户机的虚拟机镜像文件并将备份虚拟机镜像文件存储至的第一客户机对应的备份目录中,同时存储备份虚拟机镜像文件的名称、存储时间、在宿主机10上的存储路径等信息。拷贝完成后,宿主机10向第一客户机反馈备份完成指令,以使第一客户机重启数据写入事务, 即允许第一客户机的文件系统向虚拟机镜像文件中写入数据。In the present disclosure, after receiving the file backup request sent by the first client, the host 10 starts to copy the virtual machine image file of the first client and stores the backup virtual machine image file to a backup directory corresponding to the first client. In addition, information such as the name of the backup virtual machine image file, the storage time, and the storage path on the host machine 10 are also stored. After the copying is completed, the host 10 feeds back the backup completion instruction to the first client, so that the first client restarts the data writing transaction, that is, allows the file system of the first client to write data to the virtual machine image file.
现有技术中,当客户机20无法启动时,需要宿主机10利用客户机20的备份虚拟机镜像文件来对当前虚拟机镜像文件进行恢复,但是该备份虚拟机镜像文件未必是可靠的,这样就会导致客户机20在虚拟机镜像文件恢复后仍然无法启动成功,需要反复地去恢复虚拟机镜像文件,进而导致客户机20长时间无法对外提供服务,同时,降低了宿主机10和客户机20的耦合度以及宿主机10用户的维护工作量。因此,在宿主机10将第一客户机的虚拟机镜像文件进行备份之后,可以对备份虚拟机镜像文件进行可靠性检测,将第一客户机因意外导致的服务中断时间缩减到最低。In the prior art, when the client 20 cannot be started, the host machine 10 is required to use the backup virtual machine image file of the client 20 to restore the current virtual machine image file, but the backup virtual machine image file may not be reliable. It will cause the client 20 to fail to start successfully after the virtual machine image file is restored, and it is necessary to repeatedly restore the virtual machine image file. As a result, the client 20 cannot provide external services for a long time. At the same time, the host machine 10 and the client machine are reduced. The coupling degree of 20 and the maintenance workload of 10 users of the host machine. Therefore, after the host machine 10 backs up the virtual machine image file of the first client, the reliability check of the backup virtual machine image file can be performed to reduce the service interruption time of the first client due to accident to a minimum.
在本公开中,考虑到宿主机10无法根据备份虚拟机镜像文件的内容来确定其是否可靠,故巧妙地通过判断该备份虚拟机镜像文件是否可以成功启动第一客户机的方式来检测该备份虚拟机镜像文件的可靠性。但是,第一客户机正在运行,如果将其停止会导致服务中断,因此,可以重新创建一个与第一客户机类似的第二客户机来完成对备份虚拟机镜像文件的可靠性检测,故本公开还可以包括步骤S203~S205。In the present disclosure, considering that the host machine 10 cannot determine whether the backup virtual machine image file is reliable according to the content of the backup virtual machine image file, the backup is skillfully detected by judging whether the backup virtual machine image file can successfully start the first client. The reliability of the virtual machine image file. However, the first client is running. If you stop it, it will cause service interruption. Therefore, you can re-create a second client similar to the first client to complete the reliability check of the backup virtual machine image file. The disclosure may further include steps S203 to S205.
步骤S203,获取第一客户机的硬件配置文件,并依据硬件配置文件生成检测配置文件。Step S203: Obtain a hardware configuration file of the first client, and generate a detection configuration file according to the hardware configuration file.
当不同客户机的硬盘配置文件中的一些特定信息相同时,这些不同客户机会出现冲突错误。所述特定信息例如可以是,但不限于,UUID(Universally Unique Identifier,通用唯一识别码)、虚拟机名称、宿主机10与第一客户机之间的串口通道名称等,所述特定信息可以称为冲突信息。在本公开中,可以对第一客户机的硬件配置文件中的冲突信息进行修改,得到检测配置文件,从而避免后续生成的第二客户机与第一客户机出现冲突。Conflict errors occur when different clients have the same specific information in their hard disk configuration files. The specific information may be, for example, but not limited to, a UUID (Universally Unique Identifier), a virtual machine name, a serial port channel name between the host 10 and the first client, and the like. The specific information may be called For conflict information. In the present disclosure, the conflict information in the hardware configuration file of the first client may be modified to obtain a detection configuration file, so as to avoid a conflict between the second client and the first client generated subsequently.
步骤S204,依据检测配置文件和备份虚拟机镜像文件创建第二客户机。Step S204: Create a second client according to the detection configuration file and the backup virtual machine image file.
步骤S205,控制第二客户机启动,当检测到第二客户机启动成功时,则判定备份虚拟机镜像文件通过可靠性检测并添加可靠性标记。In step S205, the second client is controlled to start. When it is detected that the second client is successfully started, it is determined that the backup virtual machine image file passes the reliability detection and a reliability flag is added.
在本公开中,可以通过宿主机10和第二客户机之间是否握手成功的方式来检测第二客户机是否启动成功,具体来说,可以设置一个握手时间(例如,5分钟),如果启动第二客户机后,在握手时间内宿主机10和第二客户机握手成功,则判定备份虚拟机镜像文件通过可靠性检测。在备份虚拟机镜像文件通过可靠性检测时添加可靠性标记,以标识备份虚拟机镜像文件为可靠,并删除第二客户机。In the present disclosure, whether the second client is successfully started can be detected by whether the handshake between the host 10 and the second client is successful. Specifically, a handshake time (for example, 5 minutes) can be set. After the second client, if the host 10 and the second client successfully shake hands within the handshake time, it is determined that the backup virtual machine image file passes the reliability check. When the backup virtual machine image file passes the reliability test, a reliability mark is added to identify the backup virtual machine image file as reliable, and the second client is deleted.
需要指出的是,为了保证第一客户机的硬件配置文件和备份虚拟机镜像文件的稳定性,可以对硬件配置文件和备份虚拟机镜像文件进行拷贝,并依据拷贝后的硬件配置文件生成检测配置文件,以及依据检测配置文件和拷贝的备份虚拟机镜像文件创建第二客户机。对应地,在可靠性检测结束后,可以删除该检测配置文件和拷贝的备份虚拟机镜像文件。It should be noted that in order to ensure the stability of the hardware configuration file of the first client and the backup virtual machine image file, the hardware configuration file and the backup virtual machine image file can be copied, and a detection configuration is generated according to the copied hardware configuration file. File, and a second guest is created based on the detection configuration file and the copied backup virtual machine image file. Correspondingly, after the reliability test is completed, the test configuration file and the copied backup virtual machine image file may be deleted.
当第一客户机的用户发现第一客户机能够启动,但是第一客户机的用户数据不完整(例如,数据库损坏等)、或者一些重要的业务进程(例如,数据收发进程等)无法启动时,可以向宿主机10发送文件恢复请求,以使宿主机10利用备份的第一客户机的备份虚拟机镜像文件对第一客户机的虚拟机镜像文件进行恢复,因此,本公开还包括步骤S206~步骤S207。When the user of the first client finds that the first client can be started, but the user data of the first client is incomplete (for example, the database is damaged, etc.), or some important business processes (for example, the data sending and receiving process, etc.) cannot be started , A file restoration request may be sent to the host machine 10, so that the host machine 10 uses the backup virtual machine image file of the backup first client to restore the virtual machine image file of the first client, therefore, the present disclosure further includes step S206 ~ Step S207.
步骤S206,接收第一客户机发送的文件恢复请求,其中,文件恢复请求是第一客户机响应用户的文件恢复操作产生的。Step S206: Receive a file recovery request sent by the first client, where the file recovery request is generated by the first client in response to a file recovery operation of the user.
在本公开中,在第一客户机能够启动,但是第一客户机的用户数据不完整(例如,数据库损坏等)、或者一些重要的业务进程(例如,数据收发进程等)无法启动时,第一客户机的用户可以触发文件恢复操作,文件恢复操作可以是第一客户机的用户获取宿主机10存储的第一客户机的备份目录,并从该备份目录中选择一个待恢复的备份虚拟机镜像文件后触发的操作。第一客户机接收到文件恢复操作后,向宿主机10发送文件恢复请求。In the present disclosure, when the first client can be started, but the user data of the first client is incomplete (for example, the database is corrupted, etc.), or some important business processes (for example, the data sending and receiving process, etc.) cannot be started, the first A user of a client may trigger a file recovery operation. The file recovery operation may be that the user of the first client obtains a backup directory of the first client stored by the host machine 10 and selects a backup virtual machine to be restored from the backup directory. Action triggered after mirroring the file. After receiving the file recovery operation, the first client sends a file recovery request to the host machine 10.
步骤S207,依据文件恢复请求关闭第一客户机,并对第一客户机的虚拟机镜像文件进行恢复后重启所述第一客户机。In step S207, the first client is shut down according to the file restoration request, and the virtual machine image file of the first client is restored, and then the first client is restarted.
在本公开中,文件恢复请求可以包括待恢复文件名称,宿主机10中预先存储有第一客户机对应的至少一个备份虚拟机镜像文件及每个备份虚拟机镜像文件的名称。宿主机10接收到第一客户机发送的文件恢复请求之后,首先关闭第一客户机;然后,依据待恢复文件名称及每个备份虚拟机镜像文件的名称,从至少一个备份虚拟机镜像文件中确定出待恢复的备份虚拟机镜像文件,并利用待恢复的备份虚拟机镜像文件替换第一客户机的当前虚拟机镜像文件;替换完成后,启动第一客户机。In the present disclosure, the file restoration request may include a name of a file to be restored, and at least one backup virtual machine image file corresponding to the first client and a name of each backup virtual machine image file are stored in the host machine 10 in advance. After receiving the file restoration request sent by the first client, the host machine 10 first closes the first client; then, based on the name of the file to be restored and the name of each backup virtual machine image file, from at least one backup virtual machine image file Determine the backup virtual machine image file to be restored, and use the backup virtual machine image file to be restored to replace the current virtual machine image file of the first client; after the replacement is completed, start the first client.
如果宿主机10检测到第一客户机无法启动,则可以利用具有可靠性标记的备份虚拟机镜像文件对第一客户机进行恢复,因此,本公开还包括步骤S208~步骤S210。If the host machine 10 detects that the first client cannot be started, the first client can be restored by using a backup virtual machine image file with a reliability mark. Therefore, the present disclosure further includes steps S208 to S210.
步骤S208,当检测到第一客户机无法启动时,查询第一客户机对应的至少一个备份虚拟机镜像文件中是否存在具有可靠性标记的备份虚拟机镜像文件。Step S208: When it is detected that the first client cannot be started, query whether at least one backup virtual machine image file corresponding to the first client exists a backup virtual machine image file with a reliability mark.
在本公开中,当宿主机根据接收的文件恢复请求对当前虚拟机镜像文件进行恢复并对第一客户机进行启动后,或者,当宿主机在其它任意情况下对第一客户机进行启动后,宿主机10可通过与第一客户机握手来判断第一客户机是否启动成功,如果在预设握手时间(例如,3-5分钟)内宿主机10和第一客户机未握手成功,则判定第一客户机无法启动成功,此时宿主机10可以查询第一客户机对应的备份目录中是否存在具有可靠性标记的备份虚拟机镜像文件,即是否存在可靠的备份虚拟机镜像文件。如果第一客户机对应的至少一个备份虚拟机镜像文件中存在具有可靠性标记的备份虚拟机镜像文件,则执行步骤S209。In the present disclosure, after the host recovers the current virtual machine image file and starts the first client according to the received file recovery request, or after the host starts the first client under any other circumstances, The host 10 can determine whether the first client is successfully started by shaking hands with the first client. If the host 10 and the first client fail to shake hands within a preset handshake time (for example, 3-5 minutes), the host 10 determines The first client cannot be started successfully. At this time, the host machine 10 can query whether there is a backup virtual machine image file with a reliability mark in the backup directory corresponding to the first client, that is, whether there is a reliable backup virtual machine image file. If there is a backup virtual machine image file with a reliability flag in the at least one backup virtual machine image file corresponding to the first client, step S209 is performed.
步骤S209,从所有具有可靠性标记的备份虚拟机镜像文件中获取存储时间最晚的备份虚拟机镜像文件作为目标虚拟机镜像文件。Step S209: Obtain the backup virtual machine image file with the latest storage time from all the backup virtual machine image files with the reliability mark as the target virtual machine image file.
在本公开中,当宿主机10检测到第一客户机对应的备份目录中存在具有可靠性标记的备份虚拟机镜像文件,则获取每个具有可靠性标记的备份虚拟机镜像文件的存储时间,并将存储时间最晚的备份虚拟机镜像文件作为目标虚拟机镜像文件,进而利用目标虚拟机镜像文件对第一客户机进行恢复,就可以将第一客户机恢复至出现异常前的状态。In the present disclosure, when the host machine 10 detects the existence of a backup virtual machine image file with a reliability mark in the backup directory corresponding to the first client, it obtains the storage time of each backup virtual machine image file with a reliability mark. By using the backup virtual machine image file with the latest storage time as the target virtual machine image file, and then using the target virtual machine image file to restore the first client, the first client can be restored to the state before the exception occurred.
步骤S210,依据目标虚拟机镜像文件对第一客户机的虚拟机镜像文件进行恢复。Step S210: Restore the virtual machine image file of the first client according to the target virtual machine image file.
在本公开中,确定出目标虚拟机镜像文件之后,首先关闭第一客户机,然后利用目标虚拟机镜像文件替换第一客户机的当前虚拟机镜像文件,并在目标虚拟机镜像文件替换完成后,重新启动第一客户机。In the present disclosure, after the target virtual machine image file is determined, the first client is closed first, and then the current virtual machine image file of the first client is replaced with the target virtual machine image file, and after the replacement of the target virtual machine image file is completed , Restart the first client.
本公开提供的虚拟机镜像文件处理方法,首先,在宿主机10完成虚拟机镜像文件的备份操作之后,自动对备份虚拟机镜像文件进行可靠性检测,并对通过可靠性检测的备份虚拟机镜像文件添加可靠性标记;其次,可以在检测到第一客户机无法启动时,利用具有可靠性标记且存储时间最晚的备份虚拟机镜像文件恢复第一客户机,从而可以在检测到第一客户机启动失败时,直接查找相应的可靠备份虚拟机镜像文件来恢复当前虚拟机镜像文件,从而有效缩短第一客户机无法提供服务的时间,并且整个过程可以无需宿主机10用户参与,减少了宿主机10用户的维护工作量。The method for processing a virtual machine image file provided by the present disclosure firstly, after the host machine 10 completes the backup operation of the virtual machine image file, it automatically performs a reliability check on the backup virtual machine image file, and backs up the virtual machine image that has passed the reliability test. Add a reliability flag to the file. Second, when it is detected that the first client cannot be started, the first client can be restored by using the backup virtual machine image file with the reliability flag and the latest storage time, so that the first client can be detected When the machine fails to start, it directly finds the corresponding reliable backup virtual machine image file to restore the current virtual machine image file, thereby effectively reducing the time that the first client cannot provide services, and the entire process can eliminate the need for the host machine 10 users to participate, reducing the host The maintenance workload of the host 10 users.
请参照图4,图4示出了本公开提供的一种宿主机10的方框示意图。宿主机10包括处理器101、存储器102、总线103和通信接口104,所述处理器101、存储器102和通信接口104通过总线103连接;处理器101配置成执行存储器102中存储的可执行模块,例如计算机程序。Please refer to FIG. 4, which is a schematic block diagram of a host machine 10 provided by the present disclosure. The host machine 10 includes a processor 101, a memory 102, a bus 103, and a communication interface 104. The processor 101, the memory 102, and the communication interface 104 are connected through the bus 103; the processor 101 is configured to execute executable modules stored in the memory 102, For example, computer programs.
其中,存储器102可以包括高速随机存取存储器(RAM:Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个通信接口104(可以是有线或者无线)实现该系统网元与至少一个其他网元之间的通信连接。The memory 102 may include high-speed random access memory (RAM: Random Access Memory), and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. A communication connection between the network element of the system and at least one other network element is achieved through at least one communication interface 104 (which may be wired or wireless).
总线103可以是ISA总线、PCI总线或EISA总线等。图4中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。The bus 103 may be an ISA bus, a PCI bus, an EISA bus, or the like. In FIG. 4, only one bidirectional arrow is used, but it does not mean that there is only one bus or one type of bus.
其中,存储器102配置成存储程序,例如图5所示的第一虚拟机镜像文件处理装置200及图6所示的第二虚拟机镜像文件处理装置300。第一虚拟机镜像文件处理装置200及第二虚拟机镜像文件处理装置300均包括至少一个可以软件或固件(firmware)的形式存储于所述存储器102中或固化在所述宿主机10的操作系统(operating system,OS)中的软件功 能模块。所述处理器101在接收到执行指令后,执行所述程序以实现本公开上述实施例揭示的虚拟机镜像文件处理方法。The memory 102 is configured to store programs, such as the first virtual machine image file processing device 200 shown in FIG. 5 and the second virtual machine image file processing device 300 shown in FIG. 6. The first virtual machine image file processing device 200 and the second virtual machine image file processing device 300 each include at least one operating system that can be stored in the memory 102 in the form of software or firmware or solidified in the host machine 10 (operating system, OS) software function module. After receiving the execution instruction, the processor 101 executes the program to implement the virtual machine image file processing method disclosed in the foregoing embodiment of the present disclosure.
处理器101可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器101中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器101可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)、复杂可编程逻辑器件(Complex Programmable Logic Device,CPLD)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The processor 101 may be an integrated circuit chip and has a signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 101 or an instruction in the form of software. The above-mentioned processor 101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (Network Processor) (NP), etc .; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), field programmable gate array (FPGA), complex programmable logic device (Complex Programmable Logic Device, CPLD) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
本公开还提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器101执行时实现上述实施例揭示的虚拟机镜像文件处理方法。The present disclosure also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 101, the method for processing a virtual machine image file disclosed in the foregoing embodiment is implemented.
请按照图5,图5示出了本公开提供的第一虚拟机镜像文件处理装置200的方框示意图。第一虚拟机镜像文件处理装置200应用于第一客户机,从功能上划分,其可以包括第一执行模块201、发送模块202、第一接收模块203及第二执行模块204。Please refer to FIG. 5, which illustrates a block diagram of a first virtual machine image file processing apparatus 200 provided by the present disclosure. The first virtual machine image file processing apparatus 200 is applied to a first client, and is functionally divided, and may include a first execution module 201, a sending module 202, a first receiving module 203, and a second execution module 204.
第一执行模块201,配置成响应用户的文件备份操作,停止第一客户机中的数据写入事务。The first execution module 201 is configured to stop a data writing transaction in the first client in response to a user file backup operation.
发送模块202,配置成向宿主机发送文件备份请求,以使宿主机依据文件备份请求将第一客户机的虚拟机镜像文件进行备份。The sending module 202 is configured to send a file backup request to the host machine, so that the host machine backs up the virtual machine image file of the first client according to the file backup request.
第一接收模块203,配置成接收宿主机反馈的备份完成指令,依据备份完成指令重启第一客户机中的数据写入事务。The first receiving module 203 is configured to receive a backup completion instruction fed back by the host, and restart the data writing transaction in the first client according to the backup completion instruction.
第二执行模块204,配置成响应用户的文件恢复操作,向宿主机发送文件恢复请求,以使宿主机依据文件恢复请求对第一客户机的虚拟机镜像文件进行恢复。The second execution module 204 is configured to send a file restoration request to the host machine in response to a file restoration operation of the user, so that the host machine restores the virtual machine image file of the first client according to the file restoration request.
关于上述模块的描述具体可以参考前文对相关步骤的详细描述。For the description of the above modules, please refer to the detailed description of related steps in the foregoing.
请按照图6,图6示出了本公开提供的第二虚拟机镜像文件处理装置300的方框示意图。第二虚拟机镜像文件处理装置300应用于宿主机10,从功能上划分,其可以包括第二接收模块301、文件备份模块302、文件生成模块303、创建模块304、检测模块305、第三接收模块306、文件恢复模块307、查询模块308、文件获取模块309及执行模块310。Please refer to FIG. 6, which illustrates a block diagram of a second virtual machine image file processing apparatus 300 provided by the present disclosure. The second virtual machine image file processing device 300 is applied to the host machine 10 and is functionally divided, and may include a second receiving module 301, a file backup module 302, a file generating module 303, a creating module 304, a detecting module 305, and a third receiving device. Module 306, file recovery module 307, query module 308, file acquisition module 309, and execution module 310.
第二接收模块301,配置成接收第一客户机发送的文件备份请求,其中,文件备份请求是第一客户机响应用户的文件备份操作产生的,且第一客户机响应文件备份操作停止第一客户机中的数据写入事务。The second receiving module 301 is configured to receive a file backup request sent by the first client, wherein the file backup request is generated by the first client in response to a file backup operation of the user, and the first client stops the first response to the file backup operation. Data write transactions from the client.
文件备份模块302,配置成依据文件备份请求将第一客户机的虚拟机镜像文件进行备 份得到备份虚拟机镜像文件,并在备份完成后反馈备份完成指令至第一客户机以重启第一客户机中的数据写入事务。The file backup module 302 is configured to perform a backup of the virtual machine image file of the first client to obtain a backup virtual machine image file according to the file backup request, and feed back a backup completion instruction to the first client to restart the first client after the backup is completed. Data in a write transaction.
文件生成模块303,配置成获取第一客户机的硬件配置文件,并依据硬件配置文件生成检测配置文件。The file generating module 303 is configured to obtain a hardware configuration file of the first client, and generate a detection configuration file according to the hardware configuration file.
创建模块304,配置成依据检测配置文件和备份虚拟机镜像文件创建第二客户机。The creating module 304 is configured to create a second client according to the detection configuration file and the backup virtual machine image file.
检测模块305,配置成控制第二客户机启动,当检测到第二客户机启动成功时,则判定备份虚拟机镜像文件通过可靠性检测并添加可靠性标记。The detection module 305 is configured to control the startup of the second client. When it is detected that the startup of the second client is successful, it is determined that the backup virtual machine image file passes the reliability detection and adds a reliability flag.
第三接收模块306,配置成接收第一客户机发送的文件恢复请求,其中,文件恢复请求是第一客户机响应用户的文件恢复操作产生的。The third receiving module 306 is configured to receive a file recovery request sent by the first client, where the file recovery request is generated by the first client in response to a user's file recovery operation.
文件恢复模块307,配置成依据文件恢复请求关闭第一客户机,并对第一客户机的虚拟机镜像文件进行恢复后重启所述第一客户机。The file recovery module 307 is configured to shut down the first client according to the file recovery request, and recover the virtual machine image file of the first client and restart the first client.
查询模块308,配置成当检测到第一客户机无法启动时,查询第一客户机对应的至少一个备份虚拟机镜像文件中是否存在具有可靠性标记的备份虚拟机镜像文件。The querying module 308 is configured to query whether there is a backup virtual machine image file with a reliability flag in at least one backup virtual machine image file corresponding to the first client when it is detected that the first client cannot be started.
在本公开中,如果查询模块308查询到第一客户机对应的至少一个备份虚拟机镜像文件中存在具有可靠性标记的备份虚拟机镜像文件,则由文件获取模块309执行。In the present disclosure, if the query module 308 queries that there is a backup virtual machine image file with a reliability mark in the at least one backup virtual machine image file corresponding to the first client, the query is performed by the file acquisition module 309.
文件获取模块309,配置成当第一客户机对应的至少一个备份虚拟机镜像文件中存在具有可靠性标记的备份虚拟机镜像文件时,从所有具有可靠性标记的备份虚拟机镜像文件中获取存储时间最晚的备份虚拟机镜像文件作为目标虚拟机镜像文件。The file obtaining module 309 is configured to obtain storage from all backup virtual machine image files with reliability marks when there are backup virtual machine image files with reliability marks in at least one backup virtual machine image file corresponding to the first client. The latest backup virtual machine image file is used as the target virtual machine image file.
执行模块310,配置成依据目标虚拟机镜像文件对第一客户机的虚拟机镜像文件进行恢复。The execution module 310 is configured to restore the virtual machine image file of the first client according to the target virtual machine image file.
关于上述模块的描述具体可以参照前文对相关步骤的详细描述。For the description of the above modules, please refer to the detailed description of related steps.
综上所述,本公开提供的虚拟机镜像文件处理方法及装置,客户机的用户无需宿主机用户的协助即可独立完成对客户机的虚拟机镜像文件的备份/恢复操作,减少了宿主机用户的维护工作量,降低了宿主机与客户机之间的耦合度,提升了安全性。In summary, with the method and device for processing virtual machine image files provided by the present disclosure, the user of the client can independently complete the backup / restore operation of the virtual machine image file of the client without the assistance of the host user, reducing the host The user's maintenance workload reduces the coupling between the host and the client and improves security.
另外,客户机用户触发文件备份操作之后,先禁止客户机的文件系统向虚拟机镜像文件中写入数据再发送文件备份请求给宿主机,并在接收到宿主机发送的备份完成指令之后,允许第一客户机的文件系统向虚拟机镜像文件中写入数据,从而在一定程度上有效避免由于恢复了不完整的备份虚拟机镜像文件导致客户机异常、甚至无法启动的情形。In addition, after a client user triggers a file backup operation, the client's file system is first prohibited from writing data to the virtual machine image file before sending a file backup request to the host, and after receiving the backup completion instruction sent by the host, it is allowed The file system of the first client writes data into the virtual machine image file, thereby effectively avoiding the situation that the guest is abnormal or even unable to start due to the restoration of an incomplete backup virtual machine image file.
进一步地,通过在对虚拟机镜像文件备份后,对备份虚拟机镜像文件的可靠性进行检测,从而避免后续过程中,因无法确定各个备份虚拟机镜像文件是否可靠而逐个地采用备份虚拟机镜像文件来对第一客户机的当前虚拟机镜像文件进行恢复,所导致的第一客户机 服务中断时间过长的问题。Further, after the virtual machine image file is backed up, the reliability of the backup virtual machine image file is checked, thereby avoiding the subsequent use of the backup virtual machine image one by one because it is impossible to determine whether each backup virtual machine image file is reliable. File to restore the current virtual machine image file of the first client, causing the problem that the first client service is interrupted for too long.
在本公开所提供的几个实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本公开的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。In the several embodiments provided by the present disclosure, it should be understood that the disclosed apparatus and method may also be implemented in other manners. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functions, and functions of devices, methods, and computer program products according to various embodiments of the present disclosure. operating. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, which contains one or more components for implementing a specified logical function Executable instructions. It should also be noted that in some alternative implementations, the functions marked in the blocks may also occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented in a dedicated hardware-based system that performs the specified function or action. , Or it can be implemented with a combination of dedicated hardware and computer instructions.
另外,在本公开各个实施例中的各功能模块可以集成在一起形成一个独立的部分,也可以是各个模块单独存在,也可以两个或两个以上模块集成形成一个独立的部分。In addition, the functional modules in the various embodiments of the present disclosure may be integrated together to form an independent part, or each of the modules may exist alone, or two or more modules may be integrated to form an independent part.
所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present disclosure is essentially a part that contributes to the existing technology or a part of the technical solution may be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in various embodiments of the present disclosure. The foregoing storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes . It should be noted that in this article, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is any such actual relationship or order among them. Moreover, the terms "including", "comprising", or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also those that are not explicitly listed Or other elements inherent to such a process, method, article, or device. Without more restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, article, or equipment including the elements.
以上所述仅为本公开的优选实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不 需要对其进行进一步定义和解释。The above descriptions are merely preferred embodiments of the present disclosure, and are not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and changes. Any modification, equivalent replacement, or improvement made within the spirit and principle of this disclosure shall be included in the protection scope of this disclosure. It should be noted that similar reference numerals and letters indicate similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
工业实用性Industrial applicability
本公开提供的一种虚拟机镜像文件处理方法及装置,可以仅由客户机用户触发来完成虚拟机镜像文件的备份和/或恢复操作,减少了宿主机用户的维护工作量。此外,有效改善了因备份虚拟机镜像文件不完整或异常所导致的客户机无法启动的问题以及服务中断时间过长的问题。A method and device for processing a virtual machine image file provided by the present disclosure can complete the backup and / or restore operation of a virtual machine image file only triggered by a client user, which reduces the maintenance workload of the host machine user. In addition, the problem that the guest cannot start due to incomplete or abnormal backup virtual machine image files is effectively improved, and the problem that the service is interrupted for too long is effectively improved.

Claims (15)

  1. 一种虚拟机镜像文件处理方法,其特征在于,应用于第一客户机,所述第一客户机是运行于宿主机上的虚拟机,所述第一客户机的操作系统与所述宿主机的操作系统通信,所述方法包括:A virtual machine image file processing method is characterized in that it is applied to a first client, the first client is a virtual machine running on a host machine, and an operating system of the first client and the host machine Operating system communication, the method includes:
    响应用户的文件备份操作,停止所述第一客户机中的数据写入事务;In response to a user's file backup operation, stopping a data writing transaction in the first client;
    向所述宿主机发送文件备份请求,以使所述宿主机依据所述文件备份请求将所述第一客户机的虚拟机镜像文件进行备份;Sending a file backup request to the host machine, so that the host machine backs up the virtual machine image file of the first client according to the file backup request;
    接收所述宿主机反馈的备份完成指令,依据所述备份完成指令重启所述第一客户机中的数据写入事务。Receiving a backup completion instruction fed back by the host, and restarting a data writing transaction in the first client according to the backup completion instruction.
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:
    响应用户的文件恢复操作,向所述宿主机发送文件恢复请求,以使所述宿主机依据所述文件恢复请求对所述第一客户机的虚拟机镜像文件进行恢复。In response to the user's file recovery operation, a file recovery request is sent to the host machine, so that the host machine recovers the virtual machine image file of the first client according to the file recovery request.
  3. 一种虚拟机镜像文件处理方法,其特征在于,应用于宿主机,所述宿主机运行第一客户机,且所述宿主机的操作系统与所述第一客户机的操作系统通信,所述方法包括:A method for processing a virtual machine image file is characterized in that the method is applied to a host machine, the host machine runs a first client, and an operating system of the host machine communicates with an operating system of the first client. Methods include:
    接收所述第一客户机发送的文件备份请求,其中,所述文件备份请求是所述第一客户机响应用户的文件备份操作产生的,且所述第一客户机响应所述文件备份操作停止所述第一客户机中的数据写入事务;Receiving a file backup request sent by the first client, wherein the file backup request is generated by the first client in response to a file backup operation of a user, and the first client stops responding to the file backup operation A data writing transaction in the first client;
    依据所述文件备份请求将所述第一客户机的虚拟机镜像文件进行备份得到备份虚拟机镜像文件,并在备份完成后反馈备份完成指令至所述第一客户机以重启所述第一客户机中的数据写入事务。Backup the virtual machine image file of the first client according to the file backup request to obtain a backup virtual machine image file, and feed back a backup completion instruction to the first client after the backup is completed to restart the first client Data is written to the transaction.
  4. 如权利要求3所述的方法,其特征在于,所述方法还包括:The method of claim 3, further comprising:
    接收所述第一客户机发送的文件恢复请求,其中,所述文件恢复请求是所述第一客户机响应用户的文件恢复操作产生的;Receiving a file recovery request sent by the first client, wherein the file recovery request is generated by the first client in response to a file recovery operation of a user;
    依据所述文件恢复请求关闭所述第一客户机,并对所述第一客户机的虚拟机镜像文件进行恢复后重启所述第一客户机。Shut down the first client according to the file recovery request, and restart the first client after restoring a virtual machine image file of the first client.
  5. 如权利要求3或4所述的方法,其特征在于,所述方法还包括:The method according to claim 3 or 4, further comprising:
    获取所述第一客户机的硬件配置文件,并依据所述硬件配置文件生成检测配置文件;Acquiring a hardware configuration file of the first client, and generating a detection configuration file according to the hardware configuration file;
    依据所述检测配置文件和所述备份虚拟机镜像文件创建第二客户机;Creating a second client according to the detection configuration file and the backup virtual machine image file;
    控制所述第二客户机启动,当检测到所述第二客户机启动成功时,则判定所述备份虚拟机镜像文件通过可靠性检测并添加可靠性标记。Controlling the startup of the second client, and when it is detected that the startup of the second client is successful, it is determined that the backup virtual machine image file passes reliability detection and adds a reliability flag.
  6. 如权利要求5所述的方法,其特征在于,所述宿主机中预先存储有第一客户机对应 的至少一个备份虚拟机镜像文件及每个备份虚拟机镜像文件的存储时间,所述方法还包括:The method according to claim 5, wherein the host machine stores at least one backup virtual machine image file corresponding to the first client and a storage time of each backup virtual machine image file in advance, the method further comprising: include:
    当检测到所述第一客户机无法启动时,查询所述第一客户机对应的至少一个备份虚拟机镜像文件中是否存在具有可靠性标记的备份虚拟机镜像文件;When it is detected that the first client cannot be started, query whether there is a backup virtual machine image file with a reliability mark in at least one backup virtual machine image file corresponding to the first client;
    若是,则从所有具有可靠性标记的备份虚拟机镜像文件中获取存储时间最晚的备份虚拟机镜像文件作为目标虚拟机镜像文件;If yes, obtain the backup virtual machine image file with the latest storage time from all the backup virtual machine image files with the reliability mark as the target virtual machine image file;
    依据所述目标虚拟机镜像文件对所述第一客户机的虚拟机镜像文件进行恢复。Recovering the virtual machine image file of the first client according to the target virtual machine image file.
  7. 根据权利要求5或6所述的方法,其特征在于,所述依据所述硬件配置文件生成检测配置文件,包括:The method according to claim 5 or 6, wherein the generating a detection configuration file according to the hardware configuration file comprises:
    复制所述硬件配置文件,对复制的硬件配置文件中的冲突信息进行修改,得到所述检测配置文件;其中,不同客户机在硬件配置文件中的冲突信息相同的情况下,将出现冲突错误。Duplicate the hardware configuration file, modify the conflict information in the duplicated hardware configuration file to obtain the detection configuration file; where different clients have the same conflict information in the hardware configuration file, a conflict error will occur.
  8. 一种虚拟机镜像文件处理装置,其特征在于,应用于第一客户机,所述第一客户机是运行于宿主机上的虚拟机,所述第一客户机的操作系统与所述宿主机的操作系统通信,所述装置包括:A virtual machine image file processing device is characterized in that it is applied to a first client, the first client is a virtual machine running on a host machine, an operating system of the first client and the host machine Operating system communication, the device includes:
    第一执行模块,配置成响应用户的文件备份操作,停止所述第一客户机中的数据写入事务;A first execution module configured to stop a data writing transaction in the first client in response to a file backup operation of a user;
    发送模块,配置成向所述宿主机发送文件备份请求,以使所述宿主机依据所述文件备份请求将所述第一客户机的虚拟机镜像文件进行备份;A sending module configured to send a file backup request to the host machine, so that the host machine backs up the virtual machine image file of the first client according to the file backup request;
    第一接收模块,配置成接收所述宿主机反馈的备份完成指令,依据所述备份完成指令重启所述第一客户机中的数据写入事务。The first receiving module is configured to receive a backup completion instruction fed back by the host, and restart the data writing transaction in the first client according to the backup completion instruction.
  9. 如权利要求8所述的装置,其特征在于,所述装置还包括:The apparatus according to claim 8, further comprising:
    第二执行模块,配置成响应用户的文件恢复操作,向所述宿主机发送文件恢复请求,以使所述宿主机依据所述文件恢复请求对所述第一客户机的虚拟机镜像文件进行恢复。A second execution module configured to respond to a user's file recovery operation and send a file recovery request to the host machine, so that the host machine recovers the virtual machine image file of the first client according to the file recovery request .
  10. 一种虚拟机镜像文件处理装置,其特征在于,应用于宿主机,所述宿主机运行第一客户机,且所述宿主机的操作系统与所述第一客户机的操作系统通信,所述装置包括:A virtual machine image file processing device is characterized in that it is applied to a host machine, the host machine runs a first client, and an operating system of the host machine communicates with an operating system of the first client. The device includes:
    第二接收模块,配置成接收所述第一客户机发送的文件备份请求,其中,所述文件备份请求是所述第一客户机响应用户的文件备份操作产生的,且所述第一客户机响应所述文件备份操作停止所述第一客户机中的数据写入事务;A second receiving module configured to receive a file backup request sent by the first client, wherein the file backup request is generated by the first client in response to a file backup operation of a user, and the first client Stopping the data writing transaction in the first client in response to the file backup operation;
    文件备份模块,配置成依据所述文件备份请求将所述第一客户机的虚拟机镜像文件进行备份得到备份虚拟机镜像文件,并在备份完成后反馈备份完成指令至所述第一客户机以重启所述第一客户机中的数据写入事务。The file backup module is configured to perform a backup of the virtual machine image file of the first client to obtain a backup virtual machine image file according to the file backup request, and feed back a backup completion instruction to the first client to complete the backup. Restarting the data writing transaction in the first client.
  11. 如权利要求10所述的装置,其特征在于,所述装置还包括:The apparatus of claim 10, further comprising:
    第三接收模块,配置成接收所述第一客户机发送的文件恢复请求,其中,所述文件恢复请求是所述第一客户机响应用户的文件恢复操作产生的;A third receiving module configured to receive a file recovery request sent by the first client, wherein the file recovery request is generated by the first client in response to a file recovery operation of a user;
    文件恢复模块,配置成依据所述文件恢复请求关闭所述第一客户机,并对所述第一客户机的虚拟机镜像文件进行恢复后重启所述第一客户机。The file recovery module is configured to shut down the first client according to the file recovery request, and recover the virtual machine image file of the first client and restart the first client.
  12. 如权利要求10或11所述的装置,其特征在于,所述装置还包括:The device according to claim 10 or 11, wherein the device further comprises:
    文件生成模块,配置成获取所述第一客户机的硬件配置文件,并依据所述硬件配置文件生成检测配置文件;A file generating module configured to obtain a hardware configuration file of the first client and generate a detection configuration file according to the hardware configuration file;
    创建模块,配置成依据所述检测配置文件和所述备份虚拟机镜像文件创建第二客户机;A creating module configured to create a second client according to the detection configuration file and the backup virtual machine image file;
    检测模块,配置成控制所述第二客户机启动,当检测到所述第二客户机启动成功时,则判定所述备份虚拟机镜像文件通过可靠性检测并添加可靠性标记。The detection module is configured to control the startup of the second client. When it is detected that the startup of the second client is successful, it is determined that the backup virtual machine image file passes the reliability detection and adds a reliability flag.
  13. 如权利要求12所述的装置,其特征在于,所述宿主机中预先存储有第一客户机对应的至少一个备份虚拟机镜像文件及每个备份虚拟机镜像文件的存储时间,所述装置还包括:The apparatus according to claim 12, wherein the host machine stores in advance at least one backup virtual machine image file corresponding to the first client and a storage time of each backup virtual machine image file, and the apparatus further include:
    查询模块,配置成当检测到所述第一客户机无法启动时,查询所述第一客户机对应的至少一个备份虚拟机镜像文件中是否存在具有可靠性标记的备份虚拟机镜像文件;A query module configured to query whether it is detected that a backup virtual machine image file with a reliability flag exists in at least one backup virtual machine image file corresponding to the first client when it is detected that the first client cannot be started;
    文件获取模块,配置成当所述第一客户机对应的至少一个备份虚拟机镜像文件中存在具有可靠性标记的备份虚拟机镜像文件时,从所有具有可靠性标记的备份虚拟机镜像文件中获取存储时间最晚的备份虚拟机镜像文件作为目标虚拟机镜像文件;A file obtaining module configured to obtain from all backup virtual machine image files with reliability marks when there are backup virtual machine image files with reliability marks in at least one backup virtual machine image file corresponding to the first client; The latest backup virtual machine image file is stored as the target virtual machine image file;
    执行模块,配置成依据所述目标虚拟机镜像文件对所述第一客户机的虚拟机镜像文件进行恢复。The execution module is configured to restore the virtual machine image file of the first client according to the target virtual machine image file.
  14. 根据权利要求12或13所述的装置,其特征在于,所述文件生成模块具体配置成:The apparatus according to claim 12 or 13, wherein the file generating module is specifically configured to:
    复制所述硬件配置文件,对复制的硬件配置文件中的冲突信息进行修改,得到所述检测配置文件;Copying the hardware configuration file, and modifying conflict information in the copied hardware configuration file to obtain the detection configuration file;
    其中,不同客户机在硬件配置文件中的冲突信息相同的情况下,将出现冲突错误。Among them, if different clients have the same conflict information in the hardware configuration file, a conflict error will occur.
  15. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现如权利要求1-7中任一项所述的方法。A computer-readable storage medium having stored thereon a computer program, characterized in that when the computer program is executed by a processor, the method according to any one of claims 1-7 is implemented.
PCT/CN2019/096593 2018-07-20 2019-07-18 Virtual machine mirror image file processing method and device WO2020015709A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810803754.9A CN109144776B (en) 2018-07-20 2018-07-20 Virtual machine image file processing method and device
CN201810803754.9 2018-07-20

Publications (1)

Publication Number Publication Date
WO2020015709A1 true WO2020015709A1 (en) 2020-01-23

Family

ID=64801331

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/096593 WO2020015709A1 (en) 2018-07-20 2019-07-18 Virtual machine mirror image file processing method and device

Country Status (2)

Country Link
CN (1) CN109144776B (en)
WO (1) WO2020015709A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144776B (en) * 2018-07-20 2021-04-06 新华三技术有限公司 Virtual machine image file processing method and device
US10776041B1 (en) * 2019-05-14 2020-09-15 EMC IP Holding Company LLC System and method for scalable backup search
CN112667361B (en) * 2020-12-31 2023-10-17 北京北信源软件股份有限公司 Management method and device based on system virtual machine, electronic equipment and storage medium
CN113157394B (en) * 2021-04-14 2023-11-03 深信服科技股份有限公司 Mirror image backup method and device, electronic equipment and storage medium
CN115277679B (en) * 2022-07-29 2024-04-12 山石网科通信技术股份有限公司 File synchronization method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729264A (en) * 2013-12-23 2014-04-16 国云科技股份有限公司 Method for backing up and restoring Windows virtual machine system disk
CN104461773A (en) * 2014-11-18 2015-03-25 国云科技股份有限公司 Backup deduplication method of virtual machine
CN105224391A (en) * 2015-10-12 2016-01-06 浪潮(北京)电子信息产业有限公司 A kind of online backup method and system of virtual machine
US20160011946A1 (en) * 2014-07-11 2016-01-14 Quantum Corporation File Level Recovery Using Virtual Machine Image Level Backup With Selective Compression
CN107402839A (en) * 2016-05-18 2017-11-28 深圳市深信服电子科技有限公司 A kind of method and system of Backup Data
CN109144776A (en) * 2018-07-20 2019-01-04 新华三技术有限公司 Virtual machine image file processing method and processing device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102331949B (en) * 2011-10-12 2014-11-05 华为技术有限公司 Methods for generating and restoring memory snapshot of virtual machine, device and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729264A (en) * 2013-12-23 2014-04-16 国云科技股份有限公司 Method for backing up and restoring Windows virtual machine system disk
US20160011946A1 (en) * 2014-07-11 2016-01-14 Quantum Corporation File Level Recovery Using Virtual Machine Image Level Backup With Selective Compression
CN104461773A (en) * 2014-11-18 2015-03-25 国云科技股份有限公司 Backup deduplication method of virtual machine
CN105224391A (en) * 2015-10-12 2016-01-06 浪潮(北京)电子信息产业有限公司 A kind of online backup method and system of virtual machine
CN107402839A (en) * 2016-05-18 2017-11-28 深圳市深信服电子科技有限公司 A kind of method and system of Backup Data
CN109144776A (en) * 2018-07-20 2019-01-04 新华三技术有限公司 Virtual machine image file processing method and processing device

Also Published As

Publication number Publication date
CN109144776B (en) 2021-04-06
CN109144776A (en) 2019-01-04

Similar Documents

Publication Publication Date Title
WO2020015709A1 (en) Virtual machine mirror image file processing method and device
EP2539820B1 (en) System and method for failing over cluster unaware applications in a clustered system
US8719497B1 (en) Using device spoofing to improve recovery time in a continuous data protection environment
US8769226B2 (en) Discovering cluster resources to efficiently perform cluster backups and restores
US8307363B2 (en) Virtual machine system, restarting method of virtual machine and system
US9697093B2 (en) Techniques for recovering a virtual machine
EP3356941B1 (en) Systems and methods for restoring data from opaque data backup streams
US9524215B1 (en) Systems and methods for managing virtual machine backups
US10127119B1 (en) Systems and methods for modifying track logs during restore processes
US11803412B2 (en) Containerized application management system and management method
US11327850B2 (en) System and method for disaster recovery using application streaming
US10509705B2 (en) Application protection through a combined functionality failure manager
US20070143591A1 (en) Method for non-destructive restoration of a corrupted operating system
US10324637B1 (en) Dual-splitter for high performance replication
TWI764454B (en) Firmware corruption recovery
US10592133B1 (en) Managing raw device mapping during disaster recovery
US11360685B2 (en) Data consistency during reverse replication
US9535806B1 (en) User-defined storage system failure detection and failover management
US20160004607A1 (en) Information processing apparatus and information processing method
US20240111642A1 (en) Lossless failover for data recovery
US20240134670A1 (en) Management of duplicative virtual machine entries for a data management system
US9952807B1 (en) Virtual machine back-up
US20240045770A1 (en) Techniques for using data backup and disaster recovery configurations for application management
US20240095011A1 (en) State machine operation for non-disruptive update of a data management system
US20240031353A1 (en) Techniques for secure host connectivity in disaster recovery scenarios

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: 19837946

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19837946

Country of ref document: EP

Kind code of ref document: A1