Tech ONTAP Blogs
Tech ONTAP Blogs
If you’re looking for a code-based way to run your infrastructure, it’s easy to deploy Amazon FSx for NetApp ONTAP (FSx for ONTAP) using the AWS Terraform Provider FSx Resource. But are you sure you know what all the arguments are doing?
This post will explain the best practices for deploying FSx for ONTAP using the AWS Terraform provider FSX resource. The goal is to highlight important implementation, configuration, and access considerations when using this module. By following these best practices, a developer or administrator will be able to deploy FSx for ONTAP with the correct configuration for their specific needs.
FSx for ONTAP brings the power of NetApp® ONTAP® to AWS as a fully managed AWS-native storage service. It supports storage virtual machines (SVMs), logical volumes, and advanced features such as high availability (HA) with various forms of data protection (NetApp Snapshot™ copies, backups, and cross-region replication) as well as many cost saving features like deduplication, compression, cloning, and tiering.
These components provide a robust foundation for critical workloads with support for service continuity and disaster recovery. The ONTAP architecture enables you to easily replicate on-premises environments to the cloud while maintaining familiarity with NetApp tools.
The AWS Terraform provider has several Terraform resources that allow you to create and maintain a FSx for ONTAP file system. These resources include:
This section details the various parameters for the resources that were just introduced. For each one, I’ll explain what the parameter does, and give you best-practice recommendations on how to set it.
The following details relate to parameters of the aws_fsx_ontap_file_system resource. The parameter name is listed between the parentheses.
An FSx for ONTAP file system is always deployed as a pair of nodes in an HA (High Availability) configuration such that if one of the nodes becomes unavailable for any reason, the other node will pick up operations, typically before any I/Os to the file system have failed. The deployment_type parameter defines two things:
Supported settings are:
This parameter sets the ONTAP administrative password for the fsxadmin account which you can use to administer your file system using either RESTful APIs or the ONTAP command-line interface.
AWS Key Management Service (KMS) manages the encryption keys that protect your data at rest. FSx for ONTAP supports native integration with KMS to ensure that all data is encrypted per security policies.
In FSx for ONTAP, the storage type is always 'SSD'. Note that some of the other FSx services, such as FSx for Windows, give you different options here, but FSx for ONTAP only supports SSD for the primary storage. However, with its tiering capabilities, FSx for ONTAP can seamlessly move dormant data to capacity storage as a cost-saving option.
This sets the maximum IOPS of the backend disk for the file system. By default, you get 3 IOPS per GB of provisioned SSD storage.
With this setting you choose the number of HA pairs deployed within a single file system. In this way, you can have a very large amount of aggregated IOPS, throughput, and storage capacity under a single namespace. The maximum is 12 HA pairs. To have more than one HA pair, you must use a generation two based file system deployed in a single-AZ.
This parameter controls read and write throughput in MB/s to the backend disks. Unlike IOPS, throughput is crucial for workloads that handle large data transfers, such as distributed file systems.
This parameter will set your file system’s throughput capacity in MBps. The valid values you can use here are 128, 256, 512, 1024, 2048 and 4096 for Generation-1 file systems and 384, 768, 1536, 3072 and 6144 for Generation-2 file systems.
Note the field throughput_capacity_per_ha_pair supersedes the previous field throughput_capacity therefore it is recommended to use the newer field “throughput_capacity_per_ha_pair” as it is valid for both multiple HA pairs as well as a single HA pair.
This parameter also affects the maximum client-side network bandwidth, as well as the CPU capacity for the file system.
The storage capacity is defined in GiB and corresponds to the total high performance SSD space allocated in the FSx for ONTAP filesystem. Note that parameters can be adjusted after deployment, but only by raising it, not lowering it.
Valid numbers are from 1024 (1 TiB) to 196608 (192 TiB) for Generation-1 file systems. Up to 524288 (512 TiB) for single HA pair Generation-2 file systems, and up to 1048572 (1 PiB) for Generation-2 instances with more than two HA pairs.
Note that the more storage you provision here, the higher your IOPS will be, though it is possible to force a specific IOPS value using the disk_iops_configuration parameter.
This parameter defines the IP address range from which the NAS and management endpoints will be allocated. If you don’t provide an endpoint IP address range, AWS will select an IP address from within the 198.19.0.0/16 range.
Note that this parameter is only used for multi-AZ type deployments. For single-AZ type deployments, the endpoints will be allocated from the subnet’s address range.
To be able to route traffic to the endpoint_ip_address_range , your routing tables must be modified for that specific address range. This parameter allows you to specify route tables IDs you want AWS to modify to properly route traffic to the file system endpoints. Note that it only applies to multi-AZ deployments.
This is a list of security group IDs, which will be applied to network interfaces to provide access to the file system. These security groups will apply to all network interfaces
This parameter sets the start time for automatic daily backups to run.
This parameter determines the length of time—in days—that you want to retain the automatic backups, with valid ranges from 0 to 90. Setting this to 0 disables automatic backups.
Note that any time you delete an FSx ONTAP file system, by default AWS creates a final backup for all the volumes in that file system. These backups will exist in perpetuity, so unless you want costs to pile up, they should be deleted them manually.
AWS reserves the right to perform maintenance on your FSx ONTAP file system, at the most, once a week. This argument allows you to determine the day of the week and time that maintenance can take place. Note that since every FSx for ONTAP system is deployed as an HA pair, you shouldn’t experience any outages during a maintenance event, which in most cases is just upgrading the operating system.
Note that because of the way the CIFS protocol works, all CIFS connections will break twice during a maintenance event (failover, and fail back). However, most CIFS clients will know how to handle this without the risk of data loss (i.e. they will reconnect and retry their last transmission), but some clients don’t so it is something to keep in mind. The NFS and iSCSI protocols handle failover events without losing any data.
The following details relate to parameters of the aws_fsx_ontap_storage_virtual_machine resource. The parameter name is listed between the parentheses.
This parameter allows you to integrate FSx for ONTAP with Microsoft Active Directory (AD), enabling centralized authentication and permission management to access data stored in FSx for ONTAP.
This parameter allows you to specify the ID of FSx for ONTAP file system on which this SVM will be created.
This parameter allows you to set the name of the SVM. You can be up to 47 characters long but restricted to numbers, letters, and the underscore character.
Specifies the root volume security style. There are three values that can be used here: UNIX, NTFS, or MIXED. This root security style will be automatically applied to all the volumes that you create under this SVM, unless explicitly specified when creating the volume. The default value is UNIX.
Note that this setting does not affect the SVM’s ability to offer a volume using multiple protocols (i.e., NFS, CIFS, S3). See the security_style setting in the volume section below for more details.
This parameter lists the possible tags you can associate with the SVM.
Keep in mind that if the provider definition in the Terraform configuration file has a default_tags block, any tags defined here with the same key will override the values defined in the default_tags block.
This password is assigned to the vsadmin user who will manage the SVM.
The following details relate to parameters of the aws_fsx_ontap_volume resource. The parameter name is listed between the parentheses.
This parameter relates to the aggregate configurations used by FLEXGROUP volumes.
Use this parameter to specify the SVM where the volume will be created.
Use this parameter to specify the volume name. It can be up to 203 characters long. Only alphanumeric and the underscore (_) characters are allowed.
This parameter sets the security style for the volume being created. Options include NTFS, UNIX or MIXED. This is useful for controlling access permissions based on the client operating system that will be using the volume.
AWS Tags (Tags)
This parameter allows to you assign AWS tags to the volume.
Set the parameter to true will give SnapLock® admins the ability to delete FSx for ONTAP SnapLock Enterprise volumes that contain write-once, read-many (WORM) files.
This parameter indicates whether the volume’s tags should be copied to its backup copies.
This parameter determines the SVM namespace location for the volume to mount. You need to start with a forward slash for the junction_path, for example/vol9.
This parameter determines the ONTAP volume type. Can be set to RW (read-write) for standard volumes or DP (data protection) for replication volumes.
This parameter will determine your volume’s size in bytes. Note that size_in_bytes or size_in_megabytes can be used, though size_in_bytes is required if your volume is going to be larger than 2 petabytes. FLEXGROUP volumes have a minimum size of 100GiB per constituent.
This parameter determines your volume’s size in megabytes. Note that size_in_megabytes can be used when your volume is smaller than 2 PB. Like with size_in_bytes , there is the 100GiB minimum per constituent for Flexgroup volumes.
This parameter determines whether a backup is made of a volume before it is deleted.
The parameter determines whether SnapLock is enabled for this FSx for ONTAP volume.
This parameter allows you to set the snapshot policy associated with the volume.
This parameter allows you to enable Data ONTAP efficiencies (data compression, deduplication, and compaction)
This parameter sets the tiering policy for the volume The tiering policy allows inactive data to be automatically moved to a lower-cost capacity pool, reducing operational costs. Options include AUTO, SNAPSHOT_ONLY, ALL, and NONE. When setting to AUTO, you can specify the number of days before “cold data” (data that hasn’t been accessed) is moved to the capacity tier. In environments where storage cost is a critical factor, enabling automatic tiering is essential.
It’s highly recommended to enable tiering in most cases to reduce the amount of costly SSD storage consumed. It provides for seamless tiering of cold blocks to a cost-effective capacity pool. Recommendations are:
This parameter allows you to specify the type of volume. Valid values FLEXVOL and FLEXGROUP.
NetApp created a Terraform module that helps with the deployment of a FSx for ONTAP file system using Terraform. The module simplifies the deployment by doing the following:
When completing a PoC, be sure to perform proper cleanup of resources. This typically starts by running ‘terraform destroy’. Note, this will fail if you created volumes after Terraform has created the file system, so be sure to delete those volumes first. Once everything has been deleted, confirm that you don’t have any backups left over. Automatic backups and persistent volume backups can continue to incur costs even after the primary file system is removed.
With these detailed practices, you’ll be well equipped to deploy FSx for ONTAP with Terraform with the optimal configurations for your workload while maintaining security, performance, and cost controls.
To learn more, head to the GitHub repository and see the FSx for ONTAP deployment documentation on AWS.