Monday, October 21, 2013

NetApp Vol Copy commands for Data Ontap

Information:
The vol copy command has several uses the most common use is to copy or move a volume from one aggregate to another aggregate on the same Netapp controller.  The following are the general steps and associated perquisites needed to complete a move (copy and manually delete) operation while keeping the original source in place for a period of time should it be needed.

Note:
If you get the following error while trying to connect to a remote filer. Then enable rsh "options rsh.enable on" on both controllers then run the command.

Source_Filer: Connection refused
VOLCOPY: Could not connect to filer Source_Filer.
VOLCOPY: Cannot Init Input, aborting

Restrictions
  • The destination volume can’t be the root volume
  • The destination volume must be offline.
  • All existing data in the destination volume will be over written
  • The destination volume must be >= the source volume size
  • The source and destination volumes must be of same type (traditional, flexible, 32bit, or 64bit volumes).  To copy from 32bit to 64bit or from traditional to flexible you must use ndmpcopy.
Note: You can use Netapp Filerview or Netapp System Manager to perform most other steps, however all examples given are using the command line.

General Steps to follow
1)  The target volume options and other settings (snap schedule, etc) will be copied over from the source volume. The one exception to this is; LUN mappings are not copied to the target volume.  LUN mappings must be manually recreated on the target volume. You can use the following commands to review current settings as needed.
vol status -v source_volume
vol options source_volume
vnap sched source_volume

2)  Create the target volume
a.  Command line example
vol create target_volume aggr_01 100g

3)  Configure the target volume to be offline
a.  Command line example
vol offline target_volume

4)  If the source volume is currently in use, you should disable access, shutdown the server accessing the volume, remove the lun mappings, etc.  Which option(s) you use may vary.  The general idea is to make sure no changes are being made to the volume while the copy is in progress.

5)  Start the copy process, select one of the following commands based on your needs.
a.  Copy source volume to the target volume, do not copy the snapshots.
vol copy start source_volume target_volume

b.  Copy source volume to the target volume, and one snapshot (nightly.1)
vol copy start -s nightly.1 source_volume target_volume

c.  Copy the source volume and all its snapshots to the target volume
vol copy start -S source_volume target_volume

d.  Once the copy is started do not press Control – C and do not close the RSH window, this will terminate the copy process.
e.  If using SSH you will loose access to the console while the copy is in progress.  It is recommended you use RSH to initiate multiple vol copy commands, but only over a reliable and secure network connection.
f.  You are limited to 2 vol copy start commands when copying on a single Netapp controller, or 4 vol copy start commands when copying between two Netapp controllers.  This is because each Netapp controller supports up to 4 concurrent copy processes.  However, each vol copy start command initiates two separate processes, one to read and the other to write.

6)  To monitor the copy progress from either an SSH or RSH session use this command.
a.  vol copy status

7)  Bring the new volume and LUN online, change configuration as needed to point to the new volume/LUN.  This could be deleting and recreating the CIFS shares, changing the LUN mapping to the server, etc.  What configuration changes need to be completed will vary.  The general idea is to make sure the new volume is now being used and the old volume is not being used.

8)  On the target volume delete the snap used by the vol copy command
snap list target_volume

snap delete -V target_volume snapshot_for_volcopy

9)  Keep the old volume around as a fail safe for a few days or weeks as needed.

10)  When appropriate take the old volume offline and then delete
a.  Command line example.
vol offline source_volume
vol destroy source_volume

11)  Using Netapp Filerview or Netapp System Manager rename the new volume to the old volume name if needed.


To copy between Netapp Controllers (filers) you must use the following syntax.
vol copy start filer1:source_volume filer2:target_volume

No comments:

Post a Comment