A FlashCopy® mapping defines the relationship between a source volume and a target volume.
The FlashCopy® feature 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 actually 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 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.
In an incremental FlashCopy, the initial mapping copies all of the data from the source volume to the target volume. Subsequent FlashCopy mappings only copy data that was modified after the initial FlashCopy mapping, as shown in Figure 1. 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.
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.
The cascaded FlashCopy function allows a FlashCopy target volume to be the source volume of another FlashCopy mapping, as shown in Figure 2.
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.
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.
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 volumeuntil a complete copy of the source is created (progress is 100%).
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%.
If the mapping is incremental and the background copy is complete, the mapping only records 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.
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.
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.
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.