Volume attribution type conversion method, device, equipment and storage medium
By obtaining and synchronizing the home type of the original volume, adding mirror volumes and synchronizing data, the problem that users cannot switch the home type in cluster storage is solved, and convenient volume type conversion is achieved without affecting read and write operations, improving user experience.
Patent Information
- Application Number
- CN202210892249.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-27
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2042-07-27
AI Technical Summary
In cluster storage, after the user mistakenly operates to create a mismatched volume type, it will not be able to switch the volume attribute type, affecting the user experience.
By obtaining the home type of the original volume, adding a volume copy to obtain a mirror volume, and performing data synchronization and home type modification to form a converted volume to realize the switching of the volume home type.
Without affecting read and write operations, the volume attribute type is conveniently switched, which improves user satisfaction.
Smart Images

Figure CN115373596B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of volumes, and in particular, to a method, apparatus, device, and storage medium for converting volume ownership types. Background Art
[0002] In a cluster storage, it supports creating volumes with ownership and volumes without ownership. A volume with ownership means that the volume has a designated home node, and read and write operations on the volume with ownership are only issued and processed from the home node, and the relevant metadata of the volume is only backed up between the two nodes in the mirror pair to which it belongs. A volume without ownership means that the volume is scattered in different mirror pairs after being broken up at a preset granularity, and the nodes in each mirror pair can perform read and write operations, and the issuance and processing can also be carried out separately on different nodes to which they belong.
[0003] However, after the above storage cluster creates volumes with ownership and volumes without ownership, it cannot be changed. If the user accidentally creates a volume type that does not match the multi-path, due to the different home nodes of the cached data and metadata of the volume with ownership and the volume without ownership, it cannot be switched. Therefore, when the user wants to switch the volume ownership type, they need to create a new volume again, resulting in a poor user experience. Summary of the Invention
[0004] Based on this, the present application provides a method, apparatus, device, and storage medium for converting volume ownership types, which realizes the switching of volume ownership types without affecting read and write operations, so as to achieve the effect of convenient conversion and improved customer satisfaction.
[0005] In a first aspect, a method for converting volume ownership types is provided, and the method includes:
[0006] Obtain the ownership type of the original volume, and add a volume copy according to the ownership type of the original volume to obtain a mirror volume; wherein, the original volume includes an original virtual volume and an original physical volume; the mirror volume includes an original virtual volume, an original physical volume, and a converted physical volume, and the ownership types of the original physical volume and the converted physical volume are different;
[0007] Perform a data synchronization operation on the original physical volume and the converted physical volume in the mirror volume, and delete the original physical volume in the mirror volume after the synchronization is completed;
[0008] Perform an operation of modifying the ownership type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume, and the converted physical volume and the converted virtual volume form a converted volume.
[0009] According to an implementable manner in the embodiment of the present application, obtaining the ownership type of the original volume includes:
[0010] Obtain the ownership attribute of the original volume;
[0011] If the ownership attribute of the original volume obtained is TRUE, determine that the original volume is an owned volume;
[0012] If the ownership attribute of the original volume obtained is FALSE, determine that the original volume is an unowned volume.
[0013] According to an implementable manner in the embodiments of the present application, when the obtained ownership type of the original volume is an owned volume, the method includes:
[0014] According to the ownership type of the owned volume, add a volume copy of the unowned physical volume to obtain a mirrored volume; wherein, the owned volume includes an owned virtual volume and an owned physical volume; the mirrored volume includes an owned virtual volume, an owned physical volume, and an unowned physical volume;
[0015] Perform a data synchronization operation on the owned physical volume and the unowned physical volume in the mirrored volume, and delete the owned physical volume after the synchronization is completed;
[0016] Perform an operation to modify the ownership type on the owned virtual volume to obtain an unowned virtual volume corresponding to the unowned physical volume, and the unowned physical volume and the unowned virtual volume form an unowned volume.
[0017] According to an implementable manner in the embodiments of the present application, when the obtained ownership type of the original volume is an unowned volume, the method includes:
[0018] According to the ownership type of the unowned volume, add a volume copy of the owned physical volume to obtain a mirrored volume; wherein, the unowned volume includes an unowned virtual volume and an unowned physical volume; the mirrored volume includes an unowned virtual volume, an owned physical volume, and an unowned physical volume;
[0019] Perform a data synchronization operation on the owned physical volume and the unowned physical volume in the mirrored volume, and delete the unowned physical volume after the synchronization is completed;
[0020] Perform an operation to modify the ownership type on the unowned virtual volume to obtain an owned virtual volume corresponding to the owned physical volume, and the owned physical volume and the owned virtual volume form an owned volume.
[0021] According to an implementable manner in the embodiments of the present application, performing an operation to modify the ownership type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume, and the converted physical volume and the converted virtual volume form a converted volume, includes:
[0022] Flush the data cache of the original virtual volume down to the controller hard disk;
[0023] Perform a node path switching operation on the data flushed down to the controller hard disk, and at the same time modify the ownership attribute of the original virtual volume; obtain a converted virtual volume corresponding to the converted physical volume, and the converted physical volume and the converted virtual volume form a converted volume.
[0024] According to an implementable manner in an embodiment of the present application, before the step of adding a volume copy to obtain a mirrored volume according to the attribution type of the original volume, the method further includes:
[0025] Determine the type of the original volume relationship;
[0026] When the original volume is any one of the source volume or the target volume of the snapshot relationship, the primary volume or the secondary volume of the remote replication relationship, and the cloud volume of the copy relationship, the step of adding a volume copy to obtain a mirrored volume according to the attribution type of the original volume is prohibited.
[0027] According to an implementable manner in an embodiment of the present application, during the data synchronization operation of the original physical volume and the converted physical volume in the mirrored volume, the operation requests for creating any one of a snapshot, creating a remote replication, and copying are rejected.
[0028] In a second aspect, a volume attribution type conversion device is provided, and the device includes:
[0029] A copy module, configured to obtain the attribution type of the original volume, and add a volume copy according to the attribution type of the original volume to obtain a mirrored volume; wherein, the original volume includes an original virtual volume and an original physical volume; the mirrored volume includes an original virtual volume, an original physical volume, and a converted physical volume, and the attribution types of the original physical volume and the converted physical volume are different;
[0030] A synchronization module, configured to perform a data synchronization operation on the original physical volume and the converted physical volume in the mirrored volume, and delete the original physical volume in the mirrored volume after the synchronization is completed;
[0031] A conversion module, configured to perform an operation of modifying the attribution type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume, and the converted physical volume and the converted virtual volume form a converted volume.
[0032] In a third aspect, a computer device is provided, including:
[0033] At least one processor; and
[0034] A memory communicatively connected to the at least one processor; wherein,
[0035] The memory stores computer instructions executable by the at least one processor, and the computer instructions are executed by the at least one processor so that the at least one processor can execute the method involved in the first aspect above.
[0036] In a fourth aspect, a computer-readable storage medium is provided, on which computer instructions are stored, and the computer instructions are characterized in that the computer instructions are used to cause a computer to execute the method involved in the first aspect above.
[0037] According to the technical content provided by the embodiments of the present application, by obtaining the attribution type of the original volume, adding a volume copy according to the attribution type of the original volume to obtain a mirrored volume; wherein, the original volume includes an original virtual volume and an original physical volume; the mirrored volume includes the original virtual volume, the original physical volume, and a converted physical volume, and the attribution types of the original physical volume and the converted physical volume are different; performing a data synchronization operation on the original physical volume and the converted physical volume in the mirrored volume, and deleting the original physical volume in the mirrored volume after the synchronization is completed; performing an operation of modifying the attribution type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume, and the converted physical volume and the converted virtual volume form a converted volume. The above operations can realize switching the attribution type of the volume without affecting the read and write operations, so as to achieve the effect of convenient conversion and improved customer satisfaction. Description of the Drawings
[0038] Figure 1 It is a schematic flowchart of a method for converting the attribution type of a volume in an embodiment;
[0039] Figure 2 It is a preferred schematic flowchart of a method for converting the attribution type of a volume in an embodiment;
[0040] Figure 3 It is a structural block diagram of a device for converting the attribution type of a volume in an embodiment;
[0041] Figure 4 It is a schematic structural diagram of a computer device in an embodiment. Detailed Embodiments
[0042] The following further details the present application in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] Figure 1 It is a flowchart of a method for converting the attribution type of a volume provided by an embodiment of the present application. As Figure 1 shown, the method may include the following steps:
[0044] Step 101: Obtain the attribution type of the original volume, and add a volume copy according to the attribution type of the original volume to obtain a mirrored volume.
[0045] Wherein, a volume refers to a storage area on a hard disk. The drive formats the volume using a file system (such as FAT or NTFS) and assigns it a drive letter. Clicking on the corresponding icon in "Windows Explorer" or "My Computer" can view the contents of the drive. A hard disk includes many volumes, and one volume can also span many disks.
[0046] Here, the original volume includes an original virtual volume and an original physical volume. A mirrored volume refers to a volume that has two volume copies, that is, a virtual volume has two physical volumes. When read and write operations are performed on the virtual volume, they will be simultaneously synchronized to the two physical volumes. Among them, the virtual volume is represented by vdisk, and the physical volume is represented by cdisk.
[0047] Specifically, obtain the attribution type of the original volume, and add volume copies according to the attribution type of the original volume to obtain a mirrored volume. The obtained mirrored volume includes the original virtual volume, the original physical volume, and a converted physical volume, and the attribution types of the original physical volume and the converted physical volume are different.
[0048] Step 103: Perform a data synchronization operation on the original physical volume and the converted physical volume in the mirrored volume. After the synchronization is completed, delete the original physical volume in the mirrored volume.
[0049] Here, perform a data synchronization operation on the original physical volume and the converted physical volume in the mirrored volume to make the data information of the original physical volume and the converted physical volume completely consistent. After the synchronization is completed, delete the original physical volume in the mirrored volume. At this time, the converted physical volume can contain all the data information of the original physical volume.
[0050] Step 105: Perform an operation to modify the attribution type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume. The converted physical volume and the converted virtual volume form a converted volume.
[0051] Here, since the original volume includes an original virtual volume and an original physical volume, the converted volume should include a converted virtual volume and a converted physical volume. And the converted physical volume has been obtained in the above steps. Therefore, it is also necessary to perform an operation to modify the attribution type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume. The converted physical volume and the converted virtual volume form a converted volume, that is, the operation of converting the attribution type of the original volume to the attribution type of the converted volume is realized.
[0052] It can be seen that in the embodiment of the present application, by obtaining the attribution type of the original volume, adding volume copies according to the attribution type of the original volume to obtain a mirrored volume; among them, the original volume includes an original virtual volume and an original physical volume; the mirrored volume includes an original virtual volume, an original physical volume, and a converted physical volume, and the attribution types of the original physical volume and the converted physical volume are different; performing a data synchronization operation on the original physical volume and the converted physical volume in the mirrored volume, and deleting the original physical volume in the mirrored volume after the synchronization is completed; performing an operation to modify the attribution type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume, and the converted physical volume and the converted virtual volume form a converted volume. The above operations can realize switching the volume attribution type without affecting read and write operations, so as to achieve the effects of convenient conversion and improved customer satisfaction.
[0053] The following describes in detail the "obtaining the attribution type of the original volume" in step 101 above in combination with embodiments.
[0054] Obtain the attribution attribute of the original volume; if the obtained attribution attribute of the original volume is TRUE, determine that the original volume is a volume with attribution; if the obtained attribution attribute of the original volume is FALSE, determine that the original volume is a volume without attribution.
[0055] Among them, the metadata and cache data of the volume with attribution are backed up between two preferred nodes of a mirror pair, and read and write operations are also processed at the preferred node.
[0056] For the volume without attribution, copies of the volume are allocated within the scope of all controllers according to a preset granularity (such as 32M), which can realize the full utilization of cache resources and computing resources. Since read and write operations can be performed on each node, read and write operations can be respectively performed on four nodes according to the preset granularity.
[0057] Specifically, since each volume has its own label to indicate whether it is a volume with attribution or a volume without attribution, therefore, obtain the attribute of the original volume; if the obtained attribution attribute of the original volume is TRUE, determine that the original volume is a volume with attribution; if the obtained attribution attribute of the original volume is FALSE, determine that the original volume is a volume without attribution.
[0058] In some embodiments, when the obtained attribution type of the original volume is a volume with attribution, according to the attribution type of the volume with attribution, add a volume copy of the volume without attribution entity to obtain a mirror volume; perform a data synchronization operation on the volume with attribution entity and the volume without attribution entity in the mirror volume, and delete the volume with attribution entity after the synchronization is completed; perform an operation of modifying the attribution type on the volume with attribution virtual volume to obtain a volume without attribution virtual volume corresponding to the volume without attribution entity, and the volume without attribution entity and the volume without attribution virtual volume form a volume without attribution.
[0059] Among them, the volume with attribution includes a volume with attribution virtual volume and a volume with attribution entity; the mirror volume includes a volume with attribution virtual volume, a volume with attribution entity, and a volume without attribution entity.
[0060] In a feasible manner, when the obtained attribution type of the original volume is a volume with attribution, since the volume with attribution includes a volume with attribution virtual volume and a volume with attribution entity, therefore, it is necessary to add a volume copy of the volume without attribution entity to obtain a mirror volume; then perform a data synchronization operation on the volume with attribution entity and the volume without attribution entity in the mirror volume, and delete the volume with attribution entity after the synchronization is completed, that is, at this time, the volume without attribution entity contains all the data information of the volume with attribution entity; finally, perform an operation of modifying the attribution type on the volume with attribution virtual volume to obtain a volume without attribution virtual volume corresponding to the volume without attribution entity, and thus obtain the converted volume without attribution.
[0061] In some embodiments, when the ownership type of the acquired original volume is an unowned volume, according to the ownership type of the unowned volume, a volume copy of the owned entity volume is added to obtain a mirrored volume; data synchronization operations are performed on the owned entity volume and the unowned entity volume in the mirrored volume, and the unowned entity volume is deleted after the synchronization is completed; the ownership type of the unowned virtual volume is modified to obtain an owned virtual volume corresponding to the owned entity volume, and the owned entity volume and the owned virtual volume form an owned volume.
[0062] Among them, the unowned volume includes an unowned virtual volume and an unowned entity volume; the mirrored volume includes an unowned virtual volume, an owned entity volume, and an unowned entity volume.
[0063] In an implementable manner, when the ownership type of the acquired original volume is an unowned volume, since the unowned volume includes an unowned virtual volume and an unowned entity volume, therefore, a volume copy of the owned entity volume needs to be added to obtain a mirrored volume; then, data synchronization operations are performed on the owned entity volume and the unowned entity volume in the mirrored volume, and the unowned entity volume is deleted after the synchronization is completed, that is, at this time, the owned entity volume contains all the data information of the unowned entity volume; finally, the ownership type of the unowned virtual volume is modified to obtain an owned virtual volume corresponding to the owned entity volume, thereby obtaining the converted owned volume.
[0064] In some embodiments, modifying the ownership type of the original virtual volume to obtain a converted virtual volume corresponding to the converted entity volume, and the converted entity volume and the converted virtual volume form a converted volume, including: flushing the data cache of the original virtual volume to the controller hard disk; performing a node path switching operation on the data flushed to the controller hard disk, and at the same time modifying the ownership attribute of the original virtual volume; obtaining a converted virtual volume corresponding to the converted entity volume, and the converted entity volume and the converted virtual volume form a converted volume.
[0065] In an implementable manner, when the original virtual volume is an unowned virtual volume, the data cache of the unowned virtual volume is flushed to the corresponding controller hard disk; a node path switching operation is performed on the data flushed to the controller hard disk. For example, currently in a four-controller storage environment, since the read and write operations of the unowned volume can be performed on four nodes respectively according to a preset granularity, and the read and write operations of the owned volume are processed between two preferred nodes of a mirror pair, therefore, a node replacement is required to switch the data of the four nodes between the two preferred nodes, and at the same time modify the ownership attribute of the unowned virtual volume to obtain an owned virtual volume corresponding to the owned entity volume, thereby obtaining an owned volume.
[0066] In another implementable manner, when the original virtual volume is an attributed virtual volume, the data cache of the attributed virtual volume is flushed down to the corresponding controller hard disk; the node path switching operation is performed on the data flushed down to the controller hard disk. For example, in a four-controller storage environment currently, since the read and write operations of the attributed volume are processed between two preferred nodes of a mirror pair, while the read and write operations of the non-attributed volume can be attributed to the four nodes respectively according to a preset granularity, therefore, it is necessary to replace the nodes, switch the data of the two preferred nodes between the four nodes, and at the same time modify the attribution attribute of the attributed virtual volume to obtain a non-attributed virtual volume corresponding to the non-attributed physical volume, thereby obtaining a non-attributed volume.
[0067] In some embodiments, before the step of adding a volume copy according to the attribution type of the original volume to obtain a mirrored volume, it further includes: determining the relationship type of the original volume; when the relationship type of the original volume is any one of the source volume or the target volume of the snapshot relationship, the primary volume or the secondary volume of the remote replication relationship, and the cloud volume of the copy relationship, the step of adding a volume copy according to the attribution type of the original volume to obtain a mirrored volume is prohibited.
[0068] Here, it should be noted that when the relationship type of the original volume is any one of the source volume or the target volume of the snapshot relationship, the primary volume or the secondary volume of the remote replication relationship, and the cloud volume of the copy relationship, the step of adding a volume copy according to the attribution type of the original volume to obtain a mirrored volume is prohibited, that is, it is not allowed to add an entity volume with a different attribution attribute to the original volume.
[0069] In some embodiments, during the data synchronization operation of the original entity volume and the converted entity volume in the mirrored volume, the operation requests for creating a snapshot, creating a remote replication, and copying any one of them are rejected.
[0070] Here, during the data synchronization operation of the original entity volume and the converted entity volume in the mirrored volume, it is not allowed to perform any one of the operations of creating a snapshot, creating a remote replication, and converting to a cloud volume. Therefore, the operation requests for creating a snapshot, creating a remote replication, and copying any one of them will be rejected.
[0071] Combined with the implementation manners in the above embodiments, the following Figure 2 is an example description of a preferred method flow provided by the embodiments of the present application. As Figure 2 shown, the method may include the following steps:
[0072] Step 210, obtain the attribution attribute of the original volume. If the obtained attribution attribute of the original volume is TRUE, execute step 220. If the obtained attribution attribute of the original volume is FALSE, execute step 230.
[0073] Step 220, then determine that the original volume is an attributed volume.
[0074] Step 221: According to the attribution type of the volume with attribution, add a volume copy of the volume of the entity without attribution to obtain a mirrored volume; wherein, the volume with attribution includes the virtual volume with attribution and the physical volume with attribution; the mirrored volume includes the virtual volume with attribution, the physical volume with attribution, and the physical volume without attribution.
[0075] Step 222: Perform a data synchronization operation on the physical volume with attribution and the physical volume without attribution in the mirrored volume. After the synchronization is completed, delete the physical volume with attribution.
[0076] Step 223: Flush the data cache of the virtual volume with attribution down to the controller hard disk.
[0077] Step 224: Perform a node path switching operation on the data flushed down to the controller hard disk, and at the same time modify the attribution attribute of the virtual volume with attribution; obtain a virtual volume without attribution corresponding to the physical volume without attribution, and the physical volume without attribution and the virtual volume without attribution form a volume without attribution.
[0078] Step 230: Determine that the original volume is a volume without attribution.
[0079] Step 231: According to the attribution type of the volume without attribution, add a volume copy of the physical volume with attribution to obtain a mirrored volume; wherein, the volume without attribution includes the virtual volume without attribution and the physical volume without attribution; the mirrored volume includes the virtual volume without attribution, the physical volume with attribution, and the physical volume without attribution.
[0080] Step 232: Perform a data synchronization operation on the physical volume with attribution and the physical volume without attribution in the mirrored volume. After the synchronization is completed, delete the physical volume without attribution.
[0081] Step 233: Flush the data cache of the virtual volume without attribution down to the controller hard disk.
[0082] Step 234: Perform a node path switching operation on the data flushed down to the controller hard disk, and at the same time modify the attribution attribute of the virtual volume without attribution; obtain a virtual volume with attribution corresponding to the physical volume with attribution, and the physical volume with attribution and the virtual volume with attribution form a volume with attribution.
[0083] It should be understood that although Figure 1 - Figure 2 the steps in the flowchart are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this application, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, Figure 1 - Figure 2At least some of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily need to be completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages does not necessarily need to be sequential, but can be executed alternately or in turn with at least some of the sub-steps or stages of other steps or other steps.
[0084] The above method embodiments can be applied to a variety of application scenarios. For example, they can include but are not limited to converting a volume with an owner to a volume without an owner or converting a volume without an owner to a volume with an owner.
[0085] Figure 3 The following is a schematic structural diagram of a volume ownership type conversion device provided by an embodiment of the present application. This device can be used to execute the Figure 1 - Figure 2 method process shown in. As Figure 3 shown, the device may include: a copy module 301, a synchronization module 303, and a conversion module 305. The main functions of each component module are as follows:
[0086] The copy module 301 is used to obtain the ownership type of the original volume, and add a volume copy according to the ownership type of the original volume to obtain a mirror volume. Among them, the original volume includes an original virtual volume and an original physical volume; the mirror volume includes an original virtual volume, an original physical volume, and a converted physical volume, and the ownership types of the original physical volume and the converted physical volume are different;
[0087] The synchronization module 303 is used to perform a data synchronization operation on the original physical volume and the converted physical volume in the mirror volume, and delete the original physical volume in the mirror volume after the synchronization is completed;
[0088] The conversion module 305 is used to perform an operation of modifying the ownership type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume. The converted physical volume and the converted virtual volume form a conversion volume.
[0089] In some embodiments, the copy module 301 is further used to:
[0090] Obtain the ownership attribute of the original volume;
[0091] If the obtained ownership attribute of the original volume is TRUE, it is determined that the original volume is a volume with an owner;
[0092] If the obtained ownership attribute of the original volume is FALSE, it is determined that the original volume is a volume without an owner.
[0093] In some embodiments, when the obtained ownership type of the original volume is a volume with an owner, the device is further used to:
[0094] Add a volume copy of the entity volume without an owner to the volume with an owner according to the ownership type of the volume with an owner; wherein, the volume with an owner includes a virtual volume with an owner and an entity volume with an owner; the mirrored volume includes a virtual volume with an owner, an entity volume with an owner, and an entity volume without an owner;
[0095] Perform a data synchronization operation on the entity volume with an owner and the entity volume without an owner in the mirrored volume, and delete the entity volume with an owner after the synchronization is completed;
[0096] Perform an operation to modify the ownership type on the virtual volume with an owner to obtain a virtual volume without an owner corresponding to the entity volume without an owner, and the entity volume without an owner and the virtual volume without an owner form a volume without an owner.
[0097] In some embodiments, when the ownership type of the original volume obtained is a volume without an owner, the apparatus is further configured to:
[0098] Add a volume copy of the entity volume with an owner to the volume according to the ownership type of the volume without an owner to obtain a mirrored volume; wherein, the volume without an owner includes a virtual volume without an owner and an entity volume without an owner; the mirrored volume includes a virtual volume without an owner, an entity volume with an owner, and an entity volume without an owner;
[0099] Perform a data synchronization operation on the entity volume with an owner and the entity volume without an owner in the mirrored volume, and delete the entity volume without an owner after the synchronization is completed;
[0100] Perform an operation to modify the ownership type on the virtual volume without an owner to obtain a virtual volume with an owner corresponding to the entity volume with an owner, and the entity volume with an owner and the virtual volume with an owner form a volume with an owner.
[0101] In some embodiments, the conversion module 305 is further configured to:
[0102] Flush the data cache of the original virtual volume down to the controller hard disk;
[0103] Perform a node path switching operation on the data flushed to the controller hard disk, and at the same time modify the ownership attribute of the original virtual volume; obtain a converted virtual volume corresponding to the converted entity volume, and the converted entity volume and the converted virtual volume form a converted volume.
[0104] In some embodiments, the apparatus is further configured to:
[0105] Determine the type of the original volume relationship;
[0106] When the relationship type of the original volume is any one of the source volume or the target volume of the snapshot relationship, the primary volume or the secondary volume of the remote replication relationship, and the cloud volume of the copy relationship, prohibit the step of adding a volume copy according to the ownership type of the original volume to obtain a mirrored volume.
[0107] In some embodiments, the apparatus is further configured to:
[0108] During the process of synchronizing data between the original physical volume and the converted physical volume in the mirrored volume, operation requests for creating a snapshot, creating a remote copy, or copying, any one of them, are rejected.
[0109] For the same or similar parts among the above embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, reference can be made to the description in the method embodiment.
[0110] It should be noted that the embodiments of the present application may involve the use of user data. In actual applications, it can be used in the solutions described in this article within the scope permitted by applicable laws and regulations (such as when the user clearly consents, is effectively notified, and clearly authorizes) in compliance with the requirements of applicable laws and regulations in the country where it is located.
[0111] According to the embodiments of the present application, the present application also provides a computer device and a computer-readable storage medium.
[0112] As Figure 4 shown, it is a block diagram of a computer device according to an embodiment of the present application. The computer device is intended to represent various forms of digital computers or mobile devices. Among them, the digital computer may include a desktop computer, a portable computer, a workbench, a personal digital assistant, a server, a mainframe computer, and other suitable computers. The mobile device may include a tablet computer, a smart phone, a wearable device, etc.
[0113] As Figure 4 shown, the device 400 includes a computing unit 401, a ROM 402, a RAM 403, a bus 404, and an input / output (I / O) interface 405. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other through the bus 404. The input / output (I / O) interface 405 is also connected to the bus 404.
[0114] The computing unit 401 may perform various processes in the method embodiments of the present application according to computer instructions stored in the read-only memory (ROM) 402 or computer instructions loaded from the storage unit 408 into the random access memory (RAM) 403. The computing unit 401 may be various general-purpose and / or special-purpose processing components with processing and computing capabilities. The computing unit 401 may include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. In some embodiments, the method provided by the embodiments of the present application may be implemented as a computer software program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 408.
[0115] The RAM 403 may also store various programs and data required for the operation of the device 400. Part or all of the computer programs may be loaded and / or installed onto the device 400 via the ROM 402 and / or the communication unit 409.
[0116] The input unit 406, output unit 407, storage unit 408, and communication unit 409 in the device 400 may be connected to the I / O interface 405. Among them, the input unit 406 may be, such as, a keyboard, a mouse, a touch screen, a microphone, etc.; the output unit 407 may be, such as, a display, a speaker, an indicator light, etc. The device 400 can exchange information, data, etc. with other devices through the communication unit 409.
[0117] It should be noted that the device may also include other components necessary for normal operation. It may also only include the components necessary to implement the solution of the present application, and does not necessarily include all the components shown in the figure.
[0118] The various embodiments of the systems and technologies described herein may be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof.
[0119] The computer instructions for implementing the method of the present application may be written in any combination of one or more programming languages. These computer instructions may be provided to the computing unit 401, such that when the computer instructions are executed by a computing unit 401 such as a processor, the steps involved in the method embodiments of the present application are executed.
[0120] The computer-readable storage medium provided by this application can be a tangible medium that can contain or store computer instructions for executing the various steps involved in the method embodiments of this application. The computer-readable storage medium can include, but is not limited to, storage media in the forms of electronic, magnetic, optical, electromagnetic, etc.
[0121] The above specific implementation manners do not constitute a limitation on the protection scope of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of this application shall be included within the protection scope of this application.
Claims
1. A method for converting roll ownership types, characterized in that, The method includes: Obtaining the attribution type of the original volume, and adding a volume copy according to the attribution type of the original volume to obtain a mirrored volume; wherein, the original volume includes an original virtual volume and an original physical volume; the mirrored volume includes an original virtual volume, an original physical volume, and a converted physical volume, and the attribution types of the original physical volume and the converted physical volume are different; Performing a data synchronization operation on the original physical volume and the converted physical volume in the mirrored volume, and deleting the original physical volume in the mirrored volume after the synchronization is completed; Performing an operation to modify the attribution type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume, and the converted physical volume and the converted virtual volume form a converted volume; Among them, the obtaining the attribution type of the original volume includes: Obtaining the attribution attribute of the original volume; If the obtained attribution attribute of the original volume is TRUE, determining that the original volume is a volume with attribution; If the obtained attribution attribute of the original volume is FALSE, determining that the original volume is a volume without attribution; When the obtained attribution type of the original volume is a volume with attribution, the method includes: Adding a volume copy of a physical volume without attribution according to the attribution type of the volume with attribution to obtain a mirrored volume; wherein, the volume with attribution includes a virtual volume with attribution and a physical volume with attribution; the mirrored volume includes a virtual volume with attribution, a physical volume with attribution, and a physical volume without attribution; Performing a data synchronization operation on the physical volume with attribution and the physical volume without attribution in the mirrored volume, and deleting the physical volume with attribution in the mirrored volume after the synchronization is completed; Performing an operation to modify the attribution type on the virtual volume with attribution to obtain a virtual volume without attribution corresponding to the physical volume without attribution, and the physical volume without attribution and the virtual volume without attribution form a volume without attribution; When the obtained attribution type of the original volume is a volume without attribution, the method includes: Adding a volume copy of a physical volume with attribution according to the attribution type of the volume without attribution to obtain a mirrored volume; wherein, the volume without attribution includes a virtual volume without attribution and a physical volume without attribution; the mirrored volume includes a virtual volume without attribution, a physical volume with attribution, and a physical volume without attribution; Performing a data synchronization operation on the physical volume with attribution and the physical volume without attribution in the mirrored volume, and deleting the physical volume without attribution in the mirrored volume after the synchronization is completed; Performing an operation to modify the attribution type on the virtual volume without attribution to obtain a virtual volume with attribution corresponding to the physical volume with attribution, and the physical volume with attribution and the virtual volume with attribution form a volume with attribution.
2. The method according to claim 1, characterized in that, The performing an operation to modify the attribution type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume, and the converted physical volume and the converted virtual volume form a converted volume, includes: Flushing the data cache of the original virtual volume down to the controller hard disk; Performing a node path switching operation on the data flushed down to the controller hard disk, and simultaneously modifying the attribution attribute of the original virtual volume; obtaining a converted virtual volume corresponding to the converted physical volume, and the converted physical volume and the converted virtual volume form a converted volume.
3. The method according to claim 1, wherein Before the step of adding a volume copy according to the attribution type of the original volume to obtain a mirrored volume, it further includes: Determining the relationship type of the original volume; When any one of the source volume or the target volume whose relationship type with the original volume is a snapshot relationship, the primary volume or the secondary volume of a remote replication relationship, and the cloud volume of a copy relationship, the step of adding a volume copy to obtain a mirrored volume according to the ownership type of the original volume is prohibited.
4. The method according to claim 1, wherein During the process of data synchronization operation on the original physical volume and the converted physical volume in the mirrored volume, an operation request for creating any one of a snapshot, creating a remote replication, and copying is rejected.
5. A roll ownership type conversion device, characterized in that, The device includes: A copy module, configured to obtain the ownership type of the original volume, and add a volume copy according to the ownership type of the original volume to obtain a mirrored volume; wherein, the original volume includes an original virtual volume and an original physical volume; the mirrored volume includes an original virtual volume, an original physical volume, and a converted physical volume, and the ownership types of the original physical volume and the converted physical volume are different; A synchronization module, configured to perform a data synchronization operation on the original physical volume and the converted physical volume in the mirrored volume, and delete the original physical volume in the mirrored volume after the synchronization is completed; A conversion module, configured to perform an operation of modifying the ownership type on the original virtual volume to obtain a converted virtual volume corresponding to the converted physical volume, and the converted physical volume and the converted virtual volume form a converted volume; The copy module is further configured to obtain the ownership attribute of the original volume. If the obtained ownership attribute of the original volume is TRUE, it is determined that the original volume is a volume with ownership. If the obtained ownership attribute of the original volume is FALSE, it is determined that the original volume is a volume without ownership; When the obtained ownership type of the original volume is a volume with ownership, the device is further configured to: Add a volume copy of a volume without ownership entity according to the ownership type of the volume with ownership to obtain a mirrored volume; wherein, the volume with ownership includes a volume with ownership virtual volume and a volume with ownership physical volume; the mirrored volume includes a volume with ownership virtual volume, a volume with ownership physical volume, and a volume without ownership physical volume; Perform a data synchronization operation on the volume with ownership physical volume and the volume without ownership physical volume in the mirrored volume, and delete the volume with ownership physical volume after the synchronization is completed; Perform an operation of modifying the ownership type on the volume with ownership virtual volume to obtain a volume without ownership virtual volume corresponding to the volume without ownership physical volume, and the volume without ownership physical volume and the volume without ownership virtual volume form a volume without ownership; When the obtained ownership type of the original volume is a volume without ownership, the device is further configured to: Add a volume copy of a volume with ownership entity according to the ownership type of the volume without ownership to obtain a mirrored volume; wherein, the volume without ownership includes a volume without ownership virtual volume and a volume without ownership physical volume; the mirrored volume includes a volume without ownership virtual volume, a volume with ownership physical volume, and a volume without ownership physical volume; Perform a data synchronization operation on the volume with ownership physical volume and the volume without ownership physical volume in the mirrored volume, and delete the volume without ownership physical volume after the synchronization is completed; Perform an operation of modifying the ownership type on the volume without ownership virtual volume to obtain a volume with ownership virtual volume corresponding to the volume with ownership physical volume, and the volume with ownership physical volume and the volume with ownership virtual volume form a volume with ownership.
6. A computer device, including: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores computer instructions executable by the at least one processor, and the computer instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1-4.
7. A computer-readable storage medium having computer instructions stored thereon, characterized in that, The computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Mirrored volume data cloud-uploading method, device, system and readable storage medium
CN109462651A
Volume type conversion method and system, equipment and medium
CN111309255A