Volume localization method, device and medium

By determining the localization location of the virtual disk in the virtual machine and building consistent metadata information, localization of volumes is solved, and the problem of insufficient virtual machine performance support is improved and data access efficiency is improved.

CN114860166BActive Publication Date: 2025-08-19JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210469686.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-30
Publication Date
2025-08-19
Estimated Expiration
2042-04-30

AI Technical Summary

Technical Problem

In the evolution of traditional distributed storage architecture to hyperconverged architecture, the volume localization method of virtual machines cannot provide good performance support for virtual machines.

Method used

By obtaining the localized location information of the virtual disk in the virtual machine, determining the distributed storage nodes corresponding to the virtual disk, and building a distribution strategy based on the consistent metadata information, so that the volume is localized in the corresponding nodes, realizing the object localization.

Benefits of technology

Ensure that data access to virtual machines occurs on the network and disk of the distributed storage node where the virtual machine process is located, improving the performance support of virtual machines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860166B_ABST
    Figure CN114860166B_ABST
Patent Text Reader

Abstract

The present application discloses a volume localization method, device and medium, which are applied to the field of distributed storage. The method first obtains the localization location information of the virtual disk in the virtual machine to determine the localization node of the virtual disk; the localization node of the virtual disk is the distributed storage node corresponding to the virtual disk in the distributed storage system. Then, based on the localization location information of the virtual disk, the localization location information of the volume corresponding to the virtual disk in the distributed storage system is determined to obtain the localization node corresponding to the volume. The distribution strategy of the object can be determined based on the consistency metadata information; and after the object is localized according to the distribution strategy, the volume can be localized in the corresponding localization node. The method provided in the embodiment of the present application can ensure that the data access of the virtual machine occurs in the network and disk of the distributed storage node where the virtual machine process is located, which can provide better performance support for the virtual machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of distributed storage, and in particular to a volume localization method, device, and medium. Background Art

[0002] In the process of evolving from traditional distributed storage architecture to hyper-converged architecture, it is first necessary to deploy traditional distributed storage nodes on a virtualization platform. Figure 1 This is a diagram of the IO access of virtual machines in the distributed storage system. Figure 1 It can be seen that there are multiple distributed storage nodes in the cluster of the distributed storage system. In the evolution of the traditional distributed storage architecture to the hyper-converged architecture, a particularly important point is how to localize the storage resources (volumes) of the virtual machine (VM). The current localization method is that the volumes used by the virtual machine will be divided into fixed sizes in the distributed storage system, and the consistency algorithm is relied on to ensure that the divided objects are evenly distributed on the various distributed storage nodes in the cluster; at the same time, in order to improve the reliability of the system, a copy strategy is also added to further achieve the uniformity of the virtual machine storage resources on each distributed storage node.

[0003] However, in a hyper-converged scenario, the distributed storage system only provides volumes for virtual machines. The essence of a virtual machine is a service process, which means that the virtual machine can only exist on one of the distributed storage nodes in the virtualization platform. However, the characteristics of traditional distributed storage are that the volumes are scattered across the distributed storage nodes in the cluster. From an architectural analysis, it can be found that this method cannot provide good performance support for virtual machines.

[0004] Therefore, it can be seen that how to provide better performance support for virtual machines when the volumes of the virtual machines are localized is a problem that needs to be solved urgently by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a volume localization method, device, and medium, so as to provide better performance support for virtual machines when the volumes of virtual machines are localized.

[0006] To solve the above technical problems, the present application provides a volume localization method, comprising:

[0007] Obtaining localization location information of a virtual disk in a virtual machine to determine a localization node of the virtual disk; wherein the localization node of the virtual disk is a distributed storage node corresponding to the virtual disk in a distributed storage system;

[0008] Determining, according to the localized location information of the virtual disk, the localized location information of the volume corresponding to the virtual disk in the distributed storage system;

[0009] Building consistent metadata information based on the localized location information of the volume;

[0010] Determining a distribution strategy for the object based on the consistency metadata information;

[0011] The object is localized according to the distribution strategy, so that the volume is localized in the corresponding localization node.

[0012] Preferably, the constructing of consistency metadata information according to the localized location information of the volume includes:

[0013] The recorded IP information of each distributed storage node and the number of virtual nodes; wherein the number of virtual nodes corresponds to the number of virtual machines;

[0014] A consistent hash ring is constructed according to the IP information of each distributed storage node and the number of virtual nodes to achieve mapping of the object to the distributed storage node.

[0015] Preferably, the constructing of consistency metadata information according to the localized location information of the volume includes:

[0016] Obtaining physical architecture information and predefined routing rules of a cluster in the distributed storage system;

[0017] A consistency strategy is constructed according to the physical architecture information of the cluster in the distributed storage system and predefined routing rules to achieve mapping of the object to the distributed storage node.

[0018] Preferably, obtaining the localization location information of the virtual disk in the virtual machine to determine the localization node of the virtual disk includes:

[0019] Obtain virtual machine creation location information provided by the virtualization platform;

[0020] The virtual machine creation location information is used as the localized location information of the virtual disk.

[0021] Preferably, determining the localized location information of the volume corresponding to the virtual disk in the distributed storage system according to the localized location information of the virtual disk includes:

[0022] Determining a mapping relationship between the virtual disk and the volume according to a request from the virtualization platform to create the virtual disk;

[0023] The localized location information of the volume corresponding to the virtual disk in the distributed storage system is determined according to the localized location information of the virtual disk and the mapping relationship.

[0024] Preferably, after constructing the consistency metadata information according to the localized location information of the volume, the method further includes:

[0025] Constructing new consistency metadata information according to the current consistency metadata information and the localized location information of the volume;

[0026] Determining the distribution strategy of the object according to the consistency metadata information includes:

[0027] The distribution strategy of the object is determined based on the current consistency metadata information and the new consistency metadata information; wherein, the localization of the object according to the distribution strategy is also used to localize the volume in the designated distributed storage node to achieve backup of the volume.

[0028] Preferably, the constructing new consistency metadata information according to the current consistency metadata information and the localized location information of the volume includes:

[0029] Deleting the relevant information of the distributed storage node corresponding to the volume in the current consistency metadata information;

[0030] The current consistency metadata information after deleting the relevant information is used as the new consistency metadata information.

[0031] To solve the above technical problems, the present application further provides a volume localization device, comprising:

[0032] An acquisition module, configured to acquire localization location information of a virtual disk in a virtual machine to determine a localization node of the virtual disk; wherein the localization node of the virtual disk is a distributed storage node corresponding to the virtual disk in a distributed storage system;

[0033] A first determining module, configured to determine, according to the localized location information of the virtual disk, the localized location information of the volume corresponding to the virtual disk in the distributed storage system;

[0034] A construction module, configured to construct consistent metadata information according to the localized location information of the volume;

[0035] A second determining module is used to determine a distribution strategy of the object according to the consistency metadata information;

[0036] An execution module is configured to implement localization of the object according to the distribution strategy, so that the volume is localized in the corresponding localization node.

[0037] Preferably, the volume localization device further comprises:

[0038] a third determining module, configured to construct new consistency metadata information according to the current consistency metadata information and the localized location information of the volume after constructing the consistency metadata information according to the localized location information of the volume;

[0039] The second determination module is used to determine the distribution strategy of the object based on the current consistency metadata information and the new consistency metadata information; wherein, the localization of the object according to the distribution strategy is also used to localize the volume in the designated distributed storage node to achieve backup of the volume.

[0040] To solve the above technical problems, the present application further provides a volume localization device, comprising: a memory for storing a computer program;

[0041] A processor is configured to implement the steps of the above volume localization method when executing a computer program.

[0042] To solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned volume localization method are implemented.

[0043] The volume localization method provided in the present application first obtains the localization location information of the virtual disk in the virtual machine to determine the localization node of the virtual disk; wherein, there are multiple distributed storage nodes in the distributed storage system, and the localization node of the virtual disk is the distributed storage node corresponding to the virtual disk in the distributed storage system. Then, the localization location information of the volume corresponding to the virtual disk in the distributed storage system is determined based on the localization location information of the virtual disk, and the localization node corresponding to the volume is obtained. A volume is a logical integration of objects. A volume has multiple objects. The consistency metadata information is used to determine which distributed storage node the object should be selected for storage. Therefore, the distribution strategy of the object can be determined based on the consistency metadata information; and after the object is localized according to the distribution strategy, the volume can be localized in the corresponding localization node. The method provided in the embodiment of the present application can ensure that data access of the virtual machine occurs in the network and disk of the distributed storage node where the virtual machine process is located, which can provide better performance support for the virtual machine.

[0044] The present application also provides a volume localization device and a computer-readable storage medium, which correspond to the above method and thus have the same beneficial effects as the above method. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0046] Figure 1 A schematic diagram of IO access of virtual machines in a distributed storage system.

[0047] Figure 2 A flowchart of a volume localization method provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of IO access of a virtual machine in a distributed storage system provided in an embodiment of the present application;

[0049] Figure 4 A structural diagram of a volume localization device provided in an embodiment of the present application;

[0050] Figure 5 A structural diagram of a volume localization device provided in another embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0052] The core of this application is to provide a volume localization method, device and medium, so as to provide better performance support for the virtual machine when the volume of the virtual machine is localized.

[0053] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0054] A volume is essentially a hard disk partition. The hard disks we commonly use are called partitions, and the partitions of dynamic disks used by servers are called volumes. An object is a unit used to store data, and business data is stored on objects. A volume is a logical integration of objects, and a volume can contain multiple objects. Writing data to a disk is equivalent to writing data to a volume, which ultimately ends up on the object. However, virtual machines only see virtual disks, which in turn correspond to volumes. The purpose of this application is to localize volumes and bind them to local distributed storage nodes.

[0055] In the process of evolving from traditional distributed storage architecture to hyper-converged architecture, it is first necessary to deploy traditional distributed storage nodes on a virtualization platform. Currently, two methods are usually adopted: one method is to deploy distributed storage nodes on nodes running virtualization capabilities, that is, to coexist with virtualization capabilities on the same node. The advantage is that the hardware capabilities of the node can be directly utilized, and the disadvantages are business integration, resource isolation, and fault isolation; the other method is to deploy distributed storage node services in a virtual machine on the virtualization platform, which can well achieve resource and fault isolation, but it is necessary to use direct pass-through, transparent transmission, etc. to give the node's physical resources to the virtual machine. However, both methods have a problem, that is, the volumes used by the virtual machine will be split into fixed sizes in the distributed storage system, relying on the consistency algorithm to ensure that the split objects are evenly distributed on the distributed storage nodes in the cluster. If the current solution is used, after the volume localization is completed, the IO access of the virtual machine will be as follows: Figure 1 As shown, from Figure 1 As can be seen, in this scenario, virtual machines communicate with distributed storage nodes in a distributed storage system over a network (this can be the ISCSI protocol or other proprietary protocols). However, in a hyper-converged scenario, the distributed storage system only provides volumes for virtual machines. The essence of a virtual machine is a service process, which means that a virtual machine can only exist on one of the distributed storage nodes in the virtualization platform. If the current solution is used, the virtual machine will not receive good performance support. To solve the above technical problems, this application implements a volume localization method. Figure 2 A flow chart of a volume localization method provided in an embodiment of the present application; Figure 2 As shown, the method includes the following steps:

[0056] S10: Obtain localization location information of the virtual disk in the virtual machine to determine the localization node of the virtual disk.

[0057] There are multiple distributed storage nodes in a distributed storage system, and the localization node of a virtual disk is the distributed storage node corresponding to the virtual disk in the distributed storage system. To achieve volume localization, you must first obtain the localization location information of the virtual disk in the virtual machine, and then determine the localization node of the virtual disk based on the localization location information of the virtual disk, that is, find the distributed storage node corresponding to the virtual disk. After the distributed storage system and the virtualization platform are integrated, the distributed storage system can obtain the basic information of the virtual machine created in the virtualization platform, which includes the distributed storage node in the distributed storage system where the virtual machine will be created, that is, the virtual machine creation location information. There is no limit to the method of obtaining the localization location information of the virtual disk. You can obtain the virtual machine creation location information provided by the virtualization platform, and then use the virtual machine creation location information as the localization location information of the virtual disk.

[0058] S11: Determine the localized location information of the volume corresponding to the virtual disk in the distributed storage system according to the localized location information of the virtual disk.

[0059] After obtaining the localized location information for the virtual disk, it's necessary to find the volume corresponding to the virtual disk. Upon receiving a request from the virtualization platform to create a virtual disk, the distributed storage system will create a volume based on the request, such as a VDI in Sheepdog or an RBD image in Ceph. Based on the virtual machine's location information, the localized node location of the corresponding volume can be obtained. In specific implementations, the mapping relationship between the virtual disk and volume can be determined based on the virtualization platform's request to create a virtual disk. Then, based on the virtual disk's localized location information and the mapping relationship, the localized location information of the volume corresponding to the virtual disk in the distributed storage system can be determined.

[0060] S12: Constructing consistency metadata information according to the localized location information of the volume.

[0061] Consistency metadata, constructed based on the volume's local location information, contains the mapping between volumes and distributed storage nodes. This mapping determines which distributed storage node should be selected for object storage. Consistency metadata is input into the distributed storage system's consistency policy. Its characteristic is that the consistency policy constructed based on consistency metadata is consistent across all distributed storage nodes and at any time (i.e., the placement of the same object calculated on any distributed storage node at any time is the same). For example, in Sheepdog, the epoch uses the IP address information and number of virtual nodes recorded in the epoch to construct a consistent hash ring, thereby mapping objects to distributed storage nodes. For another example, Ceph uses CRUSH maps, which record information describing the physical architecture of a distributed storage system cluster and predefined routing rules, to construct a consistency policy, thereby determining the mapping of objects to distributed storage nodes. Furthermore, the fact that the placement of the same object calculated on any distributed storage node at any time is the same based on consistency metadata also enables volume backup.

[0062] S13: Determine the distribution strategy of the object according to the consistency metadata information.

[0063] The consistency metadata information obtained in the above steps includes the mapping relationship between volumes and distributed storage nodes. The object distribution strategy can be determined based on the consistency metadata information. The distribution strategy is formulated based on the mapping relationship between volumes and distributed storage nodes in the consistency metadata information.

[0064] S14: localize the object according to the distribution strategy, so that the volume is localized in the corresponding localization node.

[0065] As mentioned above, a volume is a logical integration of multiple objects. Localizing objects according to a distribution strategy is essentially localizing volumes. The ultimate goal of this application is to localize volumes to their corresponding localized nodes. This means that a complete copy of the volume's object data will exist in the distributed storage nodes at the given location.

[0066] After completing the above steps, you also need to establish a data link between the virtual disk and the distributed storage node. Once the link is established, the virtual disk can be used. The virtual machine's virtual disk will store a complete copy of the object data on the local node, and service requests through the established link will be accessed locally. Figure 3 A schematic diagram of IO access of a virtual machine in a distributed storage system provided in an embodiment of the present application; Figure 3 Under the solution provided in the embodiment of the present application, the data access performed by the virtual machine is performed by Figure 3It can be seen that the data access of the virtual machine occurs in the network and disk of the distributed storage node where the virtual machine process is located. This greatly improves the read and write performance, reduces the calls of network requests, shortens the IO call path, and significantly improves performance.

[0067] In a hyper-converged scenario, virtual machines obtain virtual disks through the virtual storage service provided by the virtualization platform. The virtual storage service can use the volumes provided by the distributed storage service through a private protocol or the ISCSI protocol, but both need to establish a data link with the distributed storage system. The data link determines the path of the virtual machine's business request. Since the localized copy strategy of the virtual machine's virtual disk has been implemented, the client side (virtual machine or virtual node) obtains the localized node information of the virtual machine's virtual disk and requests the localized node to establish a link, thereby achieving the following: Figure 3 The effect shown.

[0068] The volume localization method provided in the embodiment of the present application first obtains the localization location information of the virtual disk in the virtual machine to determine the localization node of the virtual disk; wherein, there are multiple distributed storage nodes in the distributed storage system, and the localization node of the virtual disk is the distributed storage node corresponding to the virtual disk in the distributed storage system. Then, the localization location information of the volume corresponding to the virtual disk in the distributed storage system is determined based on the localization location information of the virtual disk, and the localization node corresponding to the volume is obtained. A volume is a logical integration of objects. A volume has multiple objects. The consistency metadata information is used to determine which distributed storage node the object should be selected for storage. Therefore, the distribution strategy of the object can be determined based on the consistency metadata information; and after the object is localized according to the distribution strategy, the volume can be localized in the corresponding localization node. The method provided in the embodiment of the present application can ensure that data access of the virtual machine occurs in the network and disk of the distributed storage node where the virtual machine process is located, which can provide better performance support for the virtual machine.

[0069] The embodiments of the present application provide two specific solutions for constructing consistent metadata information based on the localized location information of the volume. The first solution is to record the IP information of each distributed storage node and the number of virtual nodes; wherein, the virtual node is a virtualized node obtained based on the virtual machine, and its number corresponds to the number of virtual machines. By constructing a consistent hash ring based on the IP information of each distributed storage node and the number of virtual nodes, the mapping of objects to distributed storage nodes can be achieved. This solution uses the epoch in sheepdog to record the IP information of each distributed storage node and the number of virtual nodes. The second solution is to construct a consistency strategy based on the information of the physical architecture of the cluster in the distributed storage system and the predefined routing rules to achieve the mapping of objects to distributed storage nodes. In this solution, Ceph uses CRUSH map to record the information of the physical architecture of the cluster in the distributed storage system and the predefined routing rules, and uses this to construct a consistency strategy.

[0070] The solution provided by the above embodiment realizes the binding between the volume and the local distributed storage node, so that the virtual machine can access data in the network and disk of the distributed storage node where the virtual machine process is located. The embodiment of the present application provides a preferred solution, which backs up the volume based on the feature that the placement position of the same object calculated at any distributed storage node and at any time is the same according to the consistency metadata information. Specifically: after constructing the consistency metadata information according to the localized location information of the volume, it also includes: constructing new consistency metadata information according to the current consistency metadata information and the localized location information of the volume; and determining the distribution strategy of the object according to the consistency metadata information includes: determining the distribution strategy of the object according to the current consistency metadata information and the new consistency metadata information; wherein, localizing the object according to the distribution strategy is also used to localize the volume in the specified distributed storage node to realize volume backup. In addition, the localized location information of the volume and the constructed consistency metadata information are retained in the memory as the basic attributes of the volume, and are also persistently stored, thereby realizing the binding of the virtual disk and the consistency metadata information.

[0071] Constructing new consistency metadata based on the current consistency metadata and the volume's localization location information involves deleting the information about the volume's corresponding distributed storage node from the current consistency metadata; and then using the current consistency metadata after deleting the information as the new consistency metadata. In reality, the current consistency metadata is intended to localize the volume to the corresponding local node, while the new consistency metadata is intended to enable volume backup across distributed storage nodes.

[0072] The following is a brief description using sheepdog as an example. The current epoch of sheepdog contains three distributed storage nodes, and the disk capacity of each distributed storage node is equal. The current consistent hash metadata information is described in Table 1.

[0073] Table 1

[0074]

[0075] The location of the distributed storage node corresponding to the current virtual machine obtained by the virtualization platform is (192.168.100.2). According to the strategy provided in this application, when the virtual machine creates a virtual disk, its localization node is (192.168.100.2). The newly constructed consistency metadata information is shown in Table 2.

[0076] Table 2

[0077]

[0078] After creating a 500GB full replica on distributed storage node (192.168.100.2), the corresponding information for distributed storage node (192.168.100.2) is deleted from the table. The new consistent metadata only includes the information for distributed storage nodes (192.168.100.1) and (192.168.100.3). The remaining 500GB of replica data is distributed across distributed storage nodes (192.168.100.1) and (192.168.100.3) based on the consistent hash metadata of the virtual disk, thus achieving volume backup. A problem with any distributed storage node within a different fault domain will not affect other distributed storage nodes, preventing backup data from being corrupted.

[0079] In the above embodiments, a volume localization method is described in detail. This application also provides corresponding embodiments of a volume localization apparatus. It should be noted that this application describes the apparatus embodiments from two perspectives: one based on functional modules and the other based on hardware.

[0080] Based on the perspective of functional modules, this embodiment provides a volume localization device. Figure 4 The structure diagram of the volume localization device provided in the embodiment of the present application is as follows: Figure 4 As shown, the device includes:

[0081] An acquisition module 10 is configured to acquire localized location information of a virtual disk in a virtual machine to determine a localized node of the virtual disk; wherein the localized node of the virtual disk is a distributed storage node corresponding to the virtual disk in a distributed storage system;

[0082] A first determining module 11 is configured to determine, based on the localized location information of the virtual disk, the localized location information of the volume corresponding to the virtual disk in the distributed storage system;

[0083] A construction module 12 is configured to construct consistent metadata information based on the localized location information of the volume;

[0084] A second determining module 13 is configured to determine a distribution strategy for the object based on the consistency metadata information;

[0085] The execution module 14 is configured to implement localization of the object according to the distribution strategy, so that the volume is localized in the corresponding localization node.

[0086] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, and they will not be repeated here.

[0087] As a preferred embodiment, the volume localization device further includes:

[0088] a third determining module, configured to construct new consistent metadata information based on the current consistent metadata information and the localized location information of the volume after the consistent metadata information is constructed based on the localized location information of the volume;

[0089] The second determination module is used to determine the distribution strategy of the object according to the current consistency metadata information and the new consistency metadata information; wherein, localizing the object according to the distribution strategy is also used to localize the volume in the designated distributed storage node to achieve volume backup.

[0090] The volume localization device provided in this embodiment corresponds to the above method and thus has the same beneficial effects as the above method.

[0091] From a hardware perspective, this embodiment provides another volume localization device. Figure 5 A structural diagram of a volume localization device provided in another embodiment of the present application is shown in FIG. Figure 5 As shown, the volume localization device includes: a memory 20 for storing a computer program;

[0092] The processor 21 is configured to implement the steps of the volume localization method mentioned in the above embodiment when executing the computer program.

[0093] The volume localization device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.

[0094] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0095] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory, and non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the volume localization method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to data related to the volume localization method, etc.

[0096] In some embodiments, the volume localization device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .

[0097] Those skilled in the art will appreciate that the structure shown in the figure does not constitute a limitation on the volume localization device, and may include more or fewer components than shown in the figure.

[0098] The volume localization device provided in an embodiment of the present application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: a volume localization method.

[0099] The volume localization device provided in this embodiment corresponds to the above method and thus has the same beneficial effects as the above method.

[0100] Finally, the present application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiment.

[0101] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0102] The computer-readable storage medium provided in this embodiment corresponds to the above method and thus has the same beneficial effects as the above method.

[0103] The above is a detailed introduction to the volume localization method, device and medium provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

[0104] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the aforementioned elements.

Claims

1. A volume localization method, characterized in that: include: Obtaining localization location information of a virtual disk in a virtual machine to determine a localization node of the virtual disk; wherein the localization node of the virtual disk is a distributed storage node corresponding to the virtual disk in a distributed storage system; Determining, according to the localized location information of the virtual disk, the localized location information of the volume corresponding to the virtual disk in the distributed storage system; Building consistent metadata information based on the localized location information of the volume; Determining a distribution strategy for the object based on the consistency metadata information; localizing the object according to the distribution strategy so that the volume is localized in the corresponding localization node; The step of constructing consistent metadata information based on the localized location information of the volume includes: Recording the IP information of each of the distributed storage nodes and the number of virtual nodes; wherein the number of the virtual nodes corresponds to the number of the virtual machines; constructing a consistent hash ring based on the IP information of each of the distributed storage nodes and the number of the virtual nodes to achieve mapping of the object to the distributed storage node; Alternatively, obtaining information about the physical architecture of a cluster in the distributed storage system and predefined routing rules; building a consistency strategy based on the information about the physical architecture of a cluster in the distributed storage system and the predefined routing rules to achieve mapping of the object to the distributed storage node; The acquiring of the localization location information of the virtual disk in the virtual machine to determine the localization node of the virtual disk includes: Obtain virtual machine creation location information provided by the virtualization platform; Using the virtual machine creation location information as the localized location information of the virtual disk; Wherein, determining the localized location information of the volume corresponding to the virtual disk in the distributed storage system according to the localized location information of the virtual disk includes: Determining a mapping relationship between the virtual disk and the volume according to a request from the virtualization platform to create the virtual disk; The localized location information of the volume corresponding to the virtual disk in the distributed storage system is determined according to the localized location information of the virtual disk and the mapping relationship.

2. The volume localization method according to claim 1, characterized in that: After constructing the consistency metadata information according to the localized location information of the volume, the method further includes: Constructing new consistency metadata information according to the current consistency metadata information and the localized location information of the volume; Determining the distribution strategy of the object according to the consistency metadata information includes: The distribution strategy of the object is determined based on the current consistency metadata information and the new consistency metadata information; wherein, the localization of the object according to the distribution strategy is also used to localize the volume in the designated distributed storage node to achieve backup of the volume.

3. The volume localization method according to claim 2, characterized in that: The constructing of new consistency metadata information according to the current consistency metadata information and the localized location information of the volume includes: Deleting the relevant information of the distributed storage node corresponding to the volume in the current consistency metadata information; The current consistency metadata information after deleting the relevant information is used as the new consistency metadata information.

4. A volume localization device, characterized in that: include: An acquisition module, configured to acquire localization location information of a virtual disk in a virtual machine to determine a localization node of the virtual disk; wherein the localization node of the virtual disk is a distributed storage node corresponding to the virtual disk in a distributed storage system; A first determining module, configured to determine, according to the localized location information of the virtual disk, the localized location information of the volume corresponding to the virtual disk in the distributed storage system; A construction module, configured to construct consistent metadata information according to the localized location information of the volume; A second determining module is used to determine a distribution strategy of the object according to the consistency metadata information; an execution module, configured to implement localization of the object according to the distribution strategy, so that the volume is localized in the corresponding localization node; Wherein, the construction module is used to: record the IP information of each of the distributed storage nodes and the number of virtual nodes; wherein, the number of the virtual nodes corresponds to the number of the virtual machines, and construct a consistent hash ring according to the IP information of each of the distributed storage nodes and the number of the virtual nodes to achieve mapping of the object to the distributed storage node; or, obtain the information of the physical architecture of the cluster in the distributed storage system and predefined routing rules, and construct a consistency strategy according to the information of the physical architecture of the cluster in the distributed storage system and the predefined routing rules to achieve mapping of the object to the distributed storage node; The acquisition module is used to: acquire virtual machine creation location information provided by the virtualization platform; and use the virtual machine creation location information as the localized location information of the virtual disk; Among them, the first determination module is used to: determine the mapping relationship between the virtual disk and the volume according to the request of the virtualization platform to create the virtual disk; determine the local location information of the volume corresponding to the virtual disk in the distributed storage system according to the local location information of the virtual disk and the mapping relationship.

5. A volume localization device, characterized in that: including a memory for storing a computer program; A processor is configured to implement the steps of the volume localization method according to any one of claims 1 to 3 when executing the computer program.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the volume localization method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Full virtualization storage method based on consistency hash algorithm

    CN105068767A

  • Data volume remote import method and device, equipment and medium

    CN114035747A