Tuesday, October 22, 2013

Terminating a NetApp NDMP session

If an NDMP session is not responding, you can terminate it using the ndmpd kill command. The ndmp kill command allows non-responding sessions to be cleared without the need for a reboot.

Step

1. To terminate an NDMP session, enter the following command: 

ndmpd kill session

session is the specific NDMP session you want to terminate.
Note: If you want to terminate all NDMP sessions, use the "ndmpd killall" command.


To view any or all running sessions run "ndmpd status"

For example:

> ndmpd status ndmpd ON.
Session: 79
Active
version: 4
Operating on behalf of primary host.
tape device: not open
mover state: Idle
data state: Idle
data operation: None


> backup status
ID State Type Device Start Date Level Path
-- ----------- ---- ------ ------------ ----- ---------------
0 RESERVED NDMP
1 RESERVED NDMP
2 RESERVED NDMP
3 RESERVED NDMP
4 RESERVED NDMP
5 RESERVED NDMP
6 RESERVED NDMP
7 RESERVED NDMP
8 RESERVED NDMP
9 RESERVED NDMP
10 RESERVED NDMP
11 RESERVED NDMP
12 RESERVED NDMP
13 RESERVED NDMP
14 RESERVED NDMP
15 RESERVED NDMP
16 RESERVED NDMP
17 RESERVED NDMP
18 RESERVED NDMP
19 RESERVED NDMP
20 RESERVED NDMP
21 RESERVED NDMP
22 RESERVED NDMP
23 RESERVED NDMP
24 RESERVED NDMP
25 RESERVED NDMP
26 RESERVED NDMP
27 RESERVED NDMP


Now I know I can just do:

> backup terminate #  

Netapp NDMP copy command examples

You can migrate data from the source path to a destination path on the same storage system or to a different destination path on a remote host. You can also migrate data from a source path on a remote host to a destination path on the same host or to a destination path on a remote host.
In these examples, myhost is used for a local storage system and remotehost1 and remotehost2 are used for remote storage systems. If you specify host names when you use the ndmpcopy command, the storage system running the ndmpcopy command should be able to resolve these names to their IP addresses.

Example of migrating data from a source path to a different destination path on the same storage system

This sample command migrates data from a source path (source_path) to a different destination path (destination_path) on the same storage system (myhost).
 
myhost>ndmpcopy -sa username:password -da username:password 
myhost:/vol/vol0/source_path myhost:/vol/vol0/destination_path

The following shorter form of the command achieves the same purpose:
myhost>ndmpcopy /vol/vol0/source_path
/vol/vol0/destination_path

Because you are running the ndmpcopy command on myhost and the source and destination storage system are the same as myhost, you can omit the source and destination storage system names on the ndmpcopy command line. When your ndmpcopy command is running on the same storage system as the source storage system or destination storage system, you can also omit the -sa or -da options.

Example of migrating data from a source path to a different destination path on a remote host

This sample command migrates data from a source path (source_path) to a different destination path (destination_path) on remotehost1.
 
myhost>ndmpcopy -da username:password /vol/vol0/source_path 
remotehost1:/vol/vol0/destination_path

The destination storage system must be specified in this case, because it is a remote storage system. The destination authorization is needed, but not the source authorization.

Example of migrating data from a source path on remote host to a destination path on the local storage system

This sample command migrates data from a source path (source_path) on remotehost2 to a destination path (destination_path) on myhost.
 
myhost>ndmpcopy -sa username:password -st text 
remotehost2:/vol/vol0/source_path /vol/vol0/destination_path

The source authentication type specified by -st is text. The ndmpcopy command tool running on myhost will authenticate with the source storage system using text authentication.

Example of migrating data from a source path on a remote host to a destination path on another remote host

This sample command migrates data from a source path (source_path) on remotehost1 to a destination path (destination_path) on remotehost2.
 
myhost>ndmpcopy -sa username:password -da username:password -l 1 
remotehost1:/vol/vol0/source_path 
remotehost2:/vol/vol0/destination_path

The -l 1 option is used to do a level 1 transfer.

Example of overwriting the /etc directory during the root volume migration

Without the -f option, the /etc directory and its contents on the root volume of remotehost1 are protected from being overwritten with the/etc directory from myhost. This helps prevent unintentional changing of the system characteristics after the root volume migration is completed.

myhost>ndmpcopy -da username:password /vol/rootvol remotehost1:/vol/rootvol

To intentionally overwrite the/etc directory during the root volume migration, use the -f flag as in the following example.
myhost>ndmpcopy -da username:password -f /vol/rootvol remotehost1:/vol/rootvol

Example of the ndmpcopy command where the address modes are explicitly set to IPv6

This sample command explicitly sets the control connections and the data connection to use IPv6 address mode. In this command remotehost1 is the host name that resolves to an IPv6 address.

myhost>ndmpcopy -sa username:password -da username:password -l 0 -mcs inet6 -mcd 
inet6 -md inet6 remotehost1:/vol/vol0/source_path [2001:0db8::10]:/vol/vol0/desti
nation_path

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

NetApp - ndmpcopy - transfering directory trees between filers using NDMP

Ndmpcopy transfers data between filers/vfilers using the Network Data Management Protocol (NDMP) versions 3 and higher. This process can be thought of as creating a dedicated data pipe between dump running on the source filer and restore running on the destination filer.
 
Ndmpcopy is supported on vfilers, as well as the physical filer named vfiler0. Use vfiler context or vfiler run to issue Ndmpcopy commands on a specific vfiler. See na_vfiler(1) for details on how to issue commands on vfilers. The use of Ndmpcopy on vfilers requires a MultiStore license.


EXAMPLES

In these examples, network host names are used for the filers. ("myhost" is used for a local filer and "remotehost1" and "remotehost2" are used for remote filers.) If you specify host names when you use the ndmpcopy command, the filer running the ndmpcopy command should be able to resolve these names to their IP addresses. You could use the ping command to make sure that host name resolution works.

Before starting the ndmpcopy operation, the NDMP request daemon ndmpd has to be enabled on both the source and destination filers. Issue `ndmpd on' on both filers to enable the request daemon.
Example 1:
This command migrates data from a source path (source_path) to a different destination path (destination_path) on the same filer (myhost).
     myhost> ndmpcopy -sa username:password
             -da username:password
             myhost:/vol/vol0/source_path
             myhost:/vol/vol0/destination_path
You can also use this shorter form of the command to achieve the same result.
     myhost> ndmpcopy /vol/vol0/source_path
             /vol/vol0/destination_path
Because you are running the ndmpcopy command on myhost and the source and destination filer is the same as myhost, you can omit specifying the source and destination filer names on the ndmpcopy command line. Also note that when your ndmpcopy command is running on the same filer as the source filer and/or destination filer, you can omit the -sa and/or -da options. Example 2:
This command migrates data from a source path (source_path) to a different destination path (destination_path) on remotehost1.
     myhost> ndmpcopy -da username:password
             /vol/vol0/source_path
             remotehost1:/vol/vol0/destination_path
The destination filer must be specified in this case, because it is a remote filer. Also the destination authorization is needed, but not the source authorization. Example 3:
This command migrates data from a source path (source_path) on remotehost2 to a destination path (destination_path) on myhost.
     myhost> ndmpcopy -sa username:password -st text
             remotehost2:/vol/vol0/source_path
             /vol/vol0/destination_path
The source authentication type specified by -st has been set to text. The ndmpcopy command tool running on myhost will authenticate with the source filer using text authentication. Example 4:
This command migrates data from a source path (source_path) on remotehost1 to a destination path (destination_path) on remotehost2.
     myhost> ndmpcopy -sa username:password
             -da username:password -l 1
             remotehost1:/vol/vol0/source_path
             remotehost2:/vol/vol0/destination_path
Note that the -l 1 option is used to do a level 1 transfer. Example 5:
This command describes the behaviour of ndmpcopy without the -f option. In this case, the /etc directory and its contents on the root volume of remotehost1 are protected from being overwritten with the /etc directory from myhost. This is intended to avoid the unintentional changing of the system characteristics after the root volume migration is completed.
     myhost> ndmpcopy -da username:password /vol/rootvol
             remotehost1:/vol/rootvol
If you intentionally wish to overwrite the /etc directory, during the root volume migration, then use the -f flag as in the following copy.
     myhost> ndmpcopy -da username:password -f /vol/rootvol
             remotehost1:/vol/rootvol