You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Management-Utilities/auto_create_sm_relationships/README.md
+16-8Lines changed: 16 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,27 +15,35 @@ This script is used to ensure that all your volumes, in all your FSxN file syste
15
15
## Set Up
16
16
There are a few things you need to do in order to get this script to run properly:
17
17
18
-
- Set up a secret for each of the FSxN file systems in the AWS Secrets Manager. Each secret should have two "keys" (they can be named anything, since you set the key name in the script):
18
+
- Set up a secret for each of the FSxN file systems in the AWS Secrets Manager. Each secret should have two "keys" (they can be named anything, since you set the name of the key the scretsTable defined below.):
19
19
- username - set to the username you want the script to use when issuing API to the ONTAP system.
20
20
- password - set to the password of the username specified with the username key.
21
21
- Edit the top of the script and fill in a few variables:
22
22
- partnerTable - This table provides the association with a source FSxN file system to its partner cluster (i.e. where its volumes should be SnapMirror'ed to.) There should be five fields for each entry:
23
23
- fsxId - Set to the AWS ID of the FSx file system.
24
24
- svmName - Set to the SVM name on the FSxN file system.
25
25
- partnerFsxnIP - Set to the IP address of the management port of the partner FSxN file system.
26
-
- partnerSvmName - The name of the SVM where you want the SnapMirror destination volume to resided.
26
+
- partnerSvmName - The name of the SVM where you want the SnapMirror destination volume to reside.
27
27
- partnerSvmSourceName - Is the "peered name" of the source SVM. Usually, it is the same as the source SVM, but can be different if that same name already exists on the partner file system. When you peer the SVM it will require you to create an alias for the source SVM so all the SVM names are unique.
28
+
*NOTE:* Instead of defining the partnersTable in the script, you can define dynamodbPartnersTableName and dynamodbRegion and the script will read in the partner information from the specified DynamoDB table. The partners table should have the following fields:
29
+
- soureceId - Which is the concatentation of the source file system ID followed by a ":" followed by the SVM name. It is done this way because the id has to be unique in the table. It is split up into its two components in the script when it is read in.
30
+
- partnerFsxnIp - Set to the IP address of the management port of the partner FSxN file system.
31
+
- partnerSvmName - The name of the SVM where you want the SnapMirror destination volume to reside.
32
+
- partnerSvmSourceName - Is the "peered name" of the source SVM. Usually, it is the same as the source SVM, but can be different if that same name already exists on the partner file system. When you peer the SVM it will require you to create an alias for the source SVM so all the SVM names are unique.
33
+
28
34
- secretsTable - This table provides the secret name, and username and password keys to use for each of the file systems. It should have 4 fields:
29
-
-id - Set to the AWS File System ID
35
+
-fsxId - Set to the AWS File System ID
30
36
- secretName - Set to the name of the secret created in step one.
31
-
- usernameKey - Set to the name of the key that holds the username. In the instructions above, it should be set to 'username' but this allows you to use any key name you want.
37
+
- usernameKey - Set to the name of the key that holds the username.
32
38
- passwordKey - Set to the name of the key that holds the password.
33
-
*NOTE:* Instead of defining the secretsTable in the script, you can define dynamodbTableName and dynamodbRegion and the script will read the secretsTable from the DynamoDB table. The table should have the same fields as the secretsTable.
39
+
*NOTE:* Instead of defining the secretsTable in the script, you can define dynamodbSecretsTableName and dynamodbRegion and the script will read in the secretsTable information from the specified DynamoDB table. The table should have the same fields as the secretsTable defined above.
40
+
34
41
- secretsManagerRegion - Set to the region where the Secrets Manager has been set up.
35
42
- destinationVolumeSuffix - Set to the string you want appended to the source volume name to create the destination volume name.
36
43
- snapMirrorPolicy - Set to the Data ONTAP SnapMirror policy you want the assigned to the SnapMirror relationship.
37
-
- maxSnapMirrorRelationships - Set to the maximum number of SnapMirror relationship initializations you want to allow running at the same time.
38
-
- dryRun - If set to 'True' (case sensitive) the program will just show that it would have done, instead of actually creating the SnapMirror relationships.
44
+
- maxSnapMirrorRelationships - Set to the maximum number of SnapMirror relationship initializations you want this script to create in a single run.
45
+
- dryRun - If set to 'True' (case sensitive) the script will just show what it would have done, instead of actually creating the SnapMirror relationships.
46
+
- protectAll - If set to 'True' (case sensitive) the script will protect all volumes that don't have a "protect_volume" tag set to "skip". If set to 'False' it will only protect volumes that have a "protect_volume" tag set to "protect".
39
47
40
48
If you want to run this script as a Lambda program, then you'll need to
41
49
- Create a role that has the following permissions:
@@ -63,5 +71,5 @@ To run it as a Lambda function you will need to:
63
71
- Create the Lambda function with a Python runtime, from scratch, and paste the program into code box and save it.
64
72
- Associate the role created above with the Lambda function.
65
73
- Create the AWS service endpoints mentioned above.
66
-
- Adjust the default timeout from 4 seconds to at least 20, maybe 60 seconds.
74
+
- Adjust the default timeout from 4 seconds to at least 60 seconds.
67
75
- Once you have tested that it run successfully, creating an eventBridge that will trigger it to run on a regular basis (e.g. once or twice a day).
raiseException('Error, you must either define the secretsTable array at the top of this script, or define dynamodbRegion and dynamodbSecretsTableName')
raiseException('Error, you must either define the partnersTable array at the top of this script, or define dynamodbRegion and dynamodbPartnersTableName')
0 commit comments