FlashCopy mappings

A FlashCopy mapping defines the relationship that copies data between a source volume and a target volume.

The FlashCopy function makes an instant copy of a volume at the time that it is started. To create an instant copy of a volume, you must first create a mapping between the source volume (the disk that is copied) and the target volume (the disk that receives the copy). The source and target volumes must be of equal size.

A mapping can be created between any two volumes in a system. The volumes do not have to be in the same I/O group or pool. When a FlashCopy operation starts, a checkpoint is made of the source volume. No data is copied at the time a start operation occurs. Instead, the checkpoint creates a bitmap that indicates that no part of the source volume has been copied. Each bit in the bitmap represents one region of the source volume. Each region is called a grain.

After a FlashCopy operation starts, read and write operations to the source volume continue to occur. If new data is written to the source or target volume, the existing data on the source is copied to the target volume before the new data is written to the source or target volume. The bitmap is updated to mark that the grain of the source volume has been copied so that later write operations to the same grain do not recopy the data.

During a read operation to the target volume, the bitmap is used to determine whether the grain was copied. If the grain was copied, the data is read from the target volume. If the grain was not copied, the data is read from the source volume.

Incremental FlashCopy mappings

In an incremental FlashCopy, the initial mapping copies all of the data from the source volume to the target volume. Subsequent FlashCopy mappings copy only data that was modified after the initial FlashCopy mapping, as shown in Incremental FlashCopy of differences. This process reduces the amount of time that is needed to re-create an independent FlashCopy image. You can define a FlashCopy mapping as incremental only when you create the FlashCopy mapping.

Figure 1. Incremental FlashCopy of differences
Incremental FlashCopy of differences

FlashCopy partner mappings

You can create a mapping to mirror an existing incremental FlashCopy mapping. The mappings that are paired are called partners. A mapping can have only one partner. For example, if you have volume A and volume B with two mappings (Mapping 0 from volume A to volume B and Mapping 1 from volume B to volume A), Mapping 0 and Mapping 1 are partners.

Incremental FlashCopy mappings share the metadata for recording changes. Therefore, if one mapping in a mirrored pair (partnership) is incremental, the other mapping becomes incremental automatically and remains incremental until it is deleted.

Cascaded FlashCopy mappings

The cascaded FlashCopy function allows a FlashCopy target volume to be the source volume of another FlashCopy mapping, as shown in Cascading FlashCopy volumes.

Figure 2. Cascading FlashCopy volumes
Cascading FlashCopy volumes

Up to 256 mappings can exist in a cascade. If cascaded mappings and multiple target mappings are used, a tree of up to 256 mappings can be created.

Multiple target FlashCopy mappings

You can copy up to 256 target volumes from a single source volume. Each relationship between a source and target volume is managed by a unique mapping such that a single volume can be the source volume in up to 256 mappings.

Each of the mappings from a single source can be started and stopped independently. If multiple mappings from the same source are active (in the copying or stopping states), a dependency exists between these mappings.

For example, Mapping A depends on Mapping B if the following conditions are true:
  • Mapping A and mapping B both have the same source volume.
  • Mapping A and mapping B are both in the copying or stopping state.
  • Mapping B was started more recently than mapping A.
    Note: If both mappings were in the same consistency group and started at the same time, the order of dependency is decided internally when the consistency group is started.
  • Mapping A does not have a complete copy of the source because the copying progress for the mapping is less than 100.
  • A mapping does not exist from the same source that was started more recently than A and later than B that has a complete copy of the source because the copying progress of the mapping is less than 100.

As another example, Target volume A depends on Target volume B if the mapping that volume A belongs to depends on the mapping that Target volume B belongs to. The target volume of the most recently started mapping from the source volume depends on the source volume until a complete copy of the source is created (progress is 100%).

Clean rate, copy rate, and autodelete

When you create a mapping, you specify a clean rate. The clean rate is used to control the rate that data is copied from the target volume of the mapping to the target volume of a mapping that is either the latest copy of the target volume, or is the next oldest copy of the source volume. The clean rate is used in the following situations:
  • The mapping is in the stopping state.
  • The mapping is in the copying state and has a copy rate of zero.
  • The mapping is in the copying state and the background copy completed.

You can use the clean rate to minimize the amount of time that a mapping is in the stopping state. If the mapping has not completed, the target volume is offline while the mapping is stopping. The target volume remains offline until the mapping is restarted.

You also specify a copy rate when you create a mapping. When the mapping is in the copying state, the copy rate determines the priority that is given to the background copy process. If you want a copy of the whole source volume so that a mapping can be deleted and still be accessed from the target volume, you must copy all the data that is on the source volume to the target volume.

The default values for both the clean rate and the copy rate is 50.

When a mapping is started and the copy rate is greater than zero, the unchanged data is copied to the target volume. The bitmap is updated to show that the data was copied. After a time, the length of which depends on the priority that was determined by the copy rate and the size of the volume, the whole volume is copied to the target. The mapping returns to the idle_or_copied state and you can now restart the mapping at any time to create a new copy at the target.

While the mapping is in the copying state, you can set the copy rate to zero and the clean rate to a value other than zero to minimize the amount of time a mapping is in the stopping state.

If you use multiple target mappings, the mapping can stay in the copying state after all of the source data is copied to the target (the progress is 100%). This situation can occur if mappings that were started earlier and use the same source disk are not yet 100% copied.

If the copy rate is zero, only the data that changes on the source is copied to the target. The target never contains a copy of the whole source unless every extent is overwritten at the source. You can use this copy rate when you require a temporary copy of the source.

You can stop the mapping at any time. However, unless the target volume already contains a complete copy of the source volume, when the mapping is stopped, the target becomes inconsistent and the target volume is taken offline. The target volume remains offline until the mapping is restarted.

You can also set the autodelete attribute. If this attribute is set to on, the mapping is automatically deleted when the mapping reaches the idle_or_copied state and the progress is 100%.

FlashCopy mapping states

At any point, a mapping is in one of the following states:
Idle or copied
The source and target volumes act as independent volumes even if a mapping exists between the two. Read and write caching is enabled for both the source and the target volumes.

If the mapping is incremental and the background copy is complete, the mapping records only the differences between the source and target volumes. If the connection to both nodes in the I/O group that the mapping is assigned to is lost, the source and target volumes will be offline.

Copying
The copy is in progress. Read and write caching is enabled on the source and the target volumes.
Prepared
The mapping is ready to start. The target volume is online, but is not accessible. The target volume cannot perform read or write caching. Read and write caching is failed by the SCSI front end as a hardware error. If the mapping is incremental and a previous mapping has completed, the mapping records only the differences between the source and target volumes. If the connection to both nodes in the I/O group that the mapping is assigned to is lost, the source and target volumes go offline.
Preparing
The target volume is online, but not accessible. The target volume cannot perform read or write caching. Read and write caching is failed by the SCSI front end as a hardware error. Any changed write data for the source volume is flushed from the cache. Any read or write data for the target volume is discarded from the cache. If the mapping is incremental and a previous mapping has completed, the mapping records only the differences between the source and target volumes. If the connection to both nodes in the I/O group that the mapping is assigned to is lost, the source and target volumes go offline.
Stopped
The mapping is stopped because either you issued a stop command or an I/O error occurred. The target volume is offline and its data is lost. To access the target volume, you must restart or delete the mapping. The source volume is accessible and the read and write cache is enabled. If the mapping is incremental, the mapping is recording write operations to the source volume. If the connection to both nodes in the I/O group that the mapping is assigned to is lost, the source and target volumes go offline.
Stopping
The mapping is copying data to another mapping.
  • If the background copy process is complete, the target volume is online while the stopping copy process completes.
  • If the background copy process is not complete, data is discarded from the target volume cache. The target volume is offline while the stopping copy process runs.
The source volume is accessible for I/O operations.
Suspended
The mapping started, but it did not complete. Access to the metadata is lost, which causes both the source and target volume to go offline. When access to the metadata is restored, the mapping returns to the copying or stopping state and the source and target volumes return online. The background copy process resumes. If the data was not flushed and was written to the source or target volume before the suspension, it is in the cache until the mapping leaves the suspended state.
Notes:
  1. If a FlashCopy source volume goes offline, any FlashCopy target volumes that depend on that volume also go offline.
  2. If a FlashCopy target volume goes offline, any FlashCopy target volumes that depend on that volume also go offline. The source volume remains online.
Before you start the mapping, you must prepare it. Preparing the mapping ensures that the data in the cache is de-staged to disk and a consistent copy of the source exists on disk. The cache goes into write-through mode. Data that is written to the source is not cached in the Lenovo Storage V series system nodes; it passes straight through to the MDisks. The prepare operation for the mapping might take some time to complete; the actual length of time depends on the size of the source volume. You must coordinate the prepare operation with the operating system. Depending on the type of data that is on the source volume, the operating system or application software might also cache data write operations. You must flush, or synchronize, the file system and application program before you prepare and start the mapping.
Note: The startfcmap and startfcconsistgrp commands can take some time to process.

If you do not want to use consistency groups, the system allows a mapping to be treated as an independent entity. In this case, the mapping is known as a stand-alone mapping. For mappings that were configured in this way, use the prestartfcmap and startfcmap commands rather than the prestartfcconsistgrp and startfcconsistgrp commands.

FlashCopy mapping restoration

You can start a mapping with a target volume that is the source volume of another active mapping that is in either the idle_copied, stopped, or copying states. If the mapping is in the copying state, the restore parameter is required for the startfcmap and prestartfcmap commands. You can restore the contents of a FlashCopy source volume by using the target of the same FlashCopy mapping or a different FlashCopy mapping without waiting for the mapping to become idle and without loss of the contents of any other FlashCopy target volume.

Veritas Volume Manager

For FlashCopy target volumes, the system sets a bit in the inquiry data for those mapping states where the target volume might be an exact image of the source volume. Setting this bit enables the Veritas Volume Manager to distinguish between the source and target volumes and provide independent access to both.