A data deletion method, apparatus, device, and storage medium

By delaying the deletion of virtual machine snapshots, the storage cluster pressure problem caused by the simultaneous deletion of multiple virtual machines in cloud computing systems is solved, and the user's business stability and snapshot deletion efficiency are improved.

CN111813501BActive Publication Date: 2025-07-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010660601.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-09
Publication Date
2025-07-08
Estimated Expiration
2040-07-09

AI Technical Summary

Technical Problem

In cloud computing systems, when deleting snapshots at regular intervals, multiple virtual machines delete virtual machine snapshots at the same time leads to an increase in read and write pressure in the storage cluster, affecting user business stability.

Method used

By delaying deleting virtual machine snapshots, add deleted marks to virtual machine snapshots after receiving the delete instruction, and wait for a trigger event to perform the deletion operation to avoid all virtual machines deleting snapshots at the same time at the same time.

Benefits of technology

It reduces the read and write pressure on cloud computing system storage clusters, improves the execution stability of user services and snapshot deletion efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111813501B_ABST
    Figure CN111813501B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a data deletion method, apparatus, device, and storage medium, which are applied to the field of virtual machines in cloud computing, and are specifically applied to the delayed deletion processing of virtual machine snapshots generated by virtual machines. The method may include: when detecting a trigger event for performing a virtual machine snapshot deletion operation, obtaining at least one virtual machine snapshot whose data status is the deleted status; according to the parameter information of each virtual machine snapshot, obtaining a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot; and performing a deletion operation on the target virtual machine snapshot. By adopting the embodiment of the present invention, the delayed deletion of virtual machine snapshots is realized, the read and write pressure on the storage cluster in the cloud computing system is effectively reduced, and thus the stability of user services can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing, and in particular, to a data deletion method, apparatus, device, and storage medium. Background Technique

[0002] In a cloud computing environment, users' services all run in virtual machines, that is, users' data is stored in virtual machines. A virtual machine snapshot is a data copy of the virtual machine disk data at a certain point in time. Through this copy, the virtual machine disk data can be rolled back to the previous point in time.

[0003] To protect the security of virtual machine data, it is often necessary to make regular automatic snapshots. For example, set to make snapshots of all virtual machines in the cloud computing system at 12 o'clock every night. Regular automatic snapshots often only retain the recent several snapshots. For example, retain the recent 5 virtual machine snapshots made. When creating the 6th snapshot, the first virtual machine snapshot needs to be deleted.

[0004] However, in the process of making regular automatic snapshots using the above method, when it is detected that the 6th virtual machine snapshot is being made, at the same time, multiple virtual machines in the entire cloud computing system perform deletion operations on their respective first virtual machine snapshots. At this time, it will cause the read and write pressure of the storage cluster in the cloud computing system to rise, and the virtual machine requests for reading and writing will get stuck, thereby affecting the virtual machine and causing user service interruption. Therefore, in the field of cloud computing, how to effectively delete virtual machine snapshots has become a hot research issue today. Summary of the Invention

[0005] Embodiments of the present invention provide a data deletion method, apparatus, device, and storage medium, which realizes delaying the deletion of virtual machine snapshots, effectively reduces the read and write pressure of the storage cluster in the cloud computing system, and thus can improve the stability of user services.

[0006] On the one hand, embodiments of the present invention provide a data deletion method, which is applied to a target computing node. The target computing node is any one of at least one computing node included in the basic cloud layer of the cloud computing system. The method includes:

[0007] When a trigger event for performing a virtual machine snapshot deletion operation is detected, obtain at least one virtual machine snapshot whose data status is the deleted status. The deleted status corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is added when a deletion instruction for deleting the corresponding virtual machine snapshot is received;

[0008] According to the parameter information of each virtual machine snapshot, obtain a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot;

[0009] Perform a deletion operation on the target virtual machine snapshot.

[0010] On the one hand, an embodiment of the present invention further provides a data deletion device, including:

[0011] An acquisition unit, configured to, when detecting a trigger event for performing a virtual machine snapshot deletion operation, acquire at least one virtual machine snapshot whose data status is the deleted status, and the deleted status corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is marked when receiving a deletion instruction for deleting the corresponding virtual machine snapshot;

[0012] The acquisition unit is further configured to, according to the parameter information of each virtual machine snapshot, acquire a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot;

[0013] A processing unit, configured to perform a deletion operation on the target virtual machine snapshot.

[0014] On the one hand, an embodiment of the present invention provides a data deletion device, including:

[0015] A processor, adapted to implement one or more instructions; and,

[0016] A computer storage medium storing one or more instructions, the one or more instructions being adapted to be loaded and executed by the processor to perform the above-mentioned method for creating a to-do item; or, the one or more instructions being adapted to be loaded and executed by the processor to:

[0017] When detecting a trigger event for performing a virtual machine snapshot deletion operation, acquire at least one virtual machine snapshot whose data status is the deleted status, and the deleted status corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is marked when receiving a deletion instruction for deleting the corresponding virtual machine snapshot; according to the parameter information of each virtual machine snapshot, acquire a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot; perform a deletion operation on the target virtual machine snapshot.

[0018] On the one hand, an embodiment of the present invention provides a computer storage medium, characterized in that the computer storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, they are used to execute:

[0019] When a trigger event for performing a virtual machine snapshot deletion operation is detected, obtain at least one virtual machine snapshot with a deletion flag added, where the deletion flag corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is added when a deletion instruction for deleting the corresponding virtual machine snapshot is received; according to the parameter information of each virtual machine snapshot, obtain a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot; and perform a deletion operation on the target virtual machine snapshot.

[0020] On the one hand, an embodiment of the present invention provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor of a data deletion device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the data deletion device executes the above data deletion method.

[0021] In an embodiment of the present invention, when a target computing node detects a trigger event for performing a virtual machine snapshot deletion operation, obtain at least one virtual machine snapshot with a deletion flag added, where the deletion flag corresponding to each virtual machine snapshot is added when a deletion instruction for deleting the corresponding virtual machine snapshot is received; and, the time when a deletion instruction for deleting any one virtual machine snapshot is received is earlier than the time when the trigger event is detected; further, according to the parameter information of each virtual machine snapshot, obtain a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot; and perform a deletion operation on the target virtual machine snapshot.

[0022] During the deletion process of the above virtual machine snapshot, the time when a deletion instruction for deleting any one virtual machine snapshot is received is earlier than the time when the trigger event is detected, indicating that the deletion operation of the virtual machine snapshot is not executed immediately after the deletion instruction is received, but is executed later. In a specific implementation, after a deletion instruction for any one virtual machine snapshot is received, a deleted flag is added to it, and then the deletion operation is executed after waiting for the trigger event for deletion to be detected. Compared with the method of deleting virtual machine snapshots in the timed automatic snapshot making in the prior art, it avoids all virtual machines in the entire cloud computing system performing snapshot deletion at the same moment, reduces the read and write pressure on the storage cluster in the cloud computing system, and thus is beneficial to improving the stability of user service execution. Description of the Drawings

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0024] Figure 1a It is an architecture diagram of a cloud computing system provided by an embodiment of the present invention;

[0025] Figure 1b It is a schematic diagram of a snapshot tree provided by an embodiment of the present invention;

[0026] Figure 1c It is a schematic diagram of updating a snapshot tree provided by an embodiment of the present invention;

[0027] Figure 1d It is another schematic diagram of updating a snapshot tree provided by an embodiment of the present invention;

[0028] Figure 1e It is yet another schematic diagram of updating a snapshot tree provided by an embodiment of the present invention;

[0029] Figure 1f It is a schematic diagram of simultaneously deleting virtual machine snapshots of multiple virtual machines provided by an embodiment of the present invention;

[0030] Figure 2 It is a schematic flow diagram of a data deletion method provided by an embodiment of the present invention;

[0031] Figure 3a It is a schematic diagram of deleting a virtual machine snapshot provided by an embodiment of the present invention;

[0032] Figure 3b It is a schematic diagram of marking a virtual machine snapshot as a deleted state provided by an embodiment of the present invention;

[0033] Figure 3c It is another schematic diagram of marking a virtual machine snapshot as a deleted state provided by an embodiment of the present invention;

[0034] Figure 4 It is a schematic flow diagram of another data deletion method provided by the present invention;

[0035] Figure 5a It is a schematic diagram of obtaining a distributed lock provided by an embodiment of the present invention;

[0036] Figure 5b It is another schematic diagram of obtaining a distributed lock provided by an embodiment of the present invention;

[0037] Figure 5c It is a schematic diagram of deleting a target virtual machine snapshot provided by an embodiment of the present invention;

[0038] Figure 6 It is a schematic structural diagram of a data deletion device provided by an embodiment of the present invention;

[0039] Figure 7It is a schematic structural diagram of a data deletion device provided by an embodiment of the present invention. Detailed implementation manners

[0040] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention.

[0041] Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data computing, storage, processing, and sharing. Cloud technology is the general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model, which can form a resource pool, be used on demand, and be flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the highly developed and applied Internet industry, in the future, each item may have its own identification mark and needs to be transmitted to the background system for logical processing. Data at different levels will be processed separately, and various types of industry data require a powerful system backup support, which can only be achieved through cloud computing.

[0042] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computing devices, enabling various application systems to obtain computing power, storage space, and information services as needed. The network that provides resources is called the "cloud". The resources in the "cloud" seem to be infinitely expandable to users, and can be obtained at any time, used on demand, expanded at any time, and paid according to usage. As a basic capability provider of cloud computing, a cloud computing resource pool (abbreviated as a cloud platform, generally called an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to select and use.

[0043] Cloud computing is inseparable from virtualization technology. As the basis of cloud computing, virtualization technology can provide resource integration and re-logic. For example, when a user sends a request to a cloud computing system, after the system administrator receives the user's request, the computing resources required by the user are sorted into virtual machines that can be immediately put into use and then provided to the user. In this way, in a cloud computing system, the user's services all run in the corresponding virtual machines. A virtual machine is a virtual computer system, which is a strictly isolated software container containing an operating system and applications. Each virtual machine that completes a function is completely independent and contains its own independent (software-implemented) central processing unit, memory, hard disk, graphics card, sound card, and network card, etc.

[0044] A virtual machine snapshot is a data copy of the virtual machine disk data at a certain point in time. Through this data copy, the virtual machine disk data can be rolled back to the previous point in time. To protect the security of virtual machine data, it is often necessary to create automatic snapshots regularly. For example, set to create snapshots of all virtual machines in the cloud computing system at 12 o'clock every night. And regular automatic snapshots often only retain the last few snapshots. For example, retain the last 5 virtual machine snapshots created. When creating the 6th snapshot, the first virtual machine snapshot needs to be deleted. In this way, when it is detected that the 6th virtual machine snapshot is being created, at the same time, multiple virtual machines in the entire cloud computing system perform delete operations on their respective first virtual machine snapshots, which will cause the read and write pressure on the storage cluster in the cloud computing system to increase.

[0045] To solve this problem, an embodiment of the present invention provides a data deletion solution that can be applied to a cloud computing system, which can realize the delayed deletion of virtual machine snapshots, avoid all virtual machines in the entire cloud computing system performing snapshot deletions at the same time, reduce the read and write pressure on the storage cluster in the cloud computing system, and thus contribute to improving the stability of user service execution.

[0046] Based on the above data deletion solution, an embodiment of the present invention provides a cloud computing system. Refer to Figure 1a , which is a system architecture diagram of a cloud computing system provided by an embodiment of the present invention. Figure 1a The shown cloud computing system is proposed based on a private cloud. The private cloud refers to creating cloud infrastructure and software and hardware resources within a firewall for various departments within an organization or enterprise to share resources in the data center.

[0047] In one embodiment, Figure 1a The shown cloud computing system may include a business layer. The business layer is provided for users, and users can operate on the business layer. The business layer can provide self-service platform services, monitoring platform services, operation and maintenance platform services, etc. For example, for the self-service platform service, the business layer can provide a user with an interface for applying for resources; for the monitoring platform service, the business layer provides an interface for monitoring the usage of all resources of the entire platform; for the operation and maintenance platform service, the business layer can provide an interface for administrators to operate, and administrators can perform operations such as migration of host machines through this interface.

[0048] In one embodiment, the cloud computing system may further include a cloud gateway layer. The cloud gateway layer mainly includes venus components, an IP system, and rbac components. Among them, the venus component is used to provide a unified original platform resource interface, the IP system is used to manage network resources such as IPs, and the rbac component is used to provide an authentication service.

[0049] In one embodiment, the cloud computing system may further include a basic cloud layer. The basic cloud layer mainly provides Infrastructure as a Service (IaaS) services based on the open-source OpenStack. OpenStack is an open-source cloud computing management platform project and a combination of a series of open-source software projects. Generally, the basic cloud layer built based on OpenStack may include computing nodes, storage nodes, network nodes, and control nodes.

[0050] Among them, the computing node can be a server. Specifically, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0051] Optionally, the computing node may include the nova component. Nova is used to manage the life cycle of virtual machines. That is to say, the nova component can provide various services around virtual machines, such as the creation, running, migration, and snapshot of virtual machines. In one embodiment, the nova component mainly includes nova-api and nova-compute. Nova-api can be called an API server, which provides an interface for interacting with the outside world. It is the only channel for external users to manage the cloud computing system. The control node can be used to provide computing management services for nova. Specifically, the control node can provide a nova-api interface, and dock with the nova-api of the nova component in the computing node through this interface to achieve control of the computing node.

[0052] In the embodiment of the present invention, the instruction received by the business layer can be transmitted to the control node through the venus component of the cloud gateway layer. The control node transmits the instruction to the computing node through nova-api, specifically, it can be transmitted to the computing workstation nova-compute in the computing node. Most of the operations executed by the computing node in the embodiment of the present invention are executed by nova-compute.

[0053] The storage node may include a Cinder component, which is used to provide block storage services. Briefly, block storage virtualizes a disk that can be mounted on a corresponding virtual machine, unaffected by factors such as the file system. For a virtual machine, it is like adding a new hard disk and any operations on the disk can be completed, including mounting, unmounting, formatting, converting the file system, etc. It is mostly used for space expansion when the storage space of a virtual machine is insufficient. The storage node may also include a Glance component, which is used to manage the images available during the deployment of virtual machines, including image import, format, and creation of corresponding templates.

[0054] The network node may include a Neutron component, which is mainly used to provide communication services between the compute node and the network node.

[0055] In one embodiment, the cloud computing system may further include a storage layer. The storage layer is mainly used to store the system disk and data disk of virtual machines, and the virtual machine snapshots of virtual machines are also stored in the storage layer. In the embodiments of the present invention, the storage layer is built based on Ceph, which is a distributed storage system that provides three types of storage: block, object, and file.

[0056] As can be seen from the foregoing, based on Figure 1a the cloud computing system shown, the user's services run in virtual machines. To protect the security of data in virtual machines, a timed automatic snapshot can be set, that is, a virtual machine snapshot is made for each virtual machine at a fixed time. Generally, all the virtual machine snapshots made at all times are not retained in the storage layer, and only the most recent several virtual machine snapshots can be retained. Thus, the problem of deleting virtual machine snapshots is involved.

[0057] For any virtual machine, in the cloud computing system, each virtual machine snapshot is organized in a tree structure according to the time sequence obtained, and the parent-child relationship is bound according to the creation and rollback operation sequence to obtain a snapshot tree. Refer to Figure 1b , which is a schematic structural diagram of a snapshot tree provided by the embodiments of the present invention.

[0058] In one embodiment, Figure 1bThe snapshot tree shown includes 7 virtual machine snapshots (hereinafter simply referred to as snapshots), each snapshot corresponding to a number. The snapshot production order is the same as the number. Snapshot 1 indicates that this virtual machine snapshot is the first to be produced, and snapshot 7 is the last to be produced. Since deleting any snapshot in the snapshot tree may cause the parent-child relationship between snapshots to change, it is necessary to synchronously update the parent-child relationship between snapshots in the snapshot tree when deleting a snapshot. For example, when deleting "Snapshot 5", it is necessary to make the sub-snapshot "Snapshot 6" of "Snapshot 5" the sub-snapshot of "Snapshot 2", as Figure 1c described; and for another example, when deleting "Snapshot 2", it is necessary to make "Snapshot 3" and "Snapshot 5" the sub-snapshots of "Snapshot 1", as Figure 1d shown.

[0059] Optionally, for any virtual machine, if multiple virtual machine snapshots in the virtual machine are deleted simultaneously, there may be a phenomenon that the update of the parent-child relationship of the snapshot tree fails due to resource operation competition. For example, when deleting "Snapshot 2" and "Snapshot 5" simultaneously, when updating "Snapshot 6" as the sub-snapshot of "Snapshot 2", it is possible that "Snapshot 2" has already been deleted, resulting in the failure of updating the parent-child relationship, as Figure 1e shown.

[0060] However, for different virtual machines, if multiple virtual machine snapshots belonging to different virtual machines are deleted simultaneously, the update of the snapshot tree corresponding to each virtual machine will not be affected. As Figure 1f shown, it is a schematic diagram of simultaneously deleting virtual machine snapshots on different virtual machines provided by an embodiment of the present invention. Figure 1f It is assumed in

[0061] that the cloud computing system includes virtual machine 1, virtual machine 2, and virtual machine 3. At the same moment, deleting the oldest snapshot on virtual machine 1, the oldest snapshot on virtual machine 2, and the oldest snapshot on virtual machine 3 will not affect the update of each other's snapshot trees.

[0062] To avoid the above problems, based on Figure 1aFor the cloud computing system shown, an embodiment of the present invention provides a data deletion solution. The data deletion method can be executed by a target computing node in the cloud computing system, and the target computing node is any one of multiple computing nodes. Specifically, when receiving a deletion instruction to delete any one of the virtual snapshots to be deleted, the target computing node does not immediately perform the deletion operation on the virtual machine snapshot to be deleted, but adds a deletion mark to the virtual machine snapshot to be deleted. When detecting a trigger event for executing the virtual machine snapshot deletion operation, such as detecting the running of a timed deletion virtual machine snapshot thread, the target virtual machine snapshot matching the target computing node is obtained from multiple virtual machine snapshots to be deleted with deletion marks added, and then the deletion operation is performed on the target virtual machine snapshot.

[0063] In this way, for any virtual machine, batch deletion of virtual machine snapshots can be achieved, improving the snapshot deletion efficiency. Moreover, the trigger events for each computing node to execute the virtual machine deletion operation may be different, avoiding snapshot deletion of all virtual machines in the entire cloud computing system at the same moment, reducing the read and write pressure on the storage cluster in the cloud computing system, and thus being beneficial to improving the stability of user service execution.

[0064] Based on the above cloud computing system, an embodiment of the present invention provides a data deletion method. Refer to Figure 2 , which is a schematic flowchart of a data deletion method provided by an embodiment of the present invention. Figure 2 The data deletion method shown can be applied to a target computing node, and the target computing node is any one of at least one computing node included in the basic cloud layer of the cloud computing system. The data deletion method can be executed by the target computing node, specifically by the processor of the target computing node. Figure 2 The data deletion method may include the following steps:

[0065] Step S201, when detecting a trigger event for executing the virtual machine snapshot deletion operation, obtain at least one virtual machine snapshot with a data status of deleted status.

[0066] In one embodiment, the trigger event may refer to detecting the start and running of a timed thread for delaying the deletion of virtual machine snapshots, and the timed thread may be started and run at a preset time interval, such as starting once every 5 minutes.

[0067] In one embodiment, the at least one virtual machine snapshot is stored in a database in the storage layer. Therefore, when detecting a trigger event for executing the virtual machine snapshot deletion operation, the target computing node pulls at least one virtual machine snapshot with a deletion mark added from the database in the storage layer.

[0068] In one embodiment, the deleted status of each virtual machine snapshot is marked when a deletion instruction for deleting the corresponding virtual machine snapshot is received. Specifically, the corresponding deleted status of each virtual machine snapshot is marked by the computing node to which the virtual machine corresponding to each virtual machine snapshot belongs for the corresponding virtual machine snapshot. For example, assume that the virtual machine snapshots with the data status of deleted status include the first virtual machine snapshot, the first virtual machine snapshot corresponds to virtual machine A, and the computing node to which virtual machine A belongs is the target computing node. Then, the deleted status corresponding to the first virtual machine snapshot is marked by the target computing node. For the sake of convenient description, in the following examples, it is taken that the target computing node marks any virtual machine snapshot as the deleted status. The implementation manners of other computing nodes in the cloud computing system marking the virtual machine snapshot as the deleted status are the same as those of the target computing node.

[0069] In one embodiment, the deletion instruction for deleting any virtual machine snapshot can be submitted by the user through the service layer. As known from the foregoing, the instruction submitted by the service layer can be sent to the basic cloud layer through the venus component of the cloud gateway layer, and the target computing node in the basic cloud layer marks the data status of the virtual machine snapshot indicated by the deletion instruction as the deleted status. As known from the foregoing, the target computing node may include a nova component. The target computing node marking the virtual machine snapshot as the deleted status is essentially to call the nova component to mark the virtual machine snapshot as the deleted status.

[0070] In one embodiment, for any virtual machine snapshot, it may include multiple data statuses in the database, and the conversion relationship between the multiple data statuses can be referred to Figure 3a as shown. Figure 3a It is a schematic diagram of the conversion between multiple data statuses of a virtual machine snapshot provided by an embodiment of the present invention. As Figure 3a known, the data status of the virtual machine snapshot may include a production status, an available status, a deleting status, and a deleted status. When the cloud computing system is producing a virtual machine snapshot, the data status of the virtual machine snapshot is the production status. After the production is completed, the data status of the virtual machine snapshot becomes the available status. The virtual machine snapshot in the available status can be used for rollback, and the corresponding virtual machine disk data can be rolled back to the previous time point through the virtual machine snapshot in the available status. When a deletion of the virtual machine snapshot is received, the data status of the virtual machine snapshot is in the deleting status, and after the deletion is completed, the data status corresponding to the virtual machine data is the deleted status.

[0071] In the embodiments of the present invention, marking a virtual machine snapshot as deleted in fact means directly setting the data status of the virtual machine snapshot in the database from the available state to the deleted state. Since this direct modification of the database status flag does not actually delete the virtual machine snapshot, the snapshot tree of the virtual machine will not be updated. Compared with the prior art in which the deletion operation is immediately executed upon receiving the deletion instruction, in the embodiments of the present invention, after receiving the deletion instruction of the virtual machine snapshot, the virtual machine snapshot is first marked as deleted. As time goes by, when it is detected that the deletion operation of the virtual machine snapshot is performed, the virtual machine snapshots with the data status of deleted can be deleted simultaneously, so that it can solve the problem that all virtual machines in the cloud computing system perform the deletion operation of the virtual machine snapshot at the same moment, and can effectively reduce the read and write pressure on the storage cluster.

[0072] For example, referring to Figure 3b , it is a schematic diagram of immediately deleting a virtual machine snapshot provided by the embodiments of the present invention. In Figure 3b , the control node receives the deletion instruction of the virtual machine snapshot sent by the cloud gateway layer venus. The nova-api in the control node finds the virtual machine where the virtual machine snapshot is located, and then finds the computing node where the virtual machine is located through the information of the virtual machine, assuming it is the target computing node; then the nova-api of the control node sends the deletion instruction to the nova-api of the target computing node; the nova-api of the target computing node sends the request to the nova-compute of the target computing node, and the nova-compute of the target computing node notifies the storage layer to delete the virtual machine snapshot in the request.

[0073] Referring to Figure 3c , it is a schematic diagram of marking a virtual machine snapshot as deleted provided by this embodiment. Different from Figure 3b , after the target computing node receives the deletion instruction, it does not perform the deletion operation on the virtual machine snapshot indicated by the deletion instruction, but marks the data status of the virtual machine snapshot as deleted. In this way, in the view of the cloud gateway layer, the virtual machine snapshot has been deleted. As time goes by, when it is detected that the deletion operation of the virtual machine snapshot is performed, the deletion operation is performed on the virtual machine snapshots with the data status of deleted.

[0074] Step S202: Obtain a target virtual machine snapshot that matches the target computing node from at least one virtual machine snapshot according to the parameter information of each virtual machine snapshot.

[0075] Among them, the parameter information of each virtual machine snapshot may include the identification information of the virtual machine corresponding to the corresponding virtual machine snapshot. For example, if virtual machine snapshot A corresponds to virtual machine A, then the parameter information of virtual machine snapshot A may include the identification information of virtual machine A. The target virtual machine snapshot that matches the target computing node refers to that the virtual machine corresponding to the target virtual machine snapshot belongs to the target computing node.

[0076] In one embodiment, the obtaining, from at least one virtual machine snapshot, a target virtual machine snapshot that matches the target computing node according to the parameter information of each virtual machine snapshot may include: obtaining the computing node to which each virtual machine information belongs according to the virtual machine information of the virtual machine to which each virtual machine snapshot belongs; obtaining, from the computing nodes to which each virtual machine information belongs, the computing node that matches the target computing node, and using the virtual machine snapshot corresponding to the virtual machine in the matching computing node as the target virtual machine snapshot.

[0077] Step S203: Perform a deletion operation on the target virtual machine snapshot.

[0078] In one embodiment, the number of the target virtual machines may be at least one. After determining the target virtual machine snapshot in step S202, the target virtual machines may be stored in a first-in-first-out queue; then, the deletion operation is sequentially performed on the target virtual machine snapshots in the first-in-first-out queue.

[0079] In one embodiment, as can be seen from the foregoing, the virtual machine snapshots corresponding to each virtual machine in the cloud computing system are stored in the storage layer, and the storage layer is built based on Ceph. Therefore, the performing a deletion operation on the target virtual machine snapshot may include: calling the delete snapshot interface of Ceph to delete the target virtual machine snapshot.

[0080] In the embodiment of the present invention, when the target computing node detects a trigger event for performing a virtual machine snapshot deletion operation, at least one virtual machine snapshot whose data status is the deleted status is obtained. The deleted status corresponding to each virtual machine snapshot is marked when a deletion instruction for deleting the corresponding virtual machine snapshot is received; and, the time when the deletion instruction for deleting any one virtual machine snapshot is received is earlier than the time when the trigger event is detected; further, according to the parameter information of each virtual machine snapshot, a target virtual machine snapshot that matches the target computing node is obtained from at least one virtual machine snapshot; and a deletion operation is performed on the target virtual machine snapshot.

[0081] During the deletion process of the above virtual machine snapshot, the time when the deletion instruction for any virtual machine snapshot is received is earlier than the time when the trigger event is detected, indicating that the deletion operation of the virtual machine snapshot is not immediately executed after receiving the deletion instruction, but is delayed. In a specific implementation, after receiving the deletion instruction for any virtual machine snapshot, instead of actually deleting the virtual machine snapshot, its data status is modified to the deleted state, and then the deletion operation is executed when the trigger event for executing the deletion is detected. Compared with the method of immediately deleting the virtual machine snapshot after receiving the deletion instruction in the prior art, it avoids snapshot deletions of all virtual machines in the entire cloud computing system at the same moment, reduces the read / write pressure on the storage cluster in the cloud computing system, and thus is beneficial to improving the stability of user service execution.

[0082] Based on the above data deletion method, an embodiment of the present invention provides another data deletion method. Refer to Figure 4 , which is a schematic flowchart of another data deletion method provided by an embodiment of the present invention. Figure 4 The data deletion method shown can be executed by a target computing node, and the target computing node can be any one of multiple computing nodes in a cloud computing system. The data deletion method can specifically be executed by a processor in the target computing node. Figure 4 The data deletion method shown may include the following steps:

[0083] Step S401: When a deletion instruction for deleting a virtual machine snapshot is detected, mark the data status of the virtual machine snapshot as the deleted state.

[0084] Step S402: When a trigger event for executing the deletion of the virtual machine snapshot is detected, obtain at least one virtual machine snapshot whose data status is the deleted state.

[0085] Step S403: According to the parameter information of each virtual machine snapshot, obtain a target virtual machine snapshot that matches the target computing node from at least one virtual machine snapshot.

[0086] In one embodiment, some feasible implementation manners included in steps S401 - S403 can refer to Figure 2 the description of the relevant steps in the embodiment, which will not be elaborated here.

[0087] Step S404: Obtain an unoccupied target distributed lock from the distributed lock set.

[0088] In one embodiment, in order to control the read and write speeds of a storage cluster, after the target virtual machine snapshot is obtained through steps S401 - S403 in the embodiments of the present invention, the target computing node also needs to successfully obtain the permission to delete the virtual machine snapshot before it can call the ceph delete snapshot interface to delete the target virtual machine snapshot.

[0089] Based on the above, the concept of a distributed lock is introduced in the embodiments of the present invention. The distributed lock is used to authorize the deletion of the virtual machine snapshot. That is, when the target computing node successfully obtains the distributed lock, it is equivalent to the target computing node obtaining the permission to delete the virtual machine snapshot.

[0090] In one embodiment, the number of the distributed locks can be one or more. One or more distributed locks form a distributed lock set, and the distributed lock set is stored in the storage layer, that is, the ceph layer. Each distributed lock can only be obtained by one computing node at a time. Based on this, the operation of deleting the target virtual machine snapshot includes: obtaining an unoccupied target distributed lock from the distributed lock set; if the target distributed lock is successfully obtained, then calling the storage layer to delete the target virtual machine snapshot. Among them, the target distributed lock can refer to any one or more distributed locks in the distributed lock set. It should be understood that if the distributed lock set only includes one distributed lock, then this distributed lock is called the target distributed lock.

[0091] Optionally, the distributed lock is implemented based on ceph. As a multi-node distributed storage system, ceph can provide rbd block storage services through the librbd library. Block storage is a data organization format similar to a raw disk. The distributed lock is actually implemented based on rbd block storage. Each distributed lock corresponds to a block device with a preset storage capacity, such as a 0-byte block device.

[0092] In one embodiment, the following takes the case where the distributed lock set only includes one distributed lock as an example to introduce how the target computing node obtains the target distributed lock from the distributed lock set. Assuming that using the rbd block device to implement the distributed lock is called RbdLock, the following Python pseudo-code can be used to illustrate how to obtain the distributed lock:

[0093] Class RbdLock:

[0094] def lock(locking operation)

[0095] (1) Determine whether the 0-byte rbd exists; if it does not exist, then create a 0-byte rbd block device;

[0096] (2) Create a connection to the pool where the ceph 0-byte rbd block device is located

[0097] (3) Open the 0-byte rbd block device

[0098] (4) Obtain the exclusive lock for the 0-byte rbd block device

[0099] (5) If the exclusive lock is already occupied, close the 0-byte rbd block device and disconnect from ceph

[0100] In the above pseudocode, def lock represents starting to obtain the distributed lock. In step (1), if the target computing node determines that there is already a 0-byte block device in the ceph storage layer, then execute step (2); if in step (1) the target computing node determines that there is no 0-byte rbd block device in ceph, then create a 0-byte rbd block device and then execute step (2); in step (2), establish a connection with the pool where the 0-byte block device is located; then in step (3), open the 0-byte device and execute step (4) to configure an exclusive lock for the 0-byte rbd block device. If the locking fails, it indicates that the exclusive lock is already occupied. At this time, the 0-byte rbd block device can be closed and the connection with ceph can be disconnected. If the locking is successful in step (4), it indicates that the target node has obtained the distributed lock.

[0101] Based on the above description, if there is only one distributed lock in the distributed lock set, the schematic diagram of the target computing node obtaining the target distributed lock from the distributed lock set can be as follows Figure 5a shown Figure 5a In the schematic diagram of obtaining the distributed lock shown, it is assumed that in addition to the target computing node, the basic cloud layer of the cloud computing system may also include a first computing node and a second computing node different from the target computing node. At the same moment, there may be other computing nodes that apply for the distributed lock from the ceph storage layer simultaneously with the target computing node. However, since there is only one distributed lock in the distributed lock set, only one computing node can successfully obtain the distributed lock at this time.

[0102] In one embodiment, if the target computing node successfully obtains the target distributed lock, it can execute an operation to call the storage layer to delete the target virtual machine snapshot. For the convenience of other computing nodes to use, after the target computing node executes the deletion operation, it can release the obtained target distributed lock.

[0103] Optionally, assuming def unlock represents releasing the distributed lock, the following Python pseudocode can be used to illustrate how to release the distributed lock:

[0104] def unlock

[0105] (1) Release the exclusive lock of the 0-byte rbd block device

[0106] (2) Close the 0-byte block device

[0107] (3) Disconnect from Ceph

[0108] In one embodiment, in order to adjust the rate of deleting snapshots, multiple distributed locks can be configured. In the embodiment of the present invention, a separate lock storage pool can be used to store multiple distributed locks in the distributed lock set. Optionally, if the distributed lock set includes multiple distributed locks, in order to control the update of the number of distributed locks in the distributed lock set, a control lock needs to be deployed to manage the distributed lock set.

[0109] In one embodiment, the principle of the control lock is the same as that of the distributed lock, but the functions of the two locks are different. The control lock is used to authorize the update of the distributed lock set, and the update of the distributed lock set may include: adding a new distributed lock to the distributed lock set, or deleting a distributed lock from the distributed lock set. That is to say, the control lock is mainly used to control the update of the number of distributed locks.

[0110] Assume that both the distributed lock and the control lock are implemented through a 0-byte rbd block device. The update of the number of distributed locks can be initiated by any computing node, and is completed by creating a new 0-byte rbd block device and deleting a 0-byte rbd block device, but only one computing node can initiate the update at a time. Simply put, if any computing node wants to update the distributed lock set, then the computing node needs to obtain the control lock.

[0111] Taking any computing node as the target computing node as an example below, the implementation method of updating the distributed lock set may include: obtaining the control lock from the storage layer; if the control lock is successfully obtained, determining the target number of distributed locks that can be borne according to the performance of the storage layer; based on the target number, updating the distributed lock set.

[0112] Among them, the better the performance of the storage layer, the more distributed locks can be, and the more distributed locks there are, the more computing nodes can be allowed to obtain distributed locks to delete snapshots at the same time. The updating the distributed lock set based on the target number includes: obtaining the number of distributed locks before the update; obtaining the difference in the number between the target number and the number of distributed locks before the update; if the number of distributed locks before the update is less than the target number, creating the difference number of distributed locks; if the number of distributed locks before the update is greater than the target number, deleting the difference number of distributed locks from the distributed lock set. That is to say, the purpose of updating the distributed lock set based on the target number is to ensure that the number of distributed locks in the distributed lock set is equal to the target number.

[0113] In one embodiment, if the distributed lock set includes multiple distributed locks, the sequence numbers of these multiple distributed locks increase sequentially according to the creation order of each distributed lock. For example, distributed lock 1, distributed lock 2, etc. Based on this, when the target computing node obtains the target distributed lock from the distributed lock set, it tries in sequence according to the sequence number of each distributed lock. For example, it first tries distributed lock 1 with sequence number 1. If distributed lock 1 is already occupied, it tries to obtain distributed lock 2, and so on until an unoccupied distributed lock is obtained. If the attempt to obtain all the distributed locks in the distributed lock set fails, it is determined that the target computing set fails to obtain the target distributed lock.

[0114] For example, referring to Figure 5b , which is another schematic diagram of obtaining a distributed lock provided by an embodiment of the present invention. Assume that there is a storage pool dedicated to storing distributed locks in the storage layer, called the lock storage pool. The lock storage pool stores a control lock and a distributed lock set, and the distributed lock set includes distributed lock 1, distributed lock 2, distributed lock 3, and distributed lock 4. Assume that the cloud computing system includes a target computing node, as well as a first computing node and a second computing node other than the target computing node. In Figure 5b the schematic diagram of obtaining a distributed lock shown, any computing node can apply to update the number of distributed locks by obtaining the control lock. And, any computing node can apply for a distributed lock from the distributed lock set.

[0115] Step S405: If the target distributed lock is successfully obtained, call the storage layer to delete the target virtual machine snapshot.

[0116] As can be seen from the foregoing, after the target computing node obtains the matching target distributed lock, it puts the target distributed lock into the queue of the target computing node. Then the target computing node obtains the target distributed lock from the distributed lock set; if the target distributed lock is successfully obtained, call ceph to delete the target virtual machine snapshot; if the target distributed lock is not successfully obtained, the deletion operation on the target virtual machine snapshot may not be performed.

[0117] The following is an example to illustrate how the target computing node deletes the target virtual machine snapshot. Referring to Figure 5c For example, Figure 5c, which is a schematic diagram of deleting a target virtual machine snapshot provided by an embodiment of the present invention. Assume that the basic cloud layer of the cloud computing system includes a target computing node, a first computing node, and a second computing node. In the following description, the target computing node is taken as an example, and the deletion steps and principles of the first computing node and the second computing node for the target virtual machine snapshot are the same as those of the target computing node. When the target computing node detects that the timing thread for delaying the deletion of the virtual machine snapshot starts running, it pulls at least one virtual machine snapshot with a deletion mark added from the database; through the parameter information of each virtual machine snapshot, such as the identification information of the virtual machine to which it belongs. Pull the virtual machine information corresponding to each virtual machine snapshot from the database, and obtain the computing node to which each virtual machine belongs; match the obtained computing node with the computing node on which the timing thread runs, that is, match with the target computing node, and find the computing node that matches the target computing node; and use the virtual machine snapshots corresponding to the virtual machines in these computing nodes as the target virtual machine snapshots.

[0118] Further, put the obtained target virtual machine snapshots into a first-in-first-out queue. Call ceph to delete the snapshots in the queue in sequence, and before calling ceph, obtain a distributed lock from the lock storage pool of ceph first, and only after successful acquisition can the actual snapshot data be deleted. The number of concurrent deletions allowed depends on the number of distributed locks obtained. For example, if the number of distributed locks obtained is 2, the target computing node can delete two virtual machine snapshots simultaneously.

[0119] An embodiment of the present invention provides a data deletion scheme, which can add a deleted mark to any virtual machine snapshot to be deleted after receiving a deletion instruction, and then wait for a trigger event for deletion to be detected before performing the deletion operation. Compared with the method in the prior art of immediately deleting the virtual machine snapshot after receiving the deletion instruction, it realizes delayed deletion, avoids snapshot deletion of all virtual machines in the entire cloud computing system at the same moment, reduces the read and write pressure on the storage cluster in the cloud computing system, and thus is beneficial to improving the stability of user service execution.

[0120] In addition, during the above data deletion process, before deleting the target virtual machine snapshot, it is necessary to obtain a distributed lock from the distributed lock set. The distributed lock set may include multiple distributed locks. By setting multiple distributed locks, the target computing node can batch delete multiple target virtual machine snapshots, improving the efficiency of snapshot deletion.

[0121] Based on the above embodiment of the data deletion method, an embodiment of the present invention provides a data deletion device. Refer to Figure 6 , which is a schematic structural diagram of a data deletion device provided by an embodiment of the present invention. Figure 6 The data deletion device shown can run the following units:

[0122] An acquisition unit 601, configured to acquire at least one virtual machine snapshot whose data status is the deleted status when a trigger event for performing a virtual machine snapshot deletion operation is detected, where the deleted status corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is marked when a deletion instruction for deleting the corresponding virtual machine snapshot is received;

[0123] The acquisition unit 601 is further configured to acquire a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot according to the parameter information of each virtual machine snapshot;

[0124] A processing unit 602, configured to perform a deletion operation on the target virtual machine snapshot.

[0125] In one embodiment, the cloud computing system further includes a storage layer, where the storage layer is configured to store a distributed lock set, the distributed lock set includes at least one distributed lock, and each distributed lock is used to authorize the deletion of a virtual machine snapshot. When the processing unit 602 performs a deletion operation on the target virtual machine snapshot, the following operations are performed: acquiring an unoccupied target distributed lock from the distributed lock set; if the acquisition of the target distributed lock is successful, calling the storage layer to delete the target virtual machine snapshot.

[0126] In one embodiment, the parameter information of each virtual machine snapshot includes the virtual machine information of the virtual machine to which the corresponding virtual machine snapshot belongs. When the acquisition unit 601 acquires a target virtual machine snapshot corresponding to the target computing node from the at least one virtual machine snapshot according to the parameter information of each virtual machine snapshot, the following operations are performed: acquiring the computing node to which each virtual machine information belongs according to the virtual machine information of the virtual machine to which each virtual machine snapshot belongs; acquiring a computing node that matches the target computing node from the computing nodes to which each virtual machine information belongs, and using the virtual machine snapshot corresponding to the virtual machine in the matching computing node as the target virtual machine snapshot.

[0127] In one embodiment, the distributed lock is implemented based on the block storage of the storage layer, each distributed lock in the distributed lock set corresponds to a block device with a preset storage capacity, and the processing unit 602 is further configured to open the target block device corresponding to the target distributed lock in the storage layer and configure an exclusive lock for the target block device; if the configuration of the exclusive lock for the block device is successful, it is determined that the acquisition of the target distributed lock is successful.

[0128] In one embodiment, the reservoir further includes a control lock, which is used to authorize the update of the distributed lock set. The update of the distributed lock set includes adding a new distributed lock to the distributed lock set or deleting a distributed lock from the distributed lock set. The obtaining unit 601 is further configured to obtain the control lock from the storage layer. The processing unit 602 is further configured to, if the control lock is successfully obtained, determine a target number of distributed locks that can be borne according to the performance of the storage layer, and update the distributed lock set based on the target number.

[0129] In one embodiment, after the processing unit 602 calls the storage layer to delete the target virtual machine snapshot, the processing unit 602 is further configured to release the exclusive lock configured for the target block device and close the target block device.

[0130] In one embodiment, the trigger event includes: detecting that a timing thread for delaying the deletion of the virtual machine snapshot starts to run, and the timing thread starts to run at a preset time interval.

[0131] According to one embodiment of the present invention, Figure 2 and Figure 4 each step involved in the data deletion method shown can be executed by Figure 6 each unit in the data deletion device shown. For example, Figure 2 the steps S201 - S202 can both be executed by the obtaining unit 601 in the data deletion device described in Figure 6 , and the step S203 can be executed by the processing unit 602 in the data deletion device shown in Figure 6 . Again, for example, Figure 4 the steps S401 and S405 can be executed by the processing unit 602 in the data deletion device shown in Figure 6 , and the steps S402 - S404 can both be executed by the obtaining unit 601 in the data deletion device shown in Figure 6 .

[0132] According to another embodiment of the present invention, Figure 6The various units in the data deletion device shown can be individually or completely combined into one or several other units to form, or one (some) of the units can be further divided into multiple functionally smaller units to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above-mentioned units are divided based on logical functions. In actual applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present invention, other units can also be included based on the data deletion device. In actual applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0133] According to another embodiment of the present invention, the program can be executed by running a program on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 A computer program (including program code) for each step involved in the corresponding method shown in FIG. Figure 6 The data deletion device shown in the embodiment of the present invention is used to implement the data deletion method of the embodiment of the present invention. The computer program can be recorded on a computer-readable storage medium, for example, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.

[0134] In an embodiment of the present invention, when a target computing node detects a triggering event for executing a virtual machine snapshot deletion operation, at least one virtual machine snapshot to which a deletion mark has been added is obtained, and the deletion mark corresponding to each virtual machine snapshot is added when a deletion instruction for deleting the corresponding virtual machine snapshot is received; and the time when the deletion instruction for deleting any virtual machine snapshot is received is earlier than the time when the triggering event is detected; further, based on parameter information of each virtual machine snapshot, a target virtual machine snapshot matching the target computing node is obtained from at least one virtual machine snapshot; and the deletion operation is performed on the target virtual machine snapshot.

[0135] In the above-mentioned virtual machine snapshot deletion process, the time of receiving the deletion instruction for deleting any virtual machine snapshot is earlier than the time of detecting the triggering event, indicating that the deletion operation of the virtual machine snapshot is not executed immediately after receiving the deletion instruction, but is delayed. In a specific implementation, after receiving the deletion instruction for any virtual machine snapshot, a deleted mark is added to it, and then the deletion operation is executed after the triggering event for executing the deletion is detected. Compared with the method of deleting virtual machine snapshots in the scheduled automatic snapshot production in the prior art, it avoids deleting snapshots of all virtual machines in the entire cloud computing system at the same time, reduces the read and write pressure on the storage cluster in the cloud computing system, and is conducive to improving the stability of user business execution.

[0136] Based on the above embodiments of the data deletion method and the data deletion device, an embodiment of the present invention provides a data deletion device, and the data deletion device may be the aforementioned target computing node. Refer to Figure 7 , which is a schematic structural diagram of a data deletion device provided by an embodiment of the present invention. Figure 7 The data deletion device shown may at least include a processor 701, an input interface 702, an output interface 703, and a computer storage medium 704. Among them, the processor 701, the input interface 702, the output interface 703, and the computer storage medium 704 may be connected through a bus or other means.

[0137] The computer storage medium 704 may be stored in the memory of the node device. The computer storage medium 704 is used to store a computer program, and the computer program includes program instructions. The processor 1201 is used to execute the program instructions stored in the computer storage medium 704. The processor 701 (or CPU (Central Processing Unit, central processor)) is the computing core and control core of the data deletion device, and is adapted to implement one or more instructions, specifically adapted to load and execute one or more instructions to implement the corresponding method flow or corresponding function.

[0138] In one embodiment, the processor 701 described in the embodiment of the present invention may be used to execute: when a trigger event for performing a virtual machine snapshot deletion operation is detected, obtain at least one virtual machine snapshot whose data state is the deleted state, and the deleted state corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is added when a deletion instruction for deleting the corresponding virtual machine snapshot is received; according to the parameter information of each virtual machine snapshot, obtain a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot; perform a deletion operation on the target virtual machine snapshot.

[0139] An embodiment of the present invention further provides a computer storage medium (Memory). The computer storage medium is a memory device in a data deletion device and is used to store programs and data. It can be understood that the computer storage medium here can include both the built-in storage medium in the data deletion device and, of course, the extended storage medium supported by the data deletion device. The computer storage medium provides a storage space, and this storage space stores the operating system of the data deletion device. Moreover, one or more instructions suitable for being loaded and executed by the processor 701 are stored in this storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory; optionally, it can also be at least one computer storage medium located far from the aforementioned processor.

[0140] In one embodiment, the computer storage medium can be loaded and executed by the processor 701 with one or more instructions stored in the computer storage medium to implement the corresponding steps of the method in the data deletion method embodiment as described above. Specifically, one or more instructions in the computer storage medium are loaded and executed by the processor 701 as follows: When a trigger event for performing a virtual machine snapshot deletion operation is detected, obtain at least one virtual machine snapshot whose data status is the deleted state. The deleted state corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is added when a deletion instruction for deleting the corresponding virtual machine snapshot is received; according to the parameter information of each virtual machine snapshot, obtain a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot; perform a deletion operation on the target virtual machine snapshot. Figure 2 In one embodiment, the computer storage medium can be loaded and executed by the processor 701 with one or more instructions stored in the computer storage medium to implement the corresponding steps of the method in the data deletion method embodiment as described above. Specifically, one or more instructions in the computer storage medium are loaded and executed by the processor 701 as follows: When a trigger event for performing a virtual machine snapshot deletion operation is detected, obtain at least one virtual machine snapshot whose data status is the deleted state. The deleted state corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is added when a deletion instruction for deleting the corresponding virtual machine snapshot is received; according to the parameter information of each virtual machine snapshot, obtain a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot; perform a deletion operation on the target virtual machine snapshot.

[0141] In one embodiment, the cloud computing system further includes a storage layer. The storage layer is used to store a set of distributed locks. The set of distributed locks includes at least one distributed lock, and each distributed lock is used to authorize the deletion of a virtual machine snapshot. When the processor 701 performs a deletion operation on the target virtual machine snapshot, it performs the following steps: Obtain an unoccupied target distributed lock from the set of distributed locks; if the acquisition of the target distributed lock is successful, then call the storage layer to delete the target virtual machine snapshot.

[0142] In one embodiment, the parameter information of each virtual machine snapshot includes the virtual machine information of the virtual machine to which the corresponding virtual machine snapshot belongs. When obtaining, according to the parameter information of each virtual machine snapshot, a target virtual machine snapshot corresponding to a target computing node from the at least one virtual machine snapshot, the processor 701 performs the following steps: obtaining the computing node to which each virtual machine information belongs according to the virtual machine information of the virtual machine to which each virtual machine snapshot belongs; obtaining, from the computing nodes to which each virtual machine information belongs, a computing node that matches the target computing node, and using the virtual machine snapshot corresponding to the virtual machine in the matching computing node as the target virtual machine snapshot.

[0143] In one embodiment, the distributed lock is implemented based on block storage in the storage layer. Each distributed lock in the distributed lock set corresponds to a block device with a preset storage capacity. The processor 701 is further configured to: open the target block device corresponding to the target distributed lock in the storage layer, and configure an exclusive lock for the target block device; if the configuration of the exclusive lock for the block device is successful, determine that the acquisition of the target distributed lock is successful.

[0144] In one embodiment, the storage layer further includes a control lock, which is used to authorize the update of the distributed lock set. The update of the distributed lock set includes adding a new distributed lock to the distributed lock set or deleting a distributed lock from the distributed lock set. The processor 701 is further configured to obtain the control lock from the storage layer; if the acquisition of the control lock is successful, determine a target number of distributed locks that can be borne according to the performance of the storage layer; and update the distributed lock set based on the target number.

[0145] In one embodiment, after calling the storage layer to delete the target virtual machine snapshot, the processor 701 is further configured to release the exclusive lock configured for the target block device and close the target block device.

[0146] In one embodiment, the trigger event includes: detecting that a timing thread for delaying the deletion of a virtual machine snapshot starts running, and the timing thread starts running at a preset time interval.

[0147] In an embodiment of the present invention, when a target computing node detects a trigger event for performing a virtual machine snapshot deletion operation, at least one virtual machine snapshot with a deletion mark added is obtained. The deletion mark corresponding to each virtual machine snapshot is added when a deletion instruction for deleting the corresponding virtual machine snapshot is received; moreover, the time when a deletion instruction for deleting any one virtual machine snapshot is received is earlier than the time when the trigger event is detected; further, according to the parameter information of each virtual machine snapshot, a target virtual machine snapshot matching the target computing node is obtained from at least one virtual machine snapshot; and a deletion operation is performed on the target virtual machine snapshot.

[0148] During the deletion process of the above virtual machine snapshot, the time when a deletion instruction for deleting any one virtual machine snapshot is received is earlier than the time when the trigger event is detected, indicating that the deletion operation of the virtual machine snapshot is not immediately executed after receiving the deletion instruction, but is executed after a delay. In a specific implementation, after receiving a deletion instruction for any one virtual machine snapshot, a deleted mark is added to it, and then the deletion operation is executed after waiting for the trigger event for deletion to be detected. Compared with the method of deleting virtual machine snapshots in the existing technology of automatically making snapshots regularly, it avoids all virtual machines in the entire cloud computing system performing snapshot deletion at the same moment, reduces the read and write pressure on the storage cluster in the cloud computing system, and thus is beneficial to improving the stability of user service execution.

[0149] According to an aspect of the present application, an embodiment of the present invention further provides a computer product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor 701 of the data deletion device reads the computer instructions from the computer-readable storage medium, and the processor 701 executes the computer instructions, so that the data deletion device performs: when a trigger event for performing a virtual machine snapshot deletion operation is detected, at least one virtual machine snapshot with a data status of a deleted state is obtained, and the deleted state corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is added when a deletion instruction for deleting the corresponding virtual machine snapshot is received; according to the parameter information of each virtual machine snapshot, a target virtual machine snapshot matching the target computing node is obtained from the at least one virtual machine snapshot; and a deletion operation is performed on the target virtual machine snapshot.

[0150] The foregoing disclosure is only a part of the embodiments of the present invention. Certainly, the scope of the rights of the present invention cannot be limited thereby. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.

Claims

1. A data deletion method, characterized in that, Applied to a target computing node, where the target computing node is any one of at least one computing node included in the basic cloud layer of a cloud computing system. The cloud computing system includes a storage layer for storing a distributed lock set. The distributed lock set includes at least one distributed lock, and each distributed lock is used to authorize the deletion of a virtual machine snapshot. Each distributed lock can only be acquired by one computing node at a time. The distributed lock is implemented based on the block storage of the storage layer. Each distributed lock in the distributed lock set corresponds to a block device with a preset storage capacity. The method includes: When a trigger event for performing a virtual machine snapshot deletion operation is detected, obtain at least one virtual machine snapshot with a data status of deleted. The trigger events for performing the virtual machine snapshot deletion operation corresponding to different computing nodes are different. The deleted status of each virtual machine snapshot in the at least one virtual machine snapshot is marked when a deletion instruction for deleting the corresponding virtual machine snapshot is received, and the time when the deletion instruction for any one virtual machine snapshot is received is earlier than the time when the trigger event is detected; According to the parameter information of each virtual machine snapshot, obtain a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot; Obtain an unoccupied target distributed lock from the distributed lock set; open the target block device corresponding to the target distributed lock in the storage layer and configure an exclusive lock for the target block device; If the exclusive lock for the block device is configured successfully, it is determined that the target distributed lock is acquired successfully, and then the storage layer is called to perform a deletion operation on the target virtual machine snapshot; Release the exclusive lock configured for the target block device and close the target block device; The storage layer further includes a control lock for authorizing the update of the distributed lock set. The update of the distributed lock set includes adding a new distributed lock to the distributed lock set or deleting a distributed lock from the distributed lock set. The method further includes: Obtain the control lock from the storage layer; If the control lock is acquired successfully, determine the target number of distributed locks that can be borne according to the performance of the storage layer; Update the distributed lock set based on the target number.

2. The method according to claim 1, wherein The parameter information of each virtual machine snapshot includes the virtual machine information of the virtual machine to which the corresponding virtual machine snapshot belongs. The obtaining of the target virtual machine snapshot corresponding to the target computing node from the at least one virtual machine snapshot according to the parameter information of each virtual machine snapshot includes: According to the virtual machine information of the virtual machine to which each virtual machine snapshot belongs, obtain the computing node to which each virtual machine information belongs; From the computing nodes to which each virtual machine information belongs, obtain the computing node that matches the target computing node, and use the virtual machine snapshot corresponding to the virtual machine in the matching computing node as the target virtual machine snapshot.

3. The method according to claim 1, characterized in that, The trigger event includes: detecting that a timing thread for delaying the deletion of a virtual machine snapshot starts running, and the timing thread starts running at a preset time interval.

4. A data deletion device, characterized in that, Applied to a target computing node, where the target computing node is any one of at least one computing node included in the basic cloud layer of a cloud computing system. The cloud computing system includes a storage layer for storing a distributed lock set. The distributed lock set includes at least one distributed lock, and each distributed lock is used to authorize the deletion of a virtual machine snapshot. Each distributed lock can only be acquired by one computing node at a time. The distributed lock is implemented based on the block storage of the storage layer. Each distributed lock in the distributed lock set corresponds to a block device with a preset storage capacity. The apparatus includes: An acquisition unit, configured to, when detecting a trigger event for performing a virtual machine snapshot deletion operation, acquire at least one virtual machine snapshot with a data state of deleted. The trigger events for performing the virtual machine snapshot deletion operation corresponding to different computing nodes are different. The deleted state of each virtual machine snapshot in the at least one virtual machine snapshot is marked when receiving a deletion instruction for deleting the corresponding virtual machine snapshot, and the time of receiving the deletion instruction for deleting any one virtual machine snapshot is earlier than the time of detecting the trigger event; The acquisition unit is further configured to, according to the parameter information of each virtual machine snapshot, acquire a target virtual machine snapshot that matches the target computing node from the at least one virtual machine snapshot; A processing unit, configured to acquire an unoccupied target distributed lock from the distributed lock set; open the target block device corresponding to the target distributed lock in the storage layer and configure an exclusive lock for the target block device; if the exclusive lock for the block device is configured successfully, determine that the acquisition of the target distributed lock is successful, and then call the storage layer to perform a deletion operation on the target virtual machine snapshot; The processing unit is further configured to release the exclusive lock configured for the target block device and close the target block device; The storage layer further includes a control lock, and the control lock is used to authorize the update of the distributed lock set. The update of the distributed lock set includes adding a new distributed lock to the distributed lock set or deleting a distributed lock from the distributed lock set. The acquisition unit is further configured to: Acquire the control lock from the storage layer; If the acquisition of the control lock is successful, determine a target number of distributed locks that can be borne according to the performance of the storage layer; Based on the target number, update the distributed lock set.

5. A data deletion device, characterized in that, Including: A processor, adapted to implement one or more instructions, and A computer storage medium storing one or more instructions, where the one or more instructions are adapted to be loaded and executed by the processor to perform the data deletion method according to any one of claims 1-3.

6. A computer storage medium, characterized in that, Computer program instructions are stored in the computer storage medium, and when the computer program instructions are executed by the processor, they are used to perform the data deletion method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Snapshot deleting method and node

    CN107491529A

  • Method, equipment and computer program product for deleting snapshots

    CN111124747A