As a storage specialist, say your interest is to configure EMC clones and get going. You google around and find out pdfs and websites explaining bits and bobs, but nothing that could give you an overall picture. You’re gonna love this article in that case. It gives a quick overview of clones in EMC world so that you can get started. It assumes that you are an experienced Storage personnel, and know a fair bit about various terminology used.
Clones, and how they differ from snaps (differences between snaps and clones)
To understand the difference between clones and snaps, it is necessary to understand the similarities between them. Say, you’ve production data on a source device, and you want a copy of this data on target device, so that you can perform backup or run a job using that target device. It can be achieved in one of the two ways – via snaps or clones. They both are basically a point in time copy of source data, and can be pretty much used as soon as they have been set up. However they both differ in the way they store source data.
A snap in itself doesn’t contain any actual data when created, instead it contains pointers to data which is held on source device. When new writes arrives for source device, original tracks from source device are written to snap device before they are modified on source device. As a result, the snap device will now contain actual data in addition to pointers for data that hasn’t changed yet. When reads are performed on snap devices, they will be either read from source device using pointers or from snap’s own written data in case it was modified on source. When 100% tracks on source device are modified since the time snaps were taken, the size of snap will be same as source device because all those tracks would have been written to snap device, and all subsequent reads on snap will be performed on snap’s own data.
A clone is actually same as source device in size and nature. This means, unlike snaps, clone device takes up disk space the moment it is created. When clone session is created with appropriate options, data from source devices gets copied to target devices in the background. When reads are performed on clone devices, they will be read from clone device if data has already been copied from source to clone else it will be read from source device.
Clone Process Overview
The whole process involves 3 steps – setting up a session, activating the session, terminating the session
Setting up a session
:
This in short means marrying up partners – telling target clone device what its source device is. Devices will be paired up so long as the session exist. As soon as the session has been set up, data will start getting copied over from source device to clone device in the background. Status of pair will be CreateInProgress. There are a few options that could be given while setting up the session, and the most important option I think is -differential and -precopy. Why? Explained in the next sections. Clone device is NotReady at this stage and can’t be used on the host yet.
Activating the session
:
This means taking a point in time copy of source data and making clone device available for use on the host. Now when the session is activated, data on source device at that point of time will be copied over to clone device in full throttle and status of pair will change to CopyInProgress or CopyOnAccess and eventually to Copied after all data is copied across. Any change on source device after the session has been Activated won’t be copied to clone device. For an example, if source had a file called testfile1 at the time of activation, clone would contain that file. But if a new file testfile2 was created on source device after activation, then clone wouldn’t have that file.
Terminating the session
:
This means ending the relationship between source and clone devices. Once the session is terminated, clone devices become independent entities same as source devices and can be used just same as any other TDEV.
Understanding -differential option
Option -differential can best be explained with an example. Suppose a 20TB database got corrupted, and we aren’t sure whether backup contains corrupted data. You could proceed with restoring all 20TB that was backed up day before corruption, and might not get lucky if the backup itself included that corrupted data. 20TB restore is no mean thing, depending upon speed of your set up, it might take many days. If at the end of restore, restored data is found to contain corruption, that’s a big loss of resources, time, and efforts and also the business stays affected for so many days. One of the possible solutions is to restore chunk of data (say 2TB) at a time, test it before proceeding with next chunk of 2TB worth files. If any chunk is found to contain the corrupted data, then resotre that chunk from older backups. Steps in general would go as below:
1. Restore first chunk of 2TB and start database.
2. If DB starts successfully, take clones (this will ensure you’ve a point in time copy after 2TB of clean data was successfully restored)
3. Proceed with next 2TB of restore while database is still running.
4. If no issues found with next 2TB of data too, then quiesce the database, take clones, restart the database, and proceed with next 2TB of restore and so on.
If corrupted data is found at any stage during this operation, you’ve a point in time copy running on clone that you know is clean. Restore data from clone devices on to source devices (this should be quicker than restoring from backups), and then proceed with older version of that particular chunk’s backup.
If the session was established with -differential option, every new point in time copy on clone devices would copy only the differences since last point in time copy. This should be 2TB because that’s how much it has changed since last restore. If -differential option was not used, every new point in time copy would copy everything right from the first block.
Understanding -precopy option
Option -precopy can also be best explained with an example. Say, source device had 5 files when session was created with -precopy option. Array starts copying data from source to target in the background. If a new sixth file is created now before the session is activated, that file will also be copied across. This is because of -precopy. All this happening while session is still not activated. In short, -precopy copies all the data from source device in addition to all changes on source device between when the session was created, and when the session was activated. This speeds up the copy process.
Symclone Command Reference
Below listed is a standard procedure that I would use for setting up clones with most commonly used options. Please read man page for all the other options that I haven’t included in following commands.
1. Create a device group containing source and target devices
# symdg create clonedg -type regular
# symld -sid 1234 -g clonedg add dev SRC001 1AA1
OR # symld -sid 1234 -g clonedg addall dev -range 1AA1:1AA3
# symld -sid 1234 -g clonedg add dev TGT001 2BB3 -tgt
OR # symld -sid 1234 -g clonedg addall dev -range 2BB1:2BB1 -tgt
2. Set up a session using device group
# symclone -g clonedg create -differential -precopy -tgt
'Create' operation execution is in progress for
device group 'clonedg'. Please wait...
'Create' operation successfully executed for device group
'clonedg'.
# symclone -g clonedg query
Device Group (DG) Name: clonedg
DG's Type : ANY
DG's Symmetrix ID : 000292601234
Source Device Target Device State Copy
--------------------------------- ---------------------------- ------------ ----
Protected Modified Modified
Logical Sym Tracks Tracks Logical Sym Tracks CGDP SRC <=> TGT (%)
--------------------------------- ---------------------------- ------------ ----
SRC001 1AA1 332281 0 TGT001 2BB1 0 XXX. PreCopy 10
Total -------- -------- --------
Track(s) 332281 0 0
MB(s) 20767.6 0.0 0.0
Legend:
(C): X = The background copy setting is active for this pair.
V = The VP Snap setting is active for this pair.
. = Neither setting is active for this pair.
(G): X = The Target device is associated with this group.
. = The Target device is not associated with this group.
(D): X = The Clone session is a differential copy session.
. = The Clone session is not a differential copy session.
(P): X = The pre-copy operation has completed one cycle.
. = The pre-copy operation has not completed one cycle.
3. Activate the session
# symclone -g clonedg activate -tgt -nop
'Activate' operation execution is in progress for
device group 'clonedg'. Please wait...
'Activate' operation successfully executed for device group
'clonedg'.
# symclone -g clonedg query
Device Group (DG) Name: clonedg
DG's Type : ANY
DG's Symmetrix ID : 000292601234
Source Device Target Device State Copy
--------------------------------- ---------------------------- ------------ ----
Protected Modified Modified
Logical Sym Tracks Tracks Logical Sym Tracks CGDP SRC <=> TGT (%)
--------------------------------- ---------------------------- ------------ ----
SRC001 1AA1 158103 0 TGT001 2BB1 0 XXX. CopyInProg 57
Total -------- -------- --------
Track(s) 158103 0 0
MB(s) 9881.4 0.0 0.0
Legend:
(C): X = The background copy setting is active for this pair.
V = The VP Snap setting is active for this pair.
. = Neither setting is active for this pair.
(G): X = The Target device is associated with this group.
. = The Target device is not associated with this group.
(D): X = The Clone session is a differential copy session.
. = The Clone session is not a differential copy session.
(P): X = The pre-copy operation has completed one cycle.
. = The pre-copy operation has not completed one cycle.
# symclone -g clonedg query
Device Group (DG) Name: clonedg
DG's Type : ANY
DG's Symmetrix ID : 000292605120
Source Device Target Device State Copy
--------------------------------- ---------------------------- ------------ ----
Protected Modified Modified
Logical Sym Tracks Tracks Logical Sym Tracks CGDP SRC <=> TGT (%)
--------------------------------- ---------------------------- ------------ ----
DEV001 1D40 0 0 TGT001 24FA 0 XXX. Copied 100
Total -------- -------- --------
Track(s) 0 0 0
MB(s) 0.0 0.0 0.0
Legend:
(C): X = The background copy setting is active for this pair.
V = The VP Snap setting is active for this pair.
. = Neither setting is active for this pair.
(G): X = The Target device is associated with this group.
. = The Target device is not associated with this group.
(D): X = The Clone session is a differential copy session.
. = The Clone session is not a differential copy session.
(P): X = The pre-copy operation has completed one cycle.
. = The pre-copy operation has not completed one cycle.
4. Verify the copy progress
# symclone -g clonedg verify
All devices in the group 'clonedg' are in 'Copied' state.
5. Recreate the session (optional – if you wanted to take additional clone as explained in above database restore example)
# symclone -g clonedg recreate -precopy
6. Terminate the session
# symclone -g clonedg terminate
NOTE: Instead of device group, all above commands can also be run using flat file consisting of source devices in first column and target devices in second column.
Few other symclone command options
estbalish
Creates and activates an internal copy session with the devices in the group and one or more target devices associated with the group. Specifying this argument without the -full option performs a recreate followed by an activate operation.
# symclone -g clonedg -establish
is equivalent of
# symclone -g clonedg -recreate
# symclone -g clonedg -activate
OR
# symclone -g clonedg create -full
# symclone -g clonedg activate
restore
Initiates a copy from the target device to a source device. When you specify this argument with the -full option, a full copy of the data currently on the target device will occur. The device must be in a Copied state for a restore to take place.
split
Splits a clone device pair that is in the Restored state. Once in the Split state, you can either recreate or restore the pair.
No comments yet.