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

Friday, June 21, 2013

Enabling Auditing on NetApp CIFS shares/Volumes

Enabling Auditing in NetApp Cifs volume



Enable Auditing
Telnet to filer

NetApp Filer > options cifs.audit.enable on
This will enable auditing on cifs volume. The disadvantage of this we need to save manually to stop the auditing ( i will tell you how we can do it automatically)

Save Cifs auditing
NetApp Filer>cifs audit save -f

Automatically save auditing
NetApp Filer > options cifs.audit.autosave.ontime.enable on
NetApp Filer >cifs.audit.autosave.onsize.enable on

Where we can see the audited logs ?
/etc/log/adtlog.evt

Run –> //filername/etc$
Go to etc folder then log folder. There you can see adtlog.evt

To view in Windows OS:
It’s a event viewer file. Go to Event Viewer –> Right click –> open log file–> show this path
( try to mount this CIFS volume before it shows the path in event viewer). Select security log while selecting open.
You should be able to see similar Windows like Auditing. Object Access, log on/ log off category,...etc

CIFS auditing options on NetApp filer

options cifs.audit
cifs.audit.account_mgmt_events.enable off
cifs.audit.autosave.file.extension timestamp
cifs.audit.autosave.file.limit 0
cifs.audit.autosave.onsize.enable on
cifs.audit.autosave.onsize.threshold 75%
cifs.audit.autosave.ontime.enable on
cifs.audit.autosave.ontime.interval 1d
cifs.audit.enable            on
cifs.audit.file_access_events.enable on
cifs.audit.liveview.enable   off
cifs.audit.logon_events.enable on
cifs.audit.logsize           524288
cifs.audit.nfs.enable        off
cifs.audit.nfs.filter.filename
cifs.audit.saveas            /etc/log/adtlog.evt

Tuesday, November 27, 2012

NDMP, NETAPP and CA ARCserve Backup 12.5

 Configuring NetApp FAS 3xxx controllers to use NDMP

1)      Verify the tape device is on Netapp’s Data Protection Supported Devices list
b.      If needed just download the configuration file for your device from the web site listed above.
 Note: The configuration file should have a TCF extension. This is an example of a TCF file for my device which happens to be an HP ULTRIUM 4-SCSI tape drive (FC connected).

file name = HP_LTO4_ULTRIUM.TCF

# Configuration file for Hewlett-Packard tape drive HP LTO Gen4 AKA ULTRIUM-4
# Version 1.0
# Copyright (c) 2008 NetApp
# All rights reserved.

vendor_id="HP"
product_id="Ultrium 4-SCSI"
id_match_size=9

vendor_pretty="Hewlett-Packard"
product_pretty="LTO-4"

l_description="LTO-2(ro)/3 2/400GB"
l_density=0x00
l_algorithm=0x00

m_description="LTO-2(ro)/3 4/800GB cmp"
m_density=0x00
m_algorithm=0x01

h_description="LTO-4 800GB"
h_density=0x46
h_algorithm=0x00

a_description="LTO-4 1600GB cmp"
a_density=0x46
a_algorithm=0x01

autoload="yes"

2)      Verify / Install the Tape Configuration file
* Check the Netapp etc$\tape_config folder to see if the configuration file already exists.

       netapp> rdfile /etc/tape_config/HP_LTO4_ULTRIUM.TCF

 Note: the configuration file is just a text file that can be opened in any text editor.



The following steps may or may not be needed on the individual FC ports. When we purchased our controllers we purchased two additional quad port FC cards, one for each controller and each had been pre-configured as initiators, one less thing for my to do. 

1)   configure the appropriate Netapp FC port as an Initiator
a.       Warning: Changing the selected Netapp FC port from Target to Initiator will change the WWN associated with the port.
b.      Typically only the embedded Netapp FC ports can be configured as either Target or Initiator.  Because of this the fcadmin commands only work on those ports.  Usually, the expansion HBA’s installed into the Netapp Controllers are ordered hardcoded as Target or Initiator ports and can not be changed.
c.       The embedded Netapp FC ports are usually labeled as 0a, 0b, 0c, or 0d.  Be sure you know which FC port is being changed to the Initiator port.
                                                               i.      To map WWN to Netapp FC labels use this command.
netapp> fcp show adapter

d.      Run the following command to view the current FC Port configuration.

 netapp> fcadmin config

adapter    type        State                Status
0a             initiator  configured        online
0b             target     configured        online
0c             target     configured        online
0d             target     configured        online

e.       Disable the selected port
netapp> fcadmin config -d 0c

Fibre Channel target adapter 0c offlined


f.        Change the selected port to an Initiator
netapp> fcadmin config -t initiator 0c

*A reboot is required for the new adapter configuration to take affect


g.       If this is a Netapp FAS Cluster you need to perform the same configuration, on the same port, on the partner Netapp controller.  port 0c would need to be configured in the same manner on the partner Controller.  This is required to support proper takeover and giveback during a failure.

h.       Reboot the controller
                                                               * If this Netapp FAS Cluster perform a takeover, reboot, and giveback on each of the controllers in the Netapp FAS cluster.
                                                              * If this is a single controller reboot the controller

i.         Enable / Verify the selected Netapp FC port
                                                               i.      The port should come back online after the reboot.  Use this command to verify.
netapp> fcadmin config

adapter    type            State                Status
0a             initiator     configured        online
0b             target        configured        online
0c             initiator     configured        online
0d             target        configured        online

                                                             ii.      If the port is not enabled use the following command to enable it.
 netapp> fcadmin config -e 0c

j.        Obtain the current WWPN of the selected initiator port.
netapp> storage show adapter

Slot: 0c
Description:
Firmware Rev:
FC Node Name: 2:101:001b32:ba7xxx
FC Node Name: 2:101:001b32:fa7xxx
FC Packet Size: 2048
Link Data Rate: 4 Gbit
SRAM Parity: Yes
External GBIC: No
State: Enabled
In Use: No
Redundant: Yes


                                                               The WWPN may be needed to do the FC zoning.

2)      Connect the Tape Device to the selected Netapp FC Port
a.       If using an FC Switch
                                                               * Zone the selected Netapp FC port to the FC tape device.
b.      If using a directly connected FC tape device
                                                               * Connect the FC tape device directly to the Netapp FC port.
c.       If using an Enterprise VTL
                                                               * Grant the Netapp WWPN access to the VTL as required.

3)      Reboot the selected Netapp FC Port to force a scan for new devices.  A scan for new devices is only done during a reboot or fiber state change.
                                                               i.      A fiber state change can be initiated using one of the following methods.
1.      On the FC Switch disable then enable the Switch port the selected Netapp FC port is connected to.
2.      Unplug the selected Netapp FC port from the switch or directly connect tape device.
                                                             ii.      Leave the port down for at least 2 minutes so the Netapp Controller properly detects the fiber state change and configures the FC port as offline.

4)      List the currently discovered devices.
a.       List the tape devices
netapp> sysconfig -t

b.      List robotic Tape Library devices
netapp> sysconfig -m

c.       If the tape devices are not listed review your configuration and/or perform another bounce of the selected Netapp FC port.

5)      Review and Enable NDMP on the Netapp Controller(s)
a.       Check NDMP current status
netapp> ndmpd status

b.      Enable NDMP
netapp> ndmpd on


Configuring NetApp to support CA ARCserve Backup for use with NDMP
 The last step in my configuration was to install and configure CA ARCserve Backup 12.5 SP3 on a Windows 2008 R2 Server. The install was straight forward, the only thing I had to do differently was to run through the "Device Configuration" (QuickStart>Administration>More on Device>Device Configuration) setup.  During the setup I Selected "NAS Servers", then select "Add". Here you list the NetApp controllers by FQN with a user name and password ONLY.

note: I did run into an issue where "IF" I entered a tape device configuration name or controller name, gathered form the NetApp controller command (netapp> sysconfig -t and netapp> sysconfig -m), I couldn't run any restores from CA ARCserve backup? I chose to leave it blank. Still not sure why this was occurring but as of now my backups and restores are running great!   

 In general to support third party backup software integration with NDMP you will need to configure most of the following options on the Netapp controller(s). 

1)      On the Netapp Controller
a.       Add a backup user account for use by the software
useradmin user add backupuser -g “Backup Operators”

                                                               i.      Change the backupuser name as needed for your environment
                                                             ii.      Enter the user password when prompted.

b.      Specify the NDMP password length
                                                               i.      Users that do not have root access must enter a system generated NDMP password to run NDMP operations on the Netapp controller.  This password will also be used to authenticate the backup user when used with third party backup software.
options ndmpd.password_length {8 | 16}

                                                             ii.      The system generated password can be either 8 or 16 characters in length.

c.       Generate an NDMP password for the backup user.
                                                               i.      Use the following command to generate the NDMP password.
ndmpd password backupuser

                                                             ii.      Record the generated NDMP password.
                                                            iii.      This password is good until the regular password for this account it changed.  Once the regular password is changes you must repeat this command to obtain a new system generated password.
                                                           iv.      The system generated password will be unique to each Netapp Controller.

d.      Grant NDMP access to the host name of the server running the third party backup software.
options ndmpd.access host=server.domain.fqdn

                                                               i.      This host name must be resolved via DNS or it should be manually added to the etc$\hosts file.  You may use the IP Address instead of the DNS name.
                                                             ii.      Optionally, you can grant NDMP access to all hosts using the following command.
options ndmpd.access all

1.      By default all hosts should be granted NDMP access.  It is recommended you leave this setting at its default value.

e.       Specify the NDMP authentication type
options ndmpd.authtype {challenge | plaintext | plaintext,challenge}

                                                               i.      Challenge (MD5) is the preferred and more secure method.
                                                             ii.      Refer to your third party backup software to determine which authentication type you should configure.

f.        Enable or disable NDMP connection logging
                                                               i.      This will log NDMP connections to the etc$\messages file and can be useful for troubleshooting or auditing access.
options ndmpd.connectlog.enabled {on | off}

g.       Configure the type of Tape Reservation to use.
                                                               i.      Sharing the Tape Drive and/or Media Changer between multiple systems requires all the systems to use the same Tape Reservation method.  This may not be required if the Tape Drive and/or Media Changer is dedicated to a single Netapp Controller.
options tape.reservations {scsi | persistent | off}

                                                             ii.      The two tape reservation methods are SCSI-Reserve and SCSI-Persistent.  SCSI-Persistent reservations are not affected by error recovery mechanisms, such as loop reset, but not all devices implement SCSI-Persistent reservations correctly.

h.       Determine or set NDMP version
                                                               i.      Determine NDMP version
ndmpd version

                                                             ii.      Set NDMP version
ndmpd version {1 | 2 | 3| 4}

1.      Use this command to specify an NDMP version compatible with your third party backup software.  The highest NDMP version is 4.



To verify if your software is compatible with Netapp’s NDMP use the following link


Monitoring and Managing NDMP sessions

You can monitor and manage NDMP sessions directly from the Netapp system console using the following commands
1)      View NDMP Session details
ndmpd probe [session]
2)      Terminating an NDMP session
ndmpd kill session
3)      Enable NDMP debug log messages
ndmpd debug {10 | 30 | 50 | 70}
4)      View current NDMP debug log setting
 ndmpd debug