Views:

Summary



Create and run a script policy to clean up volumes, NetApp Snapshots, and SnapMirror and SnapVault relationships created by ECX, NetApp, and VMware protection policies.

Resolution



Command Parameters

The script policy contains a single command: /opt/ECX/tools/scripts/netappCleanup.sh. The command can be modified with the following command line parameters:

-c <address>: The cluster IP address

-h: Displays a help message

-l <label>: The Snapshot label

-p <password>: The administrator password of the NetApp storage system running Clustered Data ONTAP.

-r: Removes volumes, Snapshots, and SnapMirror and SnapVault relationships

-u <user>: The administrator user name of the NetApp storage system running Clustered Data ONTAP.

-v <vserver>: The Vserver name

Parameters -c, -p, and -u are required. Use the same label for the -l parameter if the optional Snapshot label was defined in the protection policy. Use the -v parameter to perform the cleanup on a specific Vserver.

When using the -l parameter in conjunction with the -r parameter in a script for primary Snapshot cleanup, all Snapshots created by protection jobs without labels as well as Snapshots created by protection jobs with the specific label defined in the script will be removed. If multiple protected Snapshots with different label names require cleanup, only Snapshots with labels that match the label defined in the script's -l parameter will be removed. To remove multiple labeled Snapshots, create a separate script policy for each label, or add multiple command lines in one script, defining a different label in each line.

Best Practice: Run the script first without specifying the r parameter to obtain a list of items that will be permanently deleted. After reviewing the list to ensure all items are appropriate for permanent deletion, modify the script policy to include the r parameter and re-run the script to perform the cleanup.

Considerations

  • Cluster peer relationships may not be cleaned up through the cleanup script.
  • Volume cleanup may fail if the volume is the source endpoint of one or more SnapMirror relationships.
  • Snapshot cleanup may fail if the Snapshot is a reference Snapshot copy by one or more SnapMirror relationships.
  • The cleanup will fail for resources in use by active recovery jobs.
  • When determining if a Snapshot qualifies for removal, only the beginning of the Snapshot name is checked. The trailing sub-policy name, date, and time is not matched. This may result in false positive identification of Snapshots for removal.

NetApp or VMware Cleanup Script Policy Procedure

  1. Click the Plan Plan tab icon tab. On the Views pane, select Policies Reports icon.
  2. Click the All Policies tab, select New New icon, then select Script Policy Script policy icon. The Script Policy Editor opens.
  3. Click the 1: Scripts tab. On the Scripts pane, enter the netappCleanup command and parameters in the command text box. In the following example, the cluster is named filer1, the user is named "admin," the password is "pass1," and the vserver is named vserver1. A list of items for permanent deletion on vserver1 is produced in the job log.
  4. /opt/ECX/tools/scripts/netappCleanup.sh -c filer1 -u admin -p pass1 -v vserver1
  5. Optionally enter a tag or remark in the corresponding description text box. Then click Add Add Node icon .
  6. Set script options on the 2: Options tab, then click Submit to name and save the policy.
  7. Run the script policy from the Monitor Monitor tab icon tab.
  8. Review the script policy tasks and log to monitor the cleanup script progress. Click the active job name on the All Jobs tab on the Monitor Monitor tab icon tab, then click the job's Start Time to view the currently running tasks. Once complete, click the Logs tab to view the associated log file.