[go: up one dir, main page]

CN111813501B - Data deleting method, device, equipment and storage medium - Google Patents

Data deleting method, device, equipment and storage medium Download PDF

Info

Publication number
CN111813501B
CN111813501B CN202010660601.0A CN202010660601A CN111813501B CN 111813501 B CN111813501 B CN 111813501B CN 202010660601 A CN202010660601 A CN 202010660601A CN 111813501 B CN111813501 B CN 111813501B
Authority
CN
China
Prior art keywords
virtual machine
target
machine snapshot
snapshot
deleting
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.)
Active
Application number
CN202010660601.0A
Other languages
Chinese (zh)
Other versions
CN111813501A (en
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010660601.0A priority Critical patent/CN111813501B/en
Publication of CN111813501A publication Critical patent/CN111813501A/en
Application granted granted Critical
Publication of CN111813501B publication Critical patent/CN111813501B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2336Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
    • G06F16/2343Locking methods, e.g. distributed locking or locking implementation details
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/45595Network integration; Enabling network access in virtual machine instances

Landscapes

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

Abstract

本发明实施例公开了一种数据删除方法、装置、设备以及存储介质,应用于云计算的虚拟机领域中,具体应用于对虚拟机产生的虚拟机快照进行延迟删除处理。其中,方法可包括:当检测到执行虚拟机快照删除操作的触发事件时,获取数据状态为已删除状态的至少一个虚拟机快照;根据每个虚拟机快照的参数信息,从至少一个虚拟机快照中获取与目标计算节点相匹配的目标虚拟机快照;对目标虚拟机快照进行删除操作。采用本发明实施例,实现了延时对虚拟机快照进行删除,有效减小云计算系统中存储集群的读写压力,从而可提高用户业务的稳定性。

The embodiments of the present invention disclose a data deletion method, device, equipment and storage medium, which are applied to the field of virtual machines in cloud computing, and are specifically applied to delayed deletion of virtual machine snapshots generated by virtual machines. The method may include: when a triggering event for performing a virtual machine snapshot deletion operation is detected, obtaining at least one virtual machine snapshot whose data status is a deleted state; according to the parameter information of each virtual machine snapshot, obtaining a target virtual machine snapshot that matches the target computing node from at least one virtual machine snapshot; and deleting the target virtual machine snapshot. By adopting the embodiments of the present invention, delayed deletion of virtual machine snapshots is achieved, which effectively reduces the read and write pressure of the storage cluster in the cloud computing system, thereby improving the stability of user services.

Description

Data deleting method, device, equipment and storage medium
Technical Field
The present application relates to the field of cloud computing, and in particular, to a method, an apparatus, a device, and a storage medium for deleting data.
Background
In a cloud computing environment, services of users are all run in virtual machines, that is, data of users is stored in virtual machines. Virtual machine snapshots are copies of data to virtual machine disk data at a point in time by which virtual machine disk data can be rolled back to that point in time before.
To secure virtual machine data, timed automatic snapshot making is often required. For example, all virtual machines of the cloud computing system are set to be snapshot-made at 12 pm every day, and the timed automatic snapshot often only keeps the latest several snapshots, for example, the latest 5-made virtual machine snapshots are kept, and the first virtual machine snapshot needs to be deleted when the 6 th snapshot is created.
However, in the process of timing automatic snapshot by adopting the method, when the 6 th virtual machine snapshot is detected to be made, deleting operation is performed on the respective first virtual machine snapshot by a plurality of virtual machines in the whole cloud computing system at the same moment, at the moment, the read-write pressure of a storage cluster in the cloud computing system is increased, the virtual machines are required to be read-write to be blocked, and therefore the virtual machines are influenced to cause interruption of user service. Therefore, in the field of cloud computing, how to effectively perform virtual machine snapshot deletion becomes a hotspot problem of current research.
Disclosure of Invention
The embodiment of the invention provides a data deleting method, a device, equipment and a storage medium, which realize the deletion of virtual machine snapshots by time delay and effectively reduce the read-write pressure of a storage cluster in a cloud computing system, thereby improving the stability of user service.
In one aspect, an embodiment of the present invention provides a method for deleting data, where the method is applied to a target computing node, where the target computing node is any one of at least one computing node included in a base cloud layer of a cloud computing system, and the method includes:
when a trigger event for executing the deleting operation of the virtual machine snapshot is detected, at least one virtual machine snapshot with a data state being a deleted state is obtained, wherein the deleted state corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is added when a deleting instruction for deleting the corresponding virtual machine snapshot is received;
obtaining target virtual machine snapshots matched with the target computing node from the at least one virtual machine snapshot according to the parameter information of each virtual machine snapshot;
and executing deleting operation on the target virtual machine snapshot.
In one aspect, an embodiment of the present invention further provides a data deleting device, including:
The system comprises an acquisition unit, a deletion unit and a deletion unit, wherein the acquisition unit is used for acquiring at least one virtual machine snapshot with a data state of a deleted state when a trigger event for executing the deletion operation of the virtual machine snapshot is detected, and the deleted state 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;
the obtaining unit is further configured to obtain, according to parameter information of each virtual machine snapshot, a target virtual machine snapshot that is matched with the target computing node from the at least one virtual machine snapshot;
and the processing unit is used for executing deleting operation on the target virtual machine snapshot.
In one aspect, an embodiment of the present invention provides a data deleting apparatus, including:
a processor adapted to implement one or more instructions, and
A computer storage medium storing one or more instructions adapted to be loaded and executed by the processor to perform the backlog creation method described above, or adapted to be loaded and executed by the processor to:
When a trigger event for executing the deleting operation of the virtual machine snapshot is detected, at least one virtual machine snapshot with a data state being a deleted state is obtained, the deleted state corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is marked when a deleting instruction for deleting the corresponding virtual machine snapshot is received, a target virtual machine snapshot matched with the target computing node is obtained from the at least one virtual machine snapshot according to parameter information of each virtual machine snapshot, and the deleting operation is executed on the target virtual machine snapshot.
In one aspect, an embodiment of the present invention provides a computer storage medium, where computer program instructions are stored, the computer program instructions, when executed by a processor, are configured to perform:
When a trigger event for executing the deleting operation of the virtual machine snapshot is detected, at least one virtual machine snapshot with deleting marks added is obtained, the deleting marks corresponding to each virtual machine snapshot in the at least one virtual machine snapshot are added when deleting instructions for deleting the corresponding virtual machine snapshot are received, a target virtual machine snapshot matched with the target computing node is obtained from the at least one virtual machine snapshot according to parameter information of each virtual machine snapshot, and deleting operation is executed on the target virtual machine snapshot.
In one aspect, embodiments of the present invention provide a computer program product or a computer program, where the computer program product or the computer program includes computer instructions stored in a computer readable storage medium, and a processor of a data deletion apparatus reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the data deletion apparatus performs the above-described data deletion method.
In the embodiment of the invention, when a trigger event for executing the deleting operation of the virtual machine snapshot is detected by the target computing node, at least one virtual machine snapshot with the deleting mark added is obtained, the deleting mark corresponding to each virtual machine snapshot is added when a deleting instruction for deleting the corresponding virtual machine snapshot is received, the time for receiving the deleting instruction for deleting any virtual machine snapshot is earlier than the time for detecting the trigger event, further, the target virtual machine snapshot matched with the target computing node is obtained from at least one virtual machine snapshot according to the parameter information of each virtual machine snapshot, and the deleting operation is executed on the target virtual machine snapshot.
In the deleting process of the virtual machine snapshot, the time of receiving the deleting instruction for deleting any one virtual machine snapshot is earlier than the time of detecting the triggering event, which indicates that the deleting operation of the virtual machine snapshot is not executed immediately after receiving the deleting instruction, but is executed in a delayed manner. In the specific implementation, after receiving a deletion instruction for any one virtual machine snapshot, a deleted mark is added for the virtual machine snapshot, and then the deletion operation is executed after a trigger event for executing deletion is detected. Compared with the method for deleting the virtual machine snapshot in the automatic timing snapshot in the prior art, the method avoids snapshot deletion of all virtual machines of the whole cloud computing system at the same time, reduces the read-write pressure on a storage cluster in the cloud computing system, and is beneficial to improving the stability of user service execution.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1a is a schematic diagram of a cloud computing system according to an embodiment of the present invention;
FIG. 1b is a schematic diagram of a snapshot tree provided by an embodiment of the present invention;
FIG. 1c is a schematic diagram of an update snapshot tree provided by an embodiment of the present invention;
FIG. 1d is a schematic diagram of another update snapshot tree provided by an embodiment of the present invention;
FIG. 1e is a schematic diagram of yet another updated snapshot tree provided by an embodiment of the present invention;
FIG. 1f is a schematic diagram of a multiple virtual machine deleting a snapshot of a virtual machine at the same time according to an embodiment of the present invention;
Fig. 2 is a schematic flow chart of a data deleting method according to an embodiment of the present invention;
FIG. 3a is a schematic diagram of deleting a snapshot of a virtual machine according to an embodiment of the present invention;
FIG. 3b is a schematic diagram of marking a virtual machine snapshot as a deleted state according to an embodiment of the present invention;
FIG. 3c is a schematic diagram of marking a virtual machine snapshot as a deleted state according to another embodiment of the present invention;
FIG. 4 is a flow chart of another method for deleting data according to the present invention;
FIG. 5a is a schematic diagram of an acquisition distributed lock provided by an embodiment of the present invention;
FIG. 5b is a schematic diagram of another acquisition distributed lock provided by an embodiment of the present invention;
FIG. 5c is a schematic diagram of deleting a snapshot of a target virtual machine according to an embodiment of the present invention;
Fig. 6 is a schematic structural diagram of a data deleting device according to an embodiment of the present invention;
Fig. 7 is a schematic structural diagram of a data deleting device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Cloud technology (Cloud technology) refers to a hosting technology for integrating hardware, software, network and other series resources in a wide area network or a local area network to realize calculation, storage, processing and sharing of data. The cloud technology is a generic term of network technology, information technology, integration technology, management platform technology, application technology and the like based on cloud computing business model application, can form a resource pool, and is flexible and convenient as required. Cloud computing technology will become an important support. Background services of technical networking systems require a large amount of computing, storage resources, such as video websites, picture-like websites, and more portals. Along with the high development and application of the internet industry, each article possibly has an own identification mark in the future, the identification mark needs to be transmitted to a background system for logic processing, data with different levels can be processed separately, and various industry data needs strong system rear shield support and can be realized only through cloud computing.
Cloud computing (clouding) is a computing model that distributes computing tasks across a large pool of computers, enabling various application systems to acquire computing power, storage space, and information services as needed. The network that provides the resources is referred to as the "cloud". Resources in the cloud are infinitely expandable in the sense of users, and can be acquired at any time, used as needed, expanded at any time and paid for use as needed. As a basic capability provider of cloud computing, a cloud computing resource pool (abbreviated as a cloud platform, generally referred to as IaaS (Infrastructure AS A SERVICE) platform is established, and multiple types of virtual resources are deployed in the resource pool for external clients to select for use.
Cloud computing is independent of a virtualization technology, the virtualization technology is used as a basis of cloud computing, and can provide integration and re-logic of resources, for example, a user sends a request to a cloud computing system, and after a system administrator obtains the request of the user, computing resources required by the user are carded into a virtual machine which can be immediately put into use, and the virtual machine is provided for the user. In this way, in the cloud computing system, the services of the user run in the corresponding virtual machine. A virtual machine, i.e., a virtual computer system, is a tightly isolated software container that contains an operating system and applications. Each virtual machine with the function is completely independent and comprises a self-independent (realized based on software) central processing unit, a memory, a hard disk, a display card, a sound card, a network card and the like.
A virtual machine snapshot is a copy of the virtual machine disk data at a point in time by which the virtual machine disk data can be rolled back to the point in time before. To secure virtual machine data, timed automatic snapshot making is often required. For example, all virtual machines of the cloud computing system are set to be snapshot-made at 12 pm every day, and the timed automatic snapshot often only keeps the latest several snapshots, for example, the latest 5-made virtual machine snapshots are kept, and the first virtual machine snapshot needs to be deleted when the 6 th snapshot is created. In this way, when it is detected that the 6 th virtual machine snapshot is made, a plurality of virtual machines in the whole cloud computing system delete the respective first virtual machine snapshot at the same time, and at this time, the read-write pressure of the storage cluster in the cloud computing system is increased.
In order to solve the problem, the embodiment of the invention provides a data deleting scheme which can be applied to a cloud computing system, can realize delayed deletion of snapshots of virtual machines, avoids snapshot deletion of all virtual machines of the whole cloud computing system at the same time, and reduces the read-write pressure on a storage cluster in the cloud computing system, thereby being beneficial to improving the stability of user service execution.
Based on the above data deletion scheme, the embodiment of the invention provides a cloud computing system. Referring to fig. 1a, a system architecture diagram of a cloud computing system according to an embodiment of the present invention is provided. The cloud computing system shown in fig. 1a is proposed based on a private cloud, where a cloud base setting and software and hardware resources are created in a firewall, so that each department in an organization or enterprise shares resources in a data center.
In one embodiment, the cloud computing system shown in FIG. 1a may include a business layer. The service layer is provided to the user, and the user can operate in the service layer. The service layer can provide self-service platform service, monitoring platform service, operation and maintenance platform service and the like. For example, for self-service platform service, the service layer may provide an interface for applying resources to the user, for monitoring platform service, the service layer provides an interface for monitoring all resource usage conditions of the whole platform, and for operation and maintenance platform service, the service layer may provide an interface operated by an administrator, through which the administrator may perform operations such as migration of some hosts.
In one embodiment, the cloud computing system may further include a cloud gateway layer. The cloud gateway layer mainly comprises a venus component, an IP system and rbac components. The venus component is used for providing a unified original platform resource interface, the IP system is used for managing network resources such as IP and the rbac component is used for providing authentication service.
In one embodiment, the cloud computing system may further include a base cloud layer. The underlying cloud layer is mainly based on open source OpenStack providing Infrastructure as a service (infrastruc AS A SERVICE, iaas) services. The OpenStack is an open-source cloud computing management platform project and is a combination of a series of software open-source projects. Typically, the base cloud layer built based on OpenStack may include computing nodes, storage nodes, network nodes, and control nodes.
The computing node may be a server, and specifically, the server may refer to an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, a cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and an artificial intelligence platform.
Alternatively, the compute node may include a nova component that is used to manage the lifecycle of the virtual machine, that is, the nova component may provide various services around the virtual machine, such as creation, running, migration, snapshot, etc. of the virtual machine. In one embodiment, the nova component may primarily include nova-API and nova-computer, which may be referred to as an API server, which provides an interface to external interactions, which is the only channel for external users to manage the cloud computing system. The control node may be operable to provide a computing management service to nova. In particular, the control node may provide a nova-api interface through which to interface with nova-api of nova components in the computing node to effect control of the computing node.
In the embodiment of the invention, the command received by the service 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 the nova-api, which may be specifically a computing workstation nova-computer transmitted to the computing node. The operations performed by the compute nodes in embodiments of the present invention are mostly performed by nova-computer.
A cinder component, cinder component, may be included in the storage node for providing block storage services. In short, the block storage is to virtually form a disk, and the disk can be mounted on a corresponding virtual machine without being influenced by factors such as a file system. For the virtual machine, as if a hard disk was newly added, any operations to the disk including mounting, unloading, formatting, converting the file system, etc. can be completed. Most of them are applied to space expansion in the case of insufficient storage space of a virtual machine. The storage node may further include a glance component, glance component for managing images that can be provided when the virtual machine is deployed, including importing of images, formatting, and making corresponding templates.
The network node may include a neutron component that is primarily used to provide communication services between the computing node and the network node.
In one embodiment, the cloud computing system may further include a storage tier. The storage layer is mainly used for storing a system disk and a data disk of the virtual machine, and virtual machine snapshots of the virtual machine are also stored in the storage layer. In the embodiment of the invention, the storage layer is built based on ceph, and ceph is a distributed storage system, and three types of storage including block, object and file are provided.
From the foregoing, it can be seen that, based on the cloud computing system shown in fig. 1a, the service of the user is running in the virtual machine. To protect the security of data in the virtual machines, timed automatic snapshots may be set, i.e., virtual machine snapshots may be made for each virtual machine at a fixed time. In general, virtual machine snapshots made at all times are not reserved in the storage layer, and only the last few virtual machine snapshots can be reserved. This involves the problem of virtual machine snapshot deletion.
For any virtual machine, organizing each virtual machine snapshot in a tree structure according to the time sequence obtained by each virtual machine snapshot in the cloud computing system, and binding father-son relationship according to the creation and rollback operation sequences to obtain a snapshot tree. Referring to fig. 1b, a schematic structure diagram of a snapshot tree according to an embodiment of the present invention is provided.
In one embodiment, the snapshot tree shown in fig. 1b includes 7 virtual machine snapshots (hereinafter referred to as snapshots), each snapshot corresponds to a number, the snapshot creation sequence is consistent with the number, and snapshot 1 indicates that the virtual machine snapshot is the first snapshot to be created, and snapshot 7 is the last snapshot to be created. Because deleting any snapshot in the snapshot tree may cause the parent-child relationship between the snapshots to change, the parent-child relationship between the snapshots in the snapshot tree needs to be synchronously updated when the snapshots are deleted. For example, deleting "snapshot 5" requires "snapshot 6" which is a child of "snapshot 5" as a child of "snapshot 2" as shown in fig. 1c, and for example, deleting "snapshot 2" requires "snapshot 3" and "snapshot 5" as a child of "snapshot 1" as shown in fig. 1 d.
Alternatively, for any one virtual machine, if multiple virtual machine snapshots in the virtual machine are deleted at the same time, a snapshot tree parent-child relationship update failure phenomenon caused by resource operation competition may occur. For example, when "snapshot 2" and "snapshot 5" are deleted simultaneously, when "snapshot 6" is updated as a child snapshot of "snapshot 2", it is possible that "snapshot 2" has been deleted, resulting in failure to update the parent-child relationship, as shown in fig. 1 e.
But for different virtual machines, if multiple virtual machine snapshots belonging to different virtual machines are deleted at the same time, the corresponding snapshot tree update of each virtual machine is not affected. As shown in fig. 1f, a schematic diagram of deleting virtual machine snapshots on different virtual machines simultaneously is provided in an embodiment of the present invention. In fig. 1f, it is assumed that the cloud computing system includes virtual machine 1, virtual machine 2, and virtual machine 3, and at the same time, the oldest snapshot on virtual machine 1, the oldest snapshot on virtual machine 2, and the oldest snapshot on virtual machine 3 are deleted, so that snapshot tree updates of each other are not affected.
Therefore, in order to avoid the problem that the snapshot tree is failed to update due to the competition of the resource operation, the single virtual machine can only delete a plurality of virtual machine snapshots which need to be deleted on a certain virtual machine one by one. In addition, in the process of deleting the virtual machine snapshot, the virtual machine snapshot is deleted immediately after the deletion instruction is detected. Based on the snapshot deleting method, not only the snapshot deleting efficiency is low, but also a plurality of virtual machines can delete the snapshot at the same time, so that the storage cluster brings read-write pressure, and the service of a user is influenced.
In order to avoid the above problem, based on the cloud computing system shown in fig. 1a, an embodiment of the present invention provides a data deletion scheme, where the data deletion method may be performed by a target computing node in the cloud computing system, where the target computing node is any one of a plurality of computing nodes. Specifically, when a deletion instruction for deleting any virtual snapshot to be deleted is received, the target computing node does not immediately execute the deletion operation of the virtual machine snapshot to be deleted, but adds a deletion mark for the virtual machine snapshot to be deleted. When a trigger event for executing the virtual machine snapshot deleting operation is detected, for example, a running timing virtual machine snapshot deleting thread is detected, a target virtual machine snapshot matched with a target computing node is obtained from a plurality of virtual machine snapshots to be deleted, to which a deleting mark is added, and then the deleting operation is executed on the target virtual machine snapshot.
Therefore, batch virtual machine snapshot deletion can be realized for any virtual machine, and snapshot deletion efficiency is improved. Moreover, triggering events corresponding to each computing node for executing the virtual machine deleting operation may be different, so that snapshot deletion of all virtual machines of the whole cloud computing system at the same time is avoided, read-write pressure on a storage cluster in the cloud computing system is reduced, and the stability of user service execution is improved.
Based on the cloud computing system, the embodiment of the invention provides a data deleting method. Referring to fig. 2, a flow chart of a data deleting method provided by an embodiment of the present invention is shown in fig. 2, where the data deleting method may be applied to a target computing node, where the target computing node is any one of at least one computing node included in a base cloud layer of a cloud computing system. The data deletion method may be performed by the target computing node, in particular by a processor of the target computing node. The data deletion method described in fig. 2 may include the steps of:
step 201, when a trigger event for executing a virtual machine snapshot deleting operation is detected, at least one virtual machine snapshot whose data state is a deleted state is acquired.
In one embodiment, the triggering event may refer to detecting that a timing thread for the delayed deletion of the virtual machine snapshot is started, and the timing thread may be started at a preset time interval, such as, for example, every 5 minutes.
In one embodiment, the at least one virtual machine snapshot is stored in a database of the storage layer. Thus, upon detecting a trigger event to perform a virtual machine snapshot delete operation, the target computing node pulls at least one virtual machine snapshot to which a delete marker has been added from the database of the storage tier.
In one embodiment, the deleted state of each virtual machine snapshot is marked upon receipt of a delete instruction to delete the corresponding virtual machine snapshot. Specifically, the corresponding deleted state of each virtual machine snapshot is marked by the corresponding virtual machine snapshot for the computing node to which the virtual machine to which each virtual machine snapshot corresponds belongs. For example, assume that the virtual machine snapshot with the data state being the deleted state includes a first virtual machine snapshot, where the first virtual machine snapshot corresponds to the virtual machine a, and the computing node to which the virtual machine a belongs is a target computing node, and then the deleted state corresponding to the first virtual machine snapshot is marked by the target computing node. For convenience of description, in the following examples, the target computing node marks any one virtual machine snapshot as a deleted state, and the embodiment of marking the virtual machine snapshot as the deleted state for other computing nodes in the cloud computing system is the same as that of the target computing node.
In one embodiment, the deletion instruction for deleting any one of the virtual machine snapshots may be submitted by a user through a service layer. As can be seen from the foregoing, the instructions submitted by the service layer may be sent to the base cloud layer by the venus component of the cloud gateway layer, and the target computing node in the base cloud layer marks the data state of the virtual machine snapshot indicated by the deletion instruction as a deleted state. From the foregoing, a nova component can be included in a target computing node that marks a virtual machine snapshot as deleted state essentially by invoking the nova component to mark the virtual machine snapshot as deleted state.
In one embodiment, for any one virtual machine snapshot, it may include multiple data states in the database, and the translation relationships between the multiple data states may be as described with reference to FIG. 3 a. Fig. 3a is a schematic diagram illustrating conversion between multiple data states of a virtual machine snapshot according to an embodiment of the present invention. As can be seen in FIG. 3a, the data states of the virtual machine snapshot may include a production state, an available state, a delete-in-process state, and a deleted state. When the cloud computing system is making a virtual machine snapshot, the data state of the virtual machine snapshot is the making state. After the creation is completed, the data state of the virtual machine snapshot becomes available. The virtual machine snapshot in the available state may be used to rollback, by which the corresponding virtual machine disk data may be rolled back to the previous point in time. When the virtual machine snapshot is deleted, the data state of the virtual machine snapshot is in the deleting process, and after the deleting is completed, the data state corresponding to the virtual machine data is in the deleted state.
In the embodiment of the present invention, marking the virtual machine snapshot as the deleted state essentially refers to setting the data state of the virtual machine snapshot in the database directly from the available state to the deleted deleted state. Because of this direct modification of the database state marker, the virtual machine snapshot is not actually deleted, and the virtual machine snapshot tree is not updated. Compared with the prior art that the deleting operation is executed immediately after the deleting instruction is received, in the embodiment of the invention, after the deleting instruction of the virtual machine snapshot is received, the virtual machine snapshot is marked as the deleted state. Over time, when the deleting operation of the virtual machine snapshot is detected, the virtual machine snapshot with the data state being the deleted state can be deleted at the same time, so that the deleting operation of the virtual machine snapshot by all virtual machines in the cloud computing system at the same time can be solved, and the reading and writing pressure of the storage cluster can be effectively reduced.
For example, referring to fig. 3b, a schematic diagram of immediately deleting a snapshot of a virtual machine is provided in an embodiment of the present invention. In fig. 3b, a control node receives a deletion instruction of a virtual machine snapshot sent by a cloud gateway layer venus, a nova-api in the control node searches a virtual machine where the virtual machine snapshot is located, and searches a computing node where the virtual machine is located through information of the virtual machine to assume the computing node as a target computing node, then sends the deletion instruction to the nova-api of the target computing node through the nova-api of the control node, the nova-api of the target computing node sends a request to the nova-computer of the target computing node, and the nova-computer of the target computing node notifies a storage layer to delete the virtual machine snapshot in the request.
Referring to fig. 3c, a schematic diagram of marking a virtual machine snapshot as a deleted state is provided in this embodiment. In distinction from fig. 3b, after receiving the delete instruction, the target computing node does not delete the virtual machine snapshot indicated by the delete instruction, but marks the data state of the virtual machine snapshot as deleted. As such, the virtual machine snapshot is deleted from the perspective of the cloud gateway layer. And when the deleting operation of the virtual machine snapshot is detected, deleting the virtual machine snapshot with the deleted data state.
Step S202, according to the parameter information of each virtual machine snapshot, a target virtual machine snapshot matched with a target computing node is obtained from at least one virtual machine snapshot.
The parameter information of each virtual machine snapshot may include identification information of a virtual machine corresponding to the corresponding virtual machine snapshot, for example, the parameter information of the virtual machine snapshot a may include identification information of the virtual machine a. The target virtual machine snapshot matched with the target computing node means that the virtual machine corresponding to the target virtual machine snapshot belongs to the target computing node.
In one embodiment, the obtaining the target virtual machine snapshot matched with the target computing node from at least one virtual machine snapshot 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 the computing node matched with the target computing node from the computing node to which each virtual machine information belongs, and taking the virtual machine snapshot corresponding to the virtual machine belonging to the matched computing node as the target virtual machine snapshot.
Step S203, deleting operation is executed on the target virtual machine snapshot.
In one embodiment, the number of target virtual machines may be at least one, and after determining the target virtual machine snapshot in step S202, the target virtual machine may be stored in the fifo queue, and then the deletion operation is sequentially performed on the target virtual machine snapshots in the fifo queue.
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 a storage layer, and the storage layer is built based on ceph, so that the performing the deleting operation on the target virtual machine snapshot may include calling a deleting snapshot interface of ceph to delete the target virtual machine snapshot on the target virtual machine snapshot.
In the embodiment of the invention, when a trigger event for executing the deleting operation of the virtual machine snapshot is detected by a target computing node, at least one virtual machine snapshot with a data state of deleted state is obtained, the deleted state corresponding to each virtual machine snapshot is marked when a deleting instruction for deleting the corresponding virtual machine snapshot is received, the time for receiving the deleting instruction for deleting any one virtual machine snapshot is earlier than the time for detecting the trigger event, further, the target virtual machine snapshot matched with the target computing node is obtained from at least one virtual machine snapshot according to the parameter information of each virtual machine snapshot, and the deleting operation is executed on the target virtual machine snapshot.
In the deleting process of the virtual machine snapshots, the time of receiving the deleting instruction for deleting any one virtual machine snapshot is earlier than the time of detecting the triggering event, which indicates that the deleting operation of the virtual machine snapshot is not executed immediately after receiving the deleting instruction, but is executed in a delayed manner. In a specific implementation, after receiving a deletion instruction for any one virtual machine snapshot, the virtual machine snapshot is not truly deleted, but the data state of the virtual machine snapshot is modified to be a deleted state, and then the deletion operation is executed after a trigger event for executing the deletion is detected. Compared with the method for immediately deleting the virtual machine snapshot after receiving the deleting instruction in the prior art, the method for immediately deleting the virtual machine snapshot avoids that all virtual machines of the whole cloud computing system are deleted in a snapshot mode at the same time, reduces the reading and writing pressure on a storage cluster in the cloud computing system, and is beneficial to improving the stability of user service execution.
Based on the above data deletion method, another data deletion method is provided in the embodiment of the present invention. Referring to fig. 4, a flowchart of another data deleting method according to an embodiment of the present invention is shown. The data deletion method shown in fig. 4 may be performed by a target computing node, which may be any one of a plurality of computing nodes in a cloud computing system. The data deletion method may be specifically performed by a processor in the target computing node. The data deletion method shown in fig. 4 may include the steps of:
in step S401, when a delete instruction for deleting the virtual machine snapshot is detected, the data state of the virtual machine snapshot is marked as a deleted state.
Step S402, when a trigger event for executing the deletion of the virtual machine snapshot is detected, at least one virtual machine snapshot with the data state being the deleted state is obtained.
Step S403, according to the parameter information of each virtual machine snapshot, a target virtual machine snapshot matched with the target computing node is obtained from at least one virtual machine snapshot.
In an embodiment, some possible implementations included in step S401 to step S403 may refer to descriptions of related steps in the embodiment of fig. 2, which are not described herein.
Step S404, acquiring an unoccupied target distributed lock from the distributed lock set.
In one embodiment, in order to control the read-write speed of the storage cluster, after the target virtual machine snapshot is obtained through steps S401 to S403, the target computing node needs to successfully obtain the right to delete the virtual machine snapshot, and then the snapshot deleting interface ceph may be called to delete the target virtual machine snapshot.
Based on the above, the concept of the distributed lock is introduced in the embodiment of the present invention, where the distributed lock is used for authorizing permission to delete the snapshot of the virtual machine, that is, when the target computing node acquires the distributed lock successfully, it is equivalent to that the target computing node acquires the right to delete the snapshot of the virtual machine.
In one embodiment, the number of distributed locks may be one or more, and the one or more distributed locks form a distributed lock set, and the distributed lock set is stored in a storage layer, that is, ceph layers. Each distributed lock can only be acquired by one compute node at a time. Based on the above, the deleting operation is performed on the target virtual machine snapshot, which comprises the steps of acquiring an unoccupied target distributed lock from the distributed lock set, and calling a storage layer to delete the target virtual machine snapshot if the acquisition of the target distributed lock is successful. Wherein a target distributed lock may refer to any one or more distributed locks in a set of distributed locks. It should be appreciated that if only one distributed lock is included in the set of distributed locks, the distributed lock is referred to as a target distributed lock.
Optionally, the distributed lock is implemented based on ceph. ceph as a multi-node distributed storage system, rbd block storage services can be provided externally through librbd library, and block storage is a data organization format similar to a bare disk. The distributed locks are actually implemented based on rbd block storage, and each distributed lock corresponds to a block device with a storage capacity of a preset value, such as a 0-byte block device.
In one embodiment, the following describes how a target computing node obtains a target distributed lock from a set of distributed locks, taking the example that only one distributed lock is included in the set of distributed locks. Assuming that the distributed lock is RbdLock implemented using a rbd block device, one can illustrate how to acquire the distributed lock by the following section of python pseudocode:
Class RbdLock:
deflock (locking operation)
(1) Judging whether the 0 byte rbd exists or not, if not, creating a0 byte rbd block device;
(2) Creating a connection to a pool where ceph byte rbd block devices reside
(3) Open 0 byte rbd block device
(4) Acquiring exclusive lock of 0 byte rbd block device
(5) If the exclusive lock is already occupied, the 0 byte rbd block device is turned off and the connection to ceph is broken.
In the pseudo code, deflock indicates that the acquisition of the distributed lock is started, in the step (1), if the target computing node determines that the ceph storage tier already has a 0-byte block device, then step (2) is executed, if in the step (1) the target computing node determines that the ceph does not have a 0-byte rbd block device, then a 0-byte rbd block device is created, then step (2) is executed, in the step (2), a connection with the pool where the 0-byte block device is located is established, then in the step (3), the 0-byte device is opened, and in the step (4), an exclusive lock is configured for the 0-byte rbd block device. If the lock fails, indicating that the exclusive lock is already occupied, the 0 byte rbd block device may be turned off and the connection to ceph disconnected. If the lock was successful in step (4), it is indicated that the target node acquired the distributed lock.
Based on the above description, if only one distributed lock is included in the distributed lock set, a schematic diagram of the target computing node obtaining the target distributed lock from the distributed lock set may be shown in fig. 5 a. In the schematic diagram for obtaining a distributed lock shown in fig. 5a, it is assumed that a base cloud layer of a cloud computing system may further include a first computing node and a second computing node different from the target computing node, in addition to the target computing node. Other compute nodes may be present at the same time and apply for a distributed lock to ceph storage tiers simultaneously with the target compute node. However, since there is only one distributed lock in the set of distributed locks, only one compute node can successfully acquire the distributed lock at this time.
In one embodiment, if the target computing node successfully acquires the target distributed lock, the operation of calling the storage layer to delete the target virtual machine snapshot may be performed. To facilitate use by other computing nodes, the target computing node may release the acquired target distributed lock after performing the delete operation.
Alternatively, assuming def unlock indicates release of the distributed lock, one can illustrate how to release the distributed lock by the following pseudocode of python:
def unlock
(1) Releasing exclusive lock of 0 byte rbd block device
(2) Closing a 0 byte chunk device
(3) Disconnect from ceph
In one embodiment, to allow for adjustment of the rate at which snapshots are deleted, multiple distributed locks may be configured. In embodiments of the present invention, a single latch pool may be used to store multiple distributed locks in a distributed lock set. Alternatively, if multiple distributed locks are included in the distributed lock set, in order to control the number of distributed locks in the distributed lock set to update, one control lock needs to be deployed to manage the distributed lock set.
In one embodiment, the principle of the control lock is the same as a distributed lock, except that the two locks function differently. The control lock is used to authorize updating of the distributed lock set, which may include adding a new distributed lock to the distributed lock set or deleting a distributed lock from the distributed lock set. That is, the control locks are mainly used to control the updating of the distributed lock quantity,
Assume that both the distributed lock and the control lock are implemented by a 0 byte rbd block device. The update to the distributed lock quantity can be initiated by any one of the computing nodes by creating a new 0-byte rbd block device and deleting a 0-byte rbd block device, but can only be initiated by one of the computing nodes at the time of the update. In brief, if any one computing node wants to update a distributed lock set, that computing node needs to acquire a control lock.
The method for updating the distributed lock set by taking any computing node as a target computing node as an example comprises the steps of obtaining the control lock from the storage layer, determining the target number of the loadable distributed locks according to the performance of the storage layer if the control lock is successfully obtained, and updating the distributed lock set based on the target number.
The better the performance of the storage layer, the more the number of distributed locks can be, and the more the number of distributed locks can be, the more computing nodes can be allowed to acquire the distributed locks at the same time to delete the snapshot. The method comprises the steps of updating the distributed lock set based on the target number, wherein the step of updating comprises the steps of obtaining the number of distributed locks before updating, obtaining the number difference between the target number and the number of distributed locks before updating, if the number of distributed locks before updating is smaller than the target number, building a number difference distributed lock, and if the number of distributed locks before updating is larger than the target number, deleting the number difference distributed lock from the distributed lock set. That is, the purpose of updating the set of distributed locks based on the target number is to ensure that the number of distributed locks in the set of distributed locks is equal to the target number.
In one embodiment, if multiple distributed locks are included in the distributed lock set, the sequence numbers of the multiple distributed locks are sequentially incremented according to the order of creation of each distributed lock, such as distributed lock 1, distributed lock 2, and so on. Based on this, when the target computing node acquires the target distributed lock from the distributed lock set, the target computing node sequentially tries according to the serial number of each distributed lock. For example, first try distributed lock 1 with sequence number 1, if distributed lock 1 is already occupied, try to acquire distributed lock 2, and so on until an unoccupied distributed lock is acquired. If all the distributed locks in the distributed lock set are failed to be acquired, determining that the target computing set fails to acquire the target distributed lock.
For example, referring to fig. 5b, another schematic diagram of a distributed lock acquisition is provided according to an embodiment of the present invention. It is assumed that there is a memory pool in the memory layer dedicated to storing distributed locks, called a latch pool. The latch pool stores a control lock and a distributed lock set, wherein the distributed lock set comprises a distributed lock 1, a distributed lock 2, a distributed lock 3 and a distributed lock 4. It is assumed that a target computing node is included in the cloud computing system, and a first computing node and a second computing node other than the target computing node. In the schematic diagram of acquiring distributed locks shown in fig. 5b, any computing node may apply for updating the number of distributed locks by acquiring control locks. And any computing node can apply for the distributed lock from the distributed lock set.
And step 405, if the target distributed lock is successfully obtained, calling a storage layer to delete the target virtual machine snapshot.
From the foregoing, it can be seen that after the target computing node obtains the matched target distributed lock, the target distributed lock is placed in the queue of the target computing node. The target computing node then obtains a target distributed lock from the set of distributed locks, invokes ceph to delete the target virtual machine snapshot if the target distributed lock was successfully obtained, and may not perform a delete operation on the target virtual machine snapshot if the target distributed lock was failed.
The following illustrates by FIG. 5c how the target computing node deletes the target virtual machine snapshot. Referring to fig. 5c, a schematic diagram of deleting a snapshot of a target virtual machine according to an embodiment of the present invention is provided. The base cloud layer of the cloud computing system is assumed to include a target computing node, a first computing node, and a second computing node. In the following description, taking a target computing node as an example, the deleting steps and principles of the first computing node and the second computing node to the target virtual machine snapshot are the same as those of the target computing node. When the target computing node detects that a timing thread for deleting the virtual machine snapshot in a delayed mode starts to run, at least one virtual machine snapshot added with a deletion mark is pulled from a database, and parameter information of each virtual machine snapshot such as identification information of a virtual machine to which each virtual machine snapshot belongs is used. The method comprises the steps of obtaining virtual machine information corresponding to each virtual machine snapshot from a database, obtaining computing nodes to which each virtual machine belongs, matching the obtained computing nodes with computing nodes operated by timing threads, namely matching the obtained computing nodes with target computing nodes, finding out computing nodes matched with the target computing nodes, and taking the virtual machine snapshot corresponding to the virtual machine in the computing nodes as the target virtual machine snapshot.
Further, the obtained target virtual machine snapshot is put into a first-in first-out queue. The snapshots in the queue are sequentially invoked ceph to delete the snapshots, and before invoking ceph, the distributed locks are acquired from the latch pool of ceph, and the real snapshot data deletion can be performed after the acquisition is successful. The number of concurrent deletions allowed depends on the number of acquired distributed locks, e.g., 2, and the target computing node may delete both virtual machine snapshots simultaneously.
The embodiment of the invention discloses a data deleting scheme, which can be used for adding deleted marks to any virtual machine snapshot to be deleted after a deleting instruction of the virtual machine snapshot to be deleted is received, and then executing deleting operation when a triggering event for executing deleting is detected. Compared with the method for immediately deleting the virtual machine snapshot after receiving the deleting instruction in the prior art, the method has the advantages that delayed deletion is realized, snapshot deletion of all virtual machines of the whole cloud computing system at the same time is avoided, the read-write pressure on a storage cluster in the cloud computing system is reduced, and therefore the stability of user service execution is improved.
In addition, in the data deleting process, before deleting the target virtual machine snapshot, the distributed locks are required to be acquired from the distributed lock set, the distributed lock set can comprise a plurality of distributed locks, and by setting the plurality of distributed locks, the target computing node can delete the plurality of target virtual machine snapshots in batches, so that the snapshot deleting efficiency is improved.
Based on the embodiment of the data deleting method, the embodiment of the invention provides a data deleting device. Referring to fig. 6, a schematic structural diagram of a data deleting device according to an embodiment of the present invention is provided. The data deleting apparatus shown in fig. 6 may operate as follows:
An obtaining unit 601, configured to obtain, when a trigger event for executing a deletion operation of a virtual machine snapshot is detected, at least one virtual machine snapshot whose data state is a deleted state, where the deleted state 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;
The obtaining unit 601 is further configured to obtain, from the at least one virtual machine snapshot, a target virtual machine snapshot that is matched with the target computing node according to parameter information of each virtual machine snapshot;
And the processing unit 602 is configured to perform a deletion operation on the target virtual machine snapshot.
In one embodiment, the cloud computing system further comprises a storage layer, the storage layer is used for storing a distributed lock set, the distributed lock set comprises at least one distributed lock, each distributed lock is used for authorizing to allow deleting the virtual machine snapshot, and the processing unit 602 performs the following operation when executing deleting operation on the target virtual machine snapshot, wherein the unoccupied target distributed lock is obtained from the distributed lock set, and if the target distributed lock is obtained successfully, the storage layer is called to delete the target virtual machine snapshot.
In one embodiment, the parameter information of each virtual machine snapshot includes virtual machine information of a virtual machine to which the corresponding virtual machine snapshot belongs, and the obtaining unit 601 performs an operation of obtaining, when obtaining 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, a 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 is matched with the target computing node, and taking, as the target virtual machine snapshot, a virtual machine snapshot corresponding to a virtual machine in the matched computing nodes.
In one embodiment, the distributed locks are implemented based on block storage of the storage layer, each distributed lock in the distributed lock set corresponds to a block device with a storage capacity of a preset value, and the processing unit 602 is further configured to open a target block device corresponding to a target distributed lock in the storage layer, configure an exclusive lock for the target block device, and determine that acquiring the target distributed lock is successful if configuring the exclusive lock for the block device is successful.
In one embodiment, the storage layer further includes a control lock, the control lock is used for authorizing the update of the distributed lock set, the update of the distributed lock set includes adding a new distributed lock in the distributed lock set or deleting a distributed lock from the distributed lock set, the obtaining unit 601 is further used for obtaining the control lock from the storage layer, the processing unit 602 is further used for determining a target number of the loadable distributed locks according to the performance of the storage layer if the control lock is successfully obtained, and the update of the distributed lock set is performed based on the target number.
In one embodiment, after the call storage layer deletes the target virtual machine snapshot, the processing unit 602 is further configured to release an exclusive lock configured for the target block device, and close the target block device.
In one embodiment, the triggering event includes detecting that a timing thread for time-lapse deletion of the virtual machine snapshot starts running, the timing thread being started running at a preset time interval.
According to one embodiment of the present invention, the steps involved in the data deletion method shown in fig. 2 and 4 may be performed by the respective units in the data deletion apparatus shown in fig. 6. For example, steps S201 to S202 shown in FIG. 2 may be performed by the acquisition unit 601 in the data deleting apparatus shown in FIG. 6, step S203 may be performed by the processing unit 602 in the data deleting apparatus shown in FIG. 6, and further, steps S401 and S405 shown in FIG. 4 may be performed by the processing unit 602 in the data deleting apparatus shown in FIG. 6, and steps S402 to S404 may be performed by the acquisition unit 601 in the data deleting apparatus shown in FIG. 6.
According to another embodiment of the present invention, each unit in the data deleting apparatus shown in fig. 6 may be separately or completely combined into one or several other units, or some unit(s) thereof may be further split into a plurality of units with smaller functions, which may achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present invention. The above units are divided based on logic functions, and in practical applications, the functions of one unit may be implemented by a plurality of units, or the functions of a plurality of units may be implemented by one unit. In other embodiments of the present invention, the data-based deletion apparatus may also include other units, and in actual practice, these functions may also be implemented with assistance from other units, and may be implemented by cooperation of a plurality of units.
According to another embodiment of the present invention, the data deleting apparatus as shown in fig. 6 may be constructed by running a computer program (including program code) capable of executing the steps involved in the respective methods as shown in fig. 2 on a general-purpose computing device such as a computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), and the like, and a storage element, and implementing the data deleting method of the embodiment of the present invention. The computer program may be recorded on, for example, a computer readable storage medium, and loaded into and executed by the computing device described above.
In the embodiment of the invention, when a trigger event for executing the deleting operation of the virtual machine snapshot is detected by the target computing node, at least one virtual machine snapshot with the deleting mark added is obtained, the deleting mark corresponding to each virtual machine snapshot is added when a deleting instruction for deleting the corresponding virtual machine snapshot is received, the time for receiving the deleting instruction for deleting any virtual machine snapshot is earlier than the time for detecting the trigger event, further, the target virtual machine snapshot matched with the target computing node is obtained from at least one virtual machine snapshot according to the parameter information of each virtual machine snapshot, and the deleting operation is executed on the target virtual machine snapshot.
In the deleting process of the virtual machine snapshot, the time of receiving the deleting instruction for deleting any one virtual machine snapshot is earlier than the time of detecting the triggering event, which indicates that the deleting operation of the virtual machine snapshot is not executed immediately after receiving the deleting instruction, but is executed in a delayed manner. In the specific implementation, after receiving a deletion instruction for any one virtual machine snapshot, a deleted mark is added for the virtual machine snapshot, and then the deletion operation is executed after a trigger event for executing deletion is detected. Compared with the method for deleting the virtual machine snapshot in the automatic timing snapshot in the prior art, the method avoids snapshot deletion of all virtual machines of the whole cloud computing system at the same time, reduces the read-write pressure on a storage cluster in the cloud computing system, and is beneficial to improving the stability of user service execution.
Based on the above-mentioned data deleting method and the embodiments of the data deleting device, the embodiments of the present invention provide a data deleting device, where the data deleting device may be the target computing node. Referring to fig. 7, a schematic structural diagram of a data deleting device according to an embodiment of the present invention is provided. The data deletion apparatus shown in fig. 7 may include at least a processor 701, an input interface 702, an output interface 703, and a computer storage medium 704. Wherein the processor 701, the input interface 702, the output interface 703, and the computer storage medium 704 may be connected by a bus or other means.
A computer storage medium 704 may be stored in a memory of a node device, the computer storage medium 704 being adapted to store a computer program comprising program instructions, the processor 1201 being adapted to execute the program instructions stored by the computer storage medium 704. The processor 701, or CPU (Central Processing Unit )), is a computing core and a control core of the data deleting device, which is adapted to implement one or more instructions, in particular to load and execute one or more instructions to implement the corresponding method flow or the corresponding functions.
In one embodiment, the processor 701 according to the embodiment of the present invention may be configured to, when detecting a trigger event for executing a deletion operation of a virtual machine snapshot, acquire at least one virtual machine snapshot with a deleted data state, where 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, acquire, according to parameter information of each virtual machine snapshot, a target virtual machine snapshot matched with the target computing node from the at least one virtual machine snapshot, and execute the deletion operation on the target virtual machine snapshot.
The embodiment of the invention also provides a computer storage medium (Memory), which is a Memory device in the data deleting device and is used for storing programs and data. It will be appreciated that the computer storage media herein may include both built-in storage media in the data deletion device and extended storage media supported by the data deletion device. The computer storage medium provides a storage space that stores an operating system of the data deletion apparatus. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), adapted to be loaded and executed by the processor 701. The computer storage medium may be a high-speed RAM memory, a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory, or at least one computer storage medium located remotely from the processor.
In one embodiment, the computer storage medium may be loaded and executed by the processor 701 to implement the corresponding steps of the method in the embodiment of the data deleting method shown in fig. 2, where the one or more instructions in the computer storage medium are loaded and executed by the processor 701, when a trigger event for executing a virtual machine snapshot deleting operation is detected, at least one virtual machine snapshot with a deleted state in a data state is obtained, the deleted state corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is added when a delete instruction for deleting the corresponding virtual machine snapshot is received, a target virtual machine snapshot matched with the target computing node is obtained from the at least one virtual machine snapshot according to parameter information of each virtual machine snapshot, and a deleting operation is executed on the target virtual machine snapshot.
In one embodiment, the cloud computing system further comprises a storage layer, the storage layer is used for storing a distributed lock set, the distributed lock set comprises at least one distributed lock, each distributed lock is used for authorizing to allow deleting the virtual machine snapshot, and the processor 701 performs the following steps when executing deleting operation on the target virtual machine snapshot, wherein the unoccupied target distributed lock is obtained from the distributed lock set, and if the target distributed lock is obtained successfully, the storage layer is called to delete the target virtual machine snapshot.
In one embodiment, the parameter information of each virtual machine snapshot includes virtual machine information of a virtual machine to which the corresponding virtual machine snapshot belongs, and when the processor 701 obtains 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 processor performs the steps of obtaining a 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 a computing node matched with the target computing node from the computing nodes to which each virtual machine information belongs, and taking the virtual machine snapshot corresponding to the virtual machine in the matched computing node as the target virtual machine snapshot.
In one embodiment, the distributed locks are implemented based on block storage of the storage layer, each distributed lock in the distributed lock set corresponds to a block device with a storage capacity of a preset value, and the processor 701 is further configured to open a target block device corresponding to a target distributed lock in the storage layer, configure an exclusive lock for the target block device, and determine that acquiring the target distributed lock is successful if configuring the exclusive lock for the block device is successful.
In one embodiment, the storage layer further includes a control lock, where the control lock is used to authorize updating the distributed lock set, where updating the distributed lock set includes adding a new distributed lock in the distributed lock set or deleting a distributed lock from the distributed lock set, and the processor 701 is further configured to obtain the control lock from the storage layer, determine a target number of loadable distributed locks according to the performance of the storage layer if obtaining the control lock is successful, and update the distributed lock set based on the target number.
In one embodiment, after the call storage layer deletes the target virtual machine snapshot, the processor 701 is further configured to release an exclusive lock configured for the target block device and close the target block device.
In one embodiment, the triggering event includes detecting that a timing thread for time-lapse deletion of the virtual machine snapshot starts running, the timing thread being started running at a preset time interval.
In the embodiment of the invention, when a trigger event for executing the deleting operation of the virtual machine snapshot is detected by the target computing node, at least one virtual machine snapshot with the deleting mark added is obtained, the deleting mark corresponding to each virtual machine snapshot is added when a deleting instruction for deleting the corresponding virtual machine snapshot is received, the time for receiving the deleting instruction for deleting any virtual machine snapshot is earlier than the time for detecting the trigger event, further, the target virtual machine snapshot matched with the target computing node is obtained from at least one virtual machine snapshot according to the parameter information of each virtual machine snapshot, and the deleting operation is executed on the target virtual machine snapshot.
In the deleting process of the virtual machine snapshot, the time of receiving the deleting instruction for deleting any one virtual machine snapshot is earlier than the time of detecting the triggering event, which indicates that the deleting operation of the virtual machine snapshot is not executed immediately after receiving the deleting instruction, but is executed in a delayed manner. In the specific implementation, after receiving a deletion instruction for any one virtual machine snapshot, a deleted mark is added for the virtual machine snapshot, and then the deletion operation is executed after a trigger event for executing deletion is detected. Compared with the method for deleting the virtual machine snapshot in the automatic timing snapshot in the prior art, the method avoids snapshot deletion of all virtual machines of the whole cloud computing system at the same time, reduces the read-write pressure on a storage cluster in the cloud computing system, and is beneficial to improving the stability of user service execution.
According to one aspect of the application, embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor 701 of the data deleting device reads the computer instructions from the computer readable storage medium, the processor 701 executes the computer instructions, so that the data deleting device executes at least one virtual machine snapshot with a deleted data state, wherein the deleted state corresponding to each virtual machine snapshot in the at least one virtual machine snapshot is added when a deleting instruction for deleting the corresponding virtual machine snapshot is received, a target virtual machine snapshot matched with the target computing node is obtained from the at least one virtual machine snapshot according to parameter information of each virtual machine snapshot, and the deleting operation is executed on the target virtual machine snapshot.
The above disclosure is illustrative only of some embodiments of the invention and is not intended to limit the scope of the invention, which is defined by the claims and their equivalents.

Claims (6)

1. A data deletion method, applied to a target computing node, where the target computing node is any one of at least one computing node included in a base cloud layer of a cloud computing system, where the cloud computing system includes a storage layer, where the storage layer is configured to store a set of distributed locks, where the set of distributed locks includes at least one distributed lock, each distributed lock is configured to authorize permission to delete a virtual machine snapshot, each distributed lock is allowed to be acquired by only one computing node at a time, where the distributed locks are implemented based on a block storage of the storage layer, and where each distributed lock in the set of distributed locks corresponds to a block device having a storage capacity that is a preset value, where the method includes:
when a trigger event for executing the virtual machine snapshot deleting operation is detected, at least one virtual machine snapshot with a data state being a deleted state is obtained, the trigger events for executing the virtual machine snapshot deleting 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 a deleting instruction for deleting the corresponding virtual machine snapshot is received, and the time for receiving the deleting instruction for deleting any one virtual machine snapshot is earlier than the time for detecting the trigger event;
obtaining target virtual machine snapshots matched with the target computing node from the at least one virtual machine snapshot according to the parameter information of each virtual machine snapshot;
opening target block equipment corresponding to the target distributed lock in the storage layer, and configuring exclusive locks for the target block equipment;
if the exclusive lock is configured successfully for the block device, determining that the target distributed lock is acquired successfully, and calling the storage layer to execute deleting operation on the target virtual machine snapshot;
Releasing an exclusive lock configured for the target block device and closing the target block device;
The storage tier further includes a control lock for authorizing an update to the set of distributed locks, the updating of the set of distributed locks including adding a new distributed lock to the set of distributed locks or deleting a distributed lock from the set of distributed locks, the method further comprising:
Acquiring the control lock from the storage layer;
if the control lock is successfully obtained, determining the target number of the loadable distributed locks according to the performance of the storage layer;
updating the distributed lock set based on the target number.
2. The method of claim 1, wherein the parameter information of each virtual machine snapshot includes virtual machine information of a virtual machine to which the corresponding virtual machine snapshot belongs, and the obtaining, from the at least one virtual machine snapshot, a target virtual machine snapshot corresponding to the target computing node 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, acquiring a computing node to which each virtual machine information belongs;
And acquiring a computing node matched with the target computing node from the computing node to which each piece of virtual machine information belongs, and taking the virtual machine snapshot corresponding to the virtual machine belonging to the matched computing node as a target virtual machine snapshot.
3. The method of claim 1, wherein the triggering event comprises detecting that a timing thread for time-lapse deletion of the virtual machine snapshot is started, the timing thread being started at a preset time interval.
4. A data deletion apparatus, applied to a target computing node, the target computing node being any one of at least one computing node included in a base cloud layer of a cloud computing system, the cloud computing system including a storage layer, the storage layer configured to store a set of distributed locks, the set of distributed locks including at least one distributed lock, each distributed lock configured to authorize permission to delete a virtual machine snapshot, each distributed lock being allowed to be acquired by only one computing node at a time, the distributed locks being implemented based on a block storage of the storage layer, each distributed lock in the set of distributed locks corresponding to a block device having a storage capacity of a preset value, the apparatus comprising:
The system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring at least one virtual machine snapshot with a data state of a deleted state when a trigger event for executing the virtual machine snapshot deleting operation is detected, the trigger events for executing the virtual machine snapshot deleting 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 a deleting instruction for deleting the corresponding virtual machine snapshot is received, and the time for receiving the deleting instruction for deleting any one virtual machine snapshot is earlier than the time for detecting the trigger event;
the obtaining unit is further configured to obtain, according to parameter information of each virtual machine snapshot, a target virtual machine snapshot that is matched with the target computing node from the at least one virtual machine snapshot;
A processing unit, configured to obtain an unoccupied target distributed lock from the distributed lock set; if the exclusive lock is configured for the block equipment successfully, the target distributed lock is determined to be successfully acquired, and the storage layer is called to execute deleting operation on the target virtual machine snapshot;
The processing unit is further configured to release an exclusive lock configured for the target block device, and close the target block device;
The storage layer further comprises a control lock, the control lock is used for authorizing the update of the distributed lock set, the update of the distributed lock set comprises adding a new distributed lock in the distributed lock set or deleting the distributed lock from the distributed lock set, and the acquisition unit is further used for:
Acquiring the control lock from the storage layer;
if the control lock is successfully obtained, determining the target number of the loadable distributed locks according to the performance of the storage layer;
updating the distributed lock set based on the target number.
5. A data deleting apparatus, characterized by comprising:
a processor adapted to implement one or more instructions, and
A computer storage medium storing one or more instructions adapted to be loaded by the processor and to perform the data deletion method of any one of claims 1-3.
6. A computer storage medium having stored therein computer program instructions for performing the data deletion method of any one of claims 1-3 when executed by a processor.
CN202010660601.0A 2020-07-09 2020-07-09 Data deleting method, device, equipment and storage medium Active CN111813501B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010660601.0A CN111813501B (en) 2020-07-09 2020-07-09 Data deleting method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010660601.0A CN111813501B (en) 2020-07-09 2020-07-09 Data deleting method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111813501A CN111813501A (en) 2020-10-23
CN111813501B true CN111813501B (en) 2025-07-08

Family

ID=72841695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010660601.0A Active CN111813501B (en) 2020-07-09 2020-07-09 Data deleting method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111813501B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112783447A (en) * 2021-01-22 2021-05-11 北京百度网讯科技有限公司 Method, apparatus, device, medium, and article of manufacture for processing snapshots

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107491529A (en) * 2017-08-18 2017-12-19 华为技术有限公司 A kind of snapshot delet method and node
CN111124747A (en) * 2018-10-31 2020-05-08 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for deleting snapshots

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9116846B2 (en) * 2013-06-10 2015-08-25 Veeam Software Ag Virtual machine backup from storage snapshot
CN103647849B (en) * 2013-12-24 2017-02-08 华为技术有限公司 Method and device for migrating businesses and disaster recovery system
CN105335253B (en) * 2015-10-28 2019-01-15 北京百度网讯科技有限公司 The method and apparatus for creating virtual machine system disk snapshot
CN110609807B (en) * 2018-06-15 2023-06-23 伊姆西Ip控股有限责任公司 Method, apparatus and computer readable storage medium for deleting snapshot data
CN110196755B (en) * 2019-05-07 2024-03-15 腾讯科技(深圳)有限公司 Virtual machine snapshot management method and device, server and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107491529A (en) * 2017-08-18 2017-12-19 华为技术有限公司 A kind of snapshot delet method and node
CN111124747A (en) * 2018-10-31 2020-05-08 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for deleting snapshots

Also Published As

Publication number Publication date
CN111813501A (en) 2020-10-23

Similar Documents

Publication Publication Date Title
JP7378870B2 (en) File system data access method and file system
US10911540B1 (en) Recovering snapshots from a cloud snapshot lineage on cloud storage to a storage system
US11199985B2 (en) Tracking storage capacity usage by snapshot lineages using metadata in a multi-level tree structure
KR102047216B1 (en) Replaying jobs at a secondary location of a service
CN109325016B (en) Data migration method, apparatus, medium and electronic device
US7792916B2 (en) Management of cluster-wide resources with shared variables
CN105700939A (en) Method and system for multi-thread synchronization in distributed system
US11537553B2 (en) Managing snapshots stored locally in a storage system and in cloud storage utilizing policy-based snapshot lineages
US11630736B2 (en) Recovering a storage volume associated with a snapshot lineage from cloud storage
CN112241398B (en) A data migration method and system
US11573923B2 (en) Generating configuration data enabling remote access to portions of a snapshot lineage copied to cloud storage
US11288134B2 (en) Pausing and resuming copying of snapshots from a local snapshot lineage to at least one cloud snapshot lineage
US11150981B2 (en) Fast recovery from failures in a chronologically ordered log-structured key-value storage system
US11599276B1 (en) Snapshot shipping to multiple cloud destinations
CN117909027A (en) Hierarchical container arrangement system and container arrangement method
CN111813501B (en) Data deleting method, device, equipment and storage medium
US11010408B2 (en) Hydration of a hierarchy of dehydrated files
US11366600B2 (en) Moving snapshots from a local snapshot lineage on a storage system to a cloud snapshot lineage on cloud storage
US12455794B2 (en) Relational software-as-a-service data protection
US12056023B2 (en) Orchestration of storage system-based snapshot recovery
US9852154B2 (en) Methods for transferring reserves when moving virtual machines across systems
US12242418B2 (en) Orchestration of storage system-based snapshot shipping
CN116360696B (en) Distributed block storage system, medium, and electronic device thereof
US12524317B1 (en) Backup and recovery for computing objects with hierarchical page structures
HK40030078B (en) Data deletion method, apparatus and device, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40030078

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant