Method and related components for data preservation
By mounting cloud disks on cloud servers and combining them with host caching, the problem of uneven storage performance of cloud servers is solved, and high-efficiency data read and write speeds are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINAN INSPUR DATA TECH CO LTD
- Filing Date
- 2023-01-06
- Publication Date
- 2026-07-24
AI Technical Summary
In existing technologies, the performance of third-party storage used by cloud servers varies, making it difficult to meet high IO requirements. High-performance storage is expensive, and the high-performance disks already on the server are not fully utilized, resulting in resource waste.
By obtaining the host port information, the cloud disk is mounted to the host, and the host cache is added to the cloud disk. By combining the cloud disk and the host high-speed cache, read and write performance is improved.
During storage, cloud servers can simultaneously utilize remote cloud disks with larger memory and the host's high-speed cache, improving data read and write speeds and resolving performance differences and resource waste issues.
Smart Images

Figure CN115963996B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of storage, and in particular to a method for data storage and related components. Background Technology
[0002] Currently, most cloud servers mounted on host machines use third-party storage as the backend for cloud disks. While cloud servers can host virtual machines, the performance of third-party storage varies greatly, with some failing to meet the high I / O requirements of cloud servers. Meeting the demand for high-performance disks often involves using high-performance storage, such as all-flash storage, but this comes at a very high cost. Furthermore, the existing high-performance disks on the host machine are not utilized, resulting in resource waste. Summary of the Invention
[0003] The purpose of this invention is to provide a data storage method and related components. During the storage process, the cloud host can simultaneously use the remote cloud hard drive with large memory and the host's high-speed cache, thereby improving the speed of data reading and writing on the cloud host.
[0004] To address the aforementioned technical problems, this invention provides a data storage method applied to a host computer running a cloud server. The method includes:
[0005] Obtain the port information of the host;
[0006] Mount the cloud disk to the host according to the port information of the host;
[0007] Add the host's cache to the cloud disk;
[0008] Map the mount path of the cloud disk with the added cache to the cloud host.
[0009] Preferably, before mounting the cloud disk to the host according to the host's port information, the method further includes:
[0010] Create a volume;
[0011] Create a cloud disk based on the volume type and the correspondence between the volume type and the cloud disk;
[0012] Mounting the cloud disk to the host based on the host's port information includes:
[0013] Create a mapping relationship between the volume and the host based on the host's port information;
[0014] The cloud disk is mounted to the host according to the mapping relationship.
[0015] Preferably, after creating the cloud disk according to the volume type and the correspondence between the volume type and the cloud disk, the method further includes:
[0016] Add a cache acceleration tag to cloud disks;
[0017] After creating the mapping relationship between the volume and the host based on the host's port information, the process also includes:
[0018] Add a caching acceleration tag to the mapping relationship;
[0019] Adding cache to the host for the cloud disk includes:
[0020] The cache of the host is added to the cloud disk according to the cache acceleration tag.
[0021] Preferred options also include:
[0022] When the cloud host receives a write request, it saves the data to the host's cache.
[0023] When the amount of data in the cache reaches a preset amount, the preset amount of data is written to the cloud disk;
[0024] When the cloud host receives a read request, it first looks up the data corresponding to the read request from the cache;
[0025] If the data corresponding to the read request is not found in the cache, the data corresponding to the read request is searched from the cloud disk.
[0026] Preferred options also include:
[0027] When the cloud host receives a write request, it simultaneously saves the data to the host's cache and the cloud disk.
[0028] When the cloud host receives a read request, it first looks up the data corresponding to the read request from the cache;
[0029] If the data corresponding to the read request is not found in the cache, the data corresponding to the read request is searched from the cloud disk.
[0030] Preferred options also include:
[0031] When the cloud host receives a write request, it saves the data to the cloud disk;
[0032] When the cloud host receives a read request, it searches for the data corresponding to the read request in the cloud disk.
[0033] To address the aforementioned technical problems, the present invention also provides a data storage system, comprising:
[0034] The acquisition unit is used to acquire the port information of the host;
[0035] The mounting unit is used to mount the cloud disk to the host according to the port information of the host;
[0036] An additional unit is provided to add the host's cache to the cloud disk;
[0037] The mapping unit is used to map the mount path of the cloud disk with the added cache to the cloud host.
[0038] To address the aforementioned technical problems, the present invention also provides a host computer, comprising:
[0039] Memory, used to store computer programs;
[0040] A processor, used to implement the above-described data saving method when executing the computer program.
[0041] To address the aforementioned technical problems, the present invention also provides a data storage device, including the aforementioned host and a server providing a cloud hard drive.
[0042] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the aforementioned data saving method.
[0043] This application provides a data storage method and related components applied in the storage field. The method involves obtaining the host's port information; mounting a cloud disk to the host based on the host's port information; adding a host cache to the cloud disk; and mapping the cloud disk's mount path to the cloud host. The cloud host runs on the host machine. When the cloud host stores data via the cloud disk, the cloud disk is pre-mounted on the host. The host combines the cloud disk with its own cache and maps the combined cloud disk's mount path to the cloud host. During storage, the cloud host can simultaneously utilize a remote cloud disk with ample memory and the host's high-speed cache, improving the cloud host's data read / write speed. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 A flowchart of a data storage method provided by the present invention;
[0046] Figure 2 A schematic diagram of the structure of a data storage system provided by the present invention;
[0047] Figure 3 This is a schematic diagram of the structure of a host computer provided by the present invention. Detailed Implementation
[0048] The core of this invention is to provide a data storage method and related components. During the storage process, the cloud host can simultaneously use the remote cloud hard drive with large memory and the host's high-speed cache, thereby improving the speed of data reading and writing on the cloud host.
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] Currently, most cloud servers mounted on host machines use third-party storage as the backend for cloud disks. While cloud servers can host virtual machines, the performance of third-party storage varies greatly, with some failing to meet the high I / O requirements of cloud servers. Meeting the demand for high-performance disks often involves using high-performance storage, such as all-flash storage, but this comes at a very high cost. Furthermore, the existing high-performance disks on the host machine are not utilized, resulting in resource waste.
[0051] Figure 1 A flowchart of a data storage method provided by the present invention, the method being applied to a host computer running a cloud host computer, the method comprising:
[0052] S11: Get the host's port information;
[0053] Considering the relatively poor I / O read / write capabilities of cloud disks used by cloud servers running on the host machine, this application aims to utilize both cloud disks and the host machine's own cache. The host machine's own cache has high read / write capabilities, and combining the cache with cloud disks can improve the read / write performance of the cloud server. The cloud server can be a virtual machine, etc.
[0054] Specifically, when a cloud server wants to use a cloud disk, it needs to mount the cloud disk to the server beforehand. During the mounting process, the server's port information needs to be obtained in advance.
[0055] Furthermore, this application utilizes the OpenStack platform to implement the provided methods. The OpenStack platform runs on the host machine and includes the Nova and Cinder modules. OpenStack is a platform that uses virtual resource pools to build and manage private and public clouds, responsible for handling core cloud computing services such as compute, networking, storage, identity, and image services. Nova is the core service of the OpenStack platform, responsible for maintaining and managing the computing resources of the cloud environment, as well as managing the virtual machine lifecycle. Cinder: OpenStack Block Storage Service (Cinder) adds persistent storage to virtual machines. Block storage provides an infrastructure for managing volumes and interacting with OpenStack compute services to provide volumes for instances. This service also activates the functionality to manage volume snapshots and volume types.
[0056] The Nova module collects host information such as iqn / FC wwn and sends it to the Cinder module.
[0057] S12: Mount the cloud disk to the host based on the host's port information;
[0058] The Cinder module generates a mapping relationship between the host and the cloud disk based on the port information, and sends the mapping relationship to the Nova module. The Nova module then mounts the cloud disk to the host based on the mapping relationship.
[0059] S13: Add host cache to cloud disk;
[0060] Use the OS-brick library to call caching acceleration modules, such as Bcache and OpenCAS. OS-brick is a dependency library for mounting cloud disks to cloud hosts on the OpenStack platform. It replicates the cloud disk mounting and unmounting functionality in OpenStack, supporting multiple protocols such as iSCSI, FC, RBD, and RemoteFS, and supporting various storage methods including centralized and distributed storage. Bcache is a Linux kernel block device layer cache that supports multiple HDDs (Hard Disk Drives) using the same SSD (Solid State Drive) as a cache disk. It makes it possible to use SSDs as caches for HDDs. Because SSDs are expensive and have limited storage space, while HDDs are inexpensive and have large storage space, using SSDs as caches and HDDs as data storage disks solves both the problems of small SSD capacity and slow HDD operation. OpenCAS (Open Cache Acceleration Software) is installed as a kernel module within the Linux operating system. It binds a high-performance cache disk (the host's cache device) and a large-capacity storage disk (the cloud disk, coredevice) to create a new device partition. When reading and writing to the new device partition, the high-performance cache disk can be used to improve read and write performance and reduce read and write latency.
[0061] The new disk path, which adds the host's cache, is returned to the Nova module.
[0062] S14: Map the mount path of the cloud disk with added cache to the cloud host.
[0063] The Nova module maps the mount path of the cloud disk to the host machine, allowing the cloud server to use the cloud disk with enhanced host caching. Because cloud disks offer larger storage space and caching provides stronger read / write capabilities, the combination of caching and cloud disks better meets the read / write requests of the cloud server.
[0064] This application provides a data storage method applied in the storage field. The method involves obtaining the host's port information; mounting a cloud disk to the host based on the host's port information; adding a cache to the cloud disk on the host; and mapping the cloud disk's mount path to the cloud host. The cloud host runs on the host. When the cloud host stores data via the cloud disk, the cloud disk is pre-mounted on the host. The host combines the cloud disk with its own cache and maps the combined cloud disk's mount path to the cloud host. During storage, the cloud host can simultaneously utilize a remote cloud disk with ample memory and the host's high-speed cache, improving the cloud host's data read / write speed.
[0065] Based on the above embodiments:
[0066] As a preferred embodiment, before mounting the cloud disk to the host based on the host's port information, the method further includes:
[0067] Create a volume;
[0068] Create cloud disks based on volume types and their correspondence with cloud disks;
[0069] Mount the cloud disk to the host based on the host's port information, including:
[0070] Create a mapping relationship between the volume and the host based on the host's port information;
[0071] The cloud disk is mounted to the host according to the mapping relationship.
[0072] Before mounting a cloud disk onto a cloud host, a volume needs to be created in advance. The volume type corresponds to the required cloud disk, and the volume type includes volume parameters and tags. The cloud disk is created in the storage backend. During the cloud disk mounting process, a mapping relationship between the volume and the host is created in the storage backend, and finally, the cloud disk is mounted to the host according to the mapping relationship.
[0073] Specifically, the mapping relationship also includes volume parameters, volume tags, volume ID, and host IP address.
[0074] By establishing the correspondence between volumes and cloud disks, and the mapping relationship between volumes and hosts, cloud disks are mounted to hosts, so that the host can subsequently map the mount path of the cloud disk to the cloud host, enabling the cloud host to use the cloud disk.
[0075] As a preferred embodiment, after creating the cloud disk according to the volume type and the correspondence between the volume type and the cloud disk, the method further includes:
[0076] Add a cache acceleration tag to cloud disks;
[0077] After creating the volume-host mapping relationship based on the host's port information, the following steps are also included:
[0078] Add caching acceleration tags to the mapping relationships;
[0079] Add host caching to cloud disks, including:
[0080] Add host cache to cloud disks based on the cache acceleration tag.
[0081] Considering that not all cloud disks require acceleration, the Cinder module adds a cache acceleration tag to cloud disks that do require acceleration. This cache acceleration tag is also added when generating the volume-host mapping. Subsequently, before mapping the mount path of the cloud disk, the Nova module uses the OS-brick library to add the host's cache to the cloud disk, enabling cloud disks that require acceleration to obtain higher read and write capabilities.
[0082] Specifically, the process of increasing the host's cache includes:
[0083] When deploying the Nova module service, the SSD is initialized by specifying the SSD device path and executing the corresponding command of the opencas or bcache module (for opencas, execute the command line casadm-Sd).
[0084] The output should be ` / dev / disk / by-id / nvme0`, and for Bcache it should be `make-bcache-C / dev / disk / by-id / nvme0`. Record the SSD cache ID (for OpenCAS it's `cache-id`, for Bcache it's `cset.uuid` for the cache disk).
[0085] When mounting a cloud disk, the Nova module first follows the normal procedure and mounts the cloud disk according to the mapping relationship.
[0086] When accelerating SSD caching after the Nova module mounts the cloud disk, it calls the os-brick module, which then executes the opencas or bcache module command. Based on the scanned remote cloud disk and the SSD cache ID obtained during initialization, it establishes a connection between the remote cloud disk and the local high-speed SSD cache, enabling the cloud disk to have the caching function of the local SSD.
[0087] The corresponding commands are as follows:
[0088] OpenCAS:
[0089] a) casadm -Ai [Cache ID] -d [Cloud Disk Mount Path]
[0090] Bcache:
[0091] a) make-bcache-B [cloud disk mount path] (marked as cache backend)
[0092] b) echo [cset.uuid] > [backend path returned in the previous step] (establish connection)
[0093] A new disk device with SSD caching is generated. The Nova module replaces the disk device scanned above with this new disk device and maps it to the cloud host.
[0094] Tag cloud disks that require caching acceleration so that host caching can be added to those cloud disks later.
[0095] As a preferred embodiment, it also includes:
[0096] When a cloud server receives a write request, it saves the data to the server's cache.
[0097] Once the amount of data in the cache reaches a preset amount, write the preset amount of data to the cloud disk;
[0098] When a cloud server receives a read request, it first looks up the data corresponding to the read request from the cache;
[0099] If the data corresponding to the read request is not found in the cache, the data corresponding to the read request is retrieved from the cloud disk.
[0100] The writeback strategy first writes all data to the cache disk, then waits for the system to write the data back to the backend data disk (cloud disk). This mode offers the best performance, accelerating both virtual machine data read and write operations. During data writing, data is first written to the cache disk, and then multiple small I / O blocks are aggregated and written to the remote cloud disk. After reading, data is prioritized for reading from the cache disk; if not found there, it is loaded from the remote cloud disk into the cache disk for reading. Data in the cache disk is flushed based on its own cache space and other algorithms, and previously flushed data in the cache disk is cleaned up based on data usage frequency.
[0101] The above strategies accelerate both read and write operations on cloud servers, improving their read and write capabilities.
[0102] As a preferred embodiment, it also includes:
[0103] When a cloud server receives a write request, the data is simultaneously saved to the server's cache and the cloud disk.
[0104] When a cloud server receives a read request, it first looks up the data corresponding to the read request from the cache;
[0105] If the data corresponding to the read request is not found in the cache, the data corresponding to the read request is retrieved from the cloud disk.
[0106] The writethrough strategy writes data to both the cache disk and the backend data disk simultaneously. This mode is relatively safe, but it only accelerates data reading on the virtual machine. When writing data, both the cache disk and the remote cloud disk are written at the same time. When reading data, the cache disk is read first. If the data cannot be read from the cache disk, it will be loaded from the remote cloud disk into the cache disk. The algorithm then cleans up the data in the cache disk according to its own frequency.
[0107] The above strategies improve the security of the host and accelerate read operations on the cloud host, thereby enhancing its read and write capabilities.
[0108] As a preferred embodiment, it also includes:
[0109] When the cloud server receives a write request, it saves the data to the cloud disk.
[0110] When a cloud server receives a read request, it searches for the data corresponding to the read request in the cloud disk.
[0111] Writearoud writes data directly to the backend disk. This mode eliminates the effect of caching acceleration and is generally used in maintenance mode to ensure that all data is flushed to the cloud disk.
[0112] In summary, using three different data storage strategies, the writeback strategy accelerates both read and write operations on the cloud server, improving its read and write capabilities. The writethrough strategy enhances server security and accelerates read operations, further improving read and write capabilities. The writearoud strategy is used during maintenance. By employing more suitable control strategies in different states, the overall performance of the cloud server is improved.
[0113] Figure 2 A schematic diagram of a data storage system provided by the present invention, the method comprising:
[0114] Acquisition unit 21 is used to acquire port information of the host;
[0115] Mounting unit 22 is used to mount the cloud disk to the host according to the host's port information;
[0116] Add unit 23 to add host cache for cloud disk;
[0117] Mapping unit 24 is used to map the mount path of the cloud disk with added cache to the cloud host.
[0118] Specifically, it also includes:
[0119] The first creation unit is used to create volumes;
[0120] The second creation unit is used to create cloud disks based on the volume type and the correspondence between the volume type and the cloud disk.
[0121] The third creation unit is used to create a mapping relationship between the volume and the host based on the host's port information;
[0122] Mounting unit 22 is specifically used to mount the cloud disk to the host according to the mapping relationship;
[0123] The second addition unit is used to add cache acceleration tags to the cloud disk;
[0124] The third addition unit is used to add cache acceleration tags to the mapping relationship;
[0125] Add unit 23, which is specifically used to add host cache to cloud disks based on cache acceleration tags.
[0126] The first storage unit is used to save data to the host's cache when the cloud host receives a write request;
[0127] The first writing unit is used to write the preset amount of data to the cloud disk when the amount of data in the cache reaches a preset amount.
[0128] The first lookup unit is used to pre-search for the data corresponding to the read request from the cache when the cloud host receives a read request;
[0129] The second lookup unit is used to search for the data corresponding to the read request from the cloud disk when the data corresponding to the read request does not exist in the cache.
[0130] Also includes:
[0131] The second storage unit is used to save data to both the host's cache and the cloud disk when the cloud host receives a write request.
[0132] The third lookup unit is used to pre-search for the data corresponding to the read request from the cache when the cloud host receives a read request;
[0133] The fourth lookup unit is used to search for the data corresponding to the read request from the cloud disk when the data corresponding to the read request does not exist in the cache.
[0134] Also includes:
[0135] The third storage unit is used to save data to the cloud disk when the cloud host receives a write request;
[0136] The fifth lookup unit is used to search for the data corresponding to the read request from the cloud disk when the cloud host receives a read request.
[0137] This application provides a data storage system applied in the storage field. The system obtains the host's port information; mounts a cloud disk to the host based on the host's port information; adds a cache to the cloud disk on the host; and maps the cloud disk's mount path to the cloud host. The cloud host runs on the host. When the cloud host stores data via the cloud disk, the cloud disk is pre-mounted on the host. The host combines the cloud disk with its own cache and maps the combined cloud disk's mount path to the cloud host. During storage, the cloud host can simultaneously utilize a remote cloud disk with ample memory and the host's high-speed cache, improving the cloud host's data read and write speed.
[0138] The description of the data storage system provided in this application is given in the above embodiments and will not be repeated here.
[0139] Figure 3 This invention provides a schematic diagram of the structure of a host computer, which includes:
[0140] Memory 31 is used to store computer programs;
[0141] The processor 32 is used to implement the above-described data saving method when executing a computer program.
[0142] Specifically, the steps of computer program execution are as follows:
[0143] Obtain the host's port information;
[0144] Mount the cloud disk to the host based on the host's port information;
[0145] Add a cache to the host machine for the cloud disk;
[0146] Map the mount path of the cloud disk with added cache to the cloud host.
[0147] Before mounting the cloud disk to the host based on the host's port information, the process also includes:
[0148] Create a volume;
[0149] Create cloud disks based on volume types and their correspondence with cloud disks;
[0150] Mount the cloud disk to the host based on the host's port information, including:
[0151] Create a mapping relationship between the volume and the host based on the host's port information;
[0152] The cloud disk is mounted to the host according to the mapping relationship.
[0153] After creating a cloud disk based on the volume type and the mapping between volume types and cloud disks, the process also includes:
[0154] Add a cache acceleration tag to cloud disks;
[0155] After creating the volume-host mapping based on the host's port information, the process also includes:
[0156] Add caching acceleration tags to the mapping relationships;
[0157] Add host caching to cloud disks, including:
[0158] Add host cache to cloud disks based on the cache acceleration tag.
[0159] Also includes:
[0160] When a cloud server receives a write request, it saves the data to the server's cache.
[0161] Once the amount of data in the cache reaches a preset amount, write the preset amount of data to the cloud disk;
[0162] When a cloud server receives a read request, it first looks up the data corresponding to the read request from the cache;
[0163] If the data corresponding to the read request is not found in the cache, the data corresponding to the read request is retrieved from the cloud disk.
[0164] Also includes:
[0165] When a cloud server receives a write request, the data is simultaneously saved to the server's cache and the cloud disk.
[0166] When a cloud server receives a read request, it first looks up the data corresponding to the read request from the cache;
[0167] If the data corresponding to the read request is not found in the cache, the data corresponding to the read request is retrieved from the cloud disk.
[0168] Also includes:
[0169] When the cloud server receives a write request, it saves the data to the cloud disk.
[0170] When a cloud server receives a read request, it searches for the data corresponding to the read request in the cloud disk.
[0171] This application provides a host system for storage applications. It obtains the host's port information, mounts a cloud disk to the host based on the port information, adds a cache to the cloud disk, and maps the cloud disk's mount path to the cloud host. The cloud host runs on the host. When the cloud host stores data via the cloud disk, the cloud disk is pre-mounted on the host. The host combines the cloud disk with its own cache and maps the combined cloud disk's mount path to the cloud host. During storage, the cloud host can simultaneously utilize a remote cloud disk with ample memory and the host's high-speed cache, improving the cloud host's data read / write speed.
[0172] The host provided in this application is described in the above embodiments and will not be repeated here.
[0173] The present invention also provides a data storage device, including the host described above, and further including a server that provides a cloud hard drive.
[0174] The description of the data storage device provided in this application is given in the above embodiments and will not be repeated here.
[0175] This application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the above-described data saving method.
[0176] Specifically, the steps of computer program execution are as follows:
[0177] Obtain the host's port information;
[0178] Mount the cloud disk to the host based on the host's port information;
[0179] Add a cache to the host machine for the cloud disk;
[0180] Map the mount path of the cloud disk with added cache to the cloud host.
[0181] Before mounting the cloud disk to the host based on the host's port information, the process also includes:
[0182] Create a volume;
[0183] Create cloud disks based on volume types and their correspondence with cloud disks;
[0184] Mount the cloud disk to the host based on the host's port information, including:
[0185] Create a mapping relationship between the volume and the host based on the host's port information;
[0186] The cloud disk is mounted to the host according to the mapping relationship.
[0187] After creating a cloud disk based on the volume type and the mapping between volume types and cloud disks, the process also includes:
[0188] Add a cache acceleration tag to cloud disks;
[0189] After creating the volume-host mapping based on the host's port information, the process also includes:
[0190] Add caching acceleration tags to the mapping relationships;
[0191] Add host caching to cloud disks, including:
[0192] Add host cache to cloud disks based on the cache acceleration tag.
[0193] Also includes:
[0194] When a cloud server receives a write request, it saves the data to the server's cache.
[0195] Once the amount of data in the cache reaches a preset amount, write the preset amount of data to the cloud disk;
[0196] When a cloud server receives a read request, it first looks up the data corresponding to the read request from the cache;
[0197] If the data corresponding to the read request is not found in the cache, the data corresponding to the read request is retrieved from the cloud disk.
[0198] Also includes:
[0199] When a cloud server receives a write request, the data is simultaneously saved to the server's cache and the cloud disk.
[0200] When a cloud server receives a read request, it first looks up the data corresponding to the read request from the cache;
[0201] If the data corresponding to the read request is not found in the cache, the data corresponding to the read request is retrieved from the cloud disk.
[0202] Also includes:
[0203] When the cloud server receives a write request, it saves the data to the cloud disk.
[0204] When a cloud server receives a read request, it searches for the data corresponding to the read request in the cloud disk.
[0205] This application provides a computer-readable storage medium applied in the storage field, which obtains the host's port information; mounts a cloud disk to the host based on the host's port information; adds a host cache to the cloud disk; and maps the cloud disk's mount path to the cloud host. The cloud host runs on the host. When the cloud host stores data via the cloud disk, the cloud disk is pre-mounted on the host. The host combines the cloud disk with its own cache and maps the combined cloud disk's mount path to the cloud host. During storage, the cloud host can simultaneously utilize a remote cloud disk with large memory and the host's high-speed cache, improving the cloud host's data read and write speed.
[0206] The description of the computer-readable storage medium provided in this application is given in the above embodiments and will not be repeated here.
[0207] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0208] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0209] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for data storage, characterized in that, Applied to a host computer running a cloud server, the method includes: Obtain the port information of the host; Mount the cloud disk to the host according to the host's port information; Add the host's cache to the cloud disk, and return the new disk path with the added host cache to the host's Nova module; The Nova module of the host will map the mount path of the cloud disk that adds the cache to the cloud host; Before mounting the cloud disk to the host based on the host's port information, the process also includes: Create a volume; Create a cloud disk based on the volume type and the correspondence between the volume type and the cloud disk; Mounting the cloud disk to the host based on the host's port information includes: The host's Cinder module creates a mapping relationship between the cloud disk and the host based on the host's port information, and sends the mapping relationship to the Nova module; The Nova module mounts the cloud disk to the host according to the mapping relationship; After creating the cloud disk according to the volume type and the correspondence between the volume type and the cloud disk, the process also includes: Add a cache acceleration tag to cloud disks; After creating the mapping relationship between the volume and the host based on the host's port information, the process also includes: Add a caching acceleration tag to the mapping relationship; Adding cache to the host for the cloud disk includes: The cache of the host is added to the cloud disk according to the cache acceleration tag; The process of increasing the host's cache includes: When the Nova module service is deployed, by specifying the SSD device path and executing the corresponding commands of the opencas or bcache modules, the opencas module executes the command line to initialize the SSD and record the SSD cache ID. The Nova module mounts the cloud disk according to the mapping relationship. When accelerating SSD caching after the Nova module has mounted the cloud disk, it calls the os-brick module, which then executes the opencas or bcache module commands. Based on the scanned remote cloud disk and the SSD cache ID obtained during initialization, it establishes a connection between the remote cloud disk and the local high-speed SSD cache, enabling the cloud disk to have the caching function of the local SSD.
2. The data storage method as described in claim 1, characterized in that, Also includes: When the cloud host receives a write request, it saves the data to the host's cache. When the amount of data in the cache reaches a preset amount, the preset amount of data is written to the cloud disk; When the cloud host receives a read request, it first looks up the data corresponding to the read request from the cache; If the data corresponding to the read request is not found in the cache, the data corresponding to the read request is searched from the cloud disk.
3. The data storage method as described in claim 1, characterized in that, Also includes: When the cloud host receives a write request, it simultaneously saves the data to the host's cache and the cloud disk. When the cloud host receives a read request, it first looks up the data corresponding to the read request from the cache; If the data corresponding to the read request is not found in the cache, the data corresponding to the read request is searched from the cloud disk.
4. The data storage method as described in claim 1, characterized in that, Also includes: When the cloud host receives a write request, it saves the data to the cloud disk; When the cloud host receives a read request, it searches for the data corresponding to the read request in the cloud disk.
5. A data storage system, characterized in that, include: The acquisition unit is used to acquire the host's port information; The mounting unit is used to mount the cloud disk to the host according to the port information of the host; An addition unit is used to add the host's cache to the cloud disk and return the new disk path with the added host cache to the host's Nova module; The mapping unit is used by the Nova module of the host to map the mount path of the cloud disk that adds the cache to the cloud host; Also includes: The first creation unit is used to create volumes; The second creation unit is used to create a cloud disk according to the type of the volume and the correspondence between the volume type and the cloud disk; The third creation unit is used by the host's Cinder module to create a mapping relationship between the cloud disk and the host based on the host's port information, and to send the mapping relationship to the Nova module; The mounting unit is specifically used by the Nova module to mount the cloud disk to the host according to the mapping relationship; The second addition unit is used to add cache acceleration tags to the cloud disk; The third addition unit is used to add a cache acceleration tag to the mapping relationship; The adding unit is specifically used to add the host's cache to the cloud disk according to the cache acceleration tag; The process of increasing the host's cache includes: During the deployment of the Nova module service, by specifying the SSD device path and executing the corresponding commands of the opencas or bcache modules, the opencas module executes the command line to initialize the SSD and record the SSD cache ID. The Nova module mounts the cloud disk according to the mapping relationship. When accelerating SSD caching after the Nova module has completed mounting the cloud disk, it calls the os-brick module, which then executes the opencas or bcache module commands. Based on the scanned remote cloud disk and the SSD cache ID obtained during initialization, it establishes a connection between the remote cloud disk and the local high-speed SSD cache, enabling the cloud disk to have the caching function of the local SSD.
6. A host computer, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data storage method as described in any one of claims 1 to 4 when executing the computer program.
7. A data storage device, characterized in that, Including the host as described in claim 6, it also includes a server that provides cloud disks.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data saving method as described in any one of claims 1 to 4.