Skip to content

Commit d295378

Browse files
committed
Made modifications after additional testing.
1 parent dcfa6a6 commit d295378

File tree

12 files changed

+95
-34
lines changed

12 files changed

+95
-34
lines changed

CloudFormation/NetApp-FSxN-Extensions/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,19 @@ Once you have done this, you are ready to start using the examples in this repos
100100
|create_sm_without_peering.yaml|Creates a SnapMirror relationship with a specified source volume. It assumes that there is already a peering relationship between the source and destination clusters and vservers.|
101101
|create_snapshot.yaml|Creates a snapshot of an FSx for NetApp ONTAP volume.|
102102
|create_volume.yaml|Creates an FSx for NetApp ONTAP volume.|
103+
104+
## Author Information
105+
106+
This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSx-ONTAP-samples-scripts/graphs/contributors).
107+
108+
## License
109+
110+
Licensed under the Apache License, Version 2.0 (the "License").
111+
112+
You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).
113+
114+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _"AS IS"_ basis, without WARRANTIES or conditions of any kind, either express or implied.
115+
116+
See the License for the specific language governing permissions and limitations under the License.
117+
118+
© 2025 NetApp, Inc. All Rights Reserved.

CloudFormation/NetApp-FSxN-Extensions/create_sm_with_peering.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Description: "Create a SM relationship between two volumes. Includes peering the clusters and vservers."
1+
Description: "Create a SM relationship between two volumes. Includes peering the clusters and vservers. It assumes the destination volume does not exist and will create it."
22

33
Parameters:
44
SourceLinkArn:
@@ -51,8 +51,8 @@ Parameters:
5151
Description: "The name of the destination volume."
5252
Type: String
5353

54-
DestinationAggregates:
55-
Description: "The aggregates to use when creating the destination volume."
54+
DestinationAggregate:
55+
Description: "The aggregate to use when creating the destination volume."
5656
Type: CommaDelimitedList
5757
Default: "aggr1"
5858

@@ -98,7 +98,7 @@ Resources:
9898
Volume: !Ref DestinationVolumeName
9999

100100
SnapMirrorDestinationCreation:
101-
Aggregates: !Ref DestinationAggregates
101+
Aggregates: !Ref DestinationAggregate
102102

103103
Policy: !Ref Policy
104104
Reverse: !Ref Reverse

CloudFormation/NetApp-FSxN-Extensions/create_sm_without_peering.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Description: "Create a SM relationship between two volumes. Assumes that the cluster and vservers are already peered."
1+
Description: "Create a SM relationship between two volumes. Assumes that the cluster and vservers are already peered and the destintion volume does not already exist."
22

33
Parameters:
44
SourceLinkArn:
@@ -51,8 +51,8 @@ Parameters:
5151
Description: "The name of the destination volume."
5252
Type: String
5353

54-
DestinationAggregates:
55-
Description: "The aggregates to use to create the destination volume. If you don't specify an aggregate, then the destination volume should already exist."
54+
DestinationAggregate:
55+
Description: "The aggregates to use to create the destination volume. Default is aggr1."
5656
Type: CommaDelimitedList
5757
Default: "aggr1"
5858

@@ -97,7 +97,7 @@ Resources:
9797
Volume: !Ref DestinationVolumeName
9898

9999
SnapMirrorDestinationCreation:
100-
Aggregates: !Ref DestinationAggregates
100+
Aggregates: !Ref DestinationAggregate
101101

102102
Policy: !Ref Policy
103103
Reverse: !Ref Reverse

CloudFormation/NetApp-FSxN-Extensions/create_volume.yaml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,57 @@ Parameters:
2828

2929
Size:
3030
Description: "The size of the volume in bytes."
31-
Default: 20971520
3231
Type: Number
32+
Default: 20971520
33+
MinValue: 20971520
3334

3435
Aggregates:
3536
Description: "The aggregates to use."
3637
Type: CommaDelimitedList
3738

3839
AutoSizeMode:
39-
Description: "The mode of the auto size. The supported values are 'grow', 'grown_shrink' or 'off'."
40-
Default: "off"
40+
Description: "The mode of the auto size. The supported values are 'grow', 'grow_shrink' or 'off'."
4141
Type: String
42+
AllowedValues: ["off", "grow", "grow_shrink"]
43+
Default: "off"
4244

4345
MinimumShrinkSize:
4446
Description: "The minimum size the volume can shrink to in bytes."
45-
Default: 20971520
4647
Type: Number
48+
MinValue: 20971520
49+
Default: 20971520
4750

4851
MaximumGrowSize:
49-
Description: "The maximum size of the volume can grow to in bytes."
50-
Default: 107374182400
5152
Type: Number
53+
Description: "The maximum size of the volume can grow to in bytes. Default is a 160TB."
54+
Default: 175921860444160
5255

5356
GrowThresholdPercentage:
5457
Description: "The percentage of the volume size at which the volume is considered full."
5558
Default: 80
59+
MaxValue: 100
60+
MinValue: 0
5661
Type: Number
5762

5863
ShrinkThresholdPercentage:
5964
Description: "The percentage of the volume size at which the volume is considered empty."
6065
Default: 50
66+
MaxValue: 100
67+
MinValue: 0
6168
Type: Number
6269

70+
State:
71+
Description: "The state of the volume. Either 'online', 'offline' or 'restricted'. Defaults to 'online'."
72+
Type: String
73+
Default: "online"
74+
AllowedValues: ["online", "offline", "restricted"]
75+
76+
Type:
77+
Description: "The type of the volume. Either 'rw' or 'dp'. Defaults to 'rw'."
78+
Type: String
79+
Default: "rw"
80+
AllowedValues: ["rw", "dp"]
81+
6382
Resources:
6483
FSxNVolume:
6584
Type: "NetApp::FSxN::Volume"
@@ -77,6 +96,8 @@ Resources:
7796

7897
Size: !Ref Size
7998
Aggregates: !Ref Aggregates
99+
State: !Ref State
100+
Type: !Ref Type
80101

81102
Autosize:
82103
Mode: !Ref AutoSizeMode

CloudFormation/NetApp-FSxN-Extensions/scripts/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,19 @@ There are also a couple scripts that can be used to help enable the NetApp FSxN
1515
|deactivate_extensions | This script will deactivate all the NetApp FSxN CloudFormation extensions in the AWS account for a specific region.|
1616
|deploy_link | This script will use CloudFormation to deploy a Workload Factory Link.|
1717
|createClone.py | This is a Python script that will create a clone of a volume using boto to deploy a CloudFormation stack that creates a clone.|
18+
19+
## Author Information
20+
21+
This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSx-ONTAP-samples-scripts/graphs/contributors).
22+
23+
## License
24+
25+
Licensed under the Apache License, Version 2.0 (the "License").
26+
27+
You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).
28+
29+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _"AS IS"_ basis, without WARRANTIES or conditions of any kind, either express or implied.
30+
31+
See the License for the specific language governing permissions and limitations under the License.
32+
33+
© 2025 NetApp, Inc. All Rights Reserved.

CloudFormation/NetApp-FSxN-Extensions/scripts/activate_extensions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
#
33
# This script is used to activate all the NetApp FSxN CloudFormation
4-
# extenstions.
4+
# custom resources.
55
################################################################################
66
#
77
################################################################################

CloudFormation/NetApp-FSxN-Extensions/scripts/create_SM_relationship

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44
# This script is used to create a SnapMirror relationship between two volumes
55
# in two different SVMs in two different file systems. It is dependent on a
66
# a CloudFormation template that uses the NetApp CloudFormation extension. The
7-
# template should be passed as a parameter to this script.
7+
# template should be passed as a parameter to this script. The template
8+
# assumes that the destination volume does not already exist.
89
################################################################################
910

1011
################################################################################
1112
################################################################################
1213
usage () {
1314
cat <<EOF
14-
Usage: $(basename $0) [--region region] --source-link-arn linkArn --source-secret-arn secretArn [--source-secret-key password] --source-fsx fsxId --source-svm svmName --source-vol volName \
15-
--dest-link-arn linkArn --dest-secret_arn secretAnr [--dest-sceret-key password] --dest-fsx FsxId --dest-svm svmName [--dest-vol volName_dp] \
16-
--template templete_filename
15+
Usage: $(basename $0) [--region region] --source-link-arn link_arn --source-secret-arn secret_arn [--source-secret-key password] --source-fsx fsx_id --source-svm svm_name --source-vol vol_name \\
16+
--dest-link-arn link_arn --dest-secret-arn secret_arn [--dest-sceret-key password] --dest-fsx fsx_id --dest-svm svm_name [--dest-vol vol_name_dp] \\
17+
--template templete_filename [--dest-aggr aggregate1]
1718
Notes:
18-
The default regions is whatever the default region is in the AWS CLI configuration.
19+
The default region is whatever the default region is in the AWS CLI configuration.
1920
The default secret key is 'password'.
2021
The default destination volume name is the source volume name with '_dp' appended.
22+
The default aggregate is 'aggr1'.
2123
EOF
2224
}
2325
#
@@ -33,6 +35,7 @@ destinationSecretArn=""
3335
destinationSecretKey="password"
3436
destinationFsxId=""
3537
destinationSvmName=""
38+
destinationAggregate="aggr1"
3639
template=""
3740
#
3841
# Get the default region from the AWS CLI configuration
@@ -79,6 +82,9 @@ while [ ! -z "$1" ]; do
7982
elif [ "$1" == "--dest-vol" ]; then
8083
destinationVolumeName=$2
8184
shift 1
85+
elif [ "$1" == "--dest-aggrs" ]; then
86+
destinationAggregate=$2
87+
shift 1
8288
elif [ "$1" == "--template" ]; then
8389
template=$2
8490
shift 1
@@ -90,7 +96,7 @@ while [ ! -z "$1" ]; do
9096
shift 1
9197
done
9298

93-
if [ -z "destinationVolumeName" ]; then
99+
if [ -z "$destinationVolumeName" ]; then
94100
destinationVolumeName="${sourceVolumeName}_dp"
95101
fi
96102

@@ -121,4 +127,5 @@ aws cloudformation create-stack --region $region --stack-name $stackName --templ
121127
ParameterKey=DestinationSecretKey,ParameterValue=$destinationSecretKey \
122128
ParameterKey=DestinationFileSystemId,ParameterValue=$destinationFsxId \
123129
ParameterKey=DestinationSvmName,ParameterValue=$destinationSvmName \
124-
ParameterKey=DestinationVolumeName,ParameterValue=$destinationVolumeName
130+
ParameterKey=DestinationVolumeName,ParameterValue=$destinationVolumeName \
131+
ParameterKey=DestinationAggregate,ParameterValue=$destinationAggregate

CloudFormation/NetApp-FSxN-Extensions/scripts/create_clone

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
#!/bin/bash
22
#
33
################################################################################
4-
# This script create a clnne of a volume in a NetApp ONTAP file system.
4+
# This script creates a clone of a volume in a Fsx for ONTAP file system by
5+
# using the custom NetApp CloudFormation NetApp::FSxN::Volume resource.
56
################################################################################
67

78
################################################################################
89
################################################################################
910
usage () {
1011
cat <<EOF
11-
Usage: $(basename $0) [-r region] -l linkArn -s secretArn [-k secretKey] -f fsxId -v svmName -p parentVolumeName [-c cloneVolumeName] -t templete_filename
12+
Usage: $(basename $0) [-r region] -l link_arn -s secret_arn [-k secretKey] -f fsx_id -v svm_name -p parent_volume_name [-c clone_volume_name] -t templete_filename
1213
Notes:
1314
The default region is whatever the default region is for the AWS CLI.
14-
The secretKey defaults to 'password'.
15-
The cloneVolumeName defaults to the parentVolumeName with '_clone' appended.
15+
The default secretKey is 'password'.
16+
The clone_volume_name defaults to the parent_volume_name with '_clone' appended.
1617
EOF
1718
}
1819
#
@@ -69,7 +70,6 @@ if [ -z "$cloneVolumeName" ]; then
6970
fi
7071

7172
if [ -z "$linkArn" -o -z "$region" -o -z "$secretArn" -o -z "$fsxId" -o -z "$svmName" -o -z "$parentVolumeName" -o -z "$template" ]; then
72-
echo linkARN="$linkArn" region="$region" secretnArn="$secretArn" fsxid="$fsxId" svm="$svmName" par="$parentVolumeName" tempate="$template"
7373
echo "Missing required arguments."
7474
usage
7575
exit 1

CloudFormation/NetApp-FSxN-Extensions/scripts/create_export_policy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
################################################################################
44
# This script creates an export policy for an FSx for ONTAP file system.
55
# It is dependent on a CloudFormation template that uses the NetApp
6-
# CloudFormation extensions. The template should be passed in as an argument.
6+
# CloudFormation custom resources. The template should be passed in as an
7+
# argument.
78
################################################################################
89

910
################################################################################
1011
################################################################################
1112
usage () {
1213
cat <<EOF
13-
Usage: $(basename $0) [-r region] -l link_ARN -s secret_ARN -k secret_key -f fsxId -v svm_name -n policy_name [-p protocols] -c match_CIDR -t templete_filename
14+
Usage: $(basename $0) [-r region] -l link_ARN -s secret_ARN -k secret_key -f fsx_id -v svm_name -n policy_name [-p protocols] -c match_CIDR -t templete_filename
1415
Notes:
1516
The default region is whatever the default region is set in the AWS CLI.
1617
The default protocols is "any"

CloudFormation/NetApp-FSxN-Extensions/scripts/create_snapshot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
################################################################################
44
# This script creates a snapshot of an FSx for ONTAP volume.
55
# It is dependent of a CloudFormation template that uses the
6-
# Netapp CloudFormation extension. The template is passed as an argument.
6+
# Netapp CloudFormation custom resources. The template is passed as an argument.
77
################################################################################
88

99
################################################################################
1010
################################################################################
1111
usage () {
1212
cat <<EOF
13-
Usage: $(basename $0) [-r region] -l link_ARN -s secret_ARN [-k secret_key] -f FSx_Id -v svm_name -n volume_name -p snapshot_name -t templete_filename
13+
Usage: $(basename $0) [-r region] -l link_ARN -s secret_ARN [-k secret_key] -f fsx_id -v svm_name -n volume_name -p snapshot_name -t templete_filename
1414
Notes:
1515
The default region is the region configured in the AWS CLI.
1616
The default secret key is 'password'.

0 commit comments

Comments
 (0)