How to run ndmpcopy in ONTAP
Applies to
ONTAP 9
Description
- This article describes how to run ndmpcopy
- The
ndmpcopy
command is run from the cluster shell, vianode run
- Ndmpcopy can be run from the command line of either the source or destination storage system to transfer data between two systems
- Ndmpcopy can also be run on a single storage system, transferring data from one location to another within the same storage system
- To take advantage of the NDMP Cluster Aware Backup (CAB) extension, all storage systems involved in the
ndmpcopy
must be in vserver-scoped mode- This includes the storage system on which the
ndmpcopy
command is being run.
- This includes the storage system on which the
Procedure
Prerequisites
NDMP must be enabled for either vserver-scope or node-scope
- NDMP operates in vserver-scope, by default.
- On a system where NDMP has never been configured, turning NDMP on will enable NDMP in vserver-scope.
- Node-scope mode available for compatibility, but will be deprecated in a future release.
- To verify your cluster is running in vserver scope, run the following command:
cluster::> system services ndmp node-scope-mode status
- If
node-scope-mode
is disabled, the cluster is configured for vserver scope
Note: There are two ndmpcopy examples in this article, and they are independent of each other. Running ndmpcopy in vserver scope are the steps that should be followed. The next section, Running ndmpcopy in node scope, should only be followed if the cluster is found to be running in node scope.
Running ndmpcopy in vserver scope mode
- Enabled ndmp on your vserver
cluster::> vserver services ndmp on -vserver <SVM-name>
- Verify ndmp is allowed on the vserver
cluster::> vserver show -vserver <SVM-name> -fields allowed-protocols
- Create a user account on the vserver for ndmp
Note: This step is optional as you may use the vserver 'vsadmin' account if you wish.
cluster::> security login create -user-or-group-name ndmpuser -application ssh -authmethod password -vserver <SVM-name> -role vsadmin-backup
Please enter a password for user 'ndmpuser':
Please enter it again:
- Generate an ndmp password for the user account
Note: This password will not be the same as the password for the user account
cluster::> vserver services ndmp generate-password -vserver <SVM-name> -user ndmpuser
Vserver: svm2
User: ndmpuser
Password: yMGg5d0LyUG8l1kn
- Run the ndmpcopy
When running the ndmpcopy in vserver scope, you should choose a LIF that is assigned to the same vserver as the volume
Note: When copying within the same node/vserver, you must still provide an IP address.
ndmpcopy -sa <username>:<password> -da <username>:<password> <source_SVM-IP>:/<SVM-name>/<volume-name> <dest_SVM-IP>:/<SVM-name>/<volume-name>
cluster::> node run -node node1 ndmpcopy -sa ndmpuser:yMGg5d0LyUG8l1kn -da ndmpuser:yMGg5d0LyUG8l1kn 10.63.107.200:/svm2/vol1 10.63.107.200:/svm2/vol2
Note: When the source or destination path contains spaces or special characters, wrap quotes around the portion of the path that contains them
node run -node node1 ndmpcopy -sa ndmpuser:yMGg5d0LyUG8l1kn -da ndmpuser:yMGg5d0LyUG8l1kn 10.63.107.200:/svm2/'vol 1' 10.63.107.200:/svm2/'vol 2'
Note: If the SSH session used to run ndmpcopy is closed, either manually or via timeout, it will result in termination of the ndmpcopy operation
Running ndmpcopy in node scope mode
-
Enable node scope and ndmp
cluster::> system services ndmp node-scope-mode on
cluster::> system services ndmp on -node *
- Create an ndmp user and password
cluster::> system services ndmp modify -user-id ndmpuser -node *
Please enter password:
Confirm password:
- Run the ndmpcopy
When running ndmpcopy in node scope mode, the IP address should be the node management LIF for the node that hosts the volume
Note: When copying within the same node, you must still provide an IP address
ndmpcopy -sa <username>:<password> -da <username>:<password> <source_node_mgmt_IP>:/<SVM-name>/<volume-name> <dest_node_mgmt_IP>:/<SVM-name>/<volume-name>
cluster::> node run -node node1 ndmpcopy -sa ndmpuser:password -da ndmpuser:password 10.63.107.151:/svm2/vol1 10.63.107.151:/svm2/vol2
Note: When the source or destination path contains spaces or special characters, wrap quotes around the portion of the path that contains them
node run -node node1 ndmpcopy -sa ndmpuser:yMGg5d0LyUG8l1kn -da ndmpuser:yMGg5d0LyUG8l1kn 10.63.107.200:/svm2/'vol 1' 10.63.107.200:/svm2/'vol 2'
If you receive the error 'ndmpcopy not found
', then you must first enable the command:
node> options nodescope.reenabledcmds ndmpcopy
Note: If the SSH session used to run ndmpcopy is closed, either manually or via timeout, it will result in termination of the ndmpcopy operation.
Considerations for long-running ndmpcopy sessions
- Ndmpcopy is typically run via SSH
- When a process is run via SSH, the process will terminate when the SSH session terminates, or times out
- Avoid closing the SSH session used to run ndmpcopy while ndmpcopy is still running, as this will terminate the ndmpcopy operation
- For a ndmpcopy session that is expected to take an extended period of time, consider running ndmpcopy from console
Additional Information
- Transferring data using ndmpcopy Overview - ONTAP Documentation Center
- Beginning with ONTAP 9.7, NDMP is supported on FlexGroup volumes.
- BUG 467842: Local NDMPCopy fails when connection is attempted between routing groups (Fixed in ONTAP 8.3 and later)
- When using the -exclude option in the copy the format should be -exclude *Object Please note that this will exclude all objects with the same name
- Ndmpcopy run via SSH consistently aborts after a fixed amount of time
- About NDMP with SnapLock volumes