Thick provisioned volume expansion method, device, equipment, and storage medium
By monitoring and updating the occupied state of the thick-provisioned volume expansion space, the false occupation is realized and formatted is solved, and the problem of the expansion of the thick-provisioned volume affecting data writing is improved.
Patent Information
- Application Number
- CN202210612253.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-05-31
AI Technical Summary
In the prior art, the thick-provisioned volume expansion requires stopping the write request for formatting operations, which affects the data writing efficiency and takes a long time.
By monitoring whether the thick-provisioned volume has obtained the expansion space, the occupation status of the expansion space is updated to achieve false occupation, and then format it according to the received formatting request to ensure the real occupation of the expansion space.
When the formatting operation of the expansion space is not completed, the write request is allowed to continue to avoid affecting data writing and improve the expansion efficiency.
Smart Images

Figure CN114995762B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of block storage expansion, and in particular to a thick provisioned volume expansion method, apparatus, device, and storage medium. Background Art
[0002] Currently, distributed network storage systems store data in a dispersed manner across multiple independent devices. Traditional network storage systems use centralized storage servers to store all data. The storage servers become a bottleneck in system performance and a focus of reliability and security, and cannot meet the needs of large-scale storage applications. However, distributed network storage systems use a scalable system structure and utilize multiple storage servers to share the storage load, which not only improves the system's reliability, availability, and access efficiency, but also makes it easy to expand.
[0003] Block storage is suitable for data storage in most business scenarios. Users can format and create any file system to use block storage, just like physical hard drives. Therefore, block storage is becoming increasingly popular. In block storage scenarios, raw disk space is primarily mapped to the host for storage services, while volumes are primarily responsible for functional implementation and service delivery. Block storage is categorized into thin volumes and thick provisioned volumes. Thin volumes are initially created with zero space. Space is consumed only when I / O is written. Regardless of the allocated volume size, the actual storage size is the currently used size, saving storage space. However, when using a thin volume, the pre-allocated space may far exceed the total space of the storage cluster. As user data is written, the cluster may run out of space, making the thin volume unusable. Therefore, it is generally necessary to specify a maximum size for disk file growth and check whether this limit is exceeded when growth is required. Thick provisioned volumes are initially created with full space, with the used capacity and allocated capacity identical upon creation. When the volume's written data reaches its original capacity, we need to expand it. That is, when the volume capacity is insufficient, the distributed block storage system provides a capacity expansion method, adding new space based on the original volume capacity for continued use. Among them, the expanded space of the thin volume is the same as before, still reserved space, and not actually occupied. When a thick provisioned volume needs to be expanded, its expanded space still needs to be actually occupied to ensure that its allocated space is consistent with the actual occupied space. However, the method of expanding the space occupation of thick provisioned volumes requires stopping other write requests, judging whether the object data exists, and then writing zero data formatting operations on the expanded space. This method not only affects data writing, but also consumes a long time. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and storage medium for expanding thick provisioned volumes, which can save expansion time and thus improve expansion efficiency. The specific solution is as follows:
[0005] In a first aspect, the present application discloses a method for expanding a thick provisioned volume, comprising:
[0006] Monitor whether the thick provisioned volume has obtained the allocated expansion space;
[0007] If it is detected that the thick provisioned volume has obtained the allocated expansion space, updating the occupancy status of the expansion space of the thick provisioned volume;
[0008] After the update of the occupation status of the expanded space is completed, prompt information indicating that the expansion of the thick provisioned volume space is successful is generated, and the expanded space is formatted according to the received formatting request.
[0009] Optionally, before monitoring whether the thick provisioned volume obtains the allocated expansion space, the process further includes:
[0010] Determine the available capacity of the storage pool to obtain the available capacity of the storage pool;
[0011] Comparing the available capacity of the storage pool with the predetermined capacity of the space to be expanded to obtain a corresponding comparison result;
[0012] Based on the comparison result, it is determined whether the expansion operation based on the capacity of the space to be expanded meets a preset expansion condition.
[0013] Optionally, determining the available capacity corresponding to the storage pool to obtain the available capacity of the storage pool includes:
[0014] It is determined whether the current volume is a thick provisioned volume. If the current volume is the thick provisioned volume, the available capacity corresponding to the storage pool is determined to obtain the available capacity of the storage pool.
[0015] Optionally, the determining, based on the comparison result, whether the expansion operation based on the capacity of the space to be expanded meets a preset expansion condition includes:
[0016] If the comparison result is that the capacity of the expansion space is greater than the available capacity of the storage pool, it is determined that the expansion operation based on the capacity of the space to be expanded does not meet the preset expansion condition, and a prompt message indicating that the available capacity of the storage pool is insufficient is generated;
[0017] If the comparison result is that the capacity of the expanded space is not greater than the available capacity of the storage pool, it is determined that the expansion operation based on the capacity of the space to be expanded meets the preset expansion condition, and prompt information that the available capacity of the storage pool is sufficient is generated.
[0018] Optionally, determining whether the current volume is a thick provisioned volume includes:
[0019] Obtain metadata information of the current volume, and determine whether the current volume is a thick provisioned volume based on the metadata information.
[0020] Optionally, updating the occupancy status of the expanded space of the thick provisioned volume includes:
[0021] The object_map corresponding to the expanded space of the thick provisioned volume is updated to the OBJECT_EXISTS state.
[0022] Optionally, formatting the expansion space according to the received formatting request includes:
[0023] A write-zero data formatting operation is performed on the expanded space according to the received write-zero data request.
[0024] In a second aspect, the present application discloses a thick provisioned volume expansion device, comprising:
[0025] The monitoring module is used to monitor whether the thick provisioned volume has obtained the allocated expansion space;
[0026] a status update module, configured to update the occupancy status of the expansion space of the thick provisioned volume when detecting that the thick provisioned volume has acquired the allocated expansion space;
[0027] The formatting module is configured to generate prompt information indicating that the expansion of the thick provisioned volume is successful after completing the update of the occupation status of the expansion space, and format the expansion space according to the received formatting request.
[0028] In a third aspect, the present application discloses an electronic device, comprising:
[0029] Memory, used to store computer programs;
[0030] The processor is configured to execute the computer program to implement the steps of the aforementioned method for expanding thick provisioned volumes.
[0031] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed method for expanding thick provisioned volumes are implemented.
[0032] It can be seen that the present application provides a method for expanding a thick provisioned volume, including: monitoring whether the thick provisioned volume obtains the allocated expansion space; if it is monitored that the thick provisioned volume has obtained the allocated expansion space, then updating the occupancy status of the expansion space of the thick provisioned volume; after completing the update of the occupancy status of the expansion space, generating a prompt message that the expansion space of the thick provisioned volume has been successfully expanded, and formatting the expansion space according to the received formatting request. It can be seen that when the present application monitors that the thick provisioned volume obtains the allocated expansion space, then the occupancy status of the expansion space of the thick provisioned volume is updated to achieve false occupancy of the expansion space, and then the expansion space is formatted according to the received formatting request to achieve real occupancy of the expansion space. Since the false occupancy of the expansion space has been completed before the expansion space is formatted to achieve real occupancy of the expansion space, when the formatting operation of the expansion space is not completed and other write requests are received, there is no need to stop other write requests, thereby avoiding affecting the writing of data and improving the efficiency of expansion. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0034] Figure 1 This is a flow chart of a thick provisioned volume expansion method disclosed in this application;
[0035] Figure 2 This is a flowchart of a specific thick provisioning volume expansion method disclosed in this application;
[0036] Figure 3 This is a flowchart of a specific thick provisioning volume expansion method disclosed in this application;
[0037] Figure 4 This is a flowchart of a specific thick provisioning volume expansion method disclosed in this application;
[0038] Figure 5 This is a flowchart of a specific thick provisioning volume expansion method disclosed in this application;
[0039] Figure 6 This is a schematic diagram of the structure of a thick provisioned volume expansion device disclosed in this application;
[0040] Figure 7 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0042] Currently, when expanding a thick-provisioned volume, the expanded space still needs to be actually occupied to ensure that the allocated space is consistent with the actual occupied space. However, the method for expanding the space occupied by a thick-provisioned volume requires stopping other write requests, determining whether the object data exists, and then writing zero data to the expanded space for formatting. This method not only affects data writing but also takes a long time. To this end, this application provides a thick-provisioned volume expansion solution that can save expansion time and thus improve expansion efficiency.
[0043] The embodiment of the present invention discloses a method for expanding the capacity of a thick provisioned volume. Figure 1 As shown, the method includes:
[0044] Step S11: monitoring whether the thick provisioned volume obtains the allocated expansion space.
[0045] It should be pointed out that when the write data of the thick provisioned volume reaches the original capacity of the thick provisioned volume, the thick provisioned volume needs to be expanded, that is, the corresponding expansion space is allocated for the thick provision. It is understandable that the distributed block storage system provides an expansion method when the volume capacity is insufficient. New space is added on the basis of the original capacity of the volume so that data can continue to be written to the volume. Therefore, when the original capacity of the thick provisioned volume is insufficient, new storage space is allocated to the thick provisioned volume on the basis of the original capacity of the thick provisioned volume. However, since the thick provisioned volume is a bare disk that is initially full of space, the used capacity and the allocated capacity are exactly the same when it is created. Therefore, when allocating expansion space for the thick provisioned volume, the expansion space needs to be occupied.
[0046] In this embodiment, whether the thick provisioned volume obtains the allocated expansion space is monitored. If it is monitored that the thick provisioned volume does not obtain the allocated expansion space, it indicates that an exception has occurred in the operation of allocating expansion space for the thick provision. Based on the actual abnormal situation, the expansion space is re-allocated to the thick provision. If it is monitored that the thick provisioned volume has obtained the allocated expansion space, the corresponding operation is performed to ensure that the expansion space allocated to the thick provisioned volume is consistent with the actual occupied space, thereby completing the operation of allocating expansion space for the thick provisioned volume.
[0047] Step S12: If it is detected that the thick provisioned volume has obtained the allocated expansion space, the occupancy status of the expansion space of the thick provisioned volume is updated.
[0048] In this embodiment, when monitoring whether the thick provisioned volume has obtained the allocated expansion space, if it is monitored that the thick provisioned volume has obtained the allocated expansion space, the occupancy status corresponding to the expansion space of the thick provisioned volume is updated. It can be understood that in order to ensure that the expansion space allocated to the thick provisioned volume is consistent with the actual occupied space, it is necessary to perform false occupation processing on the expansion space of the thick provisioned volume, that is, by updating the occupancy status of the storage space of the thick provisioned volume, the expansion space allocated to the thick provisioned volume is guaranteed to be consistent with the actual occupied space, so that when writing data to the expansion space for space allocation query, the occupancy status of the expansion space is displayed as occupied, but in fact, the expansion space is not actually occupied, and the false occupation of the expansion space is achieved by updating the occupancy status of the expansion space of the thick provisioned volume to occupied. If it is monitored that the thick provisioning fails to obtain the allocated expansion space, the system returns to detect an exception in the process of allocating expansion space for the thick provisioning volume, and then determines whether to reallocate expansion space for the thick provisioning volume based on the exception. If expansion space is reallocated for the thick provisioning volume, the system re-monitors whether the thick provisioning volume obtains the allocated expansion space.
[0049] Step S13: After the update of the occupation status of the expanded space is completed, a prompt message indicating that the expansion of the thick provisioned volume space is successful is generated, and the expanded space is formatted according to the received formatting request.
[0050] In this embodiment, after the update of the occupancy status of the expanded space is completed, indicating that false occupation of the expanded space has been achieved, a prompt message is generated indicating that the thick provisioned volume has successfully expanded the space, and the expanded space is formatted according to the received formatting request, thereby achieving true occupation of the expanded space. It is understandable that since the update of the occupancy status of the expanded space has been completed and false occupation of the expanded space has been achieved before the expanded space is formatted and true occupation of the expanded space is achieved, other write requests do not need to be stopped when the expanded space is formatted according to the received formatting request, and the write request and formatting request can be merged. That is, the thick provisioned volume can also write data to the expanded space while formatting the expanded space.
[0051] It can be seen that when the embodiment of the present application monitors that the thick provisioned volume obtains the allocated expansion space, it updates the occupancy status of the expansion space of the thick provisioned volume to realize the false occupation of the expansion space, and then formats the expansion space according to the received formatting request to realize the real occupation of the expansion space. Since the false occupation of the expansion space has been completed before the expansion space is formatted to realize the real occupation of the expansion space, when the formatting operation of the expansion space is not completed and other write requests are received, there is no need to stop other write requests, thereby avoiding affecting the writing of data and improving the efficiency of expansion.
[0052] See also Figure 2 As shown, the embodiment of the present invention discloses a specific method for expanding thick provisioned volumes. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.
[0053] Step S21: Determine the available capacity corresponding to the storage pool to obtain the available capacity of the storage pool.
[0054] In this embodiment, since block storage provides two types of volumes, namely thin volumes and thick provisioned volumes, and the expansion methods of the thin volumes and the thick provisioned volumes are different, the expansion space of the thin volumes is considered to be reserved space and is not actually occupied. In other words, for thin volumes, no matter how much expansion space is allocated to the thin volumes, the actual occupied storage size of the thin volumes is the currently used size, that is, the amount used is the same as the amount used, thereby saving storage space. For thick provisioned volumes, it is a bare disk that is filled with space when it is initially created, and the used capacity and allocated capacity are exactly the same when they are created. Therefore, when expanding a volume, it is necessary to determine whether the current volume is a thick provisioned volume, and then perform the subsequent steps to expand the thick provisioned volume.
[0055] In this embodiment, the determination of the available capacity size corresponding to the storage pool and obtaining the available capacity of the storage pool may include: determining whether the current volume is a thick provisioned volume; if the current volume is the thick provisioned volume, determining the available capacity size corresponding to the storage pool and obtaining the available capacity of the storage pool. It is understandable that if the current volume is a thick provisioned volume, the subsequent steps of expanding the capacity of the thick provisioned volume are started, i.e., determining the available capacity size corresponding to the storage pool and obtaining the available capacity of the storage pool; if the current volume is not a thick provisioned volume, there is no need to perform the steps of determining the available capacity size corresponding to the storage pool and obtaining the available capacity of the storage pool, and the expansion operation of the current volume is ended. That is, the volume expansion of the present application is mainly aimed at thick provisioned volumes, not thin volumes. Among them, the determination of whether the current volume is a thick provisioned volume may include: obtaining metadata information of the current volume, and determining whether the current volume is a thick provisioned volume based on the metadata information. That is, by obtaining metadata information of the current volume and then analyzing the metadata information, it is possible to determine whether the current volume is a thick provisioned volume.
[0056] It should be noted that when allocating expansion space for thick provisioned volumes, the corresponding storage space is divided from the storage pool as the expansion space. Therefore, before allocating expansion space for the thick provisioned volumes, it is necessary to determine the available capacity size corresponding to the storage pool and obtain the available capacity of the storage pool to determine whether the available capacity of the storage pool meets the capacity required for expansion.
[0057] Step S22: Compare the available capacity of the storage pool with the predetermined capacity of the space to be expanded to obtain a corresponding comparison result.
[0058] In this embodiment, after determining that the current volume is a thick provisioned volume and determining the available capacity of the storage pool corresponding to the current storage pool, the available capacity of the storage pool is compared with the predetermined capacity of the space to be expanded, thereby obtaining a corresponding comparison result.
[0059] Step S23: judging whether the expansion operation based on the capacity of the space to be expanded meets a preset expansion condition based on the comparison result.
[0060] It is understood that if the comparison result is that the capacity of the expansion space is greater than the available capacity of the storage pool, then the expansion operation based on the capacity of the space to be expanded is determined to not meet the preset expansion conditions, and a prompt message indicating that the available capacity of the storage pool is insufficient is generated. In other words, if the capacity of the expansion space is greater than the available capacity of the storage pool, then the available capacity of the storage pool does not meet the capacity required for thick provisioned volume expansion. In other words, the expansion operation based on the capacity of the expansion space is determined to not meet the preset expansion conditions, and then a prompt message indicating that the available capacity of the storage pool is insufficient is generated, thereby prohibiting the expansion of the thick provisioned volume. If the comparison result is that the capacity of the expansion space is not greater than the available capacity of the storage pool, then the available capacity of the storage pool meets the capacity required for thick provisioned volume expansion. In other words, the expansion operation based on the capacity of the space to be expanded is determined to meet the preset expansion conditions, and a prompt message indicating that the available capacity of the storage pool is sufficient is generated, allowing the allocation of storage space of a corresponding size from the available capacity of the storage pool to the thick provisioned volume, that is, allocating expansion space of a corresponding size to the thick provisioned volume.
[0061] Step S24: monitoring whether the thick provisioned volume obtains the allocated expansion space.
[0062] Step S25: If it is detected that the thick provisioned volume has obtained the allocated expansion space, the occupancy status of the expansion space of the thick provisioned volume is updated.
[0063] Step S26: After the update of the occupation status of the expanded space is completed, a prompt message indicating that the expansion of the thick provisioned volume space is successful is generated, and the expanded space is formatted according to the received formatting request.
[0064] For the specific contents of the above steps S24 to S26, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.
[0065] It can be seen that when the embodiment of the present application monitors that the thick provisioned volume obtains the allocated expansion space, it updates the occupancy status of the expansion space of the thick provisioned volume to realize the false occupation of the expansion space, and then formats the expansion space according to the received formatting request to realize the real occupation of the expansion space. Since the false occupation of the expansion space has been completed before the expansion space is formatted to realize the real occupation of the expansion space, when the formatting operation of the expansion space is not completed and other write requests are received, there is no need to stop other write requests, thereby avoiding affecting the writing of data and improving the efficiency of expansion.
[0066] See also Figure 3 As shown, the embodiment of the present invention discloses a specific method for expanding thick provisioned volumes. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.
[0067] Step S31: monitoring whether the thick provisioned volume obtains the allocated expansion space.
[0068] Step S32: If it is detected that the thick provisioned volume has obtained the allocated expansion space, the object_map corresponding to the expansion space of the thick provisioned volume is updated to the OBJECT_EXISTS state.
[0069] In this embodiment, when monitoring whether the thick provisioned volume has obtained the allocated expansion space, if it is monitored that the thick provisioned volume has obtained the allocated expansion space, the object_map corresponding to the expansion space of the thick provisioned volume is updated to the OBJECT_EXISTS state (i.e., object existence data). It can be understood that in order to ensure that the expansion space allocated to the thick provisioned volume is consistent with the actual occupied space, the expansion space of the thick provisioned volume needs to be processed, that is, by updating the object_map corresponding to the expansion space of the thick provisioned volume to the OBJECT_EXISTS state to ensure that the expansion space allocated to the thick provisioned volume is consistent with the actual occupied space, so that when writing data to the expansion space for space allocation query, the occupancy status of the expansion space is displayed as occupied, but in fact, the expansion space is not actually occupied, and the occupancy status of the expansion space of the thick provisioned volume is only updated to occupied, thereby achieving false occupation of the expansion space. If it is monitored that the thick provisioning fails to obtain the allocated expansion space, the system returns to detect an exception in the process of allocating expansion space for the thick provisioning volume, and then determines whether to reallocate expansion space for the thick provisioning volume based on the exception. If expansion space is reallocated for the thick provisioning volume, the system re-monitors whether the thick provisioning volume obtains the allocated expansion space.
[0070] Step S33: After the object_map corresponding to the expanded space of the thick provisioned volume is updated to the OBJECT_EXISTS state, a prompt message indicating that the expansion of the thick provisioned volume is successful is generated, and the expanded space is formatted according to the received formatting request.
[0071] In this embodiment, when the object_map corresponding to the expanded space of the thick provisioned volume is updated to the OBJECT_EXISTS state, it indicates that false occupation of the expanded space is achieved, and a prompt message indicating that the thick provisioned volume expansion space is successful is generated, and the expanded space is formatted according to the received formatting request, thereby achieving real occupation of the expanded space.
[0072] For the specific content of the above step S31, reference may be made to the corresponding content disclosed in the above embodiments, which will not be repeated here.
[0073] It can be seen that when the embodiment of the present application monitors that the thick provisioned volume obtains the allocated expansion space, the object_map corresponding to the expansion space of the thick provisioned volume is updated to the OBJECT_EXISTS state, thereby realizing the false occupation of the expansion space, and then the expansion space is formatted according to the received formatting request, thereby realizing the real occupation of the expansion space. Since the false occupation of the expansion space has been completed before the expansion space is formatted to realize the real occupation of the expansion space, when the formatting operation of the expansion space is not completed and other write requests are received, there is no need to stop other write requests, thereby avoiding affecting the writing of data and improving the efficiency of expansion.
[0074] See also Figure 4 As shown, the embodiment of the present invention discloses a specific method for expanding thick provisioned volumes. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.
[0075] Step S41: monitoring whether the thick provisioned volume obtains the allocated expansion space.
[0076] Step S42: If it is detected that the thick provisioned volume has obtained the allocated expansion space, the occupancy status of the expansion space of the thick provisioned volume is updated.
[0077] Step S43: After the update of the occupation status of the expanded space is completed, a prompt message indicating that the thick provisioned volume expansion is successful is generated, and a write-zero data formatting operation is performed on the expanded space according to the received write-zero data request.
[0078] In this embodiment, after the update of the occupancy status of the expanded space is completed, indicating that false occupation of the expanded space has been achieved, a prompt message is generated indicating that the thick provisioned volume has successfully expanded the space, and a write-zero data formatting operation is performed on the expanded space based on the received write-zero data request, thereby achieving true occupation of the expanded space. In other words, zeros are written to the expanded space to format the expanded space, thereby achieving true occupation of the expanded space. It is understandable that since the update of the occupancy status of the expanded space has been completed before the formatting of the expanded space to achieve true occupation of the expanded space, that is, the occupancy status of the expanded space is updated to an occupied state, thereby achieving false occupation of the expanded space, when the write-zero data formatting operation is performed on the expanded space based on the received write-zero data request, other write requests do not need to be stopped, and the write request and the write-zero data request can be merged. That is, the thick provisioned volume can write data to the expanded space while formatting the expanded space.
[0079] For the specific contents of the above steps S41 to S42, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.
[0080] It can be seen that when the embodiment of the present application monitors that the thick provisioned volume obtains the allocated expansion space, it updates the occupancy status of the expansion space of the thick provisioned volume to realize the false occupation of the expansion space, and then performs the write-zero data formatting operation on the expansion space according to the received write-zero data request to realize the real occupation of the expansion space. Since the false occupation of the expansion space has been completed before the expansion space is formatted to realize the real occupation of the expansion space, when the formatting operation of the expansion space is not completed and other write requests are received, there is no need to stop other write requests, thereby avoiding affecting the writing of data and improving the efficiency of expansion.
[0081] See also Figure 5 As shown, the embodiment of the present invention discloses a specific method for expanding thick provisioned volumes. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.
[0082] Step S51: monitoring whether the thick provisioned volume obtains the allocated expansion space.
[0083] Step S52: If it is detected that the thick provisioned volume has obtained the allocated expansion space, the object_map corresponding to the expansion space of the thick provisioned volume is updated to the OBJECT_EXISTS state.
[0084] Step S53: after the object_map corresponding to the expanded space of the thick provisioned volume is updated to the OBJECT_EXISTS state, a prompt message indicating that the expansion of the thick provisioned volume is successful is generated, and a write-zero data formatting operation is performed on the expanded space according to the received write-zero data request.
[0085] For the specific contents of the above steps S51 to S53, reference may be made to the corresponding contents disclosed in the above embodiments, which will not be repeated here.
[0086] It can be seen that when the embodiment of the present application monitors that the thick provision volume obtains the allocated expansion space, the object_map corresponding to the expansion space of the thick provision volume is updated to the OBJECT_EXISTS state to realize the false occupation of the expansion space, and then the write-zero data formatting operation is performed on the expansion space according to the received write-zero data request to realize the real occupation of the expansion space. Since the false occupation of the expansion space has been completed before the expansion space is formatted to realize the real occupation of the expansion space, when the formatting operation of the expansion space is not completed and other write requests are received, there is no need to stop other write requests, thereby avoiding affecting the writing of data and improving the efficiency of expansion.
[0087] Correspondingly, the present application also discloses a thick provisioned volume expansion device, see Figure 6 As shown, the device includes:
[0088] Monitoring module 11, used to monitor whether the thick provisioned volume obtains the allocated expansion space;
[0089] A status updating module 12 is configured to update the occupancy status of the expansion space of the thick provisioned volume when detecting that the thick provisioned volume has acquired the allocated expansion space;
[0090] The formatting module 13 is configured to generate prompt information indicating that the expansion of the thick provisioned volume space is successful after completing the update of the occupancy status of the expansion space, and format the expansion space according to the received formatting request.
[0091] In this embodiment, the monitoring module 11 monitors whether the thick provisioned volume obtains the allocated expansion space. If it is monitored that the thick provisioned volume does not obtain the allocated expansion space, it indicates that an abnormality has occurred in the operation of allocating expansion space for the thick provision. According to the actual abnormal situation, the expansion space can be reallocated to the thick provision. If it is monitored that the thick provisioned volume has obtained the allocated expansion space, the corresponding operation is performed to ensure that the expansion space allocated to the thick provisioned volume is consistent with the actual occupied space, thereby completing the operation of allocating expansion space for the thick provisioned volume, that is, updating the occupancy status corresponding to the expansion space of the thick provisioned volume through the status update module 12. It is understandable that in order to ensure that the expansion space allocated to the thick provisioned volume is consistent with the actual occupied space, it is necessary to perform false occupation processing on the expansion space of the thick provisioned volume, that is, to update the occupation status of the storage space of the thick provisioned volume through the status update module 12 to ensure that the expansion space allocated to the thick provisioned volume is consistent with the actual occupied space, so that when writing data to the expansion space for space allocation query, the occupation status of the expansion space is displayed as occupied, but in fact, the expansion space is not actually occupied, but the occupation status of the expansion space of the thick provisioned volume is updated to occupied, thereby achieving false occupation of the expansion space. After the update of the occupation status of the expansion space is completed, it means that the false occupation of the expansion space is achieved, then a prompt message of the successful expansion of the thick provisioned volume is generated, and the formatting module 13 is used to format the expansion space according to the received formatting request, thereby achieving real occupation of the expansion space. It can be understood that, since the occupancy status of the expanded space has been updated before the expanded space is formatted to realize the actual occupation of the expanded space, thereby realizing the false occupation of the expanded space, it is not necessary to stop other write requests when formatting the expanded space according to the received formatting request, and the write request and the formatting request can be merged, that is, the thick provisioned volume can write data to the expanded space while formatting the expanded space.
[0092] As can be seen from the above, when the embodiment of the present application monitors that the thick provisioned volume obtains the allocated expansion space, it updates the occupancy status of the expansion space of the thick provisioned volume to realize the false occupation of the expansion space, and then formats the expansion space according to the received formatting request to realize the real occupation of the expansion space. Since the false occupation of the expansion space has been completed before the expansion space is formatted to realize the real occupation of the expansion space, when the formatting operation of the expansion space is not completed and other write requests are received, there is no need to stop other write requests, thereby avoiding affecting the writing of data and improving the efficiency of expansion.
[0093] In some specific embodiments, the thick provisioned volume expansion device may further include:
[0094] A capacity determination module determines the available capacity of the storage pool and obtains the available capacity of the storage pool;
[0095] A capacity comparison module, configured to compare the available capacity of the storage pool with the predetermined capacity of the space to be expanded, and obtain a corresponding comparison result;
[0096] A condition judgment module is used to judge whether the expansion operation based on the capacity of the space to be expanded meets a preset expansion condition based on the comparison result.
[0097] In some specific embodiments, the capacity determination module may specifically include:
[0098] A thick provision volume determination unit, configured to determine whether a current volume is a thick provision volume;
[0099] The capacity size determining unit is configured to determine the available capacity size corresponding to the storage pool when the current volume is the thick provisioned volume, so as to obtain the available capacity of the storage pool.
[0100] In some specific embodiments, the condition judgment module may specifically include:
[0101] a first determining unit configured to, when the comparison result shows that the capacity of the expansion space is greater than the available capacity of the storage pool, determine that the expansion operation based on the capacity of the space to be expanded does not meet the preset expansion condition, and generate a prompt message indicating that the available capacity of the storage pool is insufficient;
[0102] The second determination unit is configured to determine that the expansion operation based on the capacity of the space to be expanded meets the preset expansion condition when the comparison result shows that the capacity of the expanded space is not greater than the available capacity of the storage pool, and generate a prompt message that the available capacity of the storage pool is sufficient.
[0103] In some specific embodiments, the thick provisioned volume determination unit may specifically include:
[0104] The information acquisition subunit is used to obtain metadata information of the current volume;
[0105] The thick provisioned volume determination subunit is configured to determine whether the current volume is a thick provisioned volume based on the metadata information.
[0106] In some specific embodiments, the status update module may specifically include:
[0107] A status updating unit is configured to update the object_map corresponding to the expanded space of the thick provisioned volume to an OBJECT_EXISTS state.
[0108] In some specific embodiments, the formatting module may specifically include:
[0109] The formatting execution unit is configured to execute a write-zero data formatting operation on the expansion space according to the received write-zero data request.
[0110] Furthermore, an embodiment of the present application also provides an electronic device. Figure 7 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram should not be considered as any limitation to the scope of application of the present application.
[0111] Figure 7 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the thick provisioned volume expansion method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0112] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0113] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0114] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222. The operating system 221 can be Windows Server, NetWare, Unix, Linux, etc. In addition to including a computer program capable of implementing the thick provisioned volume expansion method performed by the electronic device 20 as disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program capable of performing other specific tasks.
[0115] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the thick provisioned volume expansion method disclosed in any of the aforementioned embodiments are implemented.
[0116] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0117] Finally, it should be noted that, in this document, 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 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 element.
[0118] The above is a detailed introduction to the thick provisioned volume expansion method, device, equipment and storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for expanding a thick provisioned volume, characterized in that: include: Determining whether the current volume is a thick provisioned volume, and if so, determining the available capacity of the storage pool to obtain the available capacity of the storage pool; Comparing the available capacity of the storage pool with the predetermined capacity of the space to be expanded to obtain a corresponding comparison result; Determining, based on the comparison result, whether the expansion operation based on the capacity of the space to be expanded meets a preset expansion condition; Monitoring whether the thick provisioned volume obtains the allocated expansion space; If it is detected that the thick provisioned volume has obtained the allocated expansion space, updating the occupancy status of the expansion space of the thick provisioned volume; After the update of the occupation status of the expanded space is completed, prompt information indicating that the expansion of the thick provisioned volume space is successful is generated, and the expanded space is formatted according to the received formatting request.
2. The method for expanding thick provisioned volumes according to claim 1, wherein: The determining, based on the comparison result, whether the expansion operation based on the capacity of the space to be expanded meets a preset expansion condition includes: If the comparison result is that the capacity of the expansion space is greater than the available capacity of the storage pool, it is determined that the expansion operation based on the capacity of the space to be expanded does not meet the preset expansion condition, and a prompt message indicating that the available capacity of the storage pool is insufficient is generated; If the comparison result is that the capacity of the expanded space is not greater than the available capacity of the storage pool, it is determined that the expansion operation based on the capacity of the space to be expanded meets the preset expansion condition, and prompt information that the available capacity of the storage pool is sufficient is generated.
3. The method for expanding thick provisioned volumes according to claim 1, wherein: The step of determining whether the current volume is a thick provisioned volume includes: Obtain metadata information of the current volume, and determine whether the current volume is a thick provisioned volume based on the metadata information.
4. The method for expanding thick provisioned volumes according to claim 1, wherein: The updating of the occupied state of the expanded space of the thick provisioned volume includes: The object_map corresponding to the expanded space of the thick provisioned volume is updated to the OBJECT_EXISTS state.
5. The method for expanding a thick provisioned volume according to any one of claims 1 to 4, wherein: The formatting of the expansion space according to the received formatting request includes: A write-zero data formatting operation is performed on the expanded space according to the received write-zero data request.
6. A thick provisioned volume expansion device, characterized in that: include: a capacity determination module, determining whether the current volume is a thick provisioned volume; if the current volume is the thick provisioned volume, determining the available capacity of the storage pool to obtain the available capacity of the storage pool; A capacity comparison module, configured to compare the available capacity of the storage pool with the predetermined capacity of the space to be expanded, and obtain a corresponding comparison result; A condition judgment module, configured to judge, based on the comparison result, whether the expansion operation based on the capacity of the space to be expanded satisfies a preset expansion condition; A monitoring module, configured to monitor whether the thick provisioned volume obtains the allocated expansion space; a status update module, configured to update the occupancy status of the expansion space of the thick provisioned volume when detecting that the thick provisioned volume has acquired the allocated expansion space; The formatting module is configured to generate prompt information indicating that the expansion of the thick provisioned volume is successful after completing the update of the occupation status of the expansion space, and format the expansion space according to the received formatting request.
7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the steps of the thick provisioned volume expansion method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that Used to store a computer program; wherein, when the computer program is executed by a processor, the steps of the thick provisioned volume expansion method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Self-simplification volume expansion method and system
CN106227472A
Disk space expansion method and apparatus
CN106569741A