Data cleaning method, device and equipment for bare metal and medium
Patent Information
- Application Number
- CN202410954682.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2044-07-16
AI Technical Summary
Existing technologies make it inconvenient to clean up local disks on bare metal servers, leading to the risk of data leakage after tenants change. Furthermore, existing methods are complex and not compatible with various hardware models, increasing maintenance costs.
The system controls the shutdown of the bare metal server via a smart network card, creates an index file and maps the cleanup image to create a second cloud disk, loads the virtual hard disk for data cleanup, and uses a disk cleaning program to clean up the local disk based on the index file.
It enables efficient and adaptable cleanup of the bare metal server's local disk after a tenant cancels their subscription, reducing the risk of data leakage and maintenance costs.
Smart Images

Figure CN118916337B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing, and more particularly to a method, apparatus, device, and medium for cleaning data on bare metal. Background Technology
[0002] Bare metal is a type of physical server, also known as a bare metal server. Bare metal servers are configured with devices similar to those in other servers, including hardware such as network cards, hard drives, and CPUs. Cloud computing is a method of providing computing resources (such as servers) over the Internet. In cloud computing, bare metal servers are allocated resources that can be reused.
[0003] When a tenant's lease on a bare metal server expires, if the tenant does not renew, the right to use the relevant resources on the bare metal server can be allocated to other tenants who need them. However, the data left on the disk by the previous tenant is junk data for the next tenant, and there is a risk of data leakage for the previous tenant. Existing technologies have corresponding cleanup methods for data on cloud disks, but there are no applicable cleanup methods for local disks.
[0004] Therefore, this application proposes a data cleaning method for bare metal to solve the above problems. Summary of the Invention
[0005] This application provides a data cleaning method, apparatus, device, and medium for bare metal, to solve the problem of inconvenience in cleaning local disks in the prior art.
[0006] Firstly, this application provides a data cleaning method for bare metal, comprising:
[0007] If the smart network card receives a user's unsubscribe request, it controls the bare metal server to enter a shutdown state and cleans up the first cloud disk of the user instance.
[0008] An index file is created to record the deletion patterns of the data corresponding to the user instance, and a second cloud disk is created based on the cleanup image, wherein the second cloud disk can be used to obtain the index file;
[0009] The second cloud disk is mapped to the virtual hard disk of the bare metal server. The index file is obtained by starting the virtual hard disk, and the data corresponding to the user instance in the local disk of the bare metal server is cleaned up according to the index file.
[0010] In one possible implementation, creating a second cloud disk based on the cleanup image includes:
[0011] The smart network card acquires the cleanup image recorded in the cloud management component server, so that the cloud management component server creates the second cloud disk based on the cleanup image, wherein the cleanup image is a disk cleanup operating system template.
[0012] In one possible implementation, mapping the second cloud disk to the virtual hard disk of the bare metal server includes:
[0013] The smart network card updates the identifier corresponding to the cleanup image through the cloud management component server to obtain the network connection information of the second cloud disk, so that the second cloud disk is bound to the smart network card;
[0014] The smart network card maps the second cloud disk to the virtual hard disk of the bare metal server through the smart network card interface.
[0015] In one possible implementation, after mapping the second cloud disk to the virtual hard disk of the bare metal server, the method further includes:
[0016] The smart network interface card sends a power-on request to the bare metal server, wherein the bare metal server starts the virtual hard disk according to the power-on request;
[0017] The step of obtaining the index file by starting the virtual hard disk includes:
[0018] By starting the virtual hard disk and loading the disk cleanup operating system in the second cloud disk, the bare metal server is controlled by the disk cleanup program in the disk cleanup operating system to obtain the index file from the smart network card.
[0019] In one possible implementation, cleaning up the data corresponding to the user instance on the local disk of the bare metal server according to the index file includes:
[0020] The disk cleanup operating system in the second cloud disk is used to identify the media type of the disk in the bare metal server and obtain the local disk.
[0021] The data corresponding to the user instance in the local disk is cleaned up by the deletion pattern in the index file, wherein the deletion pattern includes the type and path of the data to be deleted.
[0022] In one possible implementation, after cleaning the data corresponding to the user instance on the local disk of the bare metal server according to the index file, the method further includes:
[0023] The smart network interface card obtains the data cleanup progress of the user instance in the local disk of the bare metal server;
[0024] If the cleanup progress is 100%, it is confirmed that the cleanup of the data corresponding to the user instance in the local disk of the bare metal server has been completed, and a shutdown request is sent to the bare metal server to control the bare metal server to enter the shutdown state.
[0025] In one possible implementation, if the cleanup progress is 100%, the method further includes:
[0026] The smart network card cancels the mapping between the second cloud disk and the virtual hard disk of the bare metal server through the smart network card interface;
[0027] The smart network card deletes the second cloud disk through the cloud management component server, thus completing the user's unsubscription.
[0028] Secondly, this application provides a data cleaning device for bare metal, comprising:
[0029] The acquisition module is used to control the bare metal server to enter a shutdown state and clean up the first cloud disk of the user instance if the smart network card receives a user's unsubscribe request.
[0030] A creation module is used to create an index file for recording the deletion patterns of the data corresponding to the user instance, and to create a second cloud disk based on the cleanup image, wherein the second cloud disk can be used to obtain the index file;
[0031] The cleanup module is used to map the second cloud disk to the virtual hard disk of the bare metal server, obtain the index file by starting the virtual hard disk, and clean up the data corresponding to the user instance in the local disk of the bare metal server according to the index file.
[0032] Secondly, this application provides a data cleaning device for bare metal, comprising: at least one processor and a memory;
[0033] The memory stores computer-executed instructions;
[0034] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the bare metal data cleanup method as described above.
[0035] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the bare metal data cleaning method described above.
[0036] This application provides a data cleanup method, apparatus, device, and medium for bare metal servers. If a smart network interface card (NIC) receives a user's unsubscribe request, it controls the bare metal server to enter a shutdown state and cleans the first cloud disk of the user instance. An index file is created to record the deletion patterns of the data corresponding to the user instance, and a second cloud disk is created based on the cleanup image. The second cloud disk can be used to obtain the index file. The second cloud disk is mapped to the virtual hard disk of the bare metal server. The index file is obtained by starting the virtual hard disk, and the data corresponding to the user instance in the local disk of the bare metal server is cleaned based on the index file.
[0037] In the above method, after a user who has subscribed to a bare metal server decides not to renew their subscription, they can send a cancellation request to the smart network interface card (NIC). Upon receiving the cancellation request, the smart NIC can begin clearing the resources and data occupied by the user on the cloud disk and local disk corresponding to the bare metal server. Users who have subscribed to a bare metal server can access and manage hardware resources through their user instances, and the data corresponding to their user instances can be stored on the cloud disk and local disk. During the clearing process, the smart NIC controls the bare metal server to shut down and can clear the first cloud disk corresponding to the user instance in a conventional manner. To clear the local disk, an index file is created, recording the deletion pattern of the data corresponding to the user instance. A second cloud disk is created based on the clearing image to obtain the index file, and this second cloud disk is mapped to the virtual hard disk of the bare metal server. This allows the bare metal server to obtain the index file and clear the data corresponding to the user instance on the local disk of the bare metal server according to the corresponding deletion pattern. This application can better clear the user's resource occupation on the bare metal server after the user cancels their subscription. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0039] Figure 1 This is a schematic diagram illustrating a data cleaning scenario for bare metal provided in an embodiment of this application.
[0040] Figure 2 A flowchart illustrating a data cleaning method for bare metal provided in this application embodiment. Figure 1 ;
[0041] Figure 3 A flowchart illustrating a data cleaning method for bare metal provided in this application embodiment. Figure 2 ;
[0042] Figure 4 A flowchart illustrating a data cleaning method for bare metal provided in this application embodiment. Figure 3 ;
[0043] Figure 5 A flowchart illustrating a data cleaning method for bare metal provided in this application embodiment. Figure 4 ;
[0044] Figure 6 A diagram of a data cleaning device for bare metal provided in an embodiment of the present invention;
[0045] Figure 7 This is a hardware schematic diagram of a bare metal data cleaning device provided in an embodiment of the present invention.
[0046] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0048] Bare metal is a type of physical server, also known as a bare metal server. Bare metal servers are configured with devices similar to other servers, including network interface cards (NICs), hard drives, CPUs, and other hardware. In cloud computing scenarios, bare metal serves as a resource that can be allocated to users and is reusable. After the first tenant's usage expires and they do not renew their subscription, the user's right to use the resource can be revoked and allocated to other tenants. However, during the first tenant's usage, all data is left on the bare metal's disks. If this data is not cleaned up, it becomes useless junk data for the second user, and poses a data leakage security risk for the first user. Therefore, data cleanup of bare metal is an essential step.
[0049] Since this is a disk cleanup operation, the program that performs the cleanup cannot be booted from the local hard drive. Existing bare-metal mounted cloud disk solutions almost always use PXE to boot the server for disk cleanup; this approach has the following problems:
[0050] Bare metal network interface cards (NICs) must support PXE functionality. However, there are many types of bare metal servers with varying hardware models, and some NICs do not support PXE functionality. The bare metal management node must be on the same Layer 2 network (LAN) as the bare metal server. The ports on the bare metal server switch must be configured on the same network as the bare metal management node to ensure network connectivity. The cloud platform must control the switch, but there are many different models of switches with different commands. When encountering a new model, compatibility adaptation is required, which makes the architecture extremely complex and consumes a lot of maintenance and testing time and costs.
[0051] Furthermore, the existing processing methods do not perform proper cleanup of the local disks of bare metal servers.
[0052] The data cleaning method for bare metal provided in this application aims to solve the above-mentioned technical problems of the prior art.
[0053] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0054] Figure 1 This is a schematic diagram illustrating a data cleaning scenario for bare metal provided in an embodiment of this application. For example... Figure 1 As shown, the system includes: bare metal (bare metal server), smart network interface card (NIC), cloud management component server, and back-end storage server; the bare metal includes CPU, local disk, service network port, interconnection network port, etc.; the smart NIC includes 10 Gigabit network port, management network port, interconnection network port, etc.; the cloud management component server includes management network port, etc.; the back-end server includes storage network, storage pool, and image pool, etc.
[0055] The smart network interface card (NIC) can be directly plugged into the bare metal; under normal circumstances, the bare metal boots from the local disk; the power on / off of the smart NIC and the bare metal does not affect each other; the link aggregation bond0 formed by the 10 Gigabit Ethernet ports of the smart NIC can be mapped to the bare metal server, where it appears as a real NIC device, and all normal business traffic of the bare metal flows out through this port; the management port of the smart NIC is used to manage the inbound and outbound traffic, such as the interaction access between services mentioned later; the interconnection port of the smart NIC and the interconnection port of the bare metal are a pair of devices used to support network communication between the smart NIC and the bare metal;
[0056] The smart network interface card also has various services deployed for data cleanup of bare metal, such as nova-compute service, snap service, and spdk service;
[0057] There can be one or more cloud management component servers, which can be freely allocated according to different business models; they are mainly used to run other cloud management components, such as the Glance service and the Cinder service.
[0058] The backend storage server is used to maintain network storage. Image files, cloud disk files, etc. can be created on the backend storage server, and network connection information can be generated for these files for bare metal or virtual machines to connect to. The server has a management network port for communication with the cloud management server network. The server also has a storage network port, through which bare metal or virtual machines connect to the cloud disk.
[0059] With the aforementioned hardware and software conditions set up in this embodiment, the data generated by unsubscribing users on the cloud drive and local disk can be cleaned up. The cleanup process is as follows:
[0060] If the smart network card receives a user's unsubscribe request, it controls the bare metal server to enter a shutdown state through the interconnection network port and cleans up the user instance's first cloud disk in the usual way.
[0061] The smart network card creates an index file to record the deletion patterns of data corresponding to user instances, and creates a second cloud disk based on the cleanup image. The second cloud disk can be used to retrieve the index file.
[0062] The smart network card maps the second cloud disk to the virtual hard disk of the bare metal server through the 10 Gigabit Ethernet port and the service Ethernet port. That is, it loads the disk cleanup operating system, obtains the index file by starting the virtual hard disk, and cleans up the data corresponding to the user instance in the local disk of the bare metal server according to the index file.
[0063] Figure 2 A flowchart illustrating a data cleaning method for bare metal provided in this application embodiment. Figure 1 .like Figure 2 As shown, the method includes:
[0064] S201. If the smart network card receives a user's unsubscribe request, it controls the bare metal server to enter a shutdown state and cleans up the first cloud disk of the user instance.
[0065] A SmartNIC is a type of network interface card. A SmartNIC also has its own CPU, memory, and other units, which can offload network tasks traditionally handled by the server's CPU. It can also provide storage device emulation for the server. SmartNICs also support establishing channels with the server for network interaction. This application utilizes the storage device emulation feature to attach network storage outside the bare metal server to the bare metal server. The bare metal server uses this network storage to boot and perform local data cleanup.
[0066] During the period when a user rents a bare metal server, a user instance is created. The user instance includes the username, password, and management data. The data corresponding to the user instance is stored on the local disk and the first cloud disk of the bare metal server. When the user decides not to renew, a cancellation request for the user instance is sent to the smart network interface card (NIC). After receiving the cancellation request, the smart NIC first controls the bare metal server to shut down. The bare metal server enters a shutdown state and clears the first cloud disk, network, and information bound to the user instance recorded in the database to complete the data of the user instance related to the first cloud disk.
[0067] S202. Create an index file for recording the deletion patterns of the data corresponding to the user instance, and create a second cloud disk based on the cleanup image, wherein the second cloud disk can be used to obtain the index file.
[0068] To clean up the local disk of the bare metal server, a reasonable index file is selected for deleting the data corresponding to the user instance on the local disk. This index file stores the deletion mode of the data corresponding to the user instance, as well as the path where the cleanup results should be saved. In this way, the data cleanup can be completed step by step according to the instructions of the index file.
[0069] In order to delete local disk data, a second cloud disk is created based on the cleanup image. The second cloud disk is associated with the index file. Starting the second cloud disk will load the index file and realize the corresponding data cleanup. The cleanup image is a cleanup template selected from the image pool. The image pool stores many different types of system templates. You can select one to create a cloud disk according to your needs. In this way, starting the cloud disk can use the system, such as using the cleanup template.
[0070] The specific process for creating a second cloud drive is as follows:
[0071] For example, the smart network card obtains the cleanup image recorded in the cloud management component server, so that the cloud management component server creates the second cloud disk according to the cleanup image, wherein the cleanup image is a disk cleanup operating system template.
[0072] Preferably, the nova-compute service of the smart network card obtains the cleanup image recorded in the glance service of the cloud management component server, so that the cinder service of the cloud management component server creates the second cloud disk according to the cleanup image, wherein the cleanup image is a disk cleanup operating system template, and the second cloud disk creates a disk cleanup operating system according to the template.
[0073] In the OpenStack architecture, the nova-compute service can be used to manage the lifecycle of images, including operations such as uploading, querying, updating, and deleting a specific image; the glance service can be used to manage the lifecycle of images, including operations such as uploading, querying, updating, and deleting a specific image; the cinder service can be used to manage the lifecycle of cloud disks, including operations such as uploading, querying, updating, and deleting cloud disks; if a cloud disk is created based on an image, it will be copied from the image stored in the backend to create a new cloud disk, and a cleanup cloud disk, i.e., a second cloud disk, will be copied based on the cleanup image.
[0074] The glance service records the corresponding cleanup images. You can find a suitable cleanup image through the glance service, and then use the cinder service to create a second cloud disk using that cleanup image.
[0075] S203. Map the second cloud disk to the virtual hard disk of the bare metal server, obtain the index file by starting the virtual hard disk, and clean up the data corresponding to the user instance in the local disk of the bare metal server according to the index file.
[0076] When the bare metal server boots up, it loads a second cloud disk and uses a disk cleanup operating system. To enable the bare metal server to load the second cloud disk, it needs to be mapped to the bare metal server's virtual hard disk. Starting the virtual hard disk starts the disk cleanup operating system in the second cloud disk. The disk cleanup operating system obtains an index file and cleans up the data corresponding to the user instance on the bare metal server's local disk according to the deletion pattern instructions in the index file. The deletion pattern records information such as the target file to be deleted, the deletion order, and the path.
[0077] For example, obtaining the index file by launching the virtual hard disk includes:
[0078] By starting the virtual hard disk and loading the disk cleanup operating system in the second cloud disk, the bare metal server is controlled by the disk cleanup program in the disk cleanup operating system to obtain the index file from the smart network card.
[0079] The disk cleanup operating system includes a disk erasing program, which contains a method for retrieving the index file. After the disk cleanup operating system in the second cloud disk is loaded onto the virtual hard disk, the index file can be obtained, so that subsequent cleanup can be performed according to the instructions in the index file.
[0080] The power-on control process of a bare metal server:
[0081] For example, after mapping the second cloud disk to the virtual hard disk of the bare metal server, the method further includes:
[0082] The smart network card sends a power-on request to the bare metal server, wherein the bare metal server starts the virtual hard disk according to the power-on request.
[0083] After the smart network card's nova-compute service confirms that the second cloud disk has been created and mapped, it sends a boot request to the bare metal server. When the bare metal server boots up according to the boot request, it boots up from the second cloud disk mapped from the virtual hard disk.
[0084] In this embodiment, after a user who has subscribed to a bare metal server decides not to renew their subscription, they can send a cancellation request to the smart network interface card (NIC). Upon receiving the cancellation request, the smart NIC can begin clearing the resources and data occupied by the user on the cloud disk and local disk corresponding to the bare metal server. Users who have subscribed to a bare metal server can access and manage hardware resources through their user instances, and the data corresponding to their user instances can be stored on the cloud disk and local disk. During the clearing process, the smart NIC controls the bare metal server to shut down and can clear the first cloud disk corresponding to the user instance in a conventional manner. To clear the local disk, an index file is created, recording the deletion pattern of the data corresponding to the user instance. A second cloud disk is created based on the clearing image to obtain the index file, and this second cloud disk is mapped to the bare metal server's virtual hard disk. This allows the bare metal server to obtain the index file and clear the data corresponding to the user instance on the bare metal server's local disk according to the corresponding deletion pattern. This application can better clear the user's resource occupation on the bare metal server after the user cancels their subscription.
[0085] Figure 3 A flowchart illustrating a data cleaning method for bare metal provided in this application embodiment. Figure 2 .like Figure 3 As shown, the method includes:
[0086] S301. The smart network card updates the identifier corresponding to the cleanup image through the cloud management component server to obtain the network connection information of the second cloud disk, so that the second cloud disk is bound to the smart network card.
[0087] Preferably, the nova-compute service of the smart network card updates the identifier corresponding to the cleanup image through the cinder service of the cloud management component server to obtain the network connection information of the second cloud disk, so that the second cloud disk is bound to the smart network card.
[0088] The smart network card's nova-compute service can call the cinder service through the management network port to update the attachments corresponding to the cleanup image. Once the attachments are obtained, the network connection information of the second cloud disk can be acquired, allowing the smart network card to communicate with the second cloud disk and bind the second cloud disk to the smart network card.
[0089] S302. The smart network card maps the second cloud disk to the virtual hard disk of the bare metal server through the smart network card interface.
[0090] Preferably, the nova-compute service of the smart network card calls the snap service and the spdk service to map the second cloud disk to the virtual hard disk of the bare metal server.
[0091] After the second cloud disk is bound to the smart network interface card (NIC), the smart NIC can manage the second cloud disk and map it to the virtual hard disk of the bare metal server through the smart NIC interface (snap service and SPDK service) for use as an additional disk.
[0092] In this embodiment of the application, the process of binding the smart network card to the second cloud disk and mapping the second cloud disk to the bare metal server allows the bare metal server to delete local disk data through the second cloud disk.
[0093] Figure 4 A flowchart illustrating a data cleaning method for bare metal provided in this application embodiment. Figure 3 .like Figure 4 As shown, the method includes:
[0094] S401. Using the disk cleaning operating system in the second cloud disk, identify the media type of the disk in the bare metal server and obtain the local disk.
[0095] After the bare metal server is powered on, it will automatically load the disk cleanup operating system from the attached disk. After the system starts, the disk cleanup program will be loaded. The disk cleanup program can pull index files from the smart network card, or it can identify cloud disks and local disks according to the media type of the disks in the bare metal server to confirm the local disks from which data needs to be cleaned.
[0096] S402. Clean up the data corresponding to the user instance in the local disk using the deletion mode in the index file, wherein the deletion mode includes the type and path of the data to be deleted.
[0097] The deletion patterns in the index file include deletion instructions suitable for cleaning up data corresponding to user instances on the local disk, including the data type and path to be deleted. These deletion patterns can be defined as needed.
[0098] In this embodiment, a disk cleanup operating system is loaded via an additional disk, allowing the bare metal server to locate the local disk to be cleaned, facilitating the cleanup process based on the index file.
[0099] Figure 5 A flowchart illustrating a data cleaning method for bare metal provided in this application embodiment. Figure 4 .like Figure 5 As shown, the method includes:
[0100] S501. The smart network card obtains the data cleanup progress of the user instance in the local disk of the bare metal server.
[0101] During the local disk cleanup process on the bare metal server, the cleanup progress is synchronized to the nova-compute service of the smart network interface card (NIC). This means that the smart NIC can obtain the cleanup progress of the data corresponding to the user instance and store the cleanup progress in the corresponding database for subsequent management.
[0102] S501. If the cleanup progress is 100%, then confirm that the cleanup of the data corresponding to the user instance in the local disk of the bare metal server is complete, and send a shutdown request to the bare metal server to control the bare metal server to enter the shutdown state.
[0103] If the cleanup progress is 100%, the corresponding cleanup is confirmed to be completed, and the bare metal server can be shut down. That is, a shutdown request is sent to the bare metal server to control the bare metal server to enter the shutdown state.
[0104] After the second cloud disk used to clean up the local disk of the bare metal server completes its task, it can be deleted to avoid consuming resources.
[0105] For example, the smart network card cancels the mapping between the second cloud disk and the virtual hard disk of the bare metal server through the smart network card interface;
[0106] The smart network card deletes the second cloud disk through the cloud management component server, thus completing the user's unsubscription.
[0107] Preferably, the nova-compute service of the smart network card cancels the mapping between the second cloud disk and the virtual hard disk of the bare metal server through the snap service and the spdk service;
[0108] The smart network card's nova-compute service deletes the second cloud disk through the cloud management component server's cinder service, thus completing the user's unsubscription.
[0109] By creating a second cloud drive and then deleting it in reverse order—by canceling the mapping and deleting the second cloud drive—the user can completely unsubscribe.
[0110] In this embodiment, during the cleanup process of the bare metal server, the smart network card is simultaneously cleaned up, which facilitates timely subsequent management, completes the cleanup of the local disk and the deletion of the second cloud disk, effectively clears resource occupation, and the method of this application has good adaptability.
[0111] Figure 6 A diagram of a data cleaning device for bare metal provided in an embodiment of the present invention is shown. Figure 6 As shown, the device includes: an acquisition module 601, a creation module 602, and a cleanup module 603;
[0112] The acquisition module 601 is used to control the bare metal server to enter the shutdown state and clean up the first cloud disk of the user instance if the smart network card receives a user's unsubscribe request.
[0113] The creation module 602 is used to create an index file for recording the deletion patterns of the data corresponding to the user instance, and to create a second cloud disk based on the cleanup image, wherein the second cloud disk can be used to obtain the index file.
[0114] The creation module 602 is also used for the smart network card to obtain the cleanup image recorded in the cloud management component server, so that the cloud management component server can create the second cloud disk according to the cleanup image, wherein the cleanup image is a disk cleanup operating system template.
[0115] The cleanup module 603 is used to map the second cloud disk to the virtual hard disk of the bare metal server, obtain the index file by starting the virtual hard disk, and clean up the data corresponding to the user instance in the local disk of the bare metal server according to the index file.
[0116] The cleaning module 603 is also used for the smart network card to update the identifier corresponding to the cleaning image through the cloud management component server, and obtain the network connection information of the second cloud disk, so that the second cloud disk is bound to the smart network card;
[0117] The smart network card maps the second cloud disk to the virtual hard disk of the bare metal server through the smart network card interface.
[0118] The cleaning module 603 is also used to load the disk cleaning operating system in the second cloud disk by starting the virtual hard disk, and to control the bare metal server to obtain the index file from the smart network card through the disk cleaning program in the disk cleaning operating system.
[0119] The cleaning module 603 is also used to identify the media type of the disk in the bare metal server and obtain the local disk by using the disk cleaning operating system in the second cloud disk to clean up the disk.
[0120] The data corresponding to the user instance in the local disk is cleaned up by the deletion pattern in the index file, wherein the deletion pattern includes the type and path of the data to be deleted.
[0121] This application also provides a data cleaning device for bare metal, comprising: at least one processor and a memory;
[0122] The memory stores computer-executed instructions;
[0123] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform a data cleanup method for bare metal.
[0124] Figure 7 This is a hardware schematic diagram of a bare metal data cleaning device provided in an embodiment of the present invention. Figure 7 As shown, the bare metal data cleaning device 70 provided in this embodiment includes at least one processor 701 and a memory 702. The device 70 also includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.
[0125] In the specific implementation process, at least one processor 701 executes the computer execution instructions stored in the memory 702, causing at least one processor 701 to execute the above-mentioned bare metal data cleaning method.
[0126] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0127] In the above Figure 7 In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0128] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0129] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0130] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method described above.
[0131] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0132] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0133] The division of units described herein is merely a logical functional division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0134] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0135] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0136] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A method for cleaning data on bare metal, characterized in that, include: If the smart network card receives a user's unsubscribe request, it controls the bare metal server to enter a shutdown state and cleans up the first cloud disk of the user instance. An index file is created to record the deletion patterns of the data corresponding to the user instance, and a second cloud disk is created based on the cleanup image, wherein the second cloud disk can be used to obtain the index file; The second cloud disk is mapped to the virtual hard disk of the bare metal server. The index file is obtained by starting the virtual hard disk, and the data corresponding to the user instance in the local disk of the bare metal server is cleaned up according to the index file.
2. The method according to claim 1, characterized in that, The process of creating a second cloud disk based on the cleaned-up image includes: The smart network card acquires the cleanup image recorded in the cloud management component server, so that the cloud management component server creates the second cloud disk based on the cleanup image, wherein the cleanup image is a disk cleanup operating system template.
3. The method according to claim 1, characterized in that, The step of mapping the second cloud disk to the virtual hard disk of the bare metal server includes: The smart network card updates the identifier corresponding to the cleanup image through the cloud management component server to obtain the network connection information of the second cloud disk, so that the second cloud disk is bound to the smart network card; The smart network card maps the second cloud disk to the virtual hard disk of the bare metal server through the smart network card interface.
4. The method according to claim 1, characterized in that, After mapping the second cloud disk to the virtual hard disk of the bare metal server, the method further includes: The smart network interface card sends a power-on request to the bare metal server, wherein the bare metal server starts the virtual hard disk according to the power-on request; The step of obtaining the index file by starting the virtual hard disk includes: By starting the virtual hard disk and loading the disk cleanup operating system in the second cloud disk, the bare metal server is controlled by the disk cleanup program in the disk cleanup operating system to obtain the index file from the smart network card.
5. The method according to claim 1, characterized in that, The step of cleaning up the data corresponding to the user instance in the local disk of the bare metal server according to the index file includes: The disk cleanup operating system in the second cloud disk is used to identify the media type of the disk in the bare metal server and obtain the local disk. The data corresponding to the user instance in the local disk is cleaned up by the deletion pattern in the index file, wherein the deletion pattern includes the type and path of the data to be deleted.
6. The method according to claim 1, characterized in that, After cleaning up the data corresponding to the user instance on the local disk of the bare metal server according to the index file, the method further includes: The smart network interface card obtains the data cleanup progress of the user instance in the local disk of the bare metal server; If the cleanup progress is 100%, it is confirmed that the cleanup of the data corresponding to the user instance in the local disk of the bare metal server has been completed, and a shutdown request is sent to the bare metal server to control the bare metal server to enter the shutdown state.
7. The method according to claim 6, characterized in that, If the cleanup progress is 100%, the method further includes: The smart network card cancels the mapping between the second cloud disk and the virtual hard disk of the bare metal server through the smart network card interface; The smart network card deletes the second cloud disk through the cloud management component server, thus completing the user's unsubscription.
8. A data cleaning device for bare metal, characterized in that, include: The acquisition module is used to control the bare metal server to enter a shutdown state and clean up the first cloud disk of the user instance if the smart network card receives a user's unsubscribe request. A creation module is used to create an index file for recording the deletion patterns of the data corresponding to the user instance, and to create a second cloud disk based on the cleanup image, wherein the second cloud disk can be used to obtain the index file; The cleanup module is used to map the second cloud disk to the virtual hard disk of the bare metal server, obtain the index file by starting the virtual hard disk, and clean up the data corresponding to the user instance in the local disk of the bare metal server according to the index file.
9. A data cleaning device for bare metal, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the bare metal data cleaning method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the bare metal data cleaning method as described in any one of claims 1-7.
Citation Information
Patent Citations
Bare metal server control method and device, and medium
CN114995954A
Data cleaning method and device, equipment and storage medium
CN116774918A
