CN113961147A - Method and application for recycling space from deleted blocks on cloud platform - Google Patents

Method and application for recycling space from deleted blocks on cloud platform Download PDF

Info

Publication number
CN113961147A
CN113961147A CN202111249829.1A CN202111249829A CN113961147A CN 113961147 A CN113961147 A CN 113961147A CN 202111249829 A CN202111249829 A CN 202111249829A CN 113961147 A CN113961147 A CN 113961147A
Authority
CN
China
Prior art keywords
virtual machine
management platform
cloud
cloud management
storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111249829.1A
Other languages
Chinese (zh)
Inventor
吴业亮
朱正东
那文武
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Anchao Cloud Software Co Ltd
Original Assignee
Jiangsu Anchao Cloud Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Anchao Cloud Software Co Ltd filed Critical Jiangsu Anchao Cloud Software Co Ltd
Priority to CN202111249829.1A priority Critical patent/CN113961147A/en
Publication of CN113961147A publication Critical patent/CN113961147A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

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

Abstract

The invention discloses a method for recovering space from deleted blocks on a cloud platform and application thereof, wherein the method comprises the following steps: executing discarding service by an operating system of the virtual machine according to a preset period; when the cloud management platform receives the message of the discarding service, the cloud management platform checks whether a corresponding storage file exists in a disk of the virtual machine; and if so, deleting the storage file by the storage of the virtual machine. The method can realize the space release of the storage system, ensure the synchronous deletion of the data in the storage space, avoid the waste of the storage space and improve the utilization rate of the storage space.

Description

Method and application for recycling space from deleted blocks on cloud platform
Technical Field
The present invention relates to the field of cloud storage, and in particular, to a method and an application for recovering a space from a deleted block on a cloud platform.
Background
With the rapid development of internet technology, people increasingly use computers to store data, which makes the demand for data storage continuously increase. Because the file system storage capacity of a single machine is limited, all large internet companies adopt self-developed or open-source distributed file systems to store data. In this case, the stored data often contains more time-sensitive data, so the distributed file system generally supports data deletion operations. Since the storage space occupied by the deleted data is in an idle state after the data deletion operation is performed, it is important to recycle such storage space for the purpose of reasonably utilizing the storage space.
In the deployment of a cloud environment, storage generally has a Thin provisioning function, and the function realizes the capacity of storage allocation on demand. In the existing scenario, a user creates a large file in a file system, and deletes the file after the use of the file system is finished. In practice, however, the space occupied by the file on the storage system is not freed. When a user deletes a file in the file system, only the blocks are marked as unused in the metadata structure of the disk, and the space of the block device is not recycled. Thus, although the file system knows that these blocks are unused or available, the underlying storage system is not aware of the operations that the file system does and will consider these blocks still in use.
The information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art.
Disclosure of Invention
The invention aims to provide a method and application for recovering space from deleted blocks on a cloud platform, and solves the problem that in some scenes, a file system deletes files, corresponding storage files still exist in the storage system, and occupied space is not released.
To achieve the above object, an embodiment of the present invention provides a method for reclaiming space from deleted blocks on a cloud platform.
In one or more embodiments of the invention, the method comprises: executing discarding service by an operating system of the virtual machine according to a preset period; when the cloud management platform receives the message of the discarding service, the cloud management platform checks whether a corresponding storage file exists in a disk of the virtual machine; and if so, deleting the storage file by the storage of the virtual machine.
In one or more embodiments of the present invention, an operating system of a virtual machine performs a drop service according to a preset period, including: configuring ftrim for a disk of a virtual machine according to the preset configuration; inquiring whether the disk of the virtual machine is configured with ftrim; if yes, the operating system of the virtual machine sends the discarding service to the cloud sending management platform through the Ethernet.
In one or more embodiments of the invention, the method further comprises: when the cloud management platform checks that the disk of the virtual machine does not have the corresponding storage file, the cloud management platform checks whether the disk of the virtual machine has the corresponding storage file in the database according to a preset period.
In one or more embodiments of the invention, the method further comprises: judging whether the storage file is successfully deleted by the virtual machine; if not, the virtual machine informs an administrator of the failure of space recovery.
To achieve the above object, an embodiment of the present invention provides another method for reclaiming space from deleted blocks on a cloud platform.
In one or more embodiments of the invention, the method comprises: executing qemu-guest-agent service by an operating system of the virtual machine according to a preset period; when the cloud management platform queries a qemu-guest-agent service message, the cloud management platform checks whether a corresponding storage file exists in a disk of the virtual machine; and if so, deleting the storage file by the storage of the virtual machine.
In one or more embodiments of the invention, the method further comprises: the operating system of the virtual machine sends the information of the qemu-guest-agent service to a virtio-blk of the qemu-KVM; and the cloud management platform queries qemu-KVM according to a preset period.
In one or more embodiments of the invention, the method further comprises: when the cloud management platform detects that the disk of the virtual machine does not have the corresponding storage file, whether the disk of the virtual machine has the corresponding storage file is detected in the database according to a preset period.
In one or more embodiments of the invention, the method further comprises: judging whether the storage file is successfully deleted by the virtual machine; if not, the virtual machine informs an administrator of the failure of space recovery.
To achieve the above object, an embodiment of the present invention provides another method for reclaiming space from deleted blocks on a cloud platform.
In one or more embodiments of the invention, the method comprises: the method comprises the steps that a cloud management platform receives a discarding service message sent by an operating system of a virtual machine; when the cloud management platform receives the message of the discarding service, the cloud management platform checks whether a corresponding storage file exists in a disk of the virtual machine; if yes, the cloud management platform informs the storage of the virtual machine to delete the storage file.
In another aspect of the present invention, an apparatus for reclaiming space from deleted blocks on a cloud platform is provided, which includes an execution module, a checking module, and a deletion module.
And the execution module is used for executing the discarding service by the operating system of the virtual machine according to a preset period.
And the checking module is used for checking whether the corresponding storage file exists in the disk of the virtual machine or not by the cloud management platform when the cloud management platform receives the message of the discarding service.
And the deleting module is used for deleting the storage file by the storage of the virtual machine.
In one or more embodiments of the present invention, the execution module is further configured to: configuring ftrim for a disk of a virtual machine according to the preset configuration; inquiring whether the disk of the virtual machine is configured with ftrim; if yes, the operating system of the virtual machine sends the discarding service to the cloud sending management platform through the Ethernet.
In one or more embodiments of the invention, the checking module is further configured to: when the cloud management platform checks that the disk of the virtual machine does not have the corresponding storage file, the cloud management platform checks whether the disk of the virtual machine has the corresponding storage file in the database according to a preset period.
In one or more embodiments of the present invention, the deletion module is further configured to: judging whether the storage file is successfully deleted by the virtual machine; if not, the virtual machine informs an administrator of the failure of space recovery.
In another aspect of the present invention, there is provided still another apparatus for reclaiming space from deleted blocks on a cloud platform, which includes an execution module, a checking module, and a deletion module.
And the execution module is used for executing qemu-guest-agent service by the operating system of the virtual machine according to a preset period.
The checking module is used for checking whether a corresponding storage file exists in a disk of the virtual machine or not when the cloud management platform inquires the message of the qemu-guest-agent service.
And the deleting module is used for deleting the storage file by the storage of the virtual machine.
In one or more embodiments of the present invention, the execution module is further configured to: the operating system of the virtual machine sends the information of the qemu-guest-agent service to a virtio-blk of the qemu-KVM; and the cloud management platform queries qemu-KVM according to a preset period.
In one or more embodiments of the invention, the checking module is further configured to: when the cloud management platform checks that the disk of the virtual machine does not have the corresponding storage file, the cloud management platform checks whether the disk of the virtual machine has the corresponding storage file in the database according to a preset period.
In one or more embodiments of the present invention, the deletion module is further configured to: judging whether the storage file is successfully deleted by the virtual machine; if not, the virtual machine informs an administrator of the failure of space recovery.
In another aspect of the present invention, there is provided still another apparatus for reclaiming space from deleted blocks on a cloud platform, which includes an execution module, a checking module, and a deletion module.
And the execution module is used for receiving the discarding service message sent by the operating system of the virtual machine by the cloud management platform.
And the checking module is used for checking whether the corresponding storage file exists in the disk of the virtual machine or not by the cloud management platform when the cloud management platform receives the message of the discarding service.
And the deleting module is used for informing the storage of the virtual machine to delete the storage file by the cloud management platform.
In another aspect of the present invention, there is provided an electronic device including: at least one processor; and a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of reclaiming space from deleted blocks on a cloud platform as described above.
In another aspect of the present invention, a computer readable storage medium is provided, having stored thereon a computer program, which when executed by a processor, implements the steps of the method of reclaiming space from deleted blocks on a cloud platform as described.
Compared with the prior art, according to the method and the application for recovering the space from the deleted blocks on the cloud platform, the discarding service can be installed on the operating system of the virtual machine, the cloud management platform finds the storage files of the deleted block devices and deletes the storage files, the space release of the storage system is achieved, and the synchronous deletion of the data in the storage space is guaranteed.
According to the method and the application for recovering the space from the deleted blocks on the cloud platform, the virtual machine of the kernel and the operating system of any version can be served; the virtual machine can use virtio-blk, has no requirement on the qemu version, supports the service of the low-version qemu, and further ensures the performance of the virtual machine in the aspect of storage.
Drawings
FIG. 1 is a communication flow diagram of a method for reclaiming space from deleted blocks on a cloud platform in accordance with an embodiment of the present invention;
FIG. 2 is a communication specific flow diagram of a method for reclaiming space from deleted blocks on a cloud platform according to an embodiment of the present invention;
FIG. 3 is a communication structure diagram of a method of reclaiming space from deleted blocks on a cloud platform according to an embodiment of the present invention;
FIG. 4 is a non-communication flow diagram of a method of reclaiming space from deleted blocks on a cloud platform in accordance with an embodiment of the present invention;
FIG. 5 is a non-communicative detailed flowchart of a method for reclaiming space from deleted blocks on a cloud platform according to an embodiment of the present invention;
FIG. 6 is a non-communication structure diagram of a method of reclaiming space from deleted blocks on a cloud platform according to an embodiment of the present invention;
FIG. 7 is a block diagram of an apparatus for reclaiming space from deleted blocks on a cloud platform according to an embodiment of the present invention;
fig. 8 is a hardware configuration diagram of a computing device reclaiming space from deleted blocks on a cloud platform according to an embodiment of the present invention.
Detailed Description
The following detailed description of the present invention is provided in conjunction with the accompanying drawings, but it should be understood that the scope of the present invention is not limited to the specific embodiments.
Throughout the specification and claims, unless explicitly stated otherwise, the word "comprise", or variations such as "comprises" or "comprising", will be understood to imply the inclusion of a stated element or component but not the exclusion of any other element or component.
The technical solutions provided by the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
Example 1
Referring to fig. 1, a method for reclaiming space from deleted blocks on a cloud platform according to an embodiment of the present invention is described, which includes the following steps.
In step S101, the operating system of the virtual machine performs a drop service according to a preset period.
A drop service is installed in an operating system (Guest OS) of the virtual machine, the drop service being executed periodically. And discarding service periodical triggering of ftrim, which is an interface for a recovery space provided by the SSD, and sending a message to the cloud management platform to notify the storage file system of the recovery space each time ftrim is triggered.
When the file system performs the deletion operation, only the index is generally deleted, and the data is not deleted. For example, there is a movie file on the file system of ext2, and after deletion, the metadata is simply disconnected from the data link to the movie itself, which is still on the disk until it is overwritten. This provides an opportunity for disk data recovery, that is, at the time of file deletion, the file system notifies the SSD controller which pages are deleted, and at this time, the SSD controller will flush the deleted pages, thereby becoming blank pages. The performance of the next write operation, which is writing data to a blank page, can be improved by ftim.
In step S102, when the cloud management platform receives the message of discarding the service, the cloud management platform checks whether the disk of the virtual machine has a corresponding storage file.
After receiving a message sent by an operating system, the cloud management platform checks whether a corresponding relation between a virtual machine disk and a storage file exists in a cache of the virtual machine, if the virtual machine disk in the cache has the corresponding storage file, the cloud management platform directly issues a deletion operation to the storage, otherwise, the cloud management platform continuously checks whether the corresponding relation between the virtual machine disk and the storage file exists in the cache of the virtual machine in the database, and then issues the deletion operation to the storage until the virtual machine disk in the cache has the corresponding storage file.
For example, the correspondence between the virtual machine disk and the storage file is as follows: the names of the virtual machines are respectively VM1, VM2 and VM3, the corresponding virtual machine disks are sda, sdb and sda, and the corresponding storage files are respectively/storage/file 1,/storage/file 2 and/storage/file 3,/storage/file 4. When the cloud management platform queries the storage file/storage/file 1 of the disk sda of the virtual machine VM1, the cloud management platform directly issues a deletion operation to the storage, and deletes the storage file/storage/file 1.
In step S103, the storage of the virtual machine deletes the storage file.
After the deleting instruction is issued by the cloud management platform, the block device driving layer initiates a space releasing command to the storage of the virtual machine, and the storage of the virtual machine deletes the storage file, so that the storage space is automatically released, and the space recovery from the deleted block device on the cloud platform is completed.
For example, the cloud management platform issues a delete command to the storage of the virtual machine, where the delete command is specifically fallocate-p-o 0-l 10485760/storage/file1, and the delete command is to delete the storage file/storage/file 1 of the disk sda of the virtual machine VM 1.
Example 2
As shown in fig. 2 to 3, a method for reclaiming space from deleted blocks on a cloud platform in an embodiment of the present invention is described, which includes the following steps.
In step S201, ftrim is configured to the disk of the virtual machine according to the preset setting.
The ftrim is an interface for a recovery space provided by the SSD, the ftrim is configured for a disk of the virtual machine according to the preset configuration, when the storage file is deleted, the file system informs the SSD controller of which pages are deleted, and at the moment, the SSD controller clears the deleted pages to become blank pages, so that the recovery of the storage space is realized.
In step S202, it is queried whether the disk of the virtual machine is configured with ftrim.
If the disk of the virtual machine is configured with the ftrim, the operating system of the virtual machine sends the discarding service to the cloud management platform through the Ethernet. And the cloud management platform checks whether the corresponding storage file exists in the disk of the virtual machine, and issues a storage file deleting instruction.
In step S203, when the cloud management platform receives the message of discarding the service, the cloud management platform checks whether the disk of the virtual machine has a corresponding storage file.
After receiving a message sent by an operating system, the cloud management platform checks whether a corresponding relation between a virtual machine disk and a storage file exists in a cache of the virtual machine, if the virtual machine disk in the cache has the corresponding storage file, the cloud management platform directly issues a deletion operation to the storage, otherwise, the cloud management platform continuously checks whether the corresponding relation between the virtual machine disk and the storage file exists in the cache of the virtual machine in the database, and then issues the deletion operation to the storage until the virtual machine disk in the cache has the corresponding storage file.
In step S204, the storage of the virtual machine deletes the storage file.
After the deleting instruction is issued by the cloud management platform, the block device driving layer initiates a space releasing command to the storage of the virtual machine, and the storage of the virtual machine deletes the storage file, so that the storage space is automatically released, and the space recovery from the deleted block device on the cloud platform is completed.
In step S205, it is determined whether the storage deletion of the virtual machine has succeeded.
After the storage of the virtual machine receives the deletion instruction to delete the storage file, whether the storage deletion of the virtual machine is successful is judged, so that the space occupied by the storage file of the virtual machine on the storage system is released. If the stored file is deleted unsuccessfully, the administrator needs to be informed of the failure of space recovery, and the administrator issues a space recovery instruction again to ensure that the stored file cannot be recovered and the space of the deleted block device can be recovered.
Example 3
Referring to fig. 4, a method for reclaiming space from deleted blocks on a cloud platform according to an embodiment of the present invention is described, which includes the following steps.
In step S301, the operating system of the virtual machine executes a qemu-guest-agent service according to a preset period.
Installing a qemu-Guest-agent service in an operating system (Guest OS) of the virtual machine, the qemu-Guest-agent service being executed periodically.
qemu is a virtualization tool that simulates CPU and other hardware to the operating system (Guest OS) of a virtual machine, which considers itself and hardware to work directly, but actually, Guest OS works in cooperation with the hardware that qemu simulates, and translates these instructions to real hardware through qemu.
Due to the isolation of virtualization, and the differences between different operating systems, it is difficult to directly manage Guest OS on a physical server. At present, qemu-Guest-agent (qemu GA) service is installed in Guest OS for interaction. The qemu GA carries out simple data interaction with an external management platform through a serial bus in the virtual machine, the data interaction uses an QMP protocol, default provides some basic operations, and a developer is allowed to define an expansion interface of the developer. Guest OS of any virtual machine can be uniformly managed on a cloud platform through a qemu GA manager. Through the interface provided by qemu, a developer can realize a plurality of functions related to the virtual machine on the cloud platform, and the management work of the cloud platform is simplified.
In this embodiment, the cloud scenario is financial or a scenario with high requirements on security, and a qemu-guest-agent service is installed in an operating system of each virtual machine, and the service is mainly used for monitoring and managing the virtual machines and reporting information to the qemu-KVM in real time.
In step S302, when the cloud management platform queries the message of the qemu-guest-agent service, the cloud management platform checks whether a corresponding storage file exists in the disk of the virtual machine.
The cloud management platform periodically queries qemu-guest-agent service information in qemu-KVM, after querying the qemu-guest-agent service information in the qemu-KVM, the cloud management platform checks whether the corresponding relation between the virtual machine disk and the storage file exists in the cache of the virtual machine, if the corresponding storage file exists in the virtual machine disk in the cache, the cloud management platform directly issues deletion operation to the storage, otherwise, the cloud management platform continuously checks whether the corresponding relation between the virtual machine disk and the storage file exists in the cache of the virtual machine in the database, and then issues deletion operation to the storage until the corresponding storage file exists in the virtual machine disk in the cache.
In the prior art, an operating system of a virtual machine is also virtualized through qemu-KVM, a trim/discard operation is automatically triggered after a file is deleted in a file system, a delete instruction is sent to the qemu-KVM, and a unmap is triggered by a bus virtio-blk or virtio-sci of a simulation virtual machine to delete a storage file. However, if the qemu-KVM bus uses virtio-sci, the performance of the virtual machine is degraded a lot in terms of storage; if the bus of the qemu-KVM uses virtio-blk, the qemu needs the latest version, the qemu of the latest version is unstable, and the requirement on kernel in the operating system of the virtual machine is high.
In this embodiment, the qemu-KVM is used for the cloud management platform to query whether a corresponding storage file exists in a disk of the virtual machine, and the cloud management platform issues a deletion operation to the storage of the virtual machine. The virtual machine bus of the embodiment can use virtio-blk, supports trim/discard operation for low-version qemu, and does not sacrifice the performance of the virtual machine.
In step S303, the storage of the virtual machine deletes the storage file.
After the deleting instruction is issued by the cloud management platform, the block device driving layer initiates a space releasing command to the storage of the virtual machine, and the storage of the virtual machine deletes the storage file, so that the storage space is automatically released, and the space recovery from the deleted block device on the cloud platform is completed.
Example 4
As shown in fig. 5 to 6, a method for reclaiming space from deleted blocks on a cloud platform in an embodiment of the present invention is described, which includes the following steps.
In step S401, the operating system of the virtual machine executes a qemu-guest-agent service according to a preset period.
The qemu-guest-agent service performs simple data interaction with an external management platform through a serial bus in the virtual machine, the data interaction uses QMP protocol, default provides some basic operations, and allows a developer to define an own extension interface. Guest OS of any virtual machine can be uniformly managed on the cloud platform through qemu-Guest-agent service managers. Through the interface provided by qemu, a developer can realize a plurality of functions related to the virtual machine on the cloud platform, and the management work of the cloud platform is simplified.
In step S402, the operating system of the virtual machine transmits information of the qemu-guest-agent service to the virtio-blk of the qemu-KVM.
For some scenarios with high security requirements (e.g., financial industry), the virtual machine is not allowed to directly communicate with the cloud management platform, and information of the qemu-guest-agent service needs to be provided to the cloud management platform through the qemu-KVM. The operating system of the virtual machine sends the information of the qemu-guest-agent service to the virtio-blk of the qemu-KVM, and the virtio-blk is an implementation mode of a virtual disk under a virtual KVM platform, so that the cloud management platform can obtain the information of the qemu-guest-agent service by inquiring the qemu-KVM.
The KVM is responsible for cpu virtualization and memory virtualization, and realizes the virtualization of cpu and memory, but the KVM cannot simulate other devices, and needs a tool running in a user space. Therefore, the open source virtualization software qemu is selected as a tool running in a user space, and the qemu simulates I/O equipment (network cards, magnetic disks and the like) and modifies the I/O equipment to finally form a qemu-KVM.
In step S403, the cloud management platform queries qemu-KVM according to a preset period.
The cloud management platform queries qemu-gust-agent service in the qemu-KVM according to a preset period and provides the qemu-gust-agent service message to the cloud management platform.
In step S404, when the cloud management platform queries the message of the qemu-guest-agent service, the cloud management platform checks whether the disk of the virtual machine has a corresponding storage file.
The cloud management platform periodically queries qemu-guest-agent service information in qemu-KVM, after querying the qemu-guest-agent service information in the qemu-KVM, the cloud management platform checks whether the corresponding relation between the virtual machine disk and the storage file exists in the cache of the virtual machine, if the corresponding storage file exists in the virtual machine disk in the cache, the cloud management platform directly issues deletion operation to the storage, otherwise, the cloud management platform continuously checks whether the corresponding relation between the virtual machine disk and the storage file exists in the cache of the virtual machine in the database, and then issues deletion operation to the storage until the corresponding storage file exists in the virtual machine disk in the cache.
In step S405, the storage of the virtual machine deletes the storage file.
After the deleting instruction is issued by the cloud management platform, the block device driving layer initiates a space releasing command to the storage of the virtual machine, and the storage of the virtual machine deletes the storage file, so that the storage space is automatically released, and the space recovery from the deleted block device on the cloud platform is completed.
Example 5
Introduction a method for reclaiming space from deleted blocks on a cloud platform in one embodiment of the invention includes the following steps.
In step S501, the cloud management platform receives a drop service message sent by an operating system of the virtual machine.
A drop service is installed in an operating system (Guest OS) of the virtual machine, and the drop service is periodically executed. And discarding service is triggered periodically, and each time ftrim is triggered, the cloud management platform receives a discarding service message sent by an operating system of the virtual machine and informs the storage file system of recovering the space.
In step S502, when the cloud management platform receives the message of discarding the service, the cloud management platform checks whether the disk of the virtual machine has a corresponding storage file.
After receiving a message sent by an operating system, the cloud management platform checks whether a corresponding relation between a virtual machine disk and a storage file exists in a cache of the virtual machine, if the virtual machine disk in the cache has the corresponding storage file, the cloud management platform directly issues a deletion operation to the storage, otherwise, the cloud management platform continuously checks whether the corresponding relation between the virtual machine disk and the storage file exists in the cache of the virtual machine in the database, and then issues the deletion operation to the storage until the virtual machine disk in the cache has the corresponding storage file.
In step S503, the cloud management platform notifies the storage of the virtual machine to delete the storage file.
After the deleting instruction is issued by the cloud management platform, the block device driving layer initiates a space releasing command to the storage of the virtual machine, and the storage of the virtual machine deletes the storage file, so that the storage space is automatically released, and the space recovery from the deleted block device on the cloud platform is completed.
As shown in fig. 7, an apparatus for reclaiming space from deleted blocks on a cloud platform according to an embodiment of the present invention is introduced.
In an embodiment of the present invention, an apparatus for reclaiming space from deleted blocks on a cloud platform includes an execution module 701, a check module 702, and a deletion module 703.
An executing module 701, configured to execute a discard service according to a preset period by an operating system of the virtual machine.
The checking module 702 is configured to, when the cloud management platform receives the message of discarding the service, check, by the cloud management platform, whether a corresponding storage file exists in the disk of the virtual machine.
And a deleting module 703, configured to delete the storage file for the virtual machine.
The execution module 701 is further configured to: configuring ftrim for a disk of a virtual machine according to the preset configuration; inquiring whether the disk of the virtual machine is configured with ftrim; if so, the operating system of the virtual machine sends the discarding service to the cloud sending management platform through the Ethernet.
The checking module 702 is further configured to: when the cloud management platform checks that the disk of the virtual machine does not have the corresponding storage file, the cloud management platform checks whether the disk of the virtual machine has the corresponding storage file in the database according to a preset period.
The delete module 703 is further configured to: judging whether the storage deletion of the virtual machine is successful or not; if not, the virtual machine informs the administrator that the space recovery fails.
Fig. 7 illustrates an apparatus for reclaiming space from deleted blocks on a cloud platform according to another embodiment of the present invention.
In an embodiment of the present invention, an apparatus for reclaiming space from deleted blocks on a cloud platform includes an execution module 701, a check module 702, and a deletion module 703.
The execution module 701 is configured to execute qemu-guest-agent service according to a preset period by an operating system of the virtual machine.
The checking module 702 is configured to, when the cloud management platform queries a message of the qemu-guest-agent service, check, by the cloud management platform, whether a corresponding storage file exists in a disk of the virtual machine.
And a deleting module 703, configured to delete the storage file for the virtual machine.
The execution module 701 is further configured to: the operating system of the virtual machine sends the information of the qemu-guest-agent service to the qemu-KVM; and the cloud management platform queries qemu-KVM according to a preset period.
The checking module 702 is further configured to: when the cloud management platform checks that the disk of the virtual machine does not have the corresponding storage file, the cloud management platform checks whether the disk of the virtual machine has the corresponding storage file in the database according to a preset period.
The delete module 703 is further configured to: judging whether the storage deletion of the virtual machine is successful or not; if not, the virtual machine informs the administrator that the space recovery fails.
Fig. 7 illustrates an apparatus for reclaiming space from deleted blocks on a cloud platform according to another embodiment of the present invention.
In an embodiment of the present invention, an apparatus for reclaiming space from deleted blocks on a cloud platform includes an execution module 701, a check module 702, and a deletion module 703.
An executing module 701, configured to receive, by the cloud management platform, a discard service message sent by an operating system of the virtual machine.
The checking module 702 is configured to, when the cloud management platform receives the message of discarding the service, check, by the cloud management platform, whether a corresponding storage file exists in the disk of the virtual machine.
The deleting module 703 is configured to notify, by the cloud management platform, the storage of the virtual machine to delete the storage file.
Fig. 8 illustrates a hardware structure diagram of a computing device 80 for reclaiming space from deleted blocks on a cloud platform according to an embodiment of the present description. As shown in fig. 8, computing device 80 may include at least one processor 801, storage 802 (e.g., non-volatile storage), memory 803, and a communication interface 804, and the at least one processor 801, storage 802, memory 803, and communication interface 804 are connected together via a bus 805. The at least one processor 801 executes at least one computer readable instruction stored or encoded in the memory 802.
It should be appreciated that the computer-executable instructions stored in the memory 802, when executed, cause the at least one processor 801 to perform the various operations and functions described above in connection with fig. 1-8 in the various embodiments of the present description.
In embodiments of the present description, computing device 80 may include, but is not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, cellular phones, Personal Digital Assistants (PDAs), handheld devices, messaging devices, wearable computing devices, consumer electronics, and so forth.
According to one embodiment, a program product, such as a machine-readable medium, is provided. A machine-readable medium may have instructions (i.e., elements described above as being implemented in software) that, when executed by a machine, cause the machine to perform various operations and functions described above in connection with fig. 1-8 in the various embodiments of the present specification. Specifically, a system or apparatus may be provided which is provided with a readable storage medium on which software program code implementing the functions of any of the above embodiments is stored, and causes a computer or processor of the system or apparatus to read out and execute instructions stored in the readable storage medium.
According to the method and the application for recovering the space from the deleted blocks on the cloud platform, the discarding service can be installed on the operating system of the virtual machine, the cloud management platform finds the storage files of the deleted block devices and deletes the storage files, the space release of the storage system is achieved, and the synchronous deletion of data in the storage space is guaranteed.
According to the method and the application for recovering the space from the deleted blocks on the cloud platform, the virtual machine of the kernel and the operating system of any version can be served; the bus of the virtual machine can use virtio-blk, no requirement is made on the version of qemu, the low-version qemu is supported for service, and the performance of the virtual machine in the aspect of storage is further ensured.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing descriptions of specific exemplary embodiments of the present invention have been presented for purposes of illustration and description. It is not intended to limit the invention to the precise form disclosed, and obviously many modifications and variations are possible in light of the above teaching. The exemplary embodiments were chosen and described in order to explain certain principles of the invention and its practical application to enable one skilled in the art to make and use various exemplary embodiments of the invention and various alternatives and modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the claims and their equivalents.

Claims (12)

1. A method of reclaiming space from deleted blocks on a cloud platform, the method comprising:
executing discarding service by an operating system of the virtual machine according to a preset period;
when the cloud management platform receives the message of the discarding service, the cloud management platform checks whether a corresponding storage file exists in a disk of the virtual machine; if so,
and the storage of the virtual machine deletes the storage file.
2. The method of claim 1, wherein the operating system of the virtual machine performs a drop service according to a preset period, comprising:
configuring ftrim for a disk of a virtual machine according to the preset configuration;
inquiring whether the disk of the virtual machine is configured with ftrim; if so,
and the operating system of the virtual machine sends the discarding service to the cloud sending management platform through the Ethernet.
3. The method of reclaiming space from deleted blocks on a cloud platform as claimed in claim 1 wherein the method further comprises:
when the cloud management platform checks that the disk of the virtual machine does not have the corresponding storage file, the cloud management platform checks whether the disk of the virtual machine has the corresponding storage file in the database according to a preset period.
4. The method of reclaiming space from deleted blocks on a cloud platform as claimed in claim 1 wherein the method further comprises:
judging whether the storage file is successfully deleted by the virtual machine; if not, the user can not select the specific application,
the virtual machine notifies an administrator of a failure to reclaim space.
5. A method of reclaiming space from deleted blocks on a cloud platform, the method comprising:
executing qemu-guest-agent service by an operating system of the virtual machine according to a preset period;
when the cloud management platform queries a qemu-guest-agent service message, the cloud management platform checks whether a corresponding storage file exists in a disk of the virtual machine; if so,
and the storage of the virtual machine deletes the storage file.
6. The method of reclaiming space from deleted blocks on a cloud platform as claimed in claim 5 wherein the method further comprises:
the operating system of the virtual machine sends the information of the qemu-guest-agent service to a virtio-blk of the qemu-KVM;
and the cloud management platform queries qemu-KVM according to a preset period.
7. A method of reclaiming space from deleted blocks on a cloud platform, the method comprising:
the method comprises the steps that a cloud management platform receives a discarding service message sent by an operating system of a virtual machine;
when the cloud management platform receives the message of the discarding service, the cloud management platform checks whether a corresponding storage file exists in a disk of the virtual machine; if so,
and the cloud management platform informs the storage of the virtual machine to delete the storage file.
8. An apparatus for reclaiming space from deleted blocks on a cloud platform, the apparatus comprising:
the execution module is used for executing discarding service according to a preset period by an operating system of the virtual machine;
the checking module is used for checking whether a corresponding storage file exists in a disk of the virtual machine or not by the cloud management platform when the cloud management platform receives the message of the discarding service;
and the deleting module is used for deleting the storage file by the storage of the virtual machine.
9. An apparatus for reclaiming space from deleted blocks on a cloud platform, the apparatus comprising:
the execution module is used for executing qemu-guest-agent service by an operating system of the virtual machine according to a preset period;
the cloud management platform is used for checking whether a corresponding storage file exists in a disk of the virtual machine or not when the cloud management platform inquires a message of the qemu-guest-agent service;
and the deleting module is used for deleting the storage file by the storage of the virtual machine.
10. An apparatus for reclaiming space from deleted blocks on a cloud platform, the apparatus comprising:
the execution module is used for receiving a discarding service message sent by an operating system of the virtual machine by the cloud management platform;
the checking module is used for checking whether a corresponding storage file exists in a disk of the virtual machine or not by the cloud management platform when the cloud management platform receives the message of the discarding service;
and the deleting module is used for informing the storage of the virtual machine to delete the storage file by the cloud management platform.
11. An electronic device, comprising:
at least one processor; and
a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the method of reclaiming space from deleted blocks on a cloud platform of any of claims 1 to 7.
12. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the method of reclaiming space from deleted blocks on a cloud platform according to any one of claims 1 to 7.
CN202111249829.1A 2021-10-26 2021-10-26 Method and application for recycling space from deleted blocks on cloud platform Pending CN113961147A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111249829.1A CN113961147A (en) 2021-10-26 2021-10-26 Method and application for recycling space from deleted blocks on cloud platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111249829.1A CN113961147A (en) 2021-10-26 2021-10-26 Method and application for recycling space from deleted blocks on cloud platform

Publications (1)

Publication Number Publication Date
CN113961147A true CN113961147A (en) 2022-01-21

Family

ID=79467353

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111249829.1A Pending CN113961147A (en) 2021-10-26 2021-10-26 Method and application for recycling space from deleted blocks on cloud platform

Country Status (1)

Country Link
CN (1) CN113961147A (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486255A (en) * 2014-12-30 2015-04-01 杭州华三通信技术有限公司 Service resource dispatching method and device
CN104539708A (en) * 2014-12-29 2015-04-22 杭州华为数字技术有限公司 Capacity reduction method, device and system for cloud platform resources
CN106462451A (en) * 2014-06-20 2017-02-22 华为技术有限公司 Interruption handling method and relevant device of virtual platform
CN107704312A (en) * 2017-10-18 2018-02-16 顺丰科技有限公司 A kind of qemu kvm virtual machines is performed any order method and storage medium
CN107800806A (en) * 2017-11-15 2018-03-13 中国联合网络通信集团有限公司 Storage resource recovery method, shared memory systems and cloud service system under cloud environment
CN108363552A (en) * 2018-01-31 2018-08-03 华为技术有限公司 Magnetic disk of virtual machine space reclamation method and system
CN108632360A (en) * 2018-04-12 2018-10-09 北京百悟科技有限公司 A kind of virtual cloud terminal and virtual cloud terminal server
CN109684035A (en) * 2018-12-17 2019-04-26 武汉烽火信息集成技术有限公司 A kind of adaptive virtual machine and host communication means and system
CN111209078A (en) * 2019-12-27 2020-05-29 广东睿江云计算股份有限公司 Method and system for automatically deploying and detecting Web application of virtual machine
CN111966452A (en) * 2020-07-25 2020-11-20 苏州浪潮智能科技有限公司 Method and device for realizing storage space recovery based on ICOS cloud platform
CN112199162A (en) * 2020-10-16 2021-01-08 济南浪潮数据技术有限公司 Disk snapshot method, device and medium based on virtualized disk double-active disaster tolerance
CN112732406A (en) * 2021-01-12 2021-04-30 华云数据控股集团有限公司 Cloud platform virtual machine recovery method and computer equipment

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106462451A (en) * 2014-06-20 2017-02-22 华为技术有限公司 Interruption handling method and relevant device of virtual platform
JP2017518589A (en) * 2014-06-20 2017-07-06 華為技術有限公司Huawei Technologies Co.,Ltd. Method and associated device for handling interrupts by a virtualization platform
CN104539708A (en) * 2014-12-29 2015-04-22 杭州华为数字技术有限公司 Capacity reduction method, device and system for cloud platform resources
CN104486255A (en) * 2014-12-30 2015-04-01 杭州华三通信技术有限公司 Service resource dispatching method and device
CN107704312A (en) * 2017-10-18 2018-02-16 顺丰科技有限公司 A kind of qemu kvm virtual machines is performed any order method and storage medium
CN107800806A (en) * 2017-11-15 2018-03-13 中国联合网络通信集团有限公司 Storage resource recovery method, shared memory systems and cloud service system under cloud environment
CN108363552A (en) * 2018-01-31 2018-08-03 华为技术有限公司 Magnetic disk of virtual machine space reclamation method and system
CN108632360A (en) * 2018-04-12 2018-10-09 北京百悟科技有限公司 A kind of virtual cloud terminal and virtual cloud terminal server
CN109684035A (en) * 2018-12-17 2019-04-26 武汉烽火信息集成技术有限公司 A kind of adaptive virtual machine and host communication means and system
CN111209078A (en) * 2019-12-27 2020-05-29 广东睿江云计算股份有限公司 Method and system for automatically deploying and detecting Web application of virtual machine
CN111966452A (en) * 2020-07-25 2020-11-20 苏州浪潮智能科技有限公司 Method and device for realizing storage space recovery based on ICOS cloud platform
CN112199162A (en) * 2020-10-16 2021-01-08 济南浪潮数据技术有限公司 Disk snapshot method, device and medium based on virtualized disk double-active disaster tolerance
CN112732406A (en) * 2021-01-12 2021-04-30 华云数据控股集团有限公司 Cloud platform virtual machine recovery method and computer equipment

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
HONGWEI TANG ET AL.: "IOMMU Para-Virtualization for Efficient and Secure DMA in Virtual Machines", 《KSII TRANSACTIONS ON INTERNET AND INFORMATION SYSTEMS》 *
凌笑: "虚拟机镜像文件的废弃空间回收系统", 《万方数据库》 *
宋振华: "虚拟化技术中的存储管理问题研究", 《万方数据库》 *
尹航 等: "基于大数据应用的虚拟化云平台建设方法研究", 《软件》 *

Similar Documents

Publication Publication Date Title
EP2840495B1 (en) Container-based processing method and apparatus
CN111338854B (en) Kubernetes cluster-based method and system for quickly recovering data
EP2731013B1 (en) Backing up method, device, and system for virtual machine
CN108469986B (en) Data migration method and device
US9600369B2 (en) Operating system recovery method and apparatus, and terminal device
US10445186B1 (en) Associating a guest application within a virtual machine to create dependencies in backup/restore policy
US8881144B1 (en) Systems and methods for reclaiming storage space from virtual machine disk images
EP2905700B1 (en) Operating system recovery method, apparatus and terminal device
CN108322326B (en) Interface state control method, message transmission method and device
CN104461685A (en) Virtual machine processing method and virtual computer system
CN106777394B (en) Cluster file system
WO2015051641A1 (en) Method and apparatus for reclaiming space of magnetic disk image
US10795579B2 (en) Methods, apparatuses, system and computer program products for reclaiming storage units
CN111679889B (en) Conversion migration method and system of virtual machine
US10191817B2 (en) Systems and methods for backing up large distributed scale-out data systems
CN112328365A (en) Virtual machine migration method, device, equipment and storage medium
CN112256400A (en) Virtual machine snapshot management method and device
US9177177B1 (en) Systems and methods for securing storage space
CN111475100A (en) Method, apparatus and computer program product for managing a storage system
US11176089B2 (en) Systems and methods for implementing dynamic file systems
CN113961147A (en) Method and application for recycling space from deleted blocks on cloud platform
KR101552580B1 (en) Method for system recovery including mobile device and backup supporting multi operation system
CN113986471A (en) Method, device, equipment and storage medium for safely deleting mirror image file of virtual machine
CN110704249A (en) Method, device and system for ensuring application consistency
CN109947704B (en) Lock type switching method and device and cluster file system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220121