Data migration method and device, storage system and storage medium
By configuring the source virtual volume's configuration information to the target virtual volume, the problem of excessive storage resource consumption in existing technologies is solved, achieving efficient data migration, shortening migration time, and improving user experience.
Patent Information
- Application Number
- CN202511300397.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2025-11-21
AI Technical Summary
Existing data migration methods consume excessive storage resources during the migration process, leading to storage device resource shortages and excessively long migration times, which negatively impacts user experience.
By configuring the source virtual volume's configuration information to the target virtual volume, the target virtual volume responds to data requests and migrates the data from the source virtual volume to the target virtual volume. This avoids the source virtual volume repeatedly updating in response to data requests and reduces the creation of data snapshots.
It effectively reduces the storage resources used during the migration process, shortens the migration time, and improves data migration efficiency and user experience.
Smart Images

Figure CN120994575A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data migration, and in particular to a data migration method and device, a storage system and a storage medium. BACKGROUND
[0002] In the working process of a storage system, in order to meet the needs of storage system expansion, business performance optimization, storage device life cycle replacement, etc., data migration between different virtual volumes in the storage system is often required, that is, data of a source virtual volume is migrated to a target virtual volume.
[0003] The existing data migration method is to create a data snapshot corresponding to the data stored in the source virtual volume, and send the data snapshot to the target virtual volume. The problem with this solution is that during the process of creating the data snapshot and sending it to the target virtual volume, the data of the source virtual volume will be continuously updated because new data requests need to be processed. This results in the need to repeatedly create multiple data snapshots during the entire migration process, thereby occupying a large amount of storage resources in the storage device where the source virtual volume is located. SUMMARY
[0004] Therefore, the present application provides a data migration method and device, a storage system and a storage medium to solve the problem of excessive storage resource occupation in the existing data migration solution.
[0005] The first aspect of the present application provides a data migration method, comprising:
[0006] configuring first volume configuration information of the source virtual volume to the target virtual volume, so that the target virtual volume responds to a target data request, the target data request being a data request for the source virtual volume;
[0007] After the first volume configuration information of the source virtual volume is configured to the target virtual volume, migrating the data stored in the source virtual volume to the target virtual volume.
[0008] Optionally, the target data request includes a target write data request, and the method further comprises:
[0009] When the target virtual volume processes the target write data request, writing the data index corresponding to the to-be-written data and the to-be-written data into the target virtual volume.
[0010] Optionally, the migrating the data stored in the source virtual volume to the target virtual volume comprises:
[0011] sending source data stored in the source virtual volume to the target virtual volume;
[0012] updating the source data according to the to-be-written data and the corresponding data index written into the target virtual volume to obtain updated source data.
[0013] write the updated source data to the target virtual volume.
[0014] Optionally, the target virtual volume supports a write granularity at a byte level, so that the target virtual volume supports writing the data to be written directly to the target virtual volume.
[0015] Optionally, the target data request comprises a target read data request.
[0016] The method further comprises:
[0017] In the case that the target data is queried in the target virtual volume when the target virtual volume processes the target read data request, the target data is fed back to the client sending the target read data request.
[0018] In the case that the target data is not queried in the target virtual volume, the target read data request is redirected to the source virtual volume, and the target data is fed back to the client sending the target read data request, the target data referring to data to be read by the target read data request.
[0019] Optionally, the redirection of the target read data request to the source virtual volume and the feeding back of the target data to the client sending the target read data request comprises:
[0020] establishing a remote access link between the target virtual volume and the source virtual volume according to a remote network protocol, so that the storage device corresponding to the source virtual volume is mounted to a target storage device through the remote access link; the target storage device being a storage device mounted by the target virtual volume.
[0021] feeding back the target data to the client sending the target read data request through the target storage device.
[0022] Optionally, the method further comprises:
[0023] configuring second volume configuration information of the target virtual volume to the source virtual volume.
[0024] Optionally, the configuration of the first volume configuration information of the source virtual volume to the target virtual volume comprises:
[0025] configuring the first volume configuration information of the source virtual volume to the target virtual volume in the case that the available storage space of the target virtual volume is greater than or equal to the amount of data currently stored by the source virtual volume.
[0026] In a case where available storage space of the target virtual volume is less than an amount of data currently stored by the source virtual volume, after performing expansion processing on the target virtual volume, the first volume configuration information of the source virtual volume is configured to the target virtual volume.
[0027] Optionally, the target data request comprises a target data deletion request.
[0028] The migration of the data stored by the source virtual volume to the target virtual volume comprises:
[0029] In the data stored by the source virtual volume, the data to be deleted indicated by the target data deletion request is determined.
[0030] The data stored by the source virtual volume, except the data to be deleted, is migrated to the target virtual volume.
[0031] The second aspect of the present application provides a data migration apparatus, comprising:
[0032] A configuration unit is configured to configure the first volume configuration information of the source virtual volume to the target virtual volume, so that the target virtual volume responds to a target data request, the target data request being a data request for the source virtual volume.
[0033] A migration unit is configured to, after the configuration of the first volume configuration information of the source virtual volume to the target virtual volume, migrate the data stored by the source virtual volume to the target virtual volume.
[0034] The third aspect of the present application provides a storage system, comprising:
[0035] A client is configured to send a data request to a server.
[0036] A plurality of storage devices are configured to abstract physical storage resources into virtual volumes.
[0037] The server is configured to read and write data of the virtual volumes of the storage devices according to the data request of the client.
[0038] The server is further configured to:
[0039] Configure the first volume configuration information of the source virtual volume to the target virtual volume, so that the target virtual volume responds to a target data request, the target data request being a data request for the source virtual volume.
[0040] After the configuration of the first volume configuration information of the source virtual volume to the target virtual volume, migrate the data stored by the source virtual volume to the target virtual volume.
[0041] The method has the beneficial effects that the first volume configuration information of the source virtual volume is configured to the target virtual volume, so that the source virtual volume stops responding to the target data request, and the target virtual volume responds to the target data request, and then the source virtual volume data is migrated to the target virtual volume, which can meet the requirement of the target data request for reading and writing data through the target virtual volume during the migration process, and the data of the source virtual volume is not repeatedly updated due to responding to the target data request, so that the data migration can be realized without repeatedly creating multiple data snapshots, and the storage resources occupied during the migration process are effectively reduced. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of the provided drawings.
[0043] Figure 1 A flow chart of a data migration method disclosed by the embodiments of the present application;
[0044] Figure 2 A structural schematic diagram of a data storage system disclosed by the embodiments of the present application;
[0045] Figure 3 A schematic diagram of merging to-be-written data and target data blocks to obtain to-be-written data blocks disclosed by the embodiments of the present application;
[0046] Figure 4 A structural schematic diagram of a data migration device disclosed by the embodiments of the present application. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort fall within the scope of protection of the present application.
[0048] In this application, the terms "comprise", "contain", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not only include those elements, but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, the element defined by the phrase "comprises a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0049] And, in this paper, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations.
[0050] The embodiment provides a data migration method, please refer to Figure 1 The method can include the following steps.
[0051] S101, the first volume configuration information of the source virtual volume is configured to the target virtual volume, so that the target virtual volume responds to the target data request, and the target data request is a data request for the source virtual volume.
[0052] The data migration method of the embodiment can be applied to any data storage system based on distributed architecture, and can be executed by a virtualization server in the data storage system.
[0053] The data storage system can include a virtualization server and a plurality of storage devices, at least one virtual volume for storing and managing data can be deployed on each storage device, and the virtualization server can receive data requests of clients, and perform functions of feeding back data read from the virtual volume to the client, writing data into the virtual volume, deleting data from the virtual volume, etc. based on the data request.
[0054] Taking Figure 2 the data storage system can include storage device 1 and storage device 2, storage device 1 is deployed with virtual volume 1, storage device 2 is deployed with virtual volume 2, and the virtualization server can receive data requests of client 1, and perform data reading, writing and deleting operations on virtual volume 1 according to the data requests.
[0055] The virtual volume deployed on the storage device can be understood as that the storage device abstracts its own physical storage resources into a virtual volume for the virtualization server to access. For example, in the above example, storage device 1 abstracts its own physical storage resources into virtual volume 1, and storage device 2 abstracts its own physical storage resources into virtual volume 2.
[0056] The source virtual volume refers to a virtual volume that needs to read out data in data migration, and the target virtual volume refers to a virtual volume that needs to write data in data migration. In combination with the example of Figure 2 , it is assumed that device maintenance is currently needed for the storage device 1, and in order to guarantee that the data of the virtual volume 1 can be normally read and written by the client during maintenance, the data of the virtual volume 1 needs to be migrated to the virtual volume 2 at present, so as to realize the foregoing function based on the virtual volume 2. In this case, the virtual volume 1 serves as the source virtual volume, and the virtual volume 2 serves as the target virtual volume.
[0057] The first volume configuration information is used to refer to the configuration information of the source virtual volume. Each virtual volume in the data storage system corresponds to specific configuration information, and the configuration information corresponding to different virtual volumes is different. The configuration information can include various information for distinguishing different virtual volumes. Based on the configuration information, the virtualization server can locate different virtual volumes, so as to correctly read and write the corresponding virtual volume according to the data request.
[0058] For example, after receiving the data request, the data request can specify that the data is written into the virtual volume 1. The virtualization server locates the virtual volume 1 in the plurality of virtual volumes based on the configuration information of the virtual volume 1, and then can write the data into the virtual volume 1.
[0059] As some examples, the configuration information of the virtual volume can include some unique attribute information of the virtual volume at the Storage Area Network (SAN) protocol layer, for example, can include but is not limited to a Logical Unit Number (LUN) and other information.
[0060] Step S101 can be understood as changing the original configuration information of the target virtual volume to the first volume configuration information of the source virtual volume, and modifying the original configuration information of the source virtual volume, so that the configuration information of the source virtual volume becomes different from the previous configuration information. After completing the operation, the virtualization server can identify the target virtual volume as the source virtual volume based on the configuration information, and no longer read and write the source virtual volume based on the data request.
[0061] The target data request refers to a data request for the source virtual volume, including but not limited to a data request for reading data from the source virtual volume, a data request for writing data to the source virtual volume, and a data request for deleting data from the source virtual volume, etc. In combination with the example of Figure 2 , the target data request includes but is not limited to a data request for reading data from the virtual volume 1, a data request for writing data to the virtual volume 1, and a data request for deleting data from the virtual volume 1.
[0062] In combination with the example of Figure 2For example, assuming that the configuration information of the virtual volume 1 as the source virtual volume is 10000 and the configuration information of the virtual volume 2 as the target virtual volume is 20000, in S101, the configuration information of the virtual volume 2 can be changed to 10000, the original configuration information of the virtual volume 1 can be emptied, or changed to other configuration information, for example, changed to 30000. After the modification, when the virtualization server receives a target data request again, the virtual volume 2 can be identified as the virtual volume 1, and the virtualization server responds to the data request based on the virtual volume 2, for example, performs data reading and / or data writing operations on the virtual volume 2, instead of responding to the data request based on the virtual volume 1.
[0063] S101 can be implemented by service cut-off. Specifically, the virtualization server can first set the source virtual volume to a suspended state. In the suspended state, the virtualization server can temporarily store the target data request received for the source virtual volume, and not process these target data requests;
[0064] After being set to the suspended state, the virtualization server performs S101 to configure the first volume configuration information to the target virtual volume, and modifies the original configuration information of the source virtual volume.
[0065] After the above operations are completed, the virtualization server cancels the suspended state of the source virtual volume, and starts to process the previously stored target data requests and the subsequently received target data requests according to the target virtual volume.
[0066] It should be noted that since S101 only involves modification of the configuration information of the virtual volume, and does not involve data transmission between the virtual volumes, the service cut-off time is controllable and short, for example, it can be controlled within 5 seconds, and has little effect on the normal operation of the data storage system.
[0067] The service cut-off time can be understood as the time period from when the source virtual volume is set to the suspended state to when the suspended state is canceled.
[0068] S102, after the first volume configuration information of the source virtual volume is configured to the target virtual volume, the data stored in the source virtual volume is migrated to the target virtual volume.
[0069] After the information configuration of S101 is completed, if the virtualization server receives a target data request, it can respond to the received target data request according to the target virtual volume, that is, based on the target data request, perform data reading, writing, deleting, etc. operations on the target virtual volume, instead of performing data reading, writing, deleting, etc. operations on the source virtual volume.
[0070] It can be seen that after the target virtual volume is configured according to S101, the original data stored by the source virtual volume before S101 will no longer change, so when migrating the data stored by the source virtual volume to the target virtual volume, the virtualization server only needs to create a data snapshot for the data currently stored by the source virtual volume, transmit the data snapshot to the target virtual volume, and restore the data stored by the source virtual volume before S101 based on the data snapshot in the target virtual volume, so as to realize the data migration of the source virtual volume to the target virtual volume, and no longer need to repeatedly create multiple data snapshots.
[0071] The beneficial effects of the embodiment are:
[0072] First, by configuring the first volume configuration information of the source virtual volume to the target virtual volume, the source virtual volume stops responding to the target data request, and the target virtual volume responds to the target data request. Then, the source virtual volume data is migrated to the target virtual volume. In this way, the target virtual volume can meet the demand for reading and writing data of the target data request during the migration process, and the data of the source virtual volume can be updated repeatedly to respond to the target data request, so that data migration can be realized without repeatedly creating multiple data snapshots, effectively reducing the storage resources occupied during the migration process.
[0073] Second, when data migration is performed based on the existing method, multiple data snapshots need to be repeatedly created until the created data snapshot meets the business cut condition, and then the business cut process can be started to complete the data migration. However, due to the limited data transmission rate between the source virtual volume and the target virtual volume, it takes a long time to synchronize the data snapshot created each time from the source virtual volume to the target virtual volume, which makes it difficult to meet the business cut condition, and the entire data migration process takes too long.
[0074] The method of the embodiment does not change the data of the source virtual volume after completing the information configuration of S101, so it is not necessary to repeatedly create data snapshots without meeting the business cut condition, effectively shortening the time of the data migration process.
[0075] The business cut condition refers to the similarity between the created data snapshot and the data currently stored by the source virtual volume being greater than a certain threshold, or the data amount of the different data between the two being less than a certain threshold.
[0076] Thirdly, when data migration is performed based on the existing method, the partial data of the source virtual volume still needs to be synchronized to the target virtual volume in the background during the service cut-over process, and the data synchronization can be performed in an asynchronous manner. According to the amount of data to be synchronized and the different network environments between the source virtual volume and the target virtual volume, the time required for the service cut-over process greatly varies, and it is difficult to control the time required for the service cut-over process. If the time required for the service cut-over process is too long, the virtualization server cannot process the target data request for a long time, and the user experience is affected.
[0077] In the method of the embodiment, since step S101 only involves modification of the configuration information of the virtual volume and does not involve transmission of data between the virtual volumes, the service cut-over time is controllable and relatively short, for example, can be controlled within 5 seconds, and has little effect on the normal operation of the data storage system.
[0078] In some optional embodiments, the target data request can include a target write data request, which can be defined as a data request carrying data to be written, i.e., to-be-written data, and indicating that the to-be-written data is to be written into the source virtual volume.
[0079] If the target write data request is received, the method of the embodiment can further respond to the target write data request based on the target virtual volume in the following manner:
[0080] If the data amount of the to-be-written data carried by the target write data request is less than the minimum write granularity of the target virtual volume, target data blocks are obtained from the plurality of data blocks of the source virtual volume, each data block has a data amount consistent with the minimum write granularity, and the target data blocks are data blocks to which the to-be-written data belongs in the plurality of data blocks.
[0081] The to-be-written data is written into the target data blocks to obtain to-be-written data blocks.
[0082] The to-be-written data blocks are written into the target virtual volume.
[0083] The above process is equivalent to reading out the target data blocks from the source virtual volume, merging the to-be-written data and the target data blocks to obtain to-be-written data blocks, and then writing the to-be-written data blocks into the target virtual volume.
[0084] The minimum write granularity of the target virtual volume refers to the minimum amount of data that can be written without affecting other data when performing one write operation. If the storage device supports byte-level write granularity, a certain byte can be modified without affecting the surrounding data.
[0085] The minimum write granularity of the target virtual volume is the same as the minimum write granularity of the source virtual volume. The minimum write granularity of the virtual volume is determined according to the performance of the data storage system and is not limited.
[0086] As some examples, if the minimum write granularity is 4 kilobytes (KB), it means that each time data is written to the virtual volume, a data block of 4 KB size is written, and data less than 4 KB, such as 512 bytes, cannot be written. If the minimum write granularity is 1 byte, it means that each time data is written, 1 byte (i.e., 8 bits) of data is written at a minimum without affecting other data.
[0087] In the case where the minimum write granularity is greater than 1 byte, data in the source virtual volume is generally stored in the form of data blocks, and each data block contains data of the minimum write granularity. For example, if the minimum write granularity is 4 KB, data of the source virtual volume can be stored in the form of multiple data blocks, and each data block contains 4 KB of data.
[0088] Upon receiving the target data write request, the virtualization server can determine, according to an indication of the target data write request, a data block to which data to be written carried by the target data write request needs to be written, that is, determine a target data block corresponding to the target data write request, and then read out the target data block from the source virtual volume. Methods of determining the target data block can be found in related prior art, and are not described herein.
[0089] After obtaining the target data block, the virtualization server determines a write position of the data to be written in the target data block according to the target data write request, and then writes the data to be written to the write position of the target data block to overwrite original data at the write position. After the write operation is completed, the data block containing the data to be written is the data block to be written, and finally the virtualization server writes the data block to be written to the target virtual volume. The write position indicates a position of the data to be written in the target data block, and methods of determining the write position can be found in related prior art, and are not described herein.
[0090] When the data block to be written is written to the target virtual volume, the storage position of the data block to be written in the target virtual volume is the same as the storage position of the target data block in the source virtual volume.
[0091] For example, Figure 3 Assume that the minimum write granularity is 4 KB, virtual volume 1 is the source virtual volume, virtual volume 2 is the target virtual volume, the target data write request received carries 512 bytes of data to be written, the virtualization server determines data block 3 in virtual volume 1 as the target data block, reads out data block 3 from virtual volume 1, then writes the 512 bytes of data to be written to a corresponding write position in data block 3, and finally writes the obtained data block to be written to virtual volume 2, thereby completing the processing procedure of the target data write request.
[0092] In the above embodiment, if the determined target data block already exists in the target virtual volume, the target data block can also be obtained from the target virtual volume and processed in the above write manner, which is not described herein.
[0093] The embodiment has the beneficial effect that the virtualization server can write the to-be-written data into the target virtual volume in the case that the minimum write granularity of the target virtual volume is large and the data amount of the to-be-written data is smaller than the minimum write granularity, thereby meeting the write requirement of the client.
[0094] Optionally, if the data amount of the to-be-written data is equal to the minimum write granularity or an integer multiple of the minimum write granularity, the to-be-written data can also be directly written into the target virtual volume as one or more data blocks.
[0095] In some optional embodiments, the target virtual volume can support byte-level write granularity, so that the target virtual volume supports direct writing of the to-be-written data into the target virtual volume. In this case, if the target data write request is received, the method of the embodiment can also respond to the target data write request based on the target virtual volume in the following manner:
[0096] If the data amount of the to-be-written data carried by the target data write request is greater than or equal to the minimum write granularity of the target virtual volume, the data index corresponding to the to-be-written data and the to-be-written data are written into the target virtual volume.
[0097] The embodiment can be applied to a storage system supporting byte-level write, that is, a storage system in which the minimum write granularity of the virtual volume is 1 byte.
[0098] Generally, a storage system supporting byte-level write can store data in a log-type storage structure. The log-type storage structure can store data in the form of logs. Each log can include two parts, data and data index. The data is the to-be-written data written by the virtualization server according to the target data write request, and the data index is equivalent to information describing the storage location and data attributes of the to-be-written data.
[0099] In the case that the storage system supports byte-level write, the virtualization server can determine the data index of the to-be-written data according to the received target data write request, for example, can directly parse the data index carried by the target data write request, and then write the data index and the to-be-written data as a log into the target virtual volume, thereby storing the to-be-written data in a log-type storage structure.
[0100] The embodiment has the beneficial effect that:
[0101] The above write process does not need to read data from the source virtual volume, so the time for reading data from the source virtual volume and transmitting to the target virtual volume can be saved, and the write efficiency is improved.
[0102] Compared with the case where the byte-level write granularity is not supported, in this embodiment, since the target virtual volume supports the byte-level write granularity, after receiving the target write data request, the virtualization server can directly write the to-be-written data into the target virtual volume without the need to obtain the target data block from the source virtual volume, and the time for searching and transmitting the target data block from the source virtual volume is saved, so in the process of data migration, the to-be-written data can be quickly written into the target virtual volume with a lower latency, the write latency is lower, the response speed of the target write data request will not be affected by the data migration, and users can also obtain a better use experience in the process of data migration.
[0103] In some optional embodiments, the target data request can include a target read data request, the target read data request can be defined as a request for reading data from the source virtual volume, and the data to be read by the target read data request can be referred to as target data.
[0104] The target read data request can carry information capable of describing the target data, for example, can carry the identifier of the data block where the target data is located and the storage location in the data block, or can carry the data index corresponding to the target data.
[0105] On this basis, the virtualization server can respond to the received target read data request in the following manner:
[0106] If the target data is queried in the target virtual volume, the target data is fed back to the client sending the target read data request.
[0107] If the target data is not queried in the target virtual volume, the target read data request is redirected to the source virtual volume, and the target data is fed back to the client sending the target read data request, and the target data refers to the data to be read by the target read data request.
[0108] In this embodiment, the virtualization server can first parse the target read data request to obtain the information capable of describing the target data carried in the target read data request, so as to query whether the target data exists in the target virtual volume according to the information.
[0109] In some scenarios, when the virtualization server receives the target read data request, the corresponding target data can be data written according to the target write data request before or can have been migrated from the source virtual volume to the target virtual volume, in this case, the virtualization server can query the target data from the target virtual volume, if the target data is queried in the target virtual volume, the virtualization server directly reads out the target data from the target virtual volume and sends it to the corresponding client to complete the processing of the target read data request. The corresponding client here refers to the client sending the target read data request.
[0110] In some scenarios, when the virtualization server receives the target read data request, the corresponding target data has not been written into or migrated to the target virtual volume. In this case, the source virtual volume can be queried to find the target data, and the target data can be fed back to the corresponding client.
[0111] On the other hand, the virtualization server can write the target data read from the source virtual volume into the target virtual volume, so that the next time the data is read, it can be directly obtained from the target virtual volume.
[0112] The beneficial effects of the embodiment are:
[0113] When the target read data request is obtained, the target data required by the target read data request can be obtained by querying the source virtual volume and the target virtual volume, and the demand of the corresponding client for reading data can be met.
[0114] Optionally, the method of the embodiment can further include:
[0115] According to the remote network protocol, a remote access link is established between the target virtual volume and the source virtual volume, so that the storage device corresponding to the source virtual volume is mounted to the target storage device through the remote access link; the target storage device is a storage device mounted by the target virtual volume.
[0116] If the remote access link is established, the way of feeding back the target data to the client sending the target read data request in the foregoing embodiment can be:
[0117] The target data is fed back to the client sending the target read data request through the target storage device.
[0118] The operation of establishing the remote access link can be performed before S102, and the remote access link can be closed after the data migration process is completed.
[0119] The storage device corresponding to the source virtual volume is mounted to the target storage device through the remote access link, which can be understood as that the storage resources of the storage device corresponding to the source virtual volume are linked to a specified mounting point based on the remote access link, i.e., linked to the target storage device, so as to establish a logical access channel between the two storage devices. After the mounting is implemented, the storage resources of the source virtual volume and the target storage device are collectively provided for user reading and writing.
[0120] Therefore, after the mounting is completed, the virtualization server can directly read the target data in the storage device corresponding to the source virtual volume through the target storage device as the mounting point, and feed back the target data to the client sending the target read data request.
[0121] In combination with Figure 2In the example, the storage device 1 can be mounted to the storage device 2 by establishing a remote access link, so that the virtualization server can directly read the data stored in the storage resource of the storage device 1 through the storage device 2.
[0122] The remote network protocol used in the embodiment is not limited, and as some examples, the remote network protocol can be any one of a remote direct memory access (RDMA) protocol, a transmission control protocol / internet protocol (TCP / IP), a Fibre Channel (FC) protocol, and an NVMe over Fabric protocol, which are not limited.
[0123] After the remote access link is established based on the remote network protocol, the target virtual volume can read data from the source virtual volume at a read rate close to that of a local solid state disk, thereby significantly shortening the time for reading target data from the source virtual volume. Thus, when receiving a target data read request, the virtualization server can read and feed back target data from the source virtual volume to the client with a shorter read latency, so that the response speed of the target data read request is not affected by data migration, and users can also obtain a better use experience during data migration.
[0124] In some optional embodiments, the target data request can include a target data deletion request, which can be defined as a request for deleting data from the source virtual volume. The data to be deleted by the target data deletion request can be referred to as to-be-deleted data.
[0125] The target data deletion request can carry information capable of describing the to-be-deleted data, for example, can carry an identifier of a data block where the to-be-deleted data is located and a storage location in the data block, or can carry a data index corresponding to the to-be-deleted data.
[0126] In the case of receiving the target data deletion request, migrating the data stored in the source virtual volume to the target virtual volume includes:
[0127] Determining the to-be-deleted data indicated by the target data deletion request from the data stored in the source virtual volume;
[0128] Migrating, to the target virtual volume, the data stored in the source virtual volume except the to-be-deleted data.
[0129] After receiving the target data deletion request, the virtualization server can query whether the target virtual volume has the to-be-deleted data based on the information capable of describing the to-be-deleted data in the target data deletion request, and if so, delete the to-be-deleted data from the target virtual volume;
[0130] If the target virtual volume is found to have no data to be deleted after the query, it means that the data to be deleted has not been migrated from the source virtual volume to the target virtual volume. In this case, the virtualization server can query the data to be deleted from the source virtual volume, delete the data to be deleted from the source virtual volume after the data to be deleted is found, or mark the data to be deleted as data that does not need to be migrated. Thus, when migrating the data of the source virtual volume to the target virtual volume, the data to be deleted can not be migrated.
[0131] Processing the target data deletion request in the above manner can reduce the amount of data migrated from the source virtual volume to the target virtual volume, and further improve the migration efficiency.
[0132] Optionally, migrating the data stored by the source virtual volume to the target virtual volume includes:
[0133] sending the source data stored by the source virtual volume to the target virtual volume;
[0134] updating the source data according to the data to be written and the corresponding data index, to obtain updated source data;
[0135] writing the updated source data to the target virtual volume.
[0136] The manner in which the source data is sent to the target virtual volume can be that a corresponding data snapshot is created for all the data stored by the source virtual volume, and then the data snapshot is transmitted to the target virtual volume. After the transmission is completed, all the data stored by the source virtual volume, that is, the above-mentioned source data, is restored based on the data snapshot.
[0137] The manner in which the virtualization server updates the source data can be that:
[0138] the data to be written in the target virtual volume is used to replace the data having the same index in the source data, to obtain the updated source data.
[0139] As an example, it is assumed that the virtualization server writes 512 bytes of data to be written corresponding to an index 1 in the target virtual volume according to the target write data request. After the source data is obtained, the virtualization server can query 512 bytes of data corresponding to the index 1 in the source data. The 512 bytes of data to be written corresponding to the index 1 in the target virtual volume is used to replace the 512 bytes of data corresponding to the index 1 in the source data, to obtain the updated source data.
[0140] In some optional embodiments, if the source virtual volume and the target virtual volume both store data in the form of data blocks, the manner in which the virtualization server updates the source data to obtain the updated source data can also be that:
[0141] The data block to be written in the target virtual volume is written by using the target write data request, and the data block at the corresponding position in the source data is replaced, to obtain the updated source data.
[0142] In combination with the example, the virtualization server reads out the data block 3 from the source virtual volume when processing the target write data request, writes the data to be written in the data block 3, obtains the data block to be written, and writes the data block to be written in the target virtual volume at the same position as the data block 3; on the basis of obtaining the source data, the virtualization server can replace the data block 3 in the source data with the data block to be written, to obtain the updated source data, and write the updated source data to the target virtual volume. Figure 3
[0143] Through the method of the above embodiment, the virtualization server can cover the old data in the source virtual volume that is not updated during the migration process with the new data written in the target virtual volume during the migration process, to ensure that the data finally migrated to the target virtual volume is the latest data, and avoid the loss of the data written before the migration.
[0144] Optionally, the first volume configuration information of the source virtual volume is configured to the target virtual volume, including:
[0145] In a case where the available storage space of the target virtual volume is greater than or equal to the amount of data currently stored in the source virtual volume, the first volume configuration information of the source virtual volume is configured to the target virtual volume.
[0146] In a case where the available storage space of the target virtual volume is less than the amount of data currently stored in the source virtual volume, the first volume configuration information of the source virtual volume is configured to the target virtual volume after expansion processing is performed on the target virtual volume.
[0147] In this embodiment, the virtualization server can determine the available storage space of the target virtual volume currently and determine the amount of data currently stored in the source virtual volume before S101 is performed, and if the former is greater than or equal to the latter, S101 can be directly performed; if the former is less than the latter, an expansion prompt information can be output to prompt a relevant operation and maintenance personnel to expand the target virtual volume, for example, to increase the number of hard disks of the target virtual volume, to clean up the data currently stored in the target virtual volume, and the like, and S101 is performed after it is determined that the available storage space of the target virtual volume currently is greater than or equal to the amount of data currently stored in the source virtual volume.
[0148] The embodiment has the following beneficial effects:
[0149] The target virtual volume can accommodate all the data migrated from the source virtual volume when the migration is performed, to prevent the available storage space of the target virtual volume from being insufficient during the migration process, and to prevent the data of the source virtual volume from being lost due to the failure to write the data to the target virtual volume.
[0150] Optionally, the method of the embodiment further comprises:
[0151] configuring the second volume configuration information of the target virtual volume to the source virtual volume.
[0152] The second volume configuration information refers to the original configuration information of the target virtual volume.
[0153] In the embodiment, when performing S101, the virtualization server can configure the first volume configuration information of the source virtual volume to the target virtual volume, and configure the second volume configuration information of the target virtual volume to the source virtual volume, that is, exchange the configuration information of the source virtual volume and the target virtual volume.
[0154] In combination with the foregoing example, before the exchange, the configuration information of the virtual volume 1 as the source virtual volume is 10000, and the configuration information of the virtual volume 2 as the target virtual volume is 20000. After the exchange, the configuration information of the virtual volume 1 is 20000, and the configuration information of the virtual volume 2 is 20000.
[0155] The advantage of exchanging the configuration information in the above manner is that:
[0156] Both the target virtual volume can respond to the target data request, and the source virtual volume can be used as the target virtual volume when needed, for example, the source virtual volume can be used to store data originally to be written into the target virtual volume, so that the storage resources of the data storage system are fully utilized.
[0157] The embodiment further provides a data migration device, please refer to Figure 4 The device can include the following units.
[0158] The configuration unit 401 is configured to configure the first volume configuration information of the source virtual volume to the target virtual volume, so that the target virtual volume responds to the target data request, and the target data request is a data request for the source virtual volume.
[0159] The migration unit 402 is configured to migrate the data stored by the source virtual volume to the target virtual volume after the first volume configuration information of the source virtual volume is configured to the target virtual volume.
[0160] Optionally, the target data request includes a target write data request, and the migration unit 402 is further configured to:
[0161] When the target virtual volume processes the target write data request, write the data index corresponding to the to-be-written data and the to-be-written data into the target virtual volume.
[0162] Optionally, the migration unit 402 migrates the data stored by the source virtual volume to the target virtual volume, including:
[0163] Send the source data stored by the source virtual volume to the target virtual volume;
[0164] updating the source data according to the to-be-written data and the corresponding data index of the target virtual volume, to obtain updated source data;
[0165] writing the updated source data into the target virtual volume.
[0166] Optionally, the target virtual volume supports a byte-level write granularity, so that the target virtual volume supports direct writing of the to-be-written data into the target virtual volume.
[0167] Optionally, the target data request comprises a target read data request.
[0168] The migration unit 402 is further configured to:
[0169] if the target data is queried from the target virtual volume, feeding back the target data to a client that sends the target read data request.
[0170] if the target data is not queried from the target virtual volume, redirecting the target read data request to the source virtual volume, and feeding back the target data to the client that sends the target read data request, the target data referring to data to be read by the target read data request.
[0171] Optionally, the migration unit 402 redirects the target read data request to the source virtual volume, and feeds back the target data to the client that sends the target read data request, comprising:
[0172] establishing a remote access link between the target virtual volume and the source virtual volume according to a remote network protocol, so that a storage device corresponding to the source virtual volume is mounted to a target storage device through the remote access link; the target storage device being a storage device mounted by the target virtual volume.
[0173] feeding back the target data to the client that sends the target read data request through the target storage device.
[0174] Optionally, the target data request comprises a target data deletion request.
[0175] The migration unit 402 migrates data stored by the source virtual volume to the target virtual volume, comprising:
[0176] determining, from the data stored by the source virtual volume, to-be-deleted data indicated by the target data deletion request;
[0177] migrating, to the target virtual volume, data stored by the source virtual volume and excluding the to-be-deleted data.
[0178] Optionally, the configuration unit 401 is further configured to:
[0179] configuring second volume configuration information of the target virtual volume to the source virtual volume.
[0180] Optionally, the configuration unit 401 configures the first volume configuration information of the source virtual volume to the target virtual volume, including:
[0181] In a case where the available storage space of the target virtual volume is greater than or equal to the current data amount stored by the source virtual volume, the first volume configuration information of the source virtual volume is configured to the target virtual volume.
[0182] In a case where the available storage space of the target virtual volume is less than the current data amount stored by the source virtual volume, the first volume configuration information of the source virtual volume is configured to the target virtual volume after the target virtual volume is expanded.
[0183] The working principle of the data migration apparatus of the embodiment can be referred to the related steps of the data migration method of the foregoing embodiments, and will not be described herein.
[0184] The embodiment further provides a storage system, including:
[0185] a client, configured to send a data request to a server;
[0186] a plurality of storage devices, each of which is configured to abstract physical storage resources into a virtual volume;
[0187] a server, configured to read and write data from and to the virtual volume of the storage device according to the data request of the client;
[0188] The server is further configured to:
[0189] configure the first volume configuration information of the source virtual volume to the target virtual volume, so that the target virtual volume responds to a target data request, the target data request being a data request for the source virtual volume;
[0190] migrate the data stored by the source virtual volume to the target virtual volume after the first volume configuration information of the source virtual volume is configured to the target virtual volume.
[0191] The structure of the storage system can be referred to Figure 2 The server in the storage system is equivalent to the virtualization server shown in Figure 2 The working principle of the storage system can be referred to the data migration method of the foregoing embodiments, and will not be described herein.
[0192] The various embodiments described in this specification are described in progressive order, with each embodiment building on the previous one. The same or similar elements in each embodiment are denoted by the same or similar reference signs. For each embodiment, the differences between that embodiment and the preceding ones are described in more detail. In particular, the system or system embodiments are described more briefly than the method embodiments, since they are substantially similar to the method embodiments. The system and system embodiments described above are merely illustrative, and the units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. can be located at one place or distributed over multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. Those skilled in the art can understand and implement without creative labor.
[0193] The skilled person will further appreciate that the elements and algorithm steps of the examples described in relation to the embodiments disclosed herein can be implemented in electronic hardware, computer software, or any combination of the two. To clearly illustrate the interchangeability of hardware and software, the elements and steps of the examples have been described generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the particular application and design constraints imposed on the overall system. Skilled persons can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the application.
[0194] The above description of disclosed embodiments enables a person skilled in the art to implement or use the application. Numerous modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the application. Therefore, the present application is not to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data migration method, characterized by, The method comprises: configuring first volume configuration information of a source virtual volume to a target virtual volume, so that the target virtual volume responds to a target data request, the target data request being a data request for the source virtual volume; after the first volume configuration information of the source virtual volume is configured to the target virtual volume, migrating data stored in the source virtual volume to the target virtual volume.
2. The method of claim 1, wherein, The target data request comprises a target write data request, and the method further comprises: when the target virtual volume processes the target write data request, writing the data index corresponding to the to-be-written data and the to-be-written data into the target virtual volume.
3. The method of claim 2, wherein, The migration of the data stored in the source virtual volume to the target virtual volume comprises: sending source data stored in the source virtual volume to the target virtual volume; updating the source data according to the to-be-written data and the corresponding data index written into the target virtual volume, to obtain updated source data; writing the updated source data into the target virtual volume.
4. The method of claim 2, wherein, The target virtual volume supports a write granularity of a byte level, so that the target virtual volume supports direct writing of the to-be-written data into the target virtual volume.
5. The method of claim 1, wherein, The target data request comprises a target read data request. The method further comprises: when the target virtual volume processes the target read data request, if the target data is queried in the target virtual volume, feeding back the target data to a client sending the target read data request; if the target data is not queried in the target virtual volume, redirecting the target read data request to the source virtual volume, and feeding back the target data to the client sending the target read data request, the target data referring to data to be read by the target read data request.
6. The method of claim 5, wherein, The redirection of the target read data request to the source virtual volume and the feeding back of the target data to the client sending the target read data request comprise: establishing a remote access link between the target virtual volume and the source virtual volume according to a remote network protocol, so that a storage device corresponding to the source virtual volume is mounted to a target storage device through the remote access link; the target storage device being a storage device mounted by the target virtual volume; feeding back the target data to the client sending the target read data request through the target storage device.
7. The method of claim 1, wherein, The method further comprises: configuring second volume configuration information of the target virtual volume to the source virtual volume.
8. The method of claim 1, wherein, The configuration of the first volume configuration information of the source virtual volume to the target virtual volume comprises: in a case where available storage space of the target virtual volume is greater than or equal to an amount of data currently stored in the source virtual volume, configuring the first volume configuration information of the source virtual volume to the target virtual volume; in a case where the available storage space of the target virtual volume is less than the amount of data currently stored in the source virtual volume, performing expansion processing on the target virtual volume, and then configuring the first volume configuration information of the source virtual volume to the target virtual volume.
9. The method of claim 1, wherein, The target data request comprises a target data deletion request. The migration of the data stored in the source virtual volume to the target virtual volume comprises: determining, from the data stored in the source virtual volume, to-be-deleted data indicated by the target data deletion request; Migrate data stored in the source virtual volume to the target virtual volume, except the data to be deleted.
10. A data migration apparatus, characterized by comprising: Comprise: A configuration unit, configured to configure first volume configuration information of a source virtual volume to a target virtual volume, so that the target virtual volume responds to a target data request, the target data request being a data request for the source virtual volume; A migration unit, configured to migrate data stored in the source virtual volume to the target virtual volume after the first volume configuration information of the source virtual volume is configured to the target virtual volume.
11. A storage system, characterized by Comprise: A client, configured to send a data request to a server; A plurality of storage devices, each of which is configured to abstract physical storage resources into a virtual volume; A server, configured to read and write data from and to the virtual volume of the storage device according to the data request of the client; The server is further configured to: Configure first volume configuration information of a source virtual volume to a target virtual volume, so that the target virtual volume responds to a target data request, the target data request being a data request for the source virtual volume; Migrate data stored in the source virtual volume to the target virtual volume after the first volume configuration information of the source virtual volume is configured to the target virtual volume.
12. A computer storage medium, characterized in that A computer program storage medium, wherein the computer program is executed by a processor of an electronic device to which the computer storage medium belongs, and is used to implement the data migration method of any one of claims 1 to 9.