Storage pool binding mode switching method and device and storage server
By unbinding only the parent storage pool that allows unbinding in the storage server, the business interruption and flexibility problems when switching the storage pool binding mode in the prior art are solved, and the security and efficient switching of resource data are achieved.
Patent Information
- Application Number
- CN202510497991.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-08
AI Technical Summary
In the multi-tenant architecture of storage servers, the prior art requires deleting used resources when switching storage pool binding mode, resulting in business interruption and reduced flexibility, and failing to ensure the security of resource data.
By judging the parent storage pool that is allowed to be unbined, only unbind it, and switch the binding identifier to a custom mode, ensuring that the child storage pool depends on the parent storage pool to automatically unbind, avoiding direct operation of the child storage pool, and realizing switching without resource impact.
Ensure the security of resource data, improve switching flexibility, reduce the computing volume of storage servers, improve switching efficiency, and ensure the security and business continuity of tenant resource data.
Smart Images

Figure CN120448101A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of storage servers, and in particular to a method and device for switching storage pool binding modes, and a storage server. Background Art
[0002] In the multi-tenant architecture of a storage server, to improve resource utilization and reduce costs, multiple tenants share the same physical infrastructure. Different tenants are bound to storage pools, and tenants can only use resources in the storage pool to which they are bound.
[0003] Currently, if a tenant uses resources from a storage pool and wants to switch the storage pool binding mode, they must first delete the used resources before switching. However, deleting the used resources can cause business interruptions and fail to ensure the security of resource data; it also reduces the flexibility of switching. Summary of the Invention
[0004] The present application provides a method, device and storage server for switching storage pool binding mode, so as to at least solve the problem in related technologies that the security of resource data cannot be ensured and the flexibility of switching is reduced.
[0005] This application provides a method for switching a storage pool binding mode, including:
[0006] Receive a storage pool binding mode switching request sent by a tenant; the switching request carries a tenant identifier, and different storage pool binding modes correspond to different binding identifiers;
[0007] If the switching request is to switch from unrestricted mode to custom mode, then multiple parent storage pools corresponding to the tenant identifier are obtained according to the tenant identifier;
[0008] From multiple parent storage pools, obtain the parent storage pool that allows unbinding;
[0009] Unbind the parent storage pool that allows unbinding and switch the binding flag to the binding flag corresponding to the custom mode.
[0010] The present application also provides a device for switching a storage pool binding mode, comprising:
[0011] A receiving module is configured to receive a storage pool binding mode switching request sent by a tenant; wherein the switching request carries a tenant identifier, and different storage pool binding modes correspond to different binding identifiers;
[0012] A first acquisition module is configured to acquire, if the switching request is to switch from an unrestricted mode to a custom mode, a plurality of parent storage pools corresponding to the tenant identifier according to the tenant identifier;
[0013] The second acquisition module is used to acquire a parent storage pool that is allowed to be unbound from multiple parent storage pools;
[0014] The switching module is used to unbind the parent storage pool that is allowed to be unbound and switch the binding identifier to the binding identifier corresponding to the custom mode.
[0015] The present application also provides a storage server, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned methods for switching storage pool binding modes when executing the computer program.
[0016] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the method for switching any of the above-mentioned storage pool binding modes are implemented.
[0017] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned storage pool binding mode switching methods when executed by a processor.
[0018] Through this application, when the switching request is to switch from unrestricted mode to custom mode, it is necessary to determine whether the bound storage pool is allowed to be unbound, and only the storage pool that is allowed to be unbound is unbound, wherein the storage pool that is allowed to be unbound does not contain the tenant-side resources corresponding to the tenant identifier. Since the child storage pool depends on the parent storage pool, the binding operation and the unbinding operation also depend on the parent storage pool. Therefore, it is only necessary to obtain the parent storage pool that is allowed to be unbound. When the parent storage pool is unbound, the corresponding child storage pool will also be unbound. From the multiple parent storage pools bound to the tenant side corresponding to the tenant identifier, the parent storage pool that is allowed to be unbound is unbound. After the unbinding is completed, the switching of the storage pool binding mode can be completed by switching the binding identifier. The entire switching operation only unbinds the storage pool that is allowed to be unbound, and there are no resources in the storage pool that is allowed to be unbound. Therefore, it will not affect the use of existing resources on the tenant side, ensuring the security of resource data and improving the flexibility of switching. In addition, the child storage pools corresponding to each parent storage pool are dependent on the parent storage pool. Therefore, it is only necessary to determine whether the parent storage pool allows unbinding. The parent storage pool that allows unbinding will be unbound, and the child storage pools corresponding to each parent storage pool will also be automatically unbound. There is no need to judge the child storage pool again, which reduces the computing power of the storage server and improves the efficiency of switching the storage pool binding mode. In addition, a judgment is made on whether there are resources in the parent storage pool and the corresponding child storage pool, and it is determined that only the parent storage pool that allows unbinding will be unbound. For parent storage pools or child storage pools whose resources are being used by tenants, no unbinding operation will be performed, thereby further ensuring the security of tenant-side resource data. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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.
[0020] Figure 1 A schematic diagram of the system structure of the storage server provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a flow chart of a method for switching storage pool binding modes provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of the binding relationship between the tenant end and the storage pool provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of a process for obtaining a parent storage pool that allows unbinding provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of the structure of a device for switching storage pool binding modes provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of the structure of the storage server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] 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.
[0027] It should be noted that, in the description of this application, the terms "comprises," "includes," 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. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0028] In a multi-tenant architecture of a storage server, to improve resource utilization and reduce costs, multiple tenants share the same physical infrastructure. Different tenants are bound to storage pools, allowing tenants to use only the resources in the storage pool to which they are bound. Currently, in related technologies, after a tenant has used resources from one storage pool, if they want to switch the storage pool binding mode, they must first delete the used resources before switching. However, deleting used resources can cause business interruptions and make it impossible to ensure the security of resource data; it also reduces the flexibility of switching.
[0029] In order to solve the problems of resource data security and switching flexibility in related technologies, the embodiments of the present application propose the following technical ideas: Considering that when switching the storage pool binding mode in related technologies, it is necessary to delete the used resources before switching. The inventor thought of unbinding only the storage pools that are allowed to be unbound, wherein the storage pools that are allowed to be unbound do not have tenant-side resources corresponding to the tenant identifier. At the same time, the relationship between the parent storage pool and the child storage pool is also considered. Since the child storage pool depends on the parent storage pool, the binding operation and the unbinding operation also depend on the parent storage pool. Therefore, it is only necessary to obtain the parent storage pool that is allowed to be unbinded. When the parent storage pool is unbound, the corresponding child storage pool will also be unbound. Switch the binding identifier to the binding identifier corresponding to the custom mode to complete the switching of the storage pool binding mode. During the switching process, the deletion of resource data in the storage pool is not involved, which ensures the security of the resource data and improves the flexibility of switching.
[0030] 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.
[0031] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the storage pool binding mode switching method depends, the specific application environment architecture or specific hardware architecture is described herein.
[0032] refer to Figure 1 , Figure 1 This is a schematic diagram of the system structure of the storage server provided in the embodiment of the present application. Figure 1 As shown, the storage server includes: a receiving device 101 and a processor 102.
[0033] It is understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the method. In other feasible implementations of the present application, the above architecture may include more or fewer components than shown, or combine or split certain components, or arrange the components differently, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0034] In a specific implementation process, the receiving device 101 may be an input / output interface or a communication interface, and may receive a storage pool binding mode switching request sent by a tenant.
[0035] The processor 102 may switch the storage pool binding mode according to the storage pool binding mode switching request.
[0036] In addition, the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0037] Figure 2 A flow chart of a method for switching the storage pool binding mode provided in an embodiment of the present application is shown as follows: Figure 2 As shown, an embodiment of the present application provides a method for switching a storage pool binding mode, and the method is described in detail as follows:
[0038] S201: Receive a storage pool binding mode switching request sent by a tenant. The switching request carries a tenant identifier, and different storage pool binding modes correspond to different binding identifiers.
[0039] In this embodiment, the binding relationship between tenants and storage pools is a many-to-many relationship, which means that one tenant can be associated with multiple storage pools, and one storage pool can also be associated with multiple tenants. Figure 3 This is a schematic diagram of the binding relationship between the tenant end and the storage pool provided in the embodiment of this application. Figure 3 As shown, tenant end 1 is bound to storage pool 1, storage pool 2, and storage pool 3 respectively, and tenant end 1 can access the resources in storage pool 1, storage pool 2, and storage pool 3; tenant end 2 is bound to storage pool 1, storage pool 2, and storage pool 3 respectively, and tenant end 2 can access the resources in storage pool 1, storage pool 2, and storage pool 3; tenant end 3 is bound to storage pool 1, storage pool 2, and storage pool 3 respectively, and tenant end 3 can access the resources in storage pool 1, storage pool 2, and storage pool 3.
[0040] In this embodiment, storage pool binding modes include unrestricted mode and custom mode. When in unrestricted mode, a tenant has access to all storage pools; when in custom mode, the tenant's access rights are limited to the storage pools to which it is bound. In other words, a tenant can only use the storage pools associated with it. During the specific implementation, a structure called BindPoolList is added to the tenant's implementation to record the binding status of each tenant and the storage pool. This structure contains a key variable called noLimit, which is a Boolean value used to determine the binding mode between the tenant and the storage pool. If the value of noLimit is true, the binding mode between the tenant and the storage pool is unrestricted, and the tenant can use all storage pools. If the value of noLimit is false, the binding mode between the tenant and the storage pool is custom, and the tenant can only use the bound storage pools. In this way, each tenant's access rights to the storage pool can be clearly managed. The value of noLimit can be used to quickly determine which binding mode the tenant is in, thereby determining which storage pools the tenant can access.
[0041] In this embodiment, the tenant implementation also sets a poolId array to store all storage pools. In custom mode, when any tenant binds to a storage pool, the corresponding position in the poolId array is updated to true based on the bound storage pool ID, indicating that the tenant is bound to the storage pool. When the binding mode is unrestricted, the entire poolId array is updated to true.
[0042] S202: If the switching request is to switch from the unrestricted mode to the customized mode, multiple parent storage pools corresponding to the tenant identifier are obtained according to the tenant identifier.
[0043] Specifically, multiple storage pools bound to the tenant identifier are obtained; whether there are child storage pools in the multiple storage pools is determined; if it is determined that there are child storage pools in the multiple storage pools, the child storage pools are filtered to obtain multiple parent storage pools.
[0044] In this embodiment, a traversal check is performed on the information of 1024 storage pools. The 1024 traversals here are a pre-set range because the upper limit of the number of storage pools is 1024. In actual situations, not all storage pools corresponding to the numbers may actually exist. Optionally, the inspection range is set according to the actual situation. During the traversal process, it is necessary to filter out storage pools that meet two conditions. One is the storage pool bound to the tenant end that initiated the switching request for the storage pool binding mode; the other is that the storage pool cannot be a sub-storage pool.
[0045] In this embodiment, the binding of the child storage pool to the tenant end depends on the parent storage pool. Only when the parent storage pool of the child storage pool and the tenant end are bound, the child storage pool will be automatically bound to the tenant end, and the child storage pool cannot be directly bound to the tenant end. This is a strict restriction mechanism to ensure the standardization and consistency of storage resource management. Like the binding rules, the child storage pool cannot be directly unbound from the tenant end. This is also to ensure the orderliness of storage resource management and avoid data confusion or access anomalies caused by arbitrary unbinding. The unbinding of the child storage pool from the tenant end depends on the parent storage pool. Only when the parent storage pool and the tenant end are unbound, the child storage pool will automatically be unbound from the tenant end.
[0046] In this embodiment, if the parent storage pool is first bound to the tenant before creating a child storage pool, the newly created child storage pool will automatically be bound to the tenant, and the tenant can access the resources in the child storage pool. This binding model is designed to facilitate storage resource management, ensure data consistency and security, and avoid permission confusion and data access issues caused by arbitrarily binding or unbinding child pools.
[0047] In this embodiment, subsequent operations typically involve further processing of the storage pool, such as determining whether the storage pool contains resources and whether it can be unbound. If eligible parent storage pools are not pre-screened, subsequent processing will require operations on all 1024 storage pools, including those that do not exist or are child storage pools, resulting in a large amount of inefficient computation. By obtaining multiple parent storage pools corresponding to a tenant ID based on the tenant ID, the computational complexity can be reduced and the efficiency of the entire binding mode switching process can be improved.
[0048] In this embodiment, if the switching request is to switch from the custom mode to the unrestricted mode, the binding identifier is switched to the binding identifier corresponding to the unrestricted mode.
[0049] In this embodiment, switching from custom mode to unrestricted mode does not involve resource judgment. It only requires setting the variable noLimt in the structure BindPoolList to true and updating each position of the poolId array to true.
[0050] S203: Obtain a parent storage pool that is allowed to be unbound from multiple parent storage pools.
[0051] Among them, there is no tenant-side resource corresponding to the tenant identifier in the parent storage pool that is allowed to be unbound.
[0052] In this embodiment, switching from unrestricted mode to custom mode involves resource judgment, as a storage pool already in use by a tenant cannot be arbitrarily unbound. Unbinding an active storage pool can result in data loss or inaccessibility, impacting tenant services. Furthermore, the presence of sub-storage pools in a storage pool also requires consideration, as the binding and unbinding rules for sub-storage pools are relatively complex.
[0053] Optionally, multiple parent storage pools are stored in a 1024-bit poolBind array and then looped through the parent storage pools. Each bit in the poolBind array corresponds to a parent storage pool and is used to mark whether the parent storage pool can be unbound when switching binding modes. "true" indicates that unbinding is possible, and "false" indicates that unbinding is not possible.
[0054] refer to Figure 4 , Figure 4 This is a flow chart of obtaining a parent storage pool that is allowed to be unbound provided in an embodiment of the present application. Specifically, step S203 includes S2031 to S2033:
[0055] S2031: Determine whether there are resources in each parent storage pool.
[0056] S2032: If it is determined that each parent storage pool has resources, determine whether each parent storage pool has a child storage pool.
[0057] In this embodiment, if resources exist in each parent storage pool, it means that the tenant is using the space of the parent storage pool to store data. It is further determined whether the parent storage pool has a child storage pool.
[0058] Specifically, step S2032 includes Sa~Sb:
[0059] Sa: If each parent storage pool is determined to have child storage pools, then each parent storage pool and its corresponding child storage pools are not allowed to be unbound.
[0060] In this embodiment, if each parent storage pool has resources and child storage pools, the parent storage pools are not allowed to be unbound, and the corresponding position of each parent storage pool in the poolBind array is updated to false, indicating that each parent storage pool and the corresponding child storage pool are not allowed to be unbound.
[0061] Sb: If it is determined that each parent storage pool does not have a child storage pool, then it is determined that each parent storage pool is not allowed to be unbound.
[0062] In this embodiment, if each parent storage pool has resources and no child storage pools, the parent storage pools are not allowed to be unbound, and the corresponding position of each parent storage pool in the poolBind array is updated to false, indicating that the parent storage pools are not allowed to be unbound.
[0063] In this embodiment, if resources exist in each parent storage pool, unbinding is not allowed regardless of whether a child storage pool exists.
[0064] S2033: If it is determined that each parent storage pool has no resources, determine whether each parent storage pool has a child storage pool.
[0065] In this embodiment, if there are no resources in each parent storage pool, it means that the tenant side has not stored data in the parent storage pool, and the situation of the child storage pools of each parent storage pool is further determined.
[0066] Specifically, step S2033 includes Sc~Sf:
[0067] Sc: If it is determined that each parent storage pool has a child storage pool, determine whether the child storage pool corresponding to each parent storage pool has resources.
[0068] In this embodiment, if each parent storage pool has a child storage pool, it is necessary to further determine whether there are resources in the child storage pool.
[0069] Sd: If it is determined that the child storage pools corresponding to each parent storage pool have resources, then the parent storage pools are not allowed to be unbound.
[0070] In this embodiment, if there are no resources in each parent storage pool, but there are resources in the corresponding child storage pool, then the parent storage pools are not allowed to be unbound. The corresponding position of each parent storage pool in the poolBind array is updated to false, indicating that these parent storage pools are not allowed to be unbound.
[0071] Se: If it is determined that no resources exist in the child storage pools corresponding to each parent storage pool, then it is determined that each parent storage pool is allowed to be unbound.
[0072] In this embodiment, if there are no resources in each parent storage pool and no resources in the corresponding child storage pool, then each parent storage pool allows unbinding. The corresponding position of each parent storage pool in the poolBind array is updated to true, indicating that these parent storage pools allow unbinding.
[0073] Sf: If it is determined that each parent storage pool does not have a child storage pool, then it is determined that each parent storage pool can be unbound.
[0074] In this embodiment, if there are no resources in each parent storage pool and no child storage pool, each parent storage pool allows unbinding. The corresponding position of each parent storage pool in the poolBind array is updated to true, indicating that these parent storage pools allow unbinding.
[0075] In this embodiment, the poolBind array records whether unbinding is allowed when each parent storage pool switches the binding mode.
[0076] S204: Unbind the parent storage pool that is allowed to be unbound, and switch the binding identifier to the binding identifier corresponding to the custom mode.
[0077] In this embodiment, each position in the poolBind array corresponds to a parent storage pool, and its value is true or false, which is used to indicate whether each parent storage pool allows unbinding. For the parent storage pool with a value of true in the poolBind array, it means that the corresponding parent storage pool allows the unbinding operation, and the corresponding child storage pool also allows the unbinding operation. When the parent storage pool that allows unbinding is unbound, the corresponding child storage pool also completes the unbinding operation. The position corresponding to the poolId array of BindPoolList in the structure is updated to false. And the position corresponding to the poolId array of the corresponding child storage pool in BindPoolList is also updated to false. In the poolId array, the storage pool set to false indicates that the binding relationship with the tenant end is released, that is, the unbinding operation is completed.
[0078] In this embodiment, after all unbinding operations are completed for all allowed storage pools, the variable noLimt in the BindPoolList structure is set from true to false. True indicates that the tenant's binding to the storage pool is in unrestricted mode, while false indicates it is in custom mode. Therefore, setting the variable noLimt to false indicates that the tenant's binding mode with the storage pool has successfully switched from unrestricted mode to custom mode.
[0079] In summary, when the switching request is to switch from unrestricted mode to custom mode, it is necessary to determine whether the bound storage pool is allowed to be unbound, and only the storage pool that is allowed to be unbound is unbound, where the storage pool that is allowed to be unbound does not contain the tenant-side resources corresponding to the tenant identifier. Since the child storage pool depends on the parent storage pool, the binding and unbinding operations also depend on the parent storage pool. Therefore, it is only necessary to obtain the parent storage pool that is allowed to be unbound. When the parent storage pool is unbound, the corresponding child storage pool will also be unbound. From the multiple parent storage pools bound to the tenant side corresponding to the tenant identifier, the parent storage pool that is allowed to be unbound is unbound. After the unbinding is completed, the switching of the storage pool binding mode can be completed by switching the binding identifier. The entire switching operation only unbinds the storage pool that is allowed to be unbound, and there are no resources in the storage pool that is allowed to be unbound. Therefore, it will not affect the use of existing resources on the tenant side, ensuring the security of resource data and improving the flexibility of switching. In addition, the child storage pools corresponding to each parent storage pool are dependent on the parent storage pool. Therefore, it is only necessary to determine whether the parent storage pool allows unbinding. The parent storage pool that allows unbinding will be unbound, and the child storage pools corresponding to each parent storage pool will also be automatically unbound. There is no need to judge the child storage pool again, which reduces the computing power of the storage server and improves the efficiency of switching the storage pool binding mode. In addition, a judgment is made on whether there are resources in the parent storage pool and the corresponding child storage pool, and it is determined that only the parent storage pool that allows unbinding will be unbound. For parent storage pools or child storage pools whose resources are being used by tenants, no unbinding operation will be performed, thereby further ensuring the security of tenant-side resource data.
[0080] Based on the above embodiment, in this embodiment, the process of monitoring the switching of the storage pool binding mode is introduced, which is detailed as follows:
[0081] Real-time data collection related to binding mode switching is performed, and the data is cleaned, converted, and stored. Invalid data is removed, and data in different formats is converted to a format that is easy to analyze and stored in the database. The cleaned and converted data is displayed visually to administrators, providing an intuitive monitoring interface to monitor the switching process of the storage pool binding mode. When abnormal situations are detected, the abnormal information is highlighted on the monitoring interface, allowing administrators to review and handle them in a timely manner.
[0082] Optionally, the switching data includes but is not limited to switching progress data, storage pool operation status data and resource utilization data. Among them, the switching progress data refers to adding marks to each step of the binding mode switching and recording the start time and end time of the operation. By comparing these timestamps, the completion status of each step and the overall switching progress are calculated; the storage pool operation status data refers to the real-time recording of the operation status of each storage pool during the switching process, such as resource judgment, waiting for unbinding and unbinding completion. This can be achieved by adding a status identification field in the storage pool management module and updating the value of this field at different operation stages; resource utilization data refers to obtaining the usage of CPU, memory and disk I / O.
[0083] In this embodiment, real-time analysis of switching data is performed to determine whether the switching process is normal. Thresholds are set for switching progress data, storage pool operation status data, and resource utilization data. When the threshold is exceeded, an alarm is triggered.
[0084] In summary, by real-time monitoring of the storage pool binding mode switching process, we can promptly understand the progress of the storage pool binding mode switching and the operating status during the switching process, so that when problems arise, we can take quick measures to ensure normal operation and the security of tenant-side resource data.
[0085] Based on the above embodiment, in this embodiment, the migration tasks involved in the storage pool binding mode switching process are also processed, as detailed below:
[0086] S301: Traverse the migration tasks and obtain the migration tasks being executed.
[0087] In this embodiment, all migration tasks are traversed and checked one by one. A migration task is an operation that moves data from one storage pool to another. It may be initiated for reasons such as storage resource optimization or storage pool maintenance. During the traversal process, the migration task currently in progress is obtained when the storage pool binding mode is switched.
[0088] S302: Determine whether there is a migration task related to the tenant identifier among the migration tasks being executed.
[0089] In this embodiment, it is determined whether there is a migration task related to the tenant identifier. If so, it means that the data in the storage pool bound to the tenant identifier is changing, and unbinding is not allowed at this time; if not, it means that the data in the storage pool bound to the tenant identifier has not changed, and unbinding is allowed at this time.
[0090] S303: If it is determined that there is a migration task related to the tenant identifier among the migration tasks being executed, a parent storage pool corresponding to the related migration task is obtained.
[0091] In this embodiment, if it exists, the parent storage pool involved and the corresponding child storage pool need to be protected, and unbinding is not allowed.
[0092] S304: Determine whether the parent storage pool corresponding to the relevant migration task has a child storage pool.
[0093] S305: If it is determined that a child storage pool exists, the parent storage pool corresponding to the relevant migration task and the corresponding child storage pool are both determined to be not allowed to be unbound.
[0094] In this embodiment, the parent storage pool corresponding to the migration task associated with the tenant ID is updated to false in the poolBind array. This means that this parent storage pool cannot be unbound during the current mode switch. Unbinding this parent storage pool during data migration may cause migration task failure, data loss, or other abnormal situations.
[0095] In this embodiment, if a child storage pool exists, since the child storage pool depends on the parent storage pool, the child storage pool cannot be unbound when the migration task of the parent storage pool is not completed, to ensure the consistency and integrity of data migration.
[0096] In summary, during the storage pool binding mode switch, the parent storage pool and its corresponding child storage pools associated with the currently executing migration task, which are associated with the tenant ID, are not allowed to be unbound. This prevents migration failures, data loss, or other anomalies caused by unbinding. This ensures that ongoing migration tasks are not affected when switching the storage pool binding mode, thereby ensuring the security of tenant-side resource data.
[0097] Based on the above embodiment, in this embodiment, the binding and access between the tenant end and the storage pool are introduced, as detailed below:
[0098] S401: Establish binding relationships between different tenant identifiers and multiple storage pools, and determine a storage pool binding mode between each tenant identifier and the multiple storage pools.
[0099] Optionally, first create a tenant on the storage server. Each tenant has tenant IDs, permissions, and other related information. This information is obtained and recorded. A storage pool is created. A storage pool is a logical storage unit composed of multiple physical storage devices. Bindings are established between different tenant IDs and storage pools, creating a many-to-many binding relationship between tenants and storage pools.
[0100] In this embodiment, when different tenant identifiers establish binding relationships with multiple storage pools, it is necessary to determine the binding mode between each tenant identifier and the multiple storage pools. The storage pool binding modes include unrestricted mode and custom mode.
[0101] S402: Allocate storage volumes to tenant terminals corresponding to different tenant identifiers.
[0102] In this embodiment, different tenant IDs can be bound to the same storage pool. To achieve physical isolation of data in the storage pool for different tenant IDs, storage volumes are allocated to different tenant IDs in the storage pool. A storage volume is a logical storage unit divided from the storage pool.
[0103] In this embodiment, when different tenant identifiers establish binding relationships with multiple storage pools, sub-binding relationships between different tenant identifiers and storage volumes in each storage pool are recorded, and the binding relationships are saved in a database.
[0104] S403: When tenants corresponding to different tenant identifiers initiate access requests, the access requests of the tenants are verified according to the binding relationship.
[0105] S404: If the verification is successful, access to the corresponding storage volume is allowed.
[0106] In this embodiment, when a tenant initiates an access request, the tenant's identity is verified based on the binding relationship stored in the database. Only tenants that pass the authentication are allowed to access the corresponding storage volume.
[0107] In summary, by allocating storage volumes to different tenants within a storage pool bound to different tenant identities, we achieve physical isolation of tenant storage data. Furthermore, only authenticated tenants can access their corresponding storage volumes, ensuring data security.
[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0109] Figure 5 This is a schematic diagram of the structure of the switching device for the storage pool binding mode provided in the embodiment of the present application. Figure 5 As shown, an embodiment of the present application further provides a storage pool binding mode switching device, including: a receiving module 501 , a first obtaining module 502 , a second obtaining module 503 and a switching module 504 .
[0110] Receiving module 501, configured to receive a storage pool binding mode switching request sent by a tenant; wherein the switching request carries a tenant identifier, and different storage pool binding modes correspond to different binding identifiers;
[0111] A first acquisition module 502 is configured to acquire, based on the tenant identifier, a plurality of parent storage pools corresponding to the tenant identifier if the switching request is to switch from the unrestricted mode to the custom mode;
[0112] The second acquisition module 503 is used to acquire a parent storage pool that is allowed to be unbound from multiple parent storage pools;
[0113] The switching module 504 is configured to unbind the parent storage pool that is allowed to be unbound, and switch the binding identifier to a binding identifier corresponding to the custom mode.
[0114] In a possible implementation, the first acquisition module 502 includes:
[0115] A first acquiring unit is configured to acquire multiple storage pools bound to a tenant identifier;
[0116] a first determining unit, configured to determine whether a sub-storage pool exists in the plurality of storage pools;
[0117] The first determining unit is configured to filter the child storage pools to obtain multiple parent storage pools if it is determined that there are child storage pools among the multiple storage pools.
[0118] In a possible implementation, the second acquisition module 503 includes:
[0119] The second judgment unit is used to judge whether there are resources in each parent storage pool;
[0120] a third judgment unit, configured to judge whether each parent storage pool has a child storage pool if it is determined that each parent storage pool has resources;
[0121] The second determination unit is configured to, if it is determined that each parent storage pool has a child storage pool, determine that each parent storage pool and its corresponding child storage pool are not allowed to be unbound;
[0122] a third determination unit, configured to determine that each parent storage pool is not allowed to be unbound if it is determined that each parent storage pool does not have a child storage pool;
[0123] a fourth determination unit, configured to determine whether each parent storage pool has a child storage pool if it is determined that each parent storage pool has no resources;
[0124] a fifth determining unit, configured to determine whether resources exist in the child storage pools corresponding to the parent storage pools if it is determined that the parent storage pools have child storage pools;
[0125] a fourth determining unit, configured to determine that unbinding of each parent storage pool is not allowed if it is determined that the child storage pool corresponding to each parent storage pool has resources;
[0126] a fifth determining unit, configured to determine that each parent storage pool is allowed to be unbound if it is determined that the child storage pool corresponding to each parent storage pool does not have resources;
[0127] The sixth determination unit is configured to determine that each parent storage pool is allowed to be unbound if it is determined that each parent storage pool does not have a child storage pool.
[0128] In a possible implementation, the storage pool binding mode switching device further includes a traversal module. The traversal module includes:
[0129] The second acquisition unit is used to traverse the migration tasks and acquire the migration tasks being executed;
[0130] a sixth determining unit, configured to determine whether there is a migration task related to the tenant identifier among the migration tasks being executed;
[0131] A third acquiring unit is configured to acquire a parent storage pool corresponding to the migration task if it is determined that a migration task related to the tenant identifier exists among the migration tasks being executed;
[0132] A seventh determination unit is configured to determine whether a parent storage pool corresponding to a related migration task has a child storage pool;
[0133] The seventh determination unit is configured to, if it is determined that a child storage pool exists, determine that the parent storage pool corresponding to the relevant migration task and the corresponding child storage pool are both not allowed to be unbound.
[0134] In a possible implementation, the storage pool binding mode switching device further includes a judgment module configured to switch the binding identifier to a binding identifier corresponding to the unrestricted mode if the switching request is to switch from the custom mode to the unrestricted mode.
[0135] In a possible implementation, the storage pool binding mode switching device further includes a binding module configured to establish binding relationships between different tenant identifiers and multiple storage pools and determine a storage pool binding mode between each tenant identifier and the multiple storage pools.
[0136] In a possible implementation, the storage pool binding mode switching device further includes a verification module. The verification module includes:
[0137] An allocation unit, configured to allocate storage volumes to tenant terminals corresponding to different tenant identifiers;
[0138] A verification unit, configured to verify the access request of a tenant terminal according to the binding relationship when a tenant terminal corresponding to a different tenant identifier initiates an access request;
[0139] The access unit is used to allow access to the corresponding storage volume if the verification is successful.
[0140] For descriptions of features in the embodiment corresponding to the storage pool binding mode switching device, please refer to the relevant descriptions of the embodiment corresponding to the storage pool binding mode switching method, which will not be repeated here.
[0141] Figure 6 This is a schematic diagram of the structure of the storage server provided in the embodiment of the present application. Figure 6 As shown, the storage server provided in this embodiment includes: at least one processor 601 and a memory 602. Optionally, the storage server also includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected via a bus.
[0142] During the specific implementation process, at least one processor 601 executes the computer-executable instructions stored in the memory 602 , so that the at least one processor 601 executes the above-mentioned storage pool binding mode switching method embodiment.
[0143] The specific implementation process of the processor 601 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0144] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0145] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0146] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0147] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned storage pool binding mode switching method embodiments when running.
[0148] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0149] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above-mentioned storage pool binding mode switching method embodiments are implemented.
[0150] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned storage pool binding mode switching method embodiments.
[0151] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0152] The above is a detailed introduction to the storage pool binding mode switching method, device and storage server provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present 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 the present application.
Claims
1. A method for switching a storage pool binding mode, characterized in that: include: Receive the storage pool binding mode switching request sent by the tenant; The switching request carries a tenant identifier, and different storage pool binding modes correspond to different binding identifiers; If the switching request is to switch from an unrestricted mode to a custom mode, obtaining, according to the tenant identifier, a plurality of parent storage pools corresponding to the tenant identifier; Obtaining a parent storage pool that is allowed to be unbound from the multiple parent storage pools; The parent storage pool that is allowed to be unbound is unbound, and the binding identifier is switched to the binding identifier corresponding to the custom mode.
2. The method according to claim 1, characterized in that The acquiring, according to the tenant identifier, a plurality of parent storage pools corresponding to the tenant identifier includes: Obtain multiple storage pools bound to the tenant identifier; Determining whether there is a sub-storage pool in the multiple storage pools; If it is determined that there are child storage pools in the multiple storage pools, the child storage pools are filtered to obtain multiple parent storage pools.
3. The method according to claim 1, characterized in that The obtaining, from the plurality of parent storage pools, a parent storage pool that is allowed to be unbound includes: Determine whether resources exist in each parent storage pool; If it is determined that each parent storage pool has resources, then determining whether each parent storage pool has a child storage pool; If it is determined that each parent storage pool has a child storage pool, then it is determined that each parent storage pool and the child storage pools corresponding to each parent storage pool are not allowed to be unbound; If it is determined that each parent storage pool does not have a child storage pool, then it is determined that each parent storage pool is not allowed to be unbound; If it is determined that each parent storage pool has no resources, determining whether each parent storage pool has a child storage pool; If it is determined that each parent storage pool has a child storage pool, determining whether the child storage pool corresponding to each parent storage pool has resources; If it is determined that the child storage pools corresponding to the parent storage pools have resources, then it is determined that the parent storage pools are not allowed to be unbound; If it is determined that the child storage pools corresponding to the parent storage pools do not have resources, then it is determined that the parent storage pools are allowed to be unbound; If it is determined that each parent storage pool does not have a child storage pool, then it is determined that each parent storage pool is allowed to be unbound.
4. The method according to claim 3, characterized in that Also includes: Traverse the migration tasks and obtain the migration tasks being executed; Determining whether there is a migration task related to the tenant identifier among the migration tasks being executed; If it is determined that there is a migration task related to the tenant identifier among the migration tasks being executed, obtaining a parent storage pool corresponding to the related migration task; Determine whether a parent storage pool corresponding to the relevant migration task has a child storage pool; If it is determined that a child storage pool exists, the parent storage pool corresponding to the relevant migration task and the corresponding child storage pool are both determined to not be allowed to be unbound.
5. The method according to claim 1, characterized in that After receiving the storage pool binding mode switching request sent by the tenant, the method further includes: If the switching request is to switch from the custom mode to the unrestricted mode, the binding identifier is switched to a binding identifier corresponding to the unrestricted mode.
6. The method according to any one of claims 1 to 5, characterized in that Before receiving the storage pool binding mode switching request sent by the tenant, the method further includes: Binding relationships are established between different tenant identifiers and multiple storage pools, and a storage pool binding mode is determined between each tenant identifier and the multiple storage pools.
7. The method according to claim 6, characterized in that Also includes: Allocating storage volumes to tenant terminals corresponding to the different tenant identifiers; When a tenant terminal corresponding to the different tenant identifier initiates an access request, verifying the access request of the tenant terminal according to the binding relationship; If the verification is successful, access to the corresponding storage volume is allowed.
8. A device for switching a storage pool binding mode, characterized in that: include: A receiving module is used to receive a storage pool binding mode switching request sent by a tenant; The switching request carries a tenant identifier, and different storage pool binding modes correspond to different binding identifiers; A first acquisition module is configured to acquire, according to the tenant identifier, a plurality of parent storage pools corresponding to the tenant identifier if the switching request is to switch from the unrestricted mode to the custom mode; A second acquisition module is configured to acquire a parent storage pool that is allowed to be unbound from the multiple parent storage pools; The switching module is used to unbind the parent storage pool that is allowed to unbind, and switch the binding identifier to the binding identifier corresponding to the custom mode.
9. A storage server, characterized in that: include: memory for storing computer programs; A processor is configured to implement the steps of the method for switching the storage pool binding mode according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method for switching the storage pool binding mode according to any one of claims 1 to 7 are implemented.