FlashCopy mappings

The FlashCopy® function creates a point-in-time copy of data that is stored on a source volume to a target volume. In its basic mode, the FlashCopy function creates copies of content on a source volume to a target volume in a mapping. The function associates a source volume and a target volume in a mapping. If data exists on the target volume, that data is replaced by the copied data.

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 FlashCopy mapping defines the relationship that copies data between a source volume and a target volume. 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. 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.

Although it is difficult to make a consistent copy of a data set that is constantly updated, point-in-time copy techniques help solve this problem. If a copy of a data set is created that uses a technology that does not provide point-in-time techniques and the data set changes during the copy operation, the resulting copy might contain data that is not consistent. For example, if a reference to an object is copied earlier than the object itself and the object is moved before it is copied, the copy contains the referenced object at its new location, but the copied reference still points to the previous location. You can also assign background copy and cleaning rates to a FlashCopy mapping to control the rate at which updates are propagated to the remote system. FlashCopy mapping copy rate values can be from 128 KBps to 2 GBps and can be changed when the FlashCopy mapping is in any state.

FlashCopy mappings can be assigned to an ownership group. An ownership group defines a subset of users and objects within the system. You can create ownership groups to further restrict access to specific resources that are defined in the ownership group. Only users with Security Administrator roles can configure and manage ownership groups. Restricted users are those users who are defined to a specific ownership group and can only view or manage specific resources that are assigned to that ownership group. Unrestricted users are not defined to an ownership group and can manage any objects on the system based on their role on the system.

Ownership can be defined explicitly or it can be inherited from the user, user group, or from other parent resources, depending on the type of resource. FlashCopy mappings inherit ownership from the parent resource. A user cannot change the ownership group of the resource, but can change the ownership group of the parent object. The following rules apply to FlashCopy mappings that are defined in ownership groups:

  • FlashCopy mappings inherit the ownership group of both the volumes that are defined in the mapping.
  • Like with FlashCopy consistency groups, it is possible for a consistency group and its mappings to belong to different ownership groups. However, the ownership of the consistency group has no impact in the ownership of the mappings that it contains.

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 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.

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 Figure 2.

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 depend 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 are 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 FlashSystem 7200 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.