CN114035897A - Method and device for safely deleting mirror image file of virtual machine and storage medium - Google Patents

Method and device for safely deleting mirror image file of virtual machine and storage medium Download PDF

Info

Publication number
CN114035897A
CN114035897A CN202111325826.1A CN202111325826A CN114035897A CN 114035897 A CN114035897 A CN 114035897A CN 202111325826 A CN202111325826 A CN 202111325826A CN 114035897 A CN114035897 A CN 114035897A
Authority
CN
China
Prior art keywords
image file
deleting
type
virtual machine
data
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202111325826.1A
Other languages
Chinese (zh)
Inventor
陈仲涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
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 Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202111325826.1A priority Critical patent/CN114035897A/en
Publication of CN114035897A publication Critical patent/CN114035897A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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/45579I/O management, e.g. providing access to device drivers or storage

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method, a device and a storage medium for safely deleting a virtual machine image file, wherein the method for safely deleting the virtual machine image file comprises the following steps: when an image file deleting request aiming at the virtual machine is received, searching all image files of the virtual machine and obtaining file information of the image files; judging the type of the mirror image file according to the file information of the mirror image file, wherein the type of the mirror image file is one of a first data type and a second data type; when the type of the mirror image file is a first data type, deleting the mirror image file based on a first interface, wherein the first interface deletes the mirror image file in a safe deleting mode; and when the type of the image file is a second data type, deleting the image file based on a second interface, wherein the second interface deletes the image file in a direct deleting mode. According to the method and the device, the safe deleted data volume can be reduced, the release of resources is accelerated, and the overall deleting time is shortened in the virtual machine image file deleting process.

Description

Method and device for safely deleting mirror image file of virtual machine and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a storage medium for securely deleting a virtual machine image file.
Background
In the existing super-fusion system, most of the disk data of the virtual machine is stored in a distributed storage system. The distributed storage system improves the availability and reliability of the virtual machine, so that the virtual machine can be started on different machines. The separation of computing storage also makes data security a significant challenge. Distributed storage system data has multiple copies, and may exist in multiple data centers, or on the cloud side, and the requirement for data security may be higher than that of an ordinary physical server. When some data-sensitive virtual machines need to delete a virtual machine or delete a file in the virtual machine, the data needs to be destroyed completely, and the data cannot be recovered through a task tool.
The existing safe deleting method of the mirror image file of the virtual machine has the defect of time consumption in deleting.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, an apparatus, and a storage medium for safely deleting a virtual machine image file, so as to reduce the amount of data to be safely deleted, accelerate the release of resources, and reduce the overall deletion time in the process of deleting the virtual machine image file.
Therefore, the application discloses a method for safely deleting a virtual machine image file, which comprises the following steps:
when an image file deleting request aiming at a virtual machine is received, searching all image files of the virtual machine and obtaining file information of the image files;
judging 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 in the running process of the virtual machine;
when the type of the image file is the second data type, deleting the image file based on a first interface, wherein the first interface deletes the image file in a safe deleting mode;
and 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 mode.
By executing the method for safely deleting the image file of the virtual machine, the device of the embodiment of the application can delete the second type of data in a safe deletion mode to ensure that the second type of data is not leaked, delete the first type of data in a common deletion mode to reduce the overall time consumption of deleting the image file of the virtual machine, and delete the first type of data in the common deletion mode on the premise that the data volume of the first type of data is larger than that of the second type of data, so that the overall time consumption of deleting the image file of the virtual machine can be remarkably shortened, for example, generally speaking, in the virtual machine, the data volume of template data is generally 10-30GB, and when the template data is skipped through safe deletion every time, the deletion volume of 10-30GB can be reduced by one virtual machine. On the other hand, as the template data is deleted in the ordinary deletion mode, a large number of overwriting operations in the safe deletion mode are reduced, the occupation of the disk bandwidth caused by the overwriting operations is reduced, and the influence on normal service IO is reduced. In addition, the method and the device can reduce the occupation of the disk bandwidth caused by the overwriting operation, thereby reducing the influence on normal service IO.
Compared with the prior art, in the prior art, all the image files of the virtual machine are deleted in a safe deletion mode, for example, user data and target data are deleted in a safe deletion mode, so that the time consumption of the safe deletion mode is high, and the defect that the time consumption of the whole deletion of the image files of the virtual machine is high in the prior art is overcome.
In the first aspect of the present application, as an optional implementation manner, the deleting the image file based on the first interface includes:
determining a target overwrite file based on the first interface;
overwriting the image file according to the target overwrite file.
The alternative implementation can overwrite the image file with the target overwrite file.
In the first aspect of the present application, as an optional implementation manner, after the determining, according to the file information of the image file, the method further includes:
judging whether the image file with the type of the first data type and the image file with the type of the second data type exist at the same time, if so, triggering and executing the second interface-based deletion of the image file, and then triggering and executing the first interface-based deletion of the image file.
In the optional embodiment, since the image file deletion based on the second interface is based on a normal deletion mode, and the normal deletion method is faster than the secure deletion mode, the storage space occupied by the image file can be released earlier by preferentially deleting the image file capable of being deleted normally.
In the first aspect of the present application, as an optional implementation manner, the deleting the image file based on the second interface includes:
and deleting the storage interval reference relation of the mirror image file based on the second interface.
In the optional implementation method, in order to release the storage space occupied by the image file earlier, the reference relation of the storage interval of the image file can be deleted based on the second interface.
The second aspect of the present application discloses a device for safely deleting a virtual machine image file, the device includes:
the response module is used for searching all image files of the virtual machine and obtaining file information of the image files when receiving an image file deleting request aiming at the virtual machine;
the first judging module is used for judging 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 in the running process of the virtual machine;
the first deleting module is used for deleting the image file based on a first interface when the type of the image file is the second data type, wherein the first interface deletes the image file in a safe deleting mode;
and the second deleting module is used for deleting 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 deleting mode.
According to the device, by executing the safe deletion method of the image file of the virtual machine, the second type of data can be deleted in a safe deletion mode to ensure that the second type of data is not leaked, meanwhile, the first type of data can be deleted in a common deletion mode to reduce the overall time consumption of deleting the image file of the virtual machine, especially on the premise that the data quantity of the first type of data is larger than that of the second type of data, the first type of data is deleted in the common deletion mode to remarkably shorten the overall time consumption of deleting the image file of the virtual machine, for example, generally speaking, in the virtual machine, the data quantity of template data is generally 10-30GB, and the template data is skipped in each safe deletion, so that the deletion quantity of 10-30GB can be reduced by one virtual machine. On the other hand, the template data is deleted by adopting a common deletion mode, so that the overwriting operation in a large number of safe deletion modes is reduced, the occupation of the disk bandwidth caused by the overwriting operation is reduced, and the influence on normal service IO is reduced.
Compared with the prior art, in the prior art, all the image files of the virtual machine are deleted in a safe deletion mode, for example, user data and target data are deleted in a safe deletion mode, so that the time consumption of the safe deletion mode is high, and the defect that the time consumption of the whole deletion of the image files of the virtual machine is high in the prior art is overcome.
On the other hand, the device of the application can also reduce the occupation of the disk bandwidth caused by the overwriting operation, thereby reducing the influence on normal service IO.
In the second aspect of the present application, as an optional implementation manner, the first deleting module includes:
a determination submodule for determining a target overwrite file based on the first interface;
and the overwriting submodule is used for overwriting the image file according to the target overwriting file.
In the second aspect of the present application, as an optional implementation, the apparatus further includes:
and the second judging module is used for judging whether the image file with the type of the first data type and the image file with the type of the second data type exist at the same time, if so, the image file is triggered to be deleted based on the second interface and then the image file is triggered to be deleted based on the first interface.
In the second aspect of the present application, as an optional implementation manner, the second deleting module is configured to delete the storage interval reference relationship of the image file based on the second interface.
A third aspect of the present application discloses a device for securely deleting an image file of a virtual machine, where the device includes:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the method for safely deleting the virtual machine image file according to the first aspect of the application.
By executing the method for safely deleting the image file of the virtual machine, the device can delete the second type of data in a safe deletion mode to ensure that the second type of data is not leaked, delete the first type of data in a common deletion mode to reduce the overall time consumption for deleting the image file of the virtual machine, and delete the first type of data in a common deletion mode on the premise that the data volume of the first type of data is larger than that of the second type of data to remarkably shorten the overall time consumption for deleting the image file of the virtual machine, for example, generally speaking, in the virtual machine, the data volume of template data is generally 10-30GB, and the template data is skipped in each safe deletion, so that the deletion volume of 10-30GB can be reduced by one virtual machine. On the other hand, the template data is deleted by adopting a common deletion mode, so that the overwriting operation in a large number of safe deletion modes is reduced, the occupation of the disk bandwidth caused by the overwriting operation is reduced, and the influence on normal service IO is reduced.
Compared with the prior art, in the prior art, all the image files of the virtual machine are deleted in a safe deletion mode, for example, user data and target data are deleted in a safe deletion mode, so that the time consumption of the safe deletion mode is high, and the defect that the time consumption of the whole deletion of the image files of the virtual machine is high in the prior art is overcome.
On the other hand, the device of the application can also reduce the occupation of the disk bandwidth caused by the overwriting operation, thereby reducing the influence on normal service IO.
A fourth aspect of the present application discloses a storage medium, where the storage medium stores a computer instruction, and the computer instruction is used to execute the method for securely deleting a virtual machine image file according to the first aspect of the present application when the computer instruction is called.
By executing the method for safely deleting the image file of the virtual machine, the storage medium can delete the second type of data in a safe deletion mode to ensure that the second type of data is not leaked, delete the first type of data in a common deletion mode to reduce the overall time consumption of deleting the image file of the virtual machine, and delete the first type of data in a common deletion mode on the premise that the data volume of the first type of data is larger than that of the second type of data to remarkably shorten the overall time consumption of deleting the image file of the virtual machine, for example, in general, in the virtual machine, the data volume of template data is generally 10-30GB, and when the template data is skipped during each safe deletion, the deletion volume of 10-30GB can be reduced by one virtual machine. On the other hand, the template data is deleted by adopting a common deletion mode, so that the overwriting operation in a large number of safe deletion modes is reduced, the occupation of the disk bandwidth caused by the overwriting operation is reduced, and the influence on normal service IO is reduced.
Compared with the prior art, in the prior art, all the image files of the virtual machine are deleted in a safe deletion mode, for example, user data and target data are deleted in a safe deletion mode, so that the time consumption of the safe deletion mode is high, and the defect that the time consumption of the whole deletion of the image files of the virtual machine is high in the prior art is overcome.
On the other hand, the storage medium of the application can also reduce the occupation of the disk bandwidth caused by the overwriting operation, thereby reducing the influence on the normal service IO.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flowchart illustrating a method for securely deleting an image file of a virtual machine according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an image file of a virtual machine according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a device for securely deleting an image file of a virtual machine according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a device for securely deleting an image file of a virtual machine according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Example one
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for securely deleting a virtual machine image file according to an embodiment of the present disclosure. As shown in fig. 1, a method for securely deleting a virtual machine image file disclosed in the embodiment of the present application includes the following steps:
101. when an image file deleting request aiming at the virtual machine is received, searching all image files of the virtual machine and obtaining file information of the image files;
102. judging 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 a virtual machine, and the image file corresponding to the second data type is user data written in the running process of the virtual machine;
103. when the type of the mirror image file is a second data type, deleting the mirror image file based on a first interface, wherein the first interface deletes the mirror image file in a safe deleting mode;
104. and when the type of the image file is the first data type, deleting the image file based on the second interface, wherein the second interface deletes the image file in a direct deleting mode.
In this embodiment of the application, the image file of the virtual machine may be divided into user data and template data, that is, when the type of the image file is the first data type, the current image file is characterized as template data, and when the type of the image file is the second data type, the current image file is characterized as user data, where the user data is data newly written in the virtual machine during operation, and the data is related to a user and therefore belongs to private data and needs to be prevented from being leaked, so that the data needs to be safely deleted.
Based on this, the template data does not need to be considered to be deleted completely to cause data leakage, so that when the image file of the virtual machine is deleted, whether the image file of the virtual machine belongs to user data or the template data is firstly identified, different deletion operations are adopted based on the identification result, in the process, as for the template data, the embodiment of the application adopts a common deletion mode to delete, the time consumption of deleting the template data can be reduced, and the whole time consumption of deleting the image file of the virtual machine is reduced. On the other hand, the user data with the leakage risk is deleted in a safe deletion mode, so that the user data can be overwritten, the user data is irreversible, the user data cannot be restored, and finally the user data cannot be restored after the safe deletion is executed.
To sum up, according to the method of the embodiment of the present application, while it is ensured that the second type of data is not leaked by deleting the second type of data in a secure deletion manner, deleting the first type of data in a normal deletion manner can reduce the overall time consumption for deleting the image file of the virtual machine, and especially on the premise that the data amount of the first type of data is greater than that of the second type of data, deleting the first type of data in a normal deletion manner can significantly reduce the overall time consumption for deleting the image file of the virtual machine, for example, in general, in the virtual machine, the data amount of the template data is generally 10 to 30GB, and when the template data is skipped for secure deletion, the deletion amount of 10 to 30GB for one virtual machine can be reduced. On the other hand, as the template data is deleted in the ordinary deletion mode, a large number of overwriting operations in the safe deletion mode are reduced, the occupation of the disk bandwidth caused by the overwriting operations is reduced, and the influence on normal service IO is reduced.
Compared with the prior art, in the prior art, all the image files of the virtual machine are deleted in a safe deletion mode, for example, user data and target data are deleted in a safe deletion mode, so that the time consumption of the safe deletion mode is high, and the defect that the time consumption of the whole deletion of the image files of the virtual machine is high in the prior art is overcome.
In this embodiment of the application, specifically, as shown in fig. 2, the image files of the virtual machine are divided into a writable image file, a user snapshot image file, and a template snapshot image file, where the writable image file and the user snapshot image file are user data, and the template snapshot image file is template data.
It should be noted that the method of the embodiment of the present application may be applied to a super-convergence and desktop cloud product, where the super-convergence and desktop cloud product may implement that multiple users share a desktop of a host, and thus, in order to ensure data security of each user, virtual machines in the super-convergence and desktop cloud product need to be deleted.
In this embodiment of the application, for step 103, the first interface refers to a function that calls a secure deletion module, where the secure deletion module includes implementation logic for specifically how to execute the secure deletion step, and therefore the first interface calls the secure deletion module to enable the secure deletion operation to be performed on the second type of data. On the other hand, the second interface is a function for calling a normal deletion module, wherein the normal deletion module includes implementation logic for specifically executing the normal deletion step.
In the embodiment of the present application, please refer to the prior art for the calling process of the first interface and the second interface, which is not limited in the embodiment of the present application.
In this embodiment of the present application, as an optional implementation manner, deleting an image file based on a first interface includes:
determining a target overwrite file based on the first interface;
the image file is overwritten according to the target overwrite file.
In this optional implementation method, since the secure deletion mode needs to overwrite data in the disk with other data, an object overwrite file needs to be used, where the object overwrite file may be a binary file.
The alternative implementation can overwrite the image file with the target overwrite file.
In this embodiment of the present application, as an optional implementation manner, after determining the type of the image file according to the file information of the image file, the method according to this embodiment of the present application further includes:
judging whether a mirror image file with the type of a first data type and a mirror image file with the type of a second data type exist at the same time, if so, triggering execution to delete the mirror image file based on a second interface, and then triggering execution to delete the mirror image file based on the first interface.
In the optional embodiment, since the image file deletion based on the second interface is based on a normal deletion mode, and the normal deletion method is faster than the secure deletion mode, the storage space occupied by the image file can be released earlier by preferentially deleting the image file capable of being deleted normally.
In this embodiment of the present application, as an optional implementation manner, deleting an image file based on a second interface includes:
and deleting the storage interval reference relation of the image file based on the second interface.
In the optional implementation method, in order to release the storage space occupied by the image file earlier, the reference relation of the storage interval of the image file can be deleted based on the second interface.
Example two
Referring to fig. 3, fig. 3 is a schematic structural diagram of a device for securely deleting an image file of a virtual machine according to an embodiment of the present disclosure. As shown in fig. 3, a device for securely deleting an image file of a virtual machine disclosed in the embodiment of the present application includes the following functional modules:
the response module 201 is configured to, when receiving an image file deletion request for a virtual machine, search all image files of the virtual machine and obtain file information of the image files;
the first judging module 202 is configured to judge the type of the image file according to file information of the image file, where 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 a virtual machine, and the image file corresponding to the second data type is user data written in the running process of the virtual machine;
the first deleting module 203 is configured to delete the image file based on a first interface when the type of the image file is a first data type, where the first interface deletes the image file in a secure deleting manner;
the second deleting module 204 is configured to delete the image file based on a second interface when the type of the image file is the second data type, where the second interface deletes the image file in a direct deletion manner.
In a second aspect of the present application, as an optional implementation manner, the first deleting module includes:
a determination submodule for determining a target overwrite file based on the first interface;
and the overwriting submodule is used for overwriting the image file according to the target overwriting file.
In the second aspect of the present application, as an optional implementation, the apparatus further includes:
and the second judgment module is used for judging whether the mirror image file with the type of the first data type and the mirror image file with the type of the second data type exist at the same time, if so, the mirror image file is triggered to be deleted based on the second interface and then the mirror image file is triggered to be deleted based on the first interface.
In the second aspect of the present application, as an optional implementation manner, the second deletion module is configured to delete the storage interval reference relationship of the image file based on the second interface.
By executing the method for safely deleting the image file of the virtual machine, the device of the embodiment of the application can delete the second type of data in a safe deletion mode to ensure that the second type of data is not leaked, delete the first type of data in a common deletion mode to reduce the overall time consumption of deleting the image file of the virtual machine, and delete the first type of data in the common deletion mode on the premise that the data volume of the first type of data is larger than that of the second type of data, so that the overall time consumption of deleting the image file of the virtual machine can be remarkably shortened, for example, generally speaking, in the virtual machine, the data volume of template data is generally 10-30GB, and when the template data is skipped through safe deletion every time, the deletion volume of 10-30GB can be reduced by one virtual machine. On the other hand, as the template data is deleted in the ordinary deletion mode, a large number of overwriting operations in the safe deletion mode are reduced, the occupation of the disk bandwidth caused by the overwriting operations is reduced, and the influence on normal service IO is reduced.
Compared with the prior art, in the prior art, all the image files of the virtual machine are deleted in a safe deletion mode, for example, user data and target data are deleted in a safe deletion mode, so that the time consumption of the safe deletion mode is high, and the defect that the time consumption of the whole deletion of the image files of the virtual machine is high in the prior art is overcome.
On the other hand, the embodiment of the application can also reduce the occupation of the disk bandwidth caused by the overwriting operation, thereby reducing the influence on normal service IO.
Please refer to the first embodiment of the present application for other descriptions of the apparatus according to the embodiments of the present application, which are not repeated herein.
EXAMPLE III
Referring to fig. 4, fig. 4 is a schematic structural diagram of a device for securely deleting an image file of a virtual machine according to an embodiment of the present application. As shown in fig. 4, a device for securely deleting an image file of a virtual machine disclosed in an embodiment of the present application includes:
a memory 302 storing executable program code;
a processor 301 coupled to the memory;
the processor calls the executable program code stored in the memory 302 to execute the method for securely deleting the virtual machine image file as disclosed in the first embodiment of the present application.
By executing the method for safely deleting the image file of the virtual machine, the device of the embodiment of the application can delete the second type of data in a safe deletion mode to ensure that the second type of data is not leaked, delete the first type of data in a common deletion mode to reduce the overall time consumption of deleting the image file of the virtual machine, and delete the first type of data in a common deletion mode on the premise that the data amount of the first type of data is larger than that of the second type of data, so that the overall time consumption of deleting the image file of the virtual machine can be remarkably shortened, for example, generally speaking, in the virtual machine, the data amount of template data is generally 10-30GB, and when the template data is skipped through safe deletion every time, the deletion amount of 10-30GB can be reduced by one virtual machine. On the other hand, as the template data is deleted in the ordinary deletion mode, a large number of overwriting operations in the safe deletion mode are reduced, the occupation of the disk bandwidth caused by the overwriting operations is reduced, and the influence on normal service IO is reduced.
Compared with the prior art, in the prior art, all the image files of the virtual machine are deleted in a safe deletion mode, for example, user data and target data are deleted in a safe deletion mode, so that the time consumption of the safe deletion mode is high, and the defect that the time consumption of the whole deletion of the image files of the virtual machine is high in the prior art is overcome.
On the other hand, the embodiment of the application can also reduce the occupation of the disk bandwidth caused by the overwriting operation, thereby reducing the influence on normal service IO.
Example four
The embodiment of the application discloses a storage medium, wherein a computer instruction is stored in the storage medium, and when the computer instruction is called, the storage medium is used for executing the method for safely deleting the mirror image file of the virtual machine disclosed by the embodiment of the application.
By executing the method for safely deleting the image file of the virtual machine, the storage medium of the embodiment of the application can delete the second type of data in a safe deletion mode to ensure that the second type of data is not leaked, and delete the first type of data in a common deletion mode to reduce the overall time consumption of deleting the image file of the virtual machine, especially delete the first type of data in a common deletion mode on the premise that the data amount of the first type of data is larger than that of the second type of data, so that the overall time consumption of deleting the image file of the virtual machine can be remarkably shortened, for example, generally speaking, in the virtual machine, the data amount of template data is generally 10-30GB, and one virtual machine can reduce the deletion amount of 10-30GB when skipping the template data for each safe deletion. On the other hand, as the template data is deleted in the ordinary deletion mode, a large number of overwriting operations in the safe deletion mode are reduced, the occupation of the disk bandwidth caused by the overwriting operations is reduced, and the influence on normal service IO is reduced.
Compared with the prior art, in the prior art, all the image files of the virtual machine are deleted in a safe deletion mode, for example, user data and target data are deleted in a safe deletion mode, so that the time consumption of the safe deletion mode is high, and the defect that the time consumption of the whole deletion of the image files of the virtual machine is high in the prior art is overcome.
On the other hand, the embodiment of the application can also reduce the occupation of the disk bandwidth caused by the overwriting operation, thereby reducing the influence on normal service IO.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
It should be noted that the functions, if implemented in the form of software functional modules and sold or used as independent products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method for safely deleting a virtual machine image file is characterized by comprising the following steps:
when an image file deleting request aiming at a virtual machine is received, searching all image files of the virtual machine and obtaining file information of the image files;
judging 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 in the running process of the virtual machine;
when the type of the image file is the second data type, deleting the image file based on a first interface, wherein the first interface deletes the image file in a safe deleting mode;
and 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 mode.
2. The method of claim 1, wherein the deleting the image file based on the first interface comprises:
determining a target overwrite file based on the first interface;
overwriting the image file according to the target overwrite file.
3. The method of claim 1, wherein after the determining the type of the image file from the file information of the image file, the method further comprises:
judging whether the image file with the type of the first data type and the image file with the type of the second data type exist at the same time, if so, triggering and executing the second interface-based deletion of the image file, and then triggering and executing the first interface-based deletion of the image file.
4. The method of claim 1, wherein the deleting the image file based on the second interface comprises:
and deleting the storage interval reference relation of the mirror image file based on the second interface.
5. An apparatus for securely deleting a virtual machine image file, the apparatus comprising:
the response module is used for searching all image files of the virtual machine and obtaining file information of the image files when receiving an image file deleting request aiming at the virtual machine;
the first judging module is used for judging 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 in the running process of the virtual machine;
the first deleting module is used for deleting the image file based on a first interface when the type of the image file is the second data type, wherein the first interface deletes the image file in a safe deleting mode;
and the second deleting module is used for deleting 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 deleting mode.
6. The apparatus of claim 5, wherein the first deletion module comprises:
a determination submodule for determining a target overwrite file based on the first interface;
and the overwriting submodule is used for overwriting the image file according to the target overwriting file.
7. The apparatus of claim 5, wherein the apparatus further comprises:
and the second judging module is used for judging whether the image file with the type of the first data type and the image file with the type of the second data type exist at the same time, if so, the image file is triggered to be deleted based on the second interface and then the image file is triggered to be deleted based on the first interface.
8. The apparatus of claim 5, wherein the second deletion module is to delete a storage interval reference relationship of the image file based on the second interface.
9. An apparatus for securely deleting a virtual machine image file, the apparatus comprising:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the virtual machine image file safe deletion method according to any one of claims 1 to 4.
10. A storage medium storing computer instructions for performing the method for securely deleting a virtual machine image file according to any one of claims 1 to 4 when the computer instructions are invoked.
CN202111325826.1A 2021-11-10 2021-11-10 Method and device for safely deleting mirror image file of virtual machine and storage medium Pending CN114035897A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111325826.1A CN114035897A (en) 2021-11-10 2021-11-10 Method and device for safely deleting mirror image file of virtual machine and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111325826.1A CN114035897A (en) 2021-11-10 2021-11-10 Method and device for safely deleting mirror image file of virtual machine and storage medium

Publications (1)

Publication Number Publication Date
CN114035897A true CN114035897A (en) 2022-02-11

Family

ID=80143821

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111325826.1A Pending CN114035897A (en) 2021-11-10 2021-11-10 Method and device for safely deleting mirror image file of virtual machine and storage medium

Country Status (1)

Country Link
CN (1) CN114035897A (en)

Similar Documents

Publication Publication Date Title
US11397648B2 (en) Virtual machine recovery method and virtual machine management device
US9552168B2 (en) Virtual machine backup from storage snapshot
US9507672B2 (en) Method, apparatus, and system for generating and recovering memory snapshot of virtual machine
EP2840495B1 (en) Container-based processing method and apparatus
US9819695B2 (en) Scanning method and device, and client apparatus
US8881144B1 (en) Systems and methods for reclaiming storage space from virtual machine disk images
CN106777394B (en) Cluster file system
CN110704161B (en) Virtual machine creation method and device and computer equipment
CN108475201B (en) Data acquisition method in virtual machine starting process and cloud computing system
CN112596950A (en) Virtual machine data backup method, device, equipment and storage medium
CN112925606A (en) Memory management method, device and equipment
CN113641446A (en) Memory snapshot creating method, device and equipment and readable storage medium
CN111309799A (en) Method, device and system for realizing data merging and storage medium
CN109032762B (en) Virtual machine backtracking method and related equipment
CN113986471A (en) Method, device, equipment and storage medium for safely deleting mirror image file of virtual machine
US8984336B1 (en) Systems and methods for performing first failure data captures
CN114035897A (en) Method and device for safely deleting mirror image file of virtual machine and storage medium
KR101552580B1 (en) Method for system recovery including mobile device and backup supporting multi operation system
CN114328018A (en) Snapshot creating method, computing device and storage medium
CN112181590A (en) Method, device and equipment for deleting resources in cloud platform and readable storage medium
CN110515751B (en) Method and system for loading and running VxWorks real-time protection process
CN110704249A (en) Method, device and system for ensuring application consistency
CN112596954A (en) Data backup and reconstruction method, device, equipment and storage medium
CN110795389A (en) Storage snapshot based copying method, user equipment, storage medium and device
CN104461382A (en) Internal writing method for file server operating multiple file systems and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination