Method, device and storage medium for securely deleting virtual machine image files
By distinguishing the type of virtual machine mirror file and adopting different deletion methods, the problem of deletion of virtual machine image files in existing technologies has been used to delete a longer time, and a faster deletion process is achieved, while ensuring the security of sensitive data.
Patent Information
- Application Number
- CN202111325826.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-11-10
AI Technical Summary
The prior art takes a long time to delete virtual machine image files, resulting in a longer overall deletion time.
By distinguishing the virtual machine mirror files as the first data type (template data) and the second data type (user data), the ordinary deletion method and security deletion method are used for deletion. Specifically, when the mirror file type is the second data type, the security deletion method is used to ensure that the data is not leaked; when the type is the first data type, the normal deletion method is used to reduce the deletion time.
While ensuring that the second type of data is not leaked, the first type of data is processed by ordinary deletion methods, which significantly shortens the overall time consumption of the virtual machine mirror file. Especially when the number of data is greater than the second type of data, it can be able to Significantly reduce deletion time.
Smart Images

Figure CN114035897B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device and storage medium for securely deleting virtual machine image files. Background Art
[0002] In existing hyper-converged systems, most virtual machine disk data is stored in distributed storage systems. Distributed storage systems improve virtual machine availability and reliability, allowing virtual machines to be started on different machines. However, the separation of computing and storage also poses a huge challenge to data security. Distributed storage system data has multiple copies and may exist in multiple data centers or on the cloud, which places higher requirements on data security than ordinary physical servers. Some data-sensitive virtual machines also require that when the virtual machine is deleted or files are deleted in the virtual machine, the data must be completely destroyed to ensure that the data cannot be recovered through task tools.
[0003] The current secure deletion method for virtual machine image files has the disadvantage of being time-consuming. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method, device and storage medium for securely deleting virtual machine image files, so as to reduce the amount of securely deleted data, speed up the release of resources and reduce the overall deletion time during the virtual machine image file deletion process.
[0005] To this end, the present application discloses a method for securely deleting a virtual machine image file, the method comprising:
[0006] When receiving an image file deletion request for a virtual machine, searching for all image files of the virtual machine and obtaining file information of the image files;
[0007] Determining the type of the image file according to the file information of the image file, wherein the type of the image file is one of a first data type and a second data type, the image file corresponding to the first data type is installation data of the virtual machine, and the image file corresponding to the second data type is user data written during the operation of the virtual machine;
[0008] When the type of the image file is the second data type, deleting the image file based on the first interface, wherein the first interface deletes the image file in a secure deletion manner;
[0009] When the type of the image file is the first data type, the image file is deleted based on a second interface, wherein the second interface deletes the image file in a direct deletion manner.
[0010] The device of the embodiment of the present application can delete the second type of data by executing the virtual machine image file security deletion method, while using the security deletion method to delete the second type of data and ensure that the second type of data is not leaked, and the first type of data can be deleted by the ordinary deletion method, which can reduce the overall time consumption of the virtual machine image file deletion, especially under the premise that the amount of data of the first type of data is greater than the second type of data, the first type of data can be deleted by the ordinary deletion method, which can significantly shorten the overall deletion time consumption of the virtual machine image file deletion. For example, generally speaking, in a virtual machine, the amount of template data is generally 10-30GB. Each time the template data is skipped in the security deletion, a virtual machine can reduce the deletion amount of 10-30GB. On the other hand, since the embodiment of the present application uses the ordinary deletion method to delete the template data, a large number of overwrite operations in the security deletion method are reduced, thereby reducing the disk bandwidth occupancy caused by the overwrite operation, thereby reducing the impact on normal business IO. On the other hand, the present application can also reduce the disk bandwidth occupancy caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0011] Compared with the prior art, since the prior art uses a secure deletion method to delete all image files of a virtual machine, such as using a secure deletion method to delete user data and target data, the prior art has the disadvantage of being time-consuming in deleting the image files of the virtual machine as a whole because the secure deletion method is time-consuming.
[0012] In the first aspect of the present application, as an optional implementation, deleting the image file based on the first interface includes:
[0013] Determine a target overwrite file based on the first interface;
[0014] The image file is overwritten according to the target overwrite file.
[0015] This optional implementation method can overwrite the image file through the target overwrite file.
[0016] In the first aspect of the present application, as an optional implementation, after determining the type of the image file according to the file information of the image file, the method further includes:
[0017] Determine whether the image file of the first data type and the image file of the second data type exist at the same time. If they exist at the same time, first trigger the execution of deleting the image file based on the second interface, and then trigger the execution of deleting the image file based on the first interface.
[0018] In this optional implementation, since deleting the image file based on the second interface is based on deleting the image file in a normal deletion method, and the normal deletion method is faster than the secure deletion method, by giving priority to deleting the image files that can be deleted normally, the storage space occupied by such image files can be released earlier.
[0019] In the first aspect of the present application, as an optional implementation, the deleting the image file based on the second interface includes:
[0020] The storage interval reference relationship of the image file is deleted based on the second interface.
[0021] In this optional implementation method, in order to release the storage space occupied by this type of image file earlier, the storage interval reference relationship of the image file can be deleted based on the second interface.
[0022] A second aspect of the present application discloses a device for securely deleting a virtual machine image file, the device comprising:
[0023] A response module, configured to search for all image files of the virtual machine and obtain file information of the image files when receiving an image file deletion request for the virtual machine;
[0024] a first judgment module, configured to judge the type of the image file according to the file information of the image file, wherein the type of the image file is one of a first data type and a second data type, the image file corresponding to the first data type is installation data of the virtual machine, and the image file corresponding to the second data type is user data written during the operation of the virtual machine;
[0025] A first deleting module, configured to, when the type of the image file is the second data type, delete the image file based on a first interface, wherein the first interface deletes the image file in a secure deletion manner;
[0026] The second deleting module is used to delete the image file based on a second interface when the type of the image file is the first data type, wherein the second interface deletes the image file in a direct deletion manner.
[0027] The device of the present application can delete the second type of data by a safe deletion method of a virtual machine image file, while ensuring that the second type of data is not leaked, and can use a common deletion method to delete the first type of data, which can reduce the overall time consumption of deleting the image file of the virtual machine. In particular, under the premise that the amount of the first type of data is greater than the second type of data, the use of a common deletion method to delete the first type of data can significantly shorten the overall deletion time consumption of deleting the image file of the virtual machine. For example, generally speaking, in a virtual machine, the amount of template data is generally 10-30GB. Each time the template data is skipped in a safe deletion, a virtual machine can reduce the amount of deletion by 10-30GB. On the other hand, since the present application uses a common deletion method to delete the template data, a large number of overwrite operations in the safe deletion method are reduced, thereby reducing the disk bandwidth occupation caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0028] Compared with the prior art, since the prior art uses a secure deletion method to delete all image files of a virtual machine, such as using a secure deletion method to delete user data and target data, the prior art has the disadvantage of being time-consuming in deleting the image files of the virtual machine as a whole because the secure deletion method is time-consuming.
[0029] On the other hand, the device of the present application can also reduce the disk bandwidth occupancy caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0030] In the second aspect of the present application, as an optional implementation, the first deletion module includes:
[0031] A determination submodule, used to determine a target overwrite file based on the first interface;
[0032] The overwriting submodule is used to overwrite the image file according to the target overwriting file.
[0033] In the second aspect of the present application, as an optional implementation, the device further includes:
[0034] The second judgment module is used to judge whether the image file of the first data type and the image file of the second data type exist at the same time. If they exist at the same time, the execution of deleting the image file based on the second interface is triggered first, and then the execution of deleting the image file based on the first interface is triggered.
[0035] In the second aspect of the present application, as an optional implementation, the second deletion module is used to delete the storage interval reference relationship of the image file based on the second interface.
[0036] The third aspect of the present application discloses a device for securely deleting a virtual machine image file, the device comprising:
[0037] A memory storing executable program code;
[0038] a processor coupled to the memory;
[0039] The processor calls the executable program code stored in the memory to execute the method for securely deleting virtual machine image files as described in the first aspect of the present application.
[0040] The device of the present application can delete the second type of data by a safe deletion method of a virtual machine image file, while ensuring that the second type of data is not leaked, and can delete the first type of data by a normal deletion method, which can reduce the overall time consumption of deleting the image file of the virtual machine. In particular, under the premise that the amount of the first type of data is greater than the second type of data, the use of a normal deletion method to delete the first type of data can significantly shorten the overall deletion time consumption of deleting the image file of the virtual machine. For example, generally speaking, in a virtual machine, the amount of template data is generally 10-30GB. Each time the template data is skipped by safe deletion, a virtual machine can reduce the amount of deletion by 10-30GB. On the other hand, since the present application uses a normal deletion method to delete the template data, a large number of overwrite operations in the safe deletion method are reduced, thereby reducing the disk bandwidth occupation caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0041] Compared with the prior art, since the prior art uses a secure deletion method to delete all image files of a virtual machine, such as using a secure deletion method to delete user data and target data, the prior art has the disadvantage of being time-consuming in deleting the image files of the virtual machine as a whole because the secure deletion method is time-consuming.
[0042] On the other hand, the device of the present application can also reduce the disk bandwidth occupancy caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0043] The fourth aspect of the present application discloses a storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the method for securely deleting virtual machine image files described in the first aspect of the present application.
[0044] The storage medium of the present application can delete the second type of data by a safe deletion method of a virtual machine image file, while ensuring that the second type of data is not leaked by using a safe deletion method, and can reduce the overall time consumption of deleting the image file of the virtual machine by using a normal deletion method to delete the first type of data, especially under the premise that the amount of data of the first type of data is greater than that of the second type of data, using a normal deletion method to delete the first type of data can significantly shorten the overall deletion time consumption of deleting the image file of the virtual machine. For example, generally speaking, in a virtual machine, the amount of template data is generally 10-30GB. Each time the template data is skipped by safe deletion, a virtual machine can reduce the amount of deletion by 10-30GB. On the other hand, since the present application uses a normal deletion method to delete the template data, a large number of overwrite operations in the safe deletion method are reduced, thereby reducing the disk bandwidth occupation caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0045] Compared with the prior art, since the prior art uses a secure deletion method to delete all image files of a virtual machine, such as using a secure deletion method to delete user data and target data, the prior art has the disadvantage of being time-consuming in deleting the image files of the virtual machine as a whole because the secure deletion method is time-consuming.
[0046] On the other hand, the storage medium of the present application can also reduce the disk bandwidth occupancy caused by the overwrite operation, thereby reducing the impact on normal business IO. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 It is a flowchart of a method for securely deleting a virtual machine image file disclosed in Embodiment 1 of the present application;
[0049] Figure 2 It is a structural diagram of an image file of a virtual machine disclosed in Embodiment 1 of the present application;
[0050] Figure 3 It is a structural schematic diagram of a virtual machine image file secure deletion device disclosed in the first embodiment of the present application;
[0051] Figure 4 It is a structural schematic diagram of a virtual machine image file secure deletion device disclosed in Example 1 of the present application. DETAILED DESCRIPTION
[0052] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0053] Embodiment 1
[0054] See also Figure 1 , Figure 1 1 is a flowchart of a method for safely deleting a virtual machine image file disclosed in the first embodiment of the present application. Figure 1 As shown, a method for safely deleting a virtual machine image file disclosed in an embodiment of the present application includes the following steps:
[0055] 101. When receiving an image file deletion request for a virtual machine, searching for all image files of the virtual machine and obtaining file information of the image files;
[0056] 102. Determine the type of the image file according to the file information of the image file, wherein the type of the image file is one of a first data type and a second data type, the image file corresponding to the first data type is installation data of the virtual machine, and the image file corresponding to the second data type is user data written during the operation of the virtual machine;
[0057] 103. When the type of the image file is the second data type, delete the image file based on the first interface, wherein the first interface deletes the image file in a secure deletion manner;
[0058] 104. When the type of the image file is the first data type, delete the image file based on the second interface, wherein the second interface deletes the image file in a direct deletion manner.
[0059] In an embodiment of the present application, the image file of the virtual machine can be divided into user data and template data, that is, when the type of the image file is the first data type, it represents that the current image file is template data, and when the type of the image file is the second data type, it represents that the current image file is user data, wherein user data is newly written data when the virtual machine is running. This data is related to the user, and therefore is private data and needs to be prevented from being leaked, so this data needs to be securely deleted. On the other hand, template data is data required for installing the virtual machine. The purpose of this data is to install the virtual machine on the host machine, and it has nothing to do with the user, and therefore is not private data.
[0060] Based on this, since the template data does not need to consider the problem of data leakage caused by complete deletion, when deleting the image file of the virtual machine, the embodiment of the present application first identifies whether the image file of the virtual machine belongs to user data or template data, and then adopts different deletion operations based on the identification result. In this process, since the embodiment of the present application adopts the ordinary deletion method for template data, it can reduce the time consumption of deleting the template data, thereby reducing the overall time consumption of deleting the image file of the virtual machine. Among them, compared with the safe deletion method, the ordinary deletion method does not need to overwrite the data in the hard disk, so it has a shorter time consumption. On the other hand, the embodiment of the present application adopts the safe deletion method for user data with leakage risk, so that the user data can be overwritten, thereby making the user data irreversible, that is, the user data cannot be restored, and finally the user data cannot be restored after the safe deletion is performed.
[0061] In summary, the method of the embodiment of the present application uses a safe deletion method to delete the second type of data while ensuring that the second type of data is not leaked, and uses a normal deletion method to delete the first type of data, which can reduce the overall time consumption of deleting the image file of the virtual machine. In particular, under the premise that the amount of data of the first type of data is greater than that of the second type of data, the use of a normal deletion method to delete the first type of data can significantly shorten the overall deletion time consumption of deleting the image file of the virtual machine. For example, generally speaking, in a virtual machine, the amount of template data is generally 10-30GB. Each time the template data is skipped during safe deletion, a virtual machine can reduce the amount of deletion by 10-30GB. On the other hand, since the embodiment of the present application uses a normal deletion method to delete the template data, a large number of overwrite operations in the safe deletion method are reduced, thereby reducing the disk bandwidth occupancy caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0062] Compared with the prior art, since the prior art uses a secure deletion method to delete all image files of a virtual machine, such as using a secure deletion method to delete user data and target data, the prior art has the disadvantage of being time-consuming in deleting the image files of the virtual machine as a whole because the secure deletion method is time-consuming.
[0063] In the embodiments of the present application, specifically, Figure 2 As shown, the image file of the virtual machine is divided into a writable image file, a user snapshot image file, and a template snapshot image file, wherein the writable image file and the user snapshot image file are user data, and the template snapshot image file is template data.
[0064] It should be noted that the method of the embodiment of the present application can be applied to hyper-convergence and desktop cloud products, wherein the hyper-convergence and desktop cloud products can enable multiple people to share the desktop of a host. In this way, in order to ensure the data security of each user, the virtual machines in the hyper-convergence and desktop cloud products need to be deleted.
[0065] In the embodiment of the present application, for step 103, the first interface refers to a function that calls a secure deletion module, wherein the secure deletion module includes the implementation logic of how to specifically perform the secure deletion step, so the first interface calls the secure deletion module to implement the secure deletion operation on the second type of data. On the other hand, the second interface refers to a function that calls a normal deletion module, wherein the normal deletion module includes the implementation logic of how to specifically perform the normal deletion step.
[0066] In the embodiments of the present application, it should be noted that for the calling process of the first interface and the second interface, please refer to the prior art, and the embodiments of the present application do not limit this.
[0067] In the embodiment of the present application, as an optional implementation manner, deleting the image file based on the first interface includes:
[0068] Determine a target overwrite file based on the first interface;
[0069] Overwrite the image file according to the target overwrite file.
[0070] In this optional implementation method, since the secure deletion method requires the use of other data to overwrite the data in the disk, a target overwrite file is required, wherein the target overwrite file can be a binary file.
[0071] This optional implementation method can overwrite the image file through the target overwrite file.
[0072] In the embodiment of the present application, as an optional implementation, after determining the type of the image file according to the file information of the image file, the method of the embodiment of the present application further includes:
[0073] Determine whether a mirror file of the first data type and a mirror file of the second data type exist at the same time. If both exist, first trigger the execution of deleting the mirror file based on the second interface, and then trigger the execution of deleting the mirror file based on the first interface.
[0074] In this optional implementation, since deleting the image file based on the second interface is based on deleting the image file in a normal deletion method, and the normal deletion method is faster than the secure deletion method, by giving priority to deleting the image files that can be deleted normally, the storage space occupied by such image files can be released earlier.
[0075] In the embodiment of the present application, as an optional implementation, deleting the image file based on the second interface includes:
[0076] The storage interval reference relationship of the image file is deleted based on the second interface.
[0077] In this optional implementation method, in order to release the storage space occupied by this type of image file earlier, the storage interval reference relationship of the image file can be deleted based on the second interface.
[0078] Embodiment 2
[0079] See also Figure 3 , Figure 3 Schematic diagram of a structure of a virtual machine image file security deletion device disclosed in an embodiment of the present application. Figure 3 As shown, a virtual machine image file secure deletion device disclosed in an embodiment of the present application includes the following functional modules:
[0080] The response module 201 is used to search all the image files of the virtual machine and obtain the file information of the image files when receiving the image file deletion request for the virtual machine;
[0081] A first determination module 202 is used to determine the type of the image file according to the file information of the image file, wherein the type of the image file is one of a first data type and a second data type, the image file corresponding to the first data type is the installation data of the virtual machine, and the image file corresponding to the second data type is the user data written during the operation of the virtual machine;
[0082] A first deleting module 203, configured to delete the image file based on a first interface when the type of the image file is a first data type, wherein the first interface deletes the image file in a secure deletion manner;
[0083] The second deleting module 204 is configured to delete the image file based on the second interface when the type of the image file is the second data type, wherein the second interface deletes the image file in a direct deletion manner.
[0084] In the second aspect of the present application, as an optional implementation, the first deletion module includes:
[0085] A determination submodule, used to determine a target overwrite file based on the first interface;
[0086] The overwrite submodule is used to overwrite the image file according to the target overwrite file.
[0087] In the second aspect of the present application, as an optional implementation, the device further includes:
[0088] The second judgment module is used to judge whether there are image files of the first data type and image files of the second data type at the same time. If they exist at the same time, the execution of deleting the image files based on the second interface is triggered first, and then the execution of deleting the image files based on the first interface is triggered.
[0089] In the second aspect of the present application, as an optional implementation, the second deletion module is used to delete the storage interval reference relationship of the image file based on the second interface.
[0090] The device of the embodiment of the present application can delete the second type of data by executing the virtual machine image file security deletion method, while using the security deletion method to delete the second type of data and ensuring that the second type of data is not leaked, and using the ordinary deletion method to delete the first type of data can reduce the overall time consumption of the virtual machine image file deletion, especially under the premise that the amount of data of the first type of data is greater than the second type of data, using the ordinary deletion method to delete the first type of data can significantly shorten the overall deletion time consumption of the virtual machine image file deletion. For example, generally speaking, in a virtual machine, the amount of template data is generally 10-30GB. Each time the template data is skipped in the security deletion, a virtual machine can reduce the deletion amount of 10-30GB. On the other hand, because the embodiment of the present application uses the ordinary deletion method to delete the template data, a large number of overwrite operations in the security deletion method are reduced, thereby reducing the disk bandwidth occupation caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0091] Compared with the prior art, since the prior art uses a secure deletion method to delete all image files of a virtual machine, such as using a secure deletion method to delete user data and target data, the prior art has the disadvantage of being time-consuming in deleting the image files of the virtual machine as a whole because the secure deletion method is time-consuming.
[0092] On the other hand, the embodiments of the present application can also reduce the disk bandwidth occupancy caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0093] It should be noted that for other descriptions about the device of the embodiment of the present application, please refer to the first embodiment of the present application, and the embodiment of the present application will not be elaborated on this.
[0094] Embodiment 3
[0095] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of a virtual machine image file security deletion device disclosed in the first embodiment of the present application. Figure 4 As shown, a virtual machine image file secure deletion device disclosed in an embodiment of the present application includes:
[0096] A memory 302 storing executable program code;
[0097] A processor 301 coupled to a memory;
[0098] The processor calls the executable program code stored in the memory 302 to execute the method for securely deleting a virtual machine image file as disclosed in the first embodiment of the present application.
[0099] The device of the embodiment of the present application can delete the second type of data by executing the virtual machine image file security deletion method, while using the security deletion method to delete the second type of data and ensure that the second type of data is not leaked, and at the same time, using the ordinary deletion method to delete the first type of data can reduce the overall time consumption of the virtual machine image file deletion, especially under the premise that the amount of data of the first type of data is greater than the second type of data, using the ordinary deletion method to delete the first type of data can significantly shorten the overall deletion time consumption of the virtual machine image file deletion. For example, generally speaking, in a virtual machine, the amount of template data is generally 10-30GB. Each time the template data is skipped during security deletion, a virtual machine can reduce the amount of deletion by 10-30GB. On the other hand, since the embodiment of the present application uses the ordinary deletion method to delete the template data, a large number of overwrite operations in the security deletion method are reduced, thereby reducing the disk bandwidth occupation caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0100] Compared with the prior art, since the prior art uses a secure deletion method to delete all image files of a virtual machine, such as using a secure deletion method to delete user data and target data, the prior art has the disadvantage of being time-consuming in deleting the image files of the virtual machine as a whole because the secure deletion method is time-consuming.
[0101] On the other hand, the embodiments of the present application can also reduce the disk bandwidth occupancy caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0102] Embodiment 4
[0103] An embodiment of the present application discloses a storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the method for securely deleting virtual machine image files disclosed in the first embodiment of the present application.
[0104] The storage medium of the embodiment of the present application can delete the second type of data by executing the virtual machine image file security deletion method, while ensuring that the second type of data is not leaked by deleting the second type of data by the security deletion method, and can reduce the overall time consumption of deleting the virtual machine image file by using the ordinary deletion method to delete the first type of data, especially under the premise that the amount of data of the first type of data is greater than the second type of data, the use of the ordinary deletion method to delete the first type of data can significantly shorten the overall deletion time consumption of deleting the virtual machine image file. For example, generally speaking, in a virtual machine, the amount of template data is generally 10-30GB. Each time the template data is skipped during security deletion, a virtual machine can reduce the amount of deletion by 10-30GB. On the other hand, since the embodiment of the present application uses the ordinary deletion method to delete the template data, a large number of overwrite operations in the security deletion method are reduced, thereby reducing the disk bandwidth occupation caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0105] Compared with the prior art, since the prior art uses a secure deletion method to delete all image files of a virtual machine, such as using a secure deletion method to delete user data and target data, the prior art has the disadvantage of being time-consuming in deleting the image files of the virtual machine as a whole because the secure deletion method is time-consuming.
[0106] On the other hand, the embodiments of the present application can also reduce the disk bandwidth occupancy caused by the overwrite operation, thereby reducing the impact on normal business IO.
[0107] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0108] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0109] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0110] It should be noted that if the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM) random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0111] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0112] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for securely deleting a virtual machine image file, characterized in that: The method comprises: When receiving an image file deletion request for a virtual machine, searching for all image files of the virtual machine and obtaining file information of the image files; Determining the type of the image file according to the file information of the image file, wherein the type of the image file is one of a first data type and a second data type, the image file corresponding to the first data type is installation data of the virtual machine, and the image file corresponding to the second data type is user data written during the operation of the virtual machine; When the type of the image file is the second data type, deleting the image file based on the first interface, wherein the first interface deletes the image file in a secure deletion manner; When the type of the image file is the first data type, deleting the image file based on a second interface, wherein the second interface deletes the image file in a direct deletion manner; And, after determining the type of the image file according to the file information of the image file, the method further includes: Determine whether the image file of the first data type and the image file of the second data type exist at the same time. If they exist at the same time, first trigger the execution of deleting the image file based on the second interface, and then trigger the execution of deleting the image file based on the first interface.
2. The method according to claim 1, characterized in that The deleting the image file based on the first interface includes: Determine a target overwrite file based on the first interface; The image file is overwritten according to the target overwrite file.
3. The method according to claim 1, characterized in that The deleting the image file based on the second interface includes: The storage interval reference relationship of the image file is deleted based on the second interface.
4. A device for safely deleting virtual machine image files, characterized in that: The device comprises: A response module, configured to search for all image files of the virtual machine and obtain file information of the image files when receiving an image file deletion request for the virtual machine; a first judgment module, configured to judge the type of the image file according to the file information of the image file, wherein the type of the image file is one of a first data type and a second data type, the image file corresponding to the first data type is installation data of the virtual machine, and the image file corresponding to the second data type is user data written during the operation of the virtual machine; A first deleting module, configured to, when the type of the image file is the second data type, delete the image file based on a first interface, wherein the first interface deletes the image file in a secure deletion manner; A second deleting module, configured to delete the image file based on a second interface when the type of the image file is the first data type, wherein the second interface deletes the image file in a direct deletion manner; And, the device further comprises: The second judgment module is used to judge whether the image file of the first data type and the image file of the second data type exist at the same time. If they exist at the same time, the execution of deleting the image file based on the second interface is triggered first, and then the execution of deleting the image file based on the first interface is triggered.
5. The device according to claim 4, characterized in that The first deletion module includes: A determination submodule, used to determine a target overwrite file based on the first interface; The overwriting submodule is used to overwrite the image file according to the target overwriting file.
6. The device according to claim 4, characterized in that The second deleting module is used to delete the storage interval reference relationship of the image file based on the second interface.
7. A virtual machine image file secure deletion device, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the method for securely deleting a virtual machine image file as described in any one of claims 1 to 3.
8. A storage medium, characterized in that: The storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the method for securely deleting a virtual machine image file as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Virtual machine mirror image version management method
CN110737506A
Data soft destruction method, system and device and medium
CN113138723A