
I Tried Creating Amazon FSx for NetApp ONTAP Snapshots, Clones, and SnapMirror with CloudFormation
This page has been translated by machine translation. View original
Introduction
On November 23, 2026, an update to Amazon FSx for NetApp ONTAP was announced. With this update, you can now create and manage snapshots, clones, and replication from the FSx console and AWS CloudFormation.
This article presents the results of actually creating these with CloudFormation templates.
Test Environment
I created two file systems: a source and a destination.
- Region: Tokyo (ap-northeast-1)
- Deployment type: SINGLE_AZ_1 (first-generation Single-AZ)
- Storage: SSD 1,024 GiB
- Throughput: 128 MBps
- Network: A subnet in ap-northeast-1a of the default VPC (the same for both). No security group specified
- Passphrase: one KMS key and one Secrets Manager secret (for the cluster peers)
| Source | Destination | |
|---|---|---|
| SVM | svmsrc | svmdst |
| Volume | srcvol (RW, 10,240 MiB) | dstvol (DP, 10,240 MiB) |
Creating the environment stack took 18 minutes 37 seconds. Of that, about 16 minutes was the parallel creation of the two file systems.
Environment template and deploy command
Save it as 01-env.yaml.
AWSTemplateFormatVersion: '2010-09-09'
Description: FSx for ONTAP (Gen1 Single-AZ) x2, SVM, volumes, and cluster peer passphrase secret for verification
Parameters:
SubnetId:
Type: AWS::EC2::Subnet::Id
Description: Subnet for both file systems (same VPC, same AZ)
Resources:
# ---- Source file system ----
SrcFileSystem:
Type: AWS::FSx::FileSystem
Properties:
FileSystemType: ONTAP
StorageCapacity: 1024
StorageType: SSD
SubnetIds: [!Ref SubnetId]
OntapConfiguration:
DeploymentType: SINGLE_AZ_1
ThroughputCapacity: 128
PreferredSubnetId: !Ref SubnetId
AutomaticBackupRetentionDays: 0
Tags:
- Key: Name
Value: verify-src
SrcSvm:
Type: AWS::FSx::StorageVirtualMachine
Properties:
FileSystemId: !Ref SrcFileSystem
Name: svmsrc
RootVolumeSecurityStyle: UNIX
SrcVolume:
Type: AWS::FSx::Volume
Properties:
Name: srcvol
VolumeType: ONTAP
OntapConfiguration:
JunctionPath: /srcvol
SizeInMegabytes: '10240'
StorageEfficiencyEnabled: 'true'
StorageVirtualMachineId: !Ref SrcSvm
SnapshotPolicy: none
# ---- Destination file system ----
DstFileSystem:
Type: AWS::FSx::FileSystem
Properties:
FileSystemType: ONTAP
StorageCapacity: 1024
StorageType: SSD
SubnetIds: [!Ref SubnetId]
OntapConfiguration:
DeploymentType: SINGLE_AZ_1
ThroughputCapacity: 128
PreferredSubnetId: !Ref SubnetId
AutomaticBackupRetentionDays: 0
Tags:
- Key: Name
Value: verify-dst
DstSvm:
Type: AWS::FSx::StorageVirtualMachine
Properties:
FileSystemId: !Ref DstFileSystem
Name: svmdst
RootVolumeSecurityStyle: UNIX
# DP volume that receives the SnapMirror transfer
DstVolume:
Type: AWS::FSx::Volume
Properties:
Name: dstvol
VolumeType: ONTAP
OntapConfiguration:
OntapVolumeType: DP
SizeInMegabytes: '10240'
StorageVirtualMachineId: !Ref DstSvm
# ---- Cluster peer passphrase (KMS key + Secrets Manager secret) ----
PassphraseKey:
Type: AWS::KMS::Key
Properties:
Description: Encrypts the FSx cluster peer passphrase secret (verification)
KeyPolicy:
Version: '2012-10-17'
Statement:
- Sid: Enable IAM policies
Effect: Allow
Principal:
AWS: !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:root
Action: kms:*
Resource: '*'
- Sid: Allow FSx to decrypt the cluster peer passphrase
Effect: Allow
Principal:
Service: fsx.amazonaws.com
Action: kms:Decrypt
Resource: '*'
Condition:
StringEquals:
kms:ViaService: !Sub secretsmanager.${AWS::Region}.amazonaws.com
aws:SourceAccount: !Ref AWS::AccountId
PassphraseSecret:
Type: AWS::SecretsManager::Secret
Properties:
Description: FSx cluster peer passphrase (verification)
KmsKeyId: !Ref PassphraseKey
GenerateSecretString:
PasswordLength: 32
ExcludePunctuation: true
PassphraseSecretPolicy:
Type: AWS::SecretsManager::ResourcePolicy
Properties:
SecretId: !Ref PassphraseSecret
ResourcePolicy:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: fsx.amazonaws.com
Action: secretsmanager:GetSecretValue
Resource: '*'
Condition:
StringEquals:
aws:SourceAccount: !Ref AWS::AccountId
Outputs:
SrcFileSystemId:
Value: !Ref SrcFileSystem
DstFileSystemId:
Value: !Ref DstFileSystem
SrcSvmId:
Value: !Ref SrcSvm
DstSvmId:
Value: !Ref DstSvm
SrcVolumeId:
Value: !Ref SrcVolume
DstVolumeId:
Value: !Ref DstVolume
PassphraseSecretArn:
Value: !Ref PassphraseSecret
aws cloudformation create-stack \
--stack-name fsx-verify-env \
--template-body file://01-env.yaml \
--parameters ParameterKey=SubnetId,ParameterValue=<サブネットID>
The IDs and IP addresses that appear in the following commands are dummy values.
Snapshots and Clones
Snapshots are declared with AWS::FSx::Snapshot, and snapshot policies with AWS::FSx::SnapshotPolicy. A clone is created by specifying the parent volume in the CloneConfiguration of AWS::FSx::Volume. If you add a SnapshotId to the CloneConfiguration, it becomes a clone (restore) from that snapshot. I put the snapshot, the policy, and two clones together in one template.
Template and Creation
Save it as 02-snapshot-clone.yaml.
AWSTemplateFormatVersion: '2010-09-09'
Description: Snapshot, snapshot policy, and volume clones for FSx for ONTAP (verification)
Parameters:
FileSystemId:
Type: String
SvmId:
Type: String
VolumeId:
Type: String
Description: Parent volume ID (fsvol-...)
Resources:
# Snapshot of the parent volume
Snapshot:
Type: AWS::FSx::Snapshot
Properties:
Name: snap-cfn-01
VolumeId: !Ref VolumeId
# Custom snapshot policy (hourly, keep 3, SnapMirror label "hourly")
SnapshotPolicy:
Type: AWS::FSx::SnapshotPolicy
Properties:
Name: policy-cfn-hourly
FileSystemId: !Ref FileSystemId
Schedules:
- Name: hourly
Count: 3
SnapmirrorLabel: hourly
# Clone of the parent volume's current state (no snapshot specified)
CloneFromVolume:
Type: AWS::FSx::Volume
Properties:
Name: clonecurrent
VolumeType: ONTAP
OntapConfiguration:
JunctionPath: /clonecurrent
StorageVirtualMachineId: !Ref SvmId
CloneConfiguration:
ParentVolumeId: !Ref VolumeId
# Clone from the snapshot (restore)
CloneFromSnapshot:
Type: AWS::FSx::Volume
Properties:
Name: clonesnap
VolumeType: ONTAP
OntapConfiguration:
JunctionPath: /clonesnap
StorageVirtualMachineId: !Ref SvmId
CloneConfiguration:
ParentVolumeId: !Ref VolumeId
SnapshotId: !Ref Snapshot
Outputs:
SnapshotId:
Value: !Ref Snapshot
SnapshotArn:
Value: !GetAtt Snapshot.ResourceARN
SnapshotPolicyId:
Value: !GetAtt SnapshotPolicy.SnapshotPolicyId
CloneFromVolumeId:
Value: !Ref CloneFromVolume
CloneFromSnapshotId:
Value: !Ref CloneFromSnapshot
I deployed it by specifying the source-side file system, SVM, and srcvol.
aws cloudformation create-stack \
--stack-name fsx-verify-snapshot-clone \
--template-body file://02-snapshot-clone.yaml \
--parameters \
ParameterKey=FileSystemId,ParameterValue=fs-0123456789abcdef0 \
ParameterKey=SvmId,ParameterValue=svm-0123456789abcdef0 \
ParameterKey=VolumeId,ParameterValue=fsvol-0123456789abcdef0
The time required is the time from the first CREATE_IN_PROGRESS to CREATE_COMPLETE for each resource. For the stack as a whole, I measured using the stack's own events.
| Resource | Time required |
|---|---|
| Whole stack | about 2 min 8 sec |
| SnapshotPolicy | about 19 sec |
| Snapshot | about 1 min 2 sec |
| CloneFromVolume | about 1 min 2 sec |
| CloneFromSnapshot | about 2 min 2 sec (note) |
Note: CloneFromSnapshot reached Resource creation Initiated about 1 second after the Snapshot's CREATE_COMPLETE. From there to completion it took about 1 min 1 sec.
Created Snapshot, Policy, and Clones
Output of describe-snapshots and describe-snapshot-policies (excerpt)
aws fsx describe-snapshots --output json
"Name": "snap-cfn-01",
"VolumeId": "fsvol-0123456789abcdef0",
"CreationTime": "2026-11-24T13:35:50.244000+09:00",
"Lifecycle": "AVAILABLE",
"SnapshotType": "ONTAP",
"OntapConfiguration": {
"SizeInMegabytes": 0,
"UUID": "<uuid>"
}
aws fsx describe-snapshot-policies --output json
"Name": "policy-cfn-hourly",
"Enabled": true,
"Schedules": [
{
"Name": "hourly",
"Count": 3,
"SnapmirrorLabel": "hourly"
}
],
"Scope": "FILESYSTEM",
"Lifecycle": "CREATED",
In the output of describe-volumes, the CloneConfiguration of clonecurrent contained ParentVolumeId. The CloneConfiguration of clonesnap contained ParentVolumeId and SnapshotId. Both had a Lifecycle of CREATED, and their size was 10,240 MiB, the same as the parent.
In this test, I created clonecurrent without specifying a SnapshotId. As a result, a snapshot named clone_clonecurrent.2026-11-24_043607.0 had been created on the parent volume srcvol.
Assigning the Policy
The created policy is assigned by specifying the policy name in the volume's SnapshotPolicy. This time I assigned it to clonesnap. The changes from 02-snapshot-clone.yaml are the addition of two lines: DependsOn and SnapshotPolicy.
# Clone from the snapshot (restore)
CloneFromSnapshot:
Type: AWS::FSx::Volume
DependsOn: SnapshotPolicy
Properties:
Name: clonesnap
VolumeType: ONTAP
OntapConfiguration:
JunctionPath: /clonesnap
SnapshotPolicy: policy-cfn-hourly
StorageVirtualMachineId: !Ref SvmId
CloneConfiguration:
ParentVolumeId: !Ref VolumeId
SnapshotId: !Ref Snapshot
Replace CloneFromSnapshot in 02-snapshot-clone.yaml with this content. I saved the replaced template as 02b-snapshot-clone-with-policy.yaml and updated the stack.
aws cloudformation update-stack \
--stack-name fsx-verify-snapshot-clone \
--template-body file://02b-snapshot-clone-with-policy.yaml \
--parameters \
ParameterKey=FileSystemId,UsePreviousValue=true \
ParameterKey=SvmId,UsePreviousValue=true \
ParameterKey=VolumeId,UsePreviousValue=true
To confirm the assignment, use describe-volumes with the volume ID of clonesnap (the stack output CloneFromSnapshotId).
aws fsx describe-volumes --volume-ids fsvol-0123456789abcdef2 \
--query 'Volumes[0].[Name,Lifecycle,OntapConfiguration.SnapshotPolicy]' --output json
When I checked about 1 minute after the stack reached UPDATE_COMPLETE, SnapshotPolicy had changed to policy-cfn-hourly.
SnapMirror
SnapMirror requires a cluster peer, an SVM peer, and a SnapMirror relationship. This time I also created a SnapMirror policy. I split it into two stacks: I first created the cluster peer stack (03a-cluster-peers.yaml), and then created the stack for the SVM peer, SnapMirror policy, and SnapMirror relationship (03b-snapmirror.yaml).
Cluster Peers
For PeerAddresses of AWS::FSx::ClusterPeer, specify the intercluster IPs of the peer file system. The attributes obtainable with Fn::GetAtt on AWS::FSx::FileSystem are the four: DNSName, LustreMountName, ResourceARN, and RootVolumeId. The intercluster IPs are not included. Therefore, I obtained the intercluster IPs with describe-file-systems and passed them as stack parameters.
aws fsx describe-file-systems --file-system-ids fs-0123456789abcdef0 fs-0123456789abcdef1 \
--query 'FileSystems[].[FileSystemId,OntapConfiguration.Endpoints.Intercluster.IpAddresses]' --output json
[
[
"fs-0123456789abcdef0",
[
"10.0.1.10",
"10.0.1.11"
]
],
[
"fs-0123456789abcdef1",
[
"10.0.1.20",
"10.0.1.21"
]
]
]
Create one cluster peer on each file system, and pass the same passphrase secret. On the destination side, specify the source's IPs; on the source side, specify the destination's IPs. Save it as 03a-cluster-peers.yaml.
AWSTemplateFormatVersion: '2010-09-09'
Description: Cluster peers for FSx for ONTAP (verification)
Parameters:
SrcFileSystemId:
Type: String
DstFileSystemId:
Type: String
SrcIntercluster:
Type: CommaDelimitedList
Description: Intercluster IP addresses of the source file system (read with describe-file-systems)
DstIntercluster:
Type: CommaDelimitedList
Description: Intercluster IP addresses of the destination file system (read with describe-file-systems)
PassphraseSecretArn:
Type: String
Resources:
# Cluster peer is mutual: create one on each file system with the same passphrase
ClusterPeerOnDst:
Type: AWS::FSx::ClusterPeer
Properties:
FileSystemId: !Ref DstFileSystemId
PeerAddresses: !Ref SrcIntercluster
PassphraseSecretArn: !Ref PassphraseSecretArn
AllowedSvmMode: ALL
ClusterPeerOnSrc:
Type: AWS::FSx::ClusterPeer
DependsOn: ClusterPeerOnDst
Properties:
FileSystemId: !Ref SrcFileSystemId
PeerAddresses: !Ref DstIntercluster
PassphraseSecretArn: !Ref PassphraseSecretArn
AllowedSvmMode: ALL
Outputs:
ClusterPeerOnDstId:
Value: !GetAtt ClusterPeerOnDst.ClusterPeerId
ClusterPeerOnSrcId:
Value: !GetAtt ClusterPeerOnSrc.ClusterPeerId
Because the IP parameter values contain commas, enclose the values in double quotes (") and enclose the whole argument in single quotes ('). For PassphraseSecretArn, pass the value from the environment stack's outputs.
aws cloudformation create-stack \
--stack-name fsx-verify-cluster-peers \
--template-body file://03a-cluster-peers.yaml \
--parameters \
ParameterKey=SrcFileSystemId,ParameterValue=fs-0123456789abcdef0 \
ParameterKey=DstFileSystemId,ParameterValue=fs-0123456789abcdef1 \
'ParameterKey=SrcIntercluster,ParameterValue="10.0.1.10,10.0.1.11"' \
'ParameterKey=DstIntercluster,ParameterValue="10.0.1.20,10.0.1.21"' \
ParameterKey=PassphraseSecretArn,ParameterValue=<シークレットARN>
The stack completed in about 35 seconds, and the cluster peers were created in the order of the destination side, then the source side. After 13:43:42, when the stack reached CREATE_COMPLETE, the state of the peers changed as follows.
aws fsx describe-cluster-peers \
--query 'ClusterPeers[].[ClusterPeerId,FileSystemId,Lifecycle,Status,AuthenticationStatus.State]' --output text
| Check time | Source side (Status / AuthenticationStatus.State) | Destination side (Status / AuthenticationStatus.State) |
|---|---|---|
| 13:43:54 to 13:48:17 (5 checks) | available / ok | unavailable / pending |
| 13:56:49 | available / ok | available / ok |
The 03b-snapmirror.yaml stack started creation at 13:47:07, about 3.5 minutes after the cluster peer stack completed, and completed at 13:48:07. The destination-side cluster peer was unavailable / pending at both the check just before (13:46:11) and the check just after (13:48:17).
SVM Peer, SnapMirror Policy, and SnapMirror Relationship
All of these are created on the destination file system side. For PeerClusterName of the SVM peer, I specified the value of FsxId followed by the source file system ID with fs- removed. In the template, this value is assembled with Fn::Join, Fn::Select, and Fn::Split. Save it as 03b-snapmirror.yaml.
AWSTemplateFormatVersion: '2010-09-09'
Description: SVM peer, SnapMirror policy, and SnapMirror relationship for FSx for ONTAP (verification)
Parameters:
SrcFileSystemId:
Type: String
DstFileSystemId:
Type: String
DstSvmId:
Type: String
DstVolumeId:
Type: String
Description: DP volume on the destination file system
SrcSvmName:
Type: String
SrcVolumeName:
Type: String
Resources:
# SVM peer is created from the destination SVM
SvmPeer:
Type: AWS::FSx::StorageVirtualMachinePeer
Properties:
StorageVirtualMachineId: !Ref DstSvmId
PeerSvmName: !Ref SrcSvmName
PeerClusterName: !Join ['', ['FsxId', !Select [1, !Split ['fs-', !Ref SrcFileSystemId]]]]
Applications: [SNAPMIRROR]
# Custom SnapMirror policy on the destination file system
SnapmirrorPolicy:
Type: AWS::FSx::SnapmirrorPolicy
Properties:
FileSystemId: !Ref DstFileSystemId
Name: policy-cfn-copyall
SnapshotCopyMode: COPY_ALL_SOURCE_SNAPSHOTS
NetworkCompressionEnabled: true
# Relationship is created on the destination file system. The baseline transfer starts automatically
SnapmirrorRelationship:
Type: AWS::FSx::SnapmirrorRelationship
DependsOn: SvmPeer
Properties:
Source:
Path: !Sub ${SrcSvmName}:${SrcVolumeName}
Destination:
VolumeId: !Ref DstVolumeId
PolicyId: !GetAtt SnapmirrorPolicy.SnapmirrorPolicyId
TransferSchedule: hourly
Outputs:
SvmPeerId:
Value: !GetAtt SvmPeer.StorageVirtualMachinePeerId
SnapmirrorPolicyId:
Value: !GetAtt SnapmirrorPolicy.SnapmirrorPolicyId
SnapmirrorRelationshipId:
Value: !GetAtt SnapmirrorRelationship.SnapmirrorRelationshipId
aws cloudformation create-stack \
--stack-name fsx-verify-snapmirror \
--template-body file://03b-snapmirror.yaml \
--parameters \
ParameterKey=SrcFileSystemId,ParameterValue=fs-0123456789abcdef0 \
ParameterKey=DstFileSystemId,ParameterValue=fs-0123456789abcdef1 \
ParameterKey=DstSvmId,ParameterValue=svm-0123456789abcdef1 \
ParameterKey=DstVolumeId,ParameterValue=fsvol-0123456789abcdef1 \
ParameterKey=SrcSvmName,ParameterValue=svmsrc \
ParameterKey=SrcVolumeName,ParameterValue=srcvol
The stack completed in about 1 minute. SnapmirrorPolicy took about 19 seconds, SvmPeer about 36 seconds, and SnapmirrorRelationship about 19 seconds.
The PeerClusterName of the created SVM peer was the following value, and State was PEERED.
aws fsx describe-storage-virtual-machine-peers \
--query 'StorageVirtualMachinePeers[].[StorageVirtualMachinePeerId,Lifecycle,State,PeerSvmName,PeerClusterName]' --output text
svmpeer-0123456789abcdef0 CREATED PEERED svmsrc FsxId0123456789abcdef0
Initial Transfer
The stack completed at 13:48:07, and at the first check at 13:48:16, the State of the SnapMirror relationship was UNINITIALIZED. Checking at 30-second intervals, it remained UNINITIALIZED until 13:56:07, and became SNAPMIRRORED for the first time at 13:56:37. Healthy was true even while it was UNINITIALIZED.
aws fsx describe-snapmirror-relationships --output json
"State": "SNAPMIRRORED",
"Healthy": true,
"LagTimeInMinutes": 8,
"ExportedSnapshot": {
"SnapshotId": "fsvolsnap-0123456789abcdef3",
"SnapshotName": "snapmirror.<uuid>_2163915976.2026-11-24_044803"
},
"TransferState": {
"State": "success",
"BytesTransferred": 8096,
"Duration": "PT3S",
"EndTime": "2026-11-24T13:48:08+09:00"
}
According to TransferState, the transfer had completed at the EndTime of 13:48:08, but the State became SNAPMIRRORED about 8 to 8.5 minutes after that.
The SnapMirror policy is COPY_ALL_SOURCE_SNAPSHOTS. On the destination volume, in addition to snap-cfn-01 and clone_clonecurrent… that had existed on srcvol before the relationship was created, the snapmirror.… snapshot created by the initial transfer existed with the same names as on the source.
aws fsx describe-snapshots --filters Name=volume-id,Values=fsvol-0123456789abcdef1 \
--query 'Snapshots[].[SnapshotId,Name,VolumeId,Lifecycle]' --output text
fsvolsnap-0123456789abcdef1 snap-cfn-01 fsvol-0123456789abcdef1 AVAILABLE
fsvolsnap-0123456789abcdef2 clone_clonecurrent.2026-11-24_043607.0 fsvol-0123456789abcdef1 AVAILABLE
fsvolsnap-0123456789abcdef3 snapmirror.<uuid>_2163915976.2026-11-24_044803 fsvol-0123456789abcdef1 AVAILABLE
Summary
I confirmed that snapshots, clones, and SnapMirror for Amazon FSx for NetApp ONTAP can be configured and managed with CloudFormation.
Previously, configuring and managing these was limited to the ONTAP CLI or REST API. With this update, it can now also be done from the FSx console and CloudFormation.
If you have a requirement to manage ONTAP environment configuration as IaC for reproducibility and change history, please try CloudFormation.
