A protection method, system, device and equipment of a virtual machine

By using qcow2 image technology to create virtual machines on local network devices and automatically managing image files, the problem of cumbersome and time-consuming virtual machine restoration operations is solved, realizing the centralization and automation of virtual machine restoration, which is suitable for cloud business scenarios with multiple virtual machines.

CN113835833BActive Publication Date: 2026-01-23NEW H3C BIG DATA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111040297.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-06
Publication Date
2026-01-23
Estimated Expiration
2041-09-06

AI Technical Summary

Technical Problem

In existing technologies, virtual machine system restoration requires the installation of restoration software in the operating system of each virtual machine, which is cumbersome, time-consuming, and labor-intensive, especially in cloud business scenarios when there are many virtual machines.

Method used

The qcow2 image technology is used to create virtual machines and generate image files on the local network device. It automatically detects when the virtual machine is shut down, deletes the image file, and creates a new image file without written data, so that the virtual machine restoration operation is centralized on the local network device.

Benefits of technology

It achieves centralized and automated virtual machine restore operations, reduces dependence on each virtual machine, and improves efficiency and convenience, making it particularly suitable for cloud business scenarios with multiple virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113835833B_ABST
    Figure CN113835833B_ABST
Patent Text Reader

Abstract

A protection method, system, device and equipment of a virtual machine, the method comprising: creating at least one virtual machine on a local network device based on a qcow2 image technology and creating a first-level image file of an image file of the virtual machine, wherein the first-level image file is used to store data written by the local network device or a remote network device when using the virtual machine; after detecting that at least one used virtual machine is powered off, deleting the first-level image file of the powered-off virtual machine on the local network device, and creating a new first-level image file without written data for the powered-off virtual machine. Through the method, the virtual machine created by the local network device can realize the restoration function on the local network device while being available for the remote network device, and the restoration function does not need to depend on the operating system inside the virtual machine; and the restoration function of multiple virtual machines can be uniformly realized on the local network device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification relates to the technical field of virtual machines, and in particular to a virtual machine protection method, system, device and equipment. BACKGROUND

[0002] A virtual machine (VM) refers to a complete computer system that is simulated by software, runs in a completely isolated environment, and has complete hardware system functions. The work that can be completed in a physical computer can also be realized in a virtual machine. Each virtual machine has independent CMOS, hard disk and operating system, and can be operated like a physical machine.

[0003] As a client, a virtual machine can meet the needs of many users. However, in order to prevent the virtual machine system from being destroyed and resist virus intrusion, there is a need to restore the system after the virtual machine is shut down.

[0004] In order to solve the above-mentioned needs, in the prior art, a restoration software similar to "restoration wizard" is installed on the operating system of the virtual machine to realize the restoration of the virtual machine system. The restoration software is a software for backing up and restoring the computer system. However, this method of installing the restoration software has limitations: the restoration software needs to be installed in the operating system of the virtual machine, and is highly dependent on the operating system; in the cloud business scenario, when the number of virtual machines is large, for system restoration of multiple virtual machines, the restoration software needs to be installed on each virtual machine, and the restoration function needs to be used on each virtual machine for system restoration, which is time-consuming and laborious. SUMMARY

[0005] In view of the above technical problems, the present application provides a virtual machine protection method, system, device and equipment.

[0006] According to a first aspect of the present application, a virtual machine protection method is provided, the method comprising:

[0007] Creating at least one virtual machine on a local network device based on a qcow2 image technology and creating a first-level image file of the virtual machine, wherein the first-level image file is used to store data written by the local network device or a remote network device when using the virtual machine;

[0008] After detecting that at least one used virtual machine is shut down, deleting the first-level image file of the shut-down virtual machine on the local network device, and creating a new first-level image file without writing data for the shut-down virtual machine.

[0009] According to a second aspect of the present application, a virtual machine protection system is provided, the system comprising a local network device and at least one remote network device:

[0010] The local network device is configured to create at least one virtual machine based on qcow2 image technology and create a first-level image file of the virtual machine image file, and after detecting that at least one used virtual machine has been shut down, delete the first-level image file of the shut-down virtual machine and create a new first-level image file without written data for the shut-down virtual machine; wherein, the first-level image file is used to store data written by the local network device or remote network device when using the virtual machine.

[0011] The remote network device is used to access the virtual machine.

[0012] According to a third aspect of this application, a protection device for a virtual machine is provided, the device comprising:

[0013] The virtual machine generation module is used to generate a first-level image file on a local network device based on qcow2 image technology, which creates a virtual machine and an image file of the virtual machine.

[0014] The data storage module is used to store the write data of the virtual machine into the first-level image file of the virtual machine when the local network device or remote network device uses the virtual machine;

[0015] The deletion module is used to delete the first-level image file of the shut-down virtual machine after detecting that at least one used virtual machine has been shut down, and to create a new first-level image file without written data for the shut-down virtual machine.

[0016] According to a fourth aspect of this application, a virtual machine protection device is provided, the device comprising:

[0017] processor;

[0018] Memory used to store processor-executable instructions;

[0019] The processor implements the method described in the first aspect by running the executable instructions.

[0020] The technical solution provided in this application allows remote network devices to remotely use virtual machines created on local network devices. However, the virtual machine restoration operation is performed on the local network device. It is evident that the restoration effect of this solution does not depend on the virtual machine operating system. Furthermore, the local network device automatically detects the status of all virtual machines and deletes the first-level image files of shut-down virtual machines, so that all virtual machine restoration operations are completed automatically on the local network device. This enables batch and remote restoration without the need to deploy each virtual machine individually, saving time and effort.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. BRIEF DESCRIPTION OF DRAWINGS

[0022] The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate embodiments consistent with the present description and, together with the description, further serve to explain the principles of the present description.

[0023] Figure 1 is a flow chart of an embodiment of a protection method of a virtual machine;

[0024] Figure 2 is a schematic diagram of an expansion of a qcow2 file;

[0025] Figure 3 is a schematic diagram of a chain structure of multiple qcow2 files;

[0026] Figure 4 is a schematic diagram of an implementation principle of protecting a virtual machine of the present application;

[0027] Figure 5 is an interaction diagram of an embodiment of a protection system of a virtual machine of the present application;

[0028] Figure 6 is a schematic diagram of a structure of a protection device of a virtual machine of the present application;

[0029] Figure 7 is a network architecture diagram in an application scenario of the present application. DETAILED DESCRIPTION

[0030] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements, and the term "exemplary" is used herein to mean "serving as an example, instance, or illustration." Thus, the exemplary embodiments are not intended to be limited to the disclosed embodiments, but are intended to be as broad as possible consistent with the specification and claims. The following detailed description is presented in order to better explain the exemplary embodiments and is not intended to limit the scope of the present description.

[0031] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present description. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0032] It should be understood that, although the terms first, second, third, etc. can be employed in this specification to describe various information, the information is not to be limited to these terms. These terms are only used to distinguish one category of information from another. For example, a first information can also be termed a second information, and, similarly, a second information can also be termed a first information, without departing from the scope of the present specification. The word "if' as used herein means "when" or "upon" or "in response to the determination" depending on the context.

[0033] In order to prevent the virtual machine system from being destroyed and resist virus intrusion, in the existing function of protecting the virtual machine, although the effect of protecting the virtual machine can be restored, the user needs to install the restoration software in the operating system of each virtual machine to restore, which is very dependent on the operating system of the virtual machine; and in the cloud service scenario, when the number of virtual machines is large, the virtual machines need to be deployed one by one, and the restoration software needs to be installed one by one to realize the restoration protection function of multiple virtual machines, which is not only cumbersome to operate, but also time-consuming and laborious.

[0034] In view of the above problems, the present application provides a method for protecting a virtual machine, which can be applied to various scenarios using virtual machines. For example: a local network device creates a virtual machine for its own use; a local network device creates a virtual machine for a remote network device; a local network device creates multiple virtual machines for multiple remote network devices, etc. When it involves the operation of restoring the virtual machine, the method described in the present application can be used to realize the restoration of the virtual machine.

[0035] A typical application scenario is, for example, in a multimedia classroom, the teacher wants each student to do some tasks on their own virtual machine. If the teacher has to deploy each device and install a virtual machine on each student device, it is very troublesome. Moreover, after the students use the virtual machine, the teacher needs to restore each virtual machine. If the teacher needs to restore each virtual machine one by one using the installation of the restoration software mentioned in the related art, the process will be very cumbersome. However, if the teacher uses the method of the present application to create multiple virtual machines on the teacher's device for multiple student devices, and can uniformly restore all virtual machines on the teacher's device, the whole process will be very simple and fast.

[0036] Of course, the above application scenarios are only used for illustrative purposes and should not be understood as a limitation of the present application.

[0037] In order for those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art should belong to the scope of protection of the present application.

[0038] Figure 1 As shown, a flowchart of a virtual machine protection method provided by the present application includes the following steps:

[0039] S102, creating at least one virtual machine on the local network device based on the qcow2 image technology and creating a first-level image file of the image file of the virtual machine, wherein the first-level image file is used to store data written by the local network device or the remote network device when using the virtual machine;

[0040] S104, after detecting that at least one used virtual machine is shut down, deleting the first-level image file of the shut-down virtual machine on the local network device, and creating a new first-level image file without written data for the shut-down virtual machine.

[0041] According to S102, the implementation of the present solution is based on the creation of at least one virtual machine on the local network device based on the qcow2 image technology. The qcow2 image technology: the qcow2 image format is one of the disk image formats supported by qemu (analog processor), which can use a file to represent a fixed-size block device. The qcow2 image has a chain relationship, and when the virtual machine starts, it will open all the qcow2 image files in the entire qcow2 image chain and establish their chain relationship in the memory.

[0042] On the local network device, the last-level image file in the image file can be used as a template file for creating a virtual machine, and at least one virtual machine is created. The template file already exists before the virtual machine is created. That is, at least one chain structure of "virtual machine template file-virtual machine file-first-level image file" is created according to the template file of the virtual machine, that is, at least one virtual machine is created in effect.

[0043] As an example, before creating a virtual machine on the local network device, the step of receiving user-set configuration parameters is further included. The parameters of the pre-created virtual machine can be configured before the virtual machine is created according to the user's needs. The configured parameters include but are not limited to: operating system version, memory size, processor configuration, disk size. The user can configure within the virtual machine parameter configuration range according to preference and demand.

[0044] Based on the chain structure of "virtual machine template file - virtual machine file - first-level image file" created above, all three types of files in the chain structure are qcow2 image files. The format of a qcow2 image file is as follows: Figure 2 As shown, using Figure 2 The example shown uses a qcow2 image file to represent a fixed-size block device. It can be seen that the virtual machine template file, virtual machine file, and first-level image file mentioned above are all... Figure 2 The format is shown below. A qcow2 image file can save changes to another file image, but it does not change the file itself. This can be understood as follows: when the target file is set as the first-level image file in the above chain structure, the data read comes from the virtual machine template file, the virtual machine file, and the first-level image file. However, data written to files different from these is stored in the first-level image file and does not change the contents of the virtual machine template file and the virtual machine file. The generated chain structure is as follows: Figure 3 As shown, the virtual machine includes a virtual machine template file 301, a virtual machine file 302, and a first-level image file 303. As is known from qcow2 image technology, when the virtual machine starts, it opens all qcow2 image files in the entire chain structure and establishes their chain relationship in memory. At this time, the virtual machine's operating system data is stored in the virtual machine template file 301, and the virtual machine's system-specific data, such as user information, is stored in the virtual machine file 302. Both files are "read-only files" when the virtual machine is used, meaning that data can only be read from them and cannot be modified. When a user uses the created virtual machine, the user's write data is stored in the first-level image file 303, which is initially an empty file after creation.

[0045] When a user uses a remote network device to create a virtual machine based on qcow2 image technology using a local network device, the data read when the virtual machine is first booted up consists of data from the virtual machine template file 301 and the virtual machine file 302. This state of the virtual machine at startup is referred to as the "virtual machine initial state." When the user uses the virtual machine, they will inevitably write data to it. At this time, all the written data is stored in the first-level image file 303 of the virtual machine being used, and has no impact on the data in the virtual machine template file and the virtual machine file.

[0046] Users of local network devices can directly use virtual machines on their local network devices when they need to use them; users of remote network devices can use virtual machines generated by local network devices through remote control. For example, remote control methods include: remote control based on the virtual machine's IP address, remote control based on remote connection software, etc. Of course, there are other methods, which are not limited in this solution.

[0047] Of course, the remote network device can also use the virtual machine generated by the local network device in other ways than remote control, and the present solution does not limit this.

[0048] According to S104, the local network device automatically detects whether the virtual machine that has been started and used is shut down. If it is detected that the virtual machine is not shut down, the virtual machine continues to periodically or non-periodically detect. If the local network device deletes the first-level image file of the virtual machine that has been shut down after detecting that at least one used virtual machine is shut down, since the write data of the user using the virtual machine is all stored in the first-level image file of the virtual machine, once the first-level image file of a virtual machine that has been shut down is deleted, the data written by the user using the virtual machine will be deleted, and only the "virtual machine template file" and "virtual machine file" are left in the above chain structure. A new first-level image file that has not written data is created for the virtual machine that has been shut down, and a complete "virtual machine template file-virtual machine file-first-level image file" chain structure is formed. At this time, the chain structure contains: a virtual machine template file in a read-only state, a virtual machine file in a read-only state, and a first-level image file in an empty file state. It can be seen that at this time, the state of the virtual machine is the same as the "initial state of the virtual machine" described above. That is, the effect that the virtual machine is restored after being shut down is achieved.

[0049] Figure 4 In order to protect the implementation principle of the virtual machine of the present application, in combination with the above, when the virtual machine is started and runs, the chain structure is "virtual machine template file 401-virtual machine file 402-first-level image file 403". After the virtual machine is shut down, the "first-level image file 403" is deleted, and a new "first-level image file 413" for writing data is created for the deleted file. It can be seen that the replacement of the first-level image file is achieved before the virtual machine is started again. Through the process of shutting down and starting up again, the virtual machine realizes the system restoration function.

[0050] For the convenience of understanding the present scheme, an embodiment in a specific application scenario can be taken. For example, a teacher creates multiple virtual machines on a teacher device based on the qcow2 technology for use by multiple student devices in a computer classroom, and the teacher configures the parameters of all the virtual machines consistently. The teacher assigns an IP address of a virtual machine to each student, and the student remotely controls the virtual machine assigned to him / her on his / her own student device according to the IP address of the virtual machine owned by him / her. When using the virtual machine, the student saves the data written in the virtual machine in the first-level image file of the virtual machine. After the student turns off the virtual machine, the teacher device detects that the used virtual machine has been turned off, and then the teacher device deletes the first-level image file of the turned-off virtual machine and creates a new first-level image file of the virtual machine without written data, thereby achieving the effect of restoring all the virtual machines on the teacher device.

[0051] In the above embodiment, the way in which the student device controls the virtual machine created by the teacher device is not limited to connecting by using the IP address of the virtual machine. For example, the student device can also control the virtual machine by using remote connection software. In this regard, the present scheme does not limit how to remotely use the virtual machine.

[0052] In the above embodiment, the virtual machine is used by multiple student devices, but the restoration is performed on the teacher device that creates the virtual machine. Therefore, the present scheme can achieve the restoration function without relying on the operating system of the virtual machine. In the existing technology, the restoration software is installed in the operating system of the virtual machine. When the virtual machine fails, such as black screen, it is very difficult for the user to restore. In the present scheme, since the restoration function does not depend on the operating system of the virtual machine, if the virtual machine used by the student device in the above embodiment fails, such as black screen, the student device only needs to turn off the virtual machine or the teacher device needs to forcibly turn off the virtual machine, thereby achieving the effect of restoring the virtual machine, which is very convenient.

[0053] Moreover, in the above embodiment, to achieve the restoration of all the virtual machines used by the student devices, the existing technology needs to install the restoration software on each virtual machine and use the restoration software to restore each virtual machine, which is time-consuming and laborious. By using the present scheme, the teacher device automatically detects the state of the virtual machine used by the student device and restores the used virtual machine that has been turned off, thereby achieving the effect of restoring all the virtual machines on the teacher device. Therefore, the present scheme can achieve the effect of restoring multiple virtual machines in a cloud service scenario, thereby effectively simplifying the operation of the user.

[0054] The above merely describes one of the specific embodiments of the present application and should not be considered as a limitation of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.

[0055] Corresponding to the above method embodiments, the present application also provides a virtual machine protection system, which comprises a local network device and at least one remote network device:

[0056] The local network device is configured to create at least one virtual machine based on the qcow2 image technology, create a first-level image file of the image file of the virtual machine, and after detecting that at least one used virtual machine is powered off, delete the first-level image file of the powered-off virtual machine, and create a new first-level image file without writing data for the powered-off virtual machine; wherein the first-level image file is used to store the data written by the local network device or the remote network device when using the virtual machine.

[0057] The remote network device is configured to use the virtual machine.

[0058] The local network device creates at least one virtual machine, which comprises: taking the last-level image file in the image file as a template file for creating a virtual machine, and creating at least one virtual machine according to the template file.

[0059] The remote network device uses the virtual machine in a remote control mode, which comprises:

[0060] Remote control based on the ip address of the virtual machine;

[0061] Or,

[0062] Remote control based on remote connection software.

[0063] Before the local network device creates the virtual machine, it further comprises: receiving a user-set configuration parameter, which comprises at least one of the following:

[0064] Operating system version;

[0065] Memory size;

[0066] Processor configuration;

[0067] Disk size.

[0068] The system interaction diagram in actual application is as follows: Figure 5As shown: the system includes local network device 51 and remote network device 52, remote network device 53, in S511, the local network device 51 creates a plurality of virtual machines based on the qcow2 mirror technology and creates the first level mirror file of the mirror file of the virtual machine; in S512, the local network device 51 stores the data written in the first level mirror file of the used virtual machine when using the virtual machine; in S513, the virtual machine created by the local network device can be used by the remote network device 52; in S514, the virtual machine created by the local network device can be used by the remote network device 53; in S521, the remote network device 52 stores the data written in the first level mirror file of the used virtual machine when using the virtual machine; in S531, the remote network device 53 stores the data written in the first level mirror file of the used virtual machine when using the virtual machine; in S522, S532 and S515, the local network device 51 detects whether each used virtual machine is in the shutdown state; if the virtual machine that has been shut down is detected, S516 is executed, and the first level mirror file of the virtual machine that has been shut down is deleted at the local network device 51, and a new first level mirror file without writing data is created for the virtual machine that has been shut down.

[0069] Although Figure 5 Remote network device only draws remote network device 52, remote network device 53, but in actual application, obviously not limited to only two remote network devices using the virtual machine created by the local network device 51, the local network device can create more virtual machines as possible to use the virtual machine created by the local network device. Figure 5 The specific embodiment implemented by the system is represented, which is not limited to the present scheme.

[0070] As Figure 6 As shown, the application further provides a virtual machine protection device, which is applied to a local network device:

[0071] The virtual machine generation module 602 is used to create at least one virtual machine on the local network device based on the qcow2 mirror technology and create the first level mirror file of the virtual machine;

[0072] The data storage module 604 is used to store the data written in the first level mirror file of the virtual machine when using the virtual machine;

[0073] The deletion module 606 is used to delete the first level mirror file of the virtual machine that has been shut down after detecting that at least one used virtual machine is shut down, and create a new first level mirror file without writing data for the virtual machine that has been shut down.

[0074] The virtual machine creation module 602 creates at least one virtual machine on the local network device, which is specifically used for:

[0075] The last level mirror file in the mirror file is used as a template file for creating a virtual machine, and at least one virtual machine is created according to the template file.

[0076] Before the virtual machine creating module 602 creates the virtual machine, it is further configured to receive configuration parameters set by a user, and the configuration parameters include at least one of the following:

[0077] An operating system version;

[0078] A memory size;

[0079] A processor configuration;

[0080] A disk size.

[0081] The virtual machine is used by the remote network device in a remote control manner, and the remote control manner includes:

[0082] Remote control based on an IP address of the virtual machine;

[0083] Or,

[0084] Remote control based on remote connection software.

[0085] For the device embodiment, since it basically corresponds to the method embodiment, the related parts are described in the part of the method embodiment. The device embodiment described above is only illustrative, wherein the modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical modules, i.e., they can be located in one place or distributed on multiple network modules. Some or all of the modules can be selected to achieve the purpose of the scheme of the present specification according to actual needs. Those skilled in the art can understand and implement it without creative labor.

[0086] Figure 7 The network embodiment is used for multiple user scenarios of the present application. In the embodiment, the local network device 701 creates multiple virtual machines, the remote network devices 711-714 use the virtual machines created by the local network device 701 in a remote control manner, and finally the restoration operation of the virtual machine is performed at the local network device 701.

[0087] The above described embodiments of the present description have been described. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still accomplish the desired result. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous or necessary.

[0088] Other embodiments of the present description will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The specification and examples given are intended as illustrative only and not limiting of the true scope and spirit of the present description. The true scope and spirit of the present description are indicated by the following claims.

[0089] It is to be understood that the present description is not limited to the precise details of apparatus and methods described herein and as illustrated in the drawings. Various modifications and changes can be made as would be obvious to one skilled in the art without departing from the true spirit and scope of the present description. The scope of the present description is limited only by the claims that follow.

[0090] The above description is intended to be illustrative and not restrictive. Many other embodiments will be apparent to those of skill in the art upon reviewing the above description. The scope of the description should, therefore, be determined not with reference to the above description, but instead with reference to the appended claims, along with their full scope of equivalents.

Claims

1. A method for protecting virtual machines, characterized in that, The method includes: Based on qcow2 image technology, at least one virtual machine is created on a local network device, and a first-level image file of the virtual machine's image file is created. The first-level image file stores data written by the local or remote network device when using the virtual machine. The virtual machine's image file comprises multiple levels of image files. The last-level image file in the image file serves as a template file for creating the virtual machine, which already exists before the virtual machine is created. The first-level image file and the last-level image file have a chain relationship; this chain relationship is represented as a chain structure of "last-level image file - virtual machine file - first-level image file". The virtual machine file stores the virtual machine's system-specific data. After detecting that at least one used virtual machine is shut down, the first-level image file of the shut-down virtual machine is deleted on the local network device, and a new first-level image file without written data is created for the shut-down virtual machine, so as to replace the first-level image file in the image file of the shut-down virtual machine before the shut-down virtual machine is restarted.

2. The method according to claim 1, characterized in that, Create at least one virtual machine on the local network device, including: The last-level image file in the image file is used as a template file for creating a virtual machine, and at least one virtual machine is created based on the template file.

3. The method according to claim 1, characterized in that, Before creating the virtual machine, the process also includes: receiving configuration parameters set by the user, wherein the configuration parameters include at least one of the following: Operating system version; Memory size; Processor configuration; Disk size.

4. The method according to claim 1, characterized in that, The remote network device uses the virtual machine in a remotely controlled manner, wherein the remote control manner includes: Remote control based on the IP address of the virtual machine; or, Remote control based on remote connection software.

5. A protection system for virtual machines, characterized in that, The system includes a local network device and at least one remote network device: The local network device is configured to create at least one virtual machine based on qcow2 image technology and create a first-level image file of the virtual machine's image file. Upon detecting that at least one used virtual machine has been shut down, the device deletes the first-level image file of the shut-down virtual machine and creates a new first-level image file for the shut-down virtual machine without written data, thus replacing the first-level image file in the image file of the shut-down virtual machine before the virtual machine is restarted. The first-level image file stores data written by the local network device or a remote network device when using the virtual machine. The virtual machine's image file comprises multiple levels of image files, with the last level image file serving as a template file for creating the virtual machine. This template file exists before the virtual machine is created, and the first-level image file and the last level image file have a chain relationship. This chain relationship is represented as a chain structure of "last-level image file - virtual machine file - first-level image file". The virtual machine file stores the virtual machine's system-specific data. The remote network device is used to access the virtual machine.

6. A protection device for a virtual machine, characterized in that, The apparatus implements the method according to any one of claims 1-4, the apparatus comprising: The virtual machine creation module is used to create at least one virtual machine on a local network device based on qcow2 image technology and to create a first-level image file of the virtual machine image file. The virtual machine image file includes multiple levels of image files. The last level image file in the image file serves as a template file for creating the virtual machine. This template file already exists before the virtual machine is created. The first-level image file and the last level image file have a chain relationship. The chain relationship is represented as a chain structure of "last level image file - virtual machine file - first level image file". The virtual machine file is used to store the system-specific data of the virtual machine. The data storage module is used to store the write data of the virtual machine into the first-level image file of the virtual machine when the local network device or remote network device uses the virtual machine; The deletion module is configured to, upon detecting that at least one used virtual machine has been shut down, delete the first-level image file of the shut-down virtual machine and create a new first-level image file for the shut-down virtual machine without any written data, so as to replace the first-level image file in the image file of the shut-down virtual machine before the shut-down virtual machine is restarted.

7. The apparatus according to claim 6, characterized in that, The virtual machine creation module creates at least one virtual machine on the local network device, specifically for the following purposes: The last-level image file in the image file is used as a template file for creating a virtual machine, and at least one virtual machine is created based on the template file.

8. The apparatus according to claim 6, characterized in that, Before creating the virtual machine, the virtual machine creation module is further configured to: receive configuration parameters set by the user, the configuration parameters including at least one of the following: Operating system version; Memory size; Processor configuration; Disk size.

9. The apparatus according to claim 6, characterized in that, The remote network device uses the virtual machine in a remotely controlled manner, wherein the remote control manner includes: Remote control based on the IP address of the virtual machine; or, Remote control based on remote connection software.

10. A protection device for virtual machines, characterized in that, The device includes: processor; Memory used to store processor-executable instructions; The processor executes the executable instructions to implement the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Virtual machine creation method capable of rapidly restoring system disk

    CN103473065A

  • Method and device for creating virtual machine

    CN103970585A

  • Operation method of virtual machine in desktop cloud

    CN105872016A