A computer program product for establishing copy relationships for primary storage and secondary storage, wherein the computer program product comprises a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause operations, the operations comprising:
- receiving a command to establish a primary copy relationship of primary source data in the primary storage to copy to primary target data in the primary storage and a secondary copy relationship of secondary source data in the secondary storage to copy to secondary target data in the secondary storage;
- determining whether a part of the secondary target data in a secondary pre-existing copy relationship at the secondary storage can be withdrawn from the secondary pre-existing copy relationship;
- in response to determining that the part of the secondary target data in the secondary pre-existing copy relationship can be withdrawn, performing:
- establishing the primary copy relationship for the primary storage;
- and
- establishing the secondary copy relationship for the secondary storage.