

# Managing storage capacity
<a name="managing-storage-capacity"></a>

Amazon FSx for NetApp ONTAP provides a number of storage-related features you can use to manage storage capacity on your file system.

**Topics**
+ [FSx for ONTAP storage tiers](#storage-tiers)
+ [Choosing the right amount of file system SSD storage](#choose-ssd-capacity)
+ [File system storage capacity and IOPS](storage-capacity-and-IOPS.md)
+ [Volume storage capacity](volume-storage-capacity.md)

## FSx for ONTAP storage tiers
<a name="storage-tiers"></a>

Storage tiers are the physical storage media for an Amazon FSx for NetApp ONTAP file system. FSx for ONTAP offers the following storage tiers:
+ *SSD tier* – The user-provisioned, high-performance solid-state drive (SSD) storage that’s purpose-built for the active portion of your data set.
+ *Capacity pool tier* – Fully elastic storage that automatically scales to petabytes in size, and is cost-optimized for your infrequently accessed data.

An FSx for ONTAP volume is a virtual resource that, similar to folders, doesn't consume storage capacity. The data that you store—and that consumes physical storage—lives inside volumes. When you create a volume, you specify its size—which you can modify after it's created. FSx for ONTAP volumes are thin provisioned, and file system storage is not reserved in advance. Instead, SSD and capacity pool storage are allocated dynamically, as needed. A [tiering policy](volume-storage-capacity.md#data-tiering-policy), which you configure at the volume level, determines if and when data that's stored in the SSD tier transitions to the capacity pool tier.

The following diagram illustrates an example of data laid out across multiple FSx for ONTAP volumes in a file system.

![\[FSx for ONTAP SSD and capacity pool storage tiers logically provisioned across file system volumes.\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/fsx-ontap-volume-virtual-resource.png)


The following diagram illustrates how the file system's physical storage capacity is consumed by the data in the four volumes in the previous diagram.

![\[How the SSD, or primary storage tier, and the capacity pool storage tier usage of the file system's physical storage capacity looks across all volumes in a file system.\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/fsx-ontap-storage-tiers-physical-resource.png)


You can reduce your storage costs by choosing the tiering policy that best meets the requirements for each volume on your file system. For more information, see [Volume data tiering](volume-storage-capacity.md#volume-data-tiering).

## Choosing the right amount of file system SSD storage
<a name="choose-ssd-capacity"></a>

When choosing amount of SSD storage capacity for your FSx for ONTAP file system, you need to keep in mind the following items that impact the amount of SSD storage available for storing your data:
+ Storage capacity reserved for the NetApp ONTAP software overhead.
+ File metadata
+ Recently written data
+ Files that you intend to store on SSD storage, whether it's data that hasn't hit its cooling period, or data that you recently read that was retrieved back to SSD.

### How SSD storage is used
<a name="how-ssd-is-used"></a>

Your file system's SSD storage is used for a combination of NetApp ONTAP software (overhead), file metadata, and your data.

#### NetApp ONTAP software overhead
<a name="ONTAP-overhead"></a>

Like other NetApp ONTAP file systems, up to 16% of a file system's SSD storage capacity is reserved for ONTAP overhead, which means it's not available for storing your files. The ONTAP overhead is allocated as follows:
+ 11% is reserved for NetApp ONTAP software. For file systems with over 30 tebibytes (TiB) of SSD storage capacity, 6% is reserved.
+ 5% is reserved for aggregate snapshots, which are required to synchronize data between both of a file system's file servers.



#### File metadata
<a name="file-metadata"></a>

File metadata typically consumes 3-7% of the storage capacity that is consumed by the files. This percentage depends on the average file size (a smaller average file size requires more metadata), and the amount of storage efficiency savings achieved on your files. Note that file metadata doesn't benefit from storage efficiency savings. You can use the following guidelines for estimating the amount of SSD storage used for metadata on your file system.


| Average file size | Size of metadata as a percentage of file data | 
| --- | --- | 
|  4 KB  |  7%  | 
|  8 KB  |  3.5%  | 
|  32 KB or greater  |  1-3%  | 

When sizing the amount of SSD storage capacity you need for the metadata of files you plan to store on the capacity pool tier, we recommend using a conservative ratio of 1 GiB of SSD storage for every 10 GiB of data you plan to store on the capacity pool tier.

#### File data stored on your SSD tier
<a name="file-data-on-ssd-tier"></a>

In addition to your active data set and all file metadata, all data written to your file system is initially written to the SSD tier before being tiered-off to capacity pool storage. This is true regardless of the volume's tiering policy, with the exception that data is written directly to capacity pool storage when using SnapMirror on a volume configured with an **All** data tiering policy.

Random reads from the capacity pool tier are cached in the SSD tier, as long as the SSD tier is under 90% utilization. For more information, see [Volume data tiering](volume-storage-capacity.md#volume-data-tiering).

### Recommended SSD capacity utilization
<a name="ssd-utilization"></a>

We recommend that you do not exceed 80% utilization of your SSD storage tier on an ongoing basis. For second-generation file systems, we additionally recommend that you don't exceed 80% utilization of any of your file system's aggregates on an ongoing basis. These recommendations is consistent with NetApp's recommendation for ONTAP. Because your file system’s SSD tier is also used for staging writes to, and for random reads from, the capacity pool tier, any sudden changes in access patterns can quickly cause the utilization of your SSD tier to increase.

At 90% SSD utilization, data read from the capacity pool tier is no longer cached on the SSD tier so that the remaining SSD capacity is preserved for any new data that is written to the file system. This causes repeat reads of the same data from the capacity pool tier to be read from capacity pool storage instead of being cached and read from the SSD tier, which can impact the throughput capacity your file system.

All tiering functionality stops when the SSD tier is at or above 98% utilization. For more information, see [Tiering thresholds](volume-storage-capacity.md#storage-tiering-thresholds).

### Storage efficiency
<a name="storage-efficiency"></a>

NetApp ONTAP offers block-level storage efficiency features at the volume level that include compression, compaction, and deduplication. These features can save you up to 65% in storage capacity for general file shares, without sacrificing performance. You can enable storage efficiency on a per volume basis. These features reduce the amount of storage capacity that your data consumes, allowing you to consume less storage spaces in SSD, capacity pool, and backups storage. You can enable compression and deduplication on each volume for data in SSD storage. Storage savings from compression and deduplication in SSD storage is preserved when data is tiered to capacity pool storage. Storage efficiency is always enabled for backup data, regardless of your file system's storage efficiency configuration.

The following table shows examples of typical storage savings.


|  | Compression only | Deduplication only | Compression & deduplication | 
| --- | --- | --- | --- | 
| General-purpose file shares | 50% | 30% | 65% | 
| Virtual servers and desktops | 55% | 70% | 70% | 
| Databases | 65-70% | 0% | 65-70% | 
| Engineering data | 55% | 30% | 75% | 
| Geoseismic data | 40% | 3% | 40% | 

For most workloads, enabling compression and deduplication will not adversely impact file system performance. For most workloads, compression increases overall performance. To provide fast reads and writes from RAM cache, FSx for ONTAP file servers are equipped with higher levels of network bandwidth on the front-end network interface cards (NICs) than is available between the file servers and storage disks. Since data compression reduces the amount of data sent between file servers and storage disks, for most workloads, you will see an increase in overall file system throughput capacity when using data compression. Increases in throughput capacity related to data compression will be capped once you saturate the front-end NIC of your file system.

Amazon FSx for NetApp ONTAP also supports other ONTAP features that save you space, including snapshots, thin provisioning, and FlexClone volumes.

Storage efficiency features are not enabled by default. You can enable them as follows:
+ On an SVM's root volume when you [create a file system](creating-file-systems.md).
+ When you [create a new volume](creating-volumes.md).
+ When you [modify an existing volume](updating-volumes.md).

To view the amount of storage savings on a file system with storage efficiency enabled, see [Monitoring storage efficiency savings](view-storage-efficiency.md).

#### Calculating storage efficiency savings
<a name="storage-efficiency-calculation"></a>

You can use the `LogicalDataStored` and `StorageUsed` FSx for ONTAP CloudWatch file system metrics to calculate storage savings from compression, deduplication, compaction, snapshots, and FlexClones. These metrics have a single dimension, `FileSystemId`. For more information, see [File system metrics](file-system-metrics.md).
+ To compute storage-efficiency savings in bytes, take the Average of `StorageUsed` over a given period and subtract it from the Average of `LogicalDataStored` over the same period.
+ To compute storage-efficiency savings as a percentage of total logical data size, take the `Average` of `StorageUsed` over a given period and subtract it from the `Average` of `LogicalDataStored` over the same period. Then divide the difference by the `Average` of `LogicalDataStored` over the same period.

#### SSD sizing example
<a name="sizing-ssd-example"></a>

Assume you want to store 100 TiB of data for an application where 80% of the data is infrequently accessed. In this scenario, 80% (80 TiB) of your data is automatically tiered to the capacity pool tier and the remaining 20% (20 TiB) remains in SSD storage. Based on the typical storage efficiency savings of 65% for general-purpose file sharing workloads, that equates to 7 TiB of data. To maintain an 80% SSD utilization rate, you need 8.75 TiB of SSD storage capacity for the 20 TiB of actively-accessed data. The amount of SSD storage that you provision also needs to account for the ONTAP software storage overhead of 16%, as shown in the following calculation.

```
ssdNeeded = ssdProvisioned * (1 - 0.16)
8.75 TiB / 0.84 = ssdProvisioned
10.42 TiB = ssdProvisioned
```

So in this example, you need to provision at least 10.42 TiB of SSD storage. You will also use 28 TiB of capacity pool storage for the remaining 80 TiB of infrequently accessed data.

# File system storage capacity and IOPS
<a name="storage-capacity-and-IOPS"></a>

When you create an FSx for ONTAP file system, you specify the storage capacity of the SSD tier. For second-generation Single-AZ file systems, the storage capacity that you specify is spread evenly among the storage pools of each high-availability (HA) pair; these storage pools are called *aggregates*.

For each GiB of SSD storage that you provision, Amazon FSx automatically provisions 3 SSD input/output operations per second (IOPS) for the file system, up to a maximum of 160,000 SSD IOPS per file system. For second-generation Single-AZ file systems, your SSD IOPS are spread evenly across each of your file system's aggregates. You have the option to specify a level of provisioned SSD IOPS above the automatic 3 SSD IOPS per GiB. For more information about the maximum number of SSD IOPS that you can provision for your FSx for ONTAP file system, see [Impact of throughput capacity on performance](performance.md#impact-throughput-cap-performance).

**Topics**
+ [Updating file system SSD storage and IOPS](#increase-primary-storage)
+ [When to increase SSD storage capacity](#when-to-increase-ssd-capacity)
+ [Increasing SSD storage capacity](#increasing-ssd-capacity)
+ [Considerations for increasing SSD storage capacity](#increasing-considerations)
+ [When to decrease SSD storage capacity](#when-to-decrease-ssd-storage-capacity)
+ [Decreasing SSD storage capacity](#decreasing-ssd-capacity)
+ [Considerations for decreasing SSD storage capacity](#decreasing-considerations)
+ [Limitations for decreasing SSD storage capacity](#decreasing-limitations)
+ [Creating a storage capacity utilization alarm for your file system](alarm-low-primary-storage.md)
+ [Updating storage capacity and provisioned IOPS](increase-storage-capacity.md)
+ [Updating storage capacity dynamically](automate-storage-capacity-increase.md)
+ [Monitoring SSD storage utilization](monitor-fs-storage-console.md)
+ [Monitoring storage efficiency savings](view-storage-efficiency.md)
+ [Monitoring storage capacity and IOPS updates](monitoring-storage-capacity-increase.md)

## Updating file system SSD storage and IOPS
<a name="increase-primary-storage"></a>

When you need additional storage for the active portion of your data set, you can increase the SSD storage capacity of your Amazon FSx for NetApp ONTAP file system. For second-generation file systems, you can even decrease SSD storage capacity to match your workload's changing storage needs. Use the Amazon FSx console, Amazon FSx API, or AWS Command Line Interface (AWS CLI) to increase or decrease the SSD storage capacity. For more information, see [Updating storage capacity and provisioned IOPS](increase-storage-capacity.md).

## When to increase SSD storage capacity
<a name="when-to-increase-ssd-capacity"></a>

If you're running out of available SSD tier storage, we recommend that you increase the storage capacity of your file system. Running out of storage indicates that your SSD tier is undersized for the active portion of your data set.

To monitor the amount of free storage that's available on the file system, use the file system-level `StorageCapacity` and `StorageUsed` Amazon CloudWatch metrics. You can create a CloudWatch alarm on a metric and be notified when it drops below a specific threshold. For more information, see [Monitoring with Amazon CloudWatch](monitoring-cloudwatch.md).

**Note**  
We recommend that you don't exceed 80% SSD storage capacity utilization to ensure that data tiering, throughput scaling, and other maintenance activities function properly, and that there is capacity available for additional data. For second-generation file systems, this recommendation applies to both the average utilization across all of your file system's aggregates and to each individual aggregate. 

For more information about how a file system's SSD storage is used and how much SSD storage is reserved for file metadata and operating software, see [Choosing the right amount of file system SSD storage](managing-storage-capacity.md#choose-ssd-capacity).

## Increasing SSD storage capacity
<a name="increasing-ssd-capacity"></a>

When you increase the SSD storage capacity of your Amazon FSx file system, the new capacity is typically available for use within minutes. You're billed for the new SSD storage capacity after it becomes available to you. For more information, see [Amazon FSx for NetApp ONTAP Pricing](https://aws.amazon.com/fsx/netapp-ontap/pricing/) and [AWS billing and usage reports for FSx for ONTAP](FSxONTAP-Billing.md).

After you increase your storage capacity, Amazon FSx runs a storage optimization process in the background to rebalance your data. For most file systems, storage optimization takes a few hours with minimal noticeable impact to your workload performance.

You can track the progress of the storage optimization process at any time by using the Amazon FSx console, AWS CLI, and API. For more information, see [Monitoring storage capacity and IOPS updates](monitoring-storage-capacity-increase.md).

## Considerations for increasing SSD storage capacity
<a name="increasing-considerations"></a>

Here are a few important items to consider when increasing your file system's SSD storage capacity and IOPS:
+ **(First-generation file systems only) Storage capacity increase only** – You can only increase the amount of SSD storage capacity for a file system; you can't decrease the storage capacity.
+ **Storage capacity minimum increase** – Each SSD storage capacity increase must be a minimum of 10% of the file system's current SSD storage capacity, up to the maximum SSD storage capacity for your file system's configuration.
+ **Time between increases** – After increasing SSD storage capacity, provisioned IOPS, or throughput capacity on a file system, you must wait at least six hours before modifying any of these configurations on the same file system again. This is sometimes referred to as a cooldown period.
+ **Provisioned IOPS modes** – For a provisioned IOPS change, you must specify one of the two IOPS modes:
  + **Automatic** mode – Amazon FSx automatically scales your SSD IOPS to maintain 3 provisioned SSD IOPS per GiB of SSD storage capacity, up to the maximum SSD IOPS for your file system configuration.
**Note**  
For more information about the maximum number of SSD IOPS that you can provision for your FSx for ONTAP file system, see [Impact of throughput capacity on performance](performance.md#impact-throughput-cap-performance).
  + **User-provisioned** mode – You specify the number of SSD IOPS, which must be greater than or equal to 3 IOPS per GiB of SSD storage capacity. If you choose to provision a higher level of IOPS, you pay for the average IOPS provisioned above your included rate for the month, which is measured in IOPS-months.

For more information about pricing, see [Amazon FSx for NetApp ONTAP Pricing](https://aws.amazon.com/fsx/netapp-ontap/pricing/).

## When to decrease SSD storage capacity
<a name="when-to-decrease-ssd-storage-capacity"></a>

 You might want to decrease your FSx for ONTAP second-generation file system's SSD storage capacity in scenarios such as the following: 
+  After completing project-based workloads where high-performance storage is no longer needed 
+  After completing large-scale data migrations where temporary extra capacity was used to accelerate data ingestion 

## Decreasing SSD storage capacity
<a name="decreasing-ssd-capacity"></a>

 When you decrease SSD storage capacity of your file system, Amazon FSx attaches a new, smaller set of disks (aggregate) to each of your file system's HA pairs. Amazon FSx then runs a storage optimization process in the background to move data on a per-volume basis from the old disks to the new disks. After data in each volume has been moved, Amazon FSx redirects client access to volumes on the new disks. Amazon FSx then detaches the old disks from your file system. 

 You are billed for the existing and newly requested size of your SSD tier throughout the SSD decrease operation. For example, when you decrease SSD storage capacity from 10 tebibytes (TiB) to 5 TiB, you are billed for 15 TiB during the SSD decrease operation and 5 TiB after the SSD decrease operation is complete. For more information about billing, see [AWS billing and usage reports for FSx for ONTAP](FSxONTAP-Billing.md). 

 Decreasing SSD storage capacity can take between a few hours and a few weeks depending on factors such as the amount of data stored on your file system, the amount of net-new writes driven to your file system during the decrease operation, and the amount of network and disk resources available on the file system. 

 During the decrease operation, your data remains available for reads and writes. Most workloads experience minimal performance impact, though write-heavy workloads might experience temporary performance degradation. Brief I/O pauses (up to 60 seconds) might occur as client access is redirected to the new disks for each volume. 

 To minimize performance impact, you should maintain adequate headroom in your file system by ensuring that ongoing workloads don't consistently consume more than 50% CPU, 50% disk throughput, or 50% SSD IOPS before initiating an SSD decrease operation. You can monitor these utilization metrics in the **Monitoring & performance** tab of your file system in the Amazon FSx console. 

**Note**  
 If your SSD storage tier exceeds 80% utilization during the decrease operation, Amazon FSx pauses the operation and automatically resumes it after utilization falls below 80%. To decrease SSD utilization on the new disks, you can either tier data to capacity pool or delete data from volumes for which client access has been successfully redirected to the new set of disks. 

 If you need additional SSD capacity during a decrease operation, you can submit a request to increase SSD capacity by calling [https://docs.aws.amazon.com/cli/latest/reference/fsx/update-file-system.html](https://docs.aws.amazon.com/cli/latest/reference/fsx/update-file-system.html) in the AWS CLI or the equivalent [UpdateFileSystem](https://docs.aws.amazon.com/fsx/latest/APIReference/API_UpdateFileSystem.html) API operation and providing a new target value. Amazon FSx prioritizes completing the SSD increase request, so that the new SSD capacity is available for use within minutes before resuming the SSD decrease operation. 

## Considerations for decreasing SSD storage capacity
<a name="decreasing-considerations"></a>

Here are a few important items to consider when decreasing a file system's SSD storage capacity and provisioned IOPS:
+  **Increasing storage capacity during a decrease operation** – You can increase SSD storage capacity of your file system even while a decrease operation is in progress. This flexibility allows you to ensure performance and availability in case any of your aggregates fill up during the decrease operation. If you increase SSD capacity to a size lower than the original capacity, Amazon FSx only adjusts the size of the newly requested (target) aggregate. However, if you increase the SSD capacity to a size greater than the original, Amazon FSx increases the size of both aggregates to match the new target value. For example, if you're decreasing storage capacity from 10,000 GiB to 5,000 GiB, and then request an increase to 7,000 GiB, only the target aggregate is increased to 7,000 GiB, resulting in a final SSD storage capacity of 7,000 GiB for your file system. But if you request an increase to 12,000 GiB, both aggregates are increased to 12,000 GiB. We suggest careful planning to avoid a scenario in which you have to increase SSD capacity to a size equal to or larger than the original SSD capacity. 
+ **Pausing SSD decrease** – Amazon FSx pauses an SSD decrease operation if you exceed 80% utilization on the new aggregate and automatically resumes the decrease operation once utilization falls below 80%.
+ **(Second-generation Single-AZ file systems only) Storage capacity spread** – The new storage capacity or SSD IOPS that you select for your file system is spread evenly across each of your file system's aggregates.
+ **Patching during storage capacity decrease** – Amazon FSx aborts moving data for a volume if your file system is patched during an SSD decrease operation. As a result, you may lose progress on the SSD decrease operation if a patch occurs during the operation. Amazon FSx automatically restarts the `vol move` after the patch operation is complete.
+ **Provisioned IOPS modes** – For a provisioned IOPS change, you must specify one of the two IOPS modes:
  + **Automatic** mode – Amazon FSx automatically scales your SSD IOPS to maintain 3 provisioned SSD IOPS per GiB of SSD storage capacity, up to the maximum SSD IOPS for your file system configuration. When decreasing SSD capacity, your automatic SSD IOPS will scale down proportionally.
**Note**  
For more information about the maximum number of SSD IOPS that you can provision for your FSx for ONTAP file system, see [Impact of throughput capacity on performance](performance.md#impact-throughput-cap-performance).
  +  **User-provisioned** mode – You must provide an IOPS value that is equal to or higher than your currently provisioned IOPS. When decreasing SSD capacity, you can retain additional user-provisioned SSD IOPS as long as they don't exceed the maximum SSD IOPS supported by the smaller aggregate (50 IOPS per GB of requested SSD capacity). If your provisioned IOPS are higher than the maximum supported by the smaller aggregate, reduce IOPS before decreasing SSD capacity. 
+  **Unsupported volume types** – Amazon FSx does not support decreasing storage capacity on file systems with SnapLock volumes, FlexClones, offline volumes, or data protection (DP) volumes that do not contain any snapshots. 
+  **Unsupported Operations During Shrink ** – You cannot offline volumes, move volumes, create FlexClones, create SnapLock volumes, or modify storage efficiency settings of volumes during the decrease operation. 

## Limitations for decreasing SSD storage capacity
<a name="decreasing-limitations"></a>

The following limitations apply while decreasing SSD storage capacity of your file system:
+ **(Second-generation file systems only) Storage capacity decrease** – You can decrease the storage capacity only on second-generation file systems.
+ **Storage capacity minimum decrease** – Each SSD storage capacity decrease must be a minimum of 9 percent of the file system's current SSD storage capacity. The decrease should also ensure that your file system's resulting SSD capacity does not exceed 80% utilization after the decrease operation. For example, if your file system has 10,000 GiB of storage capacity and 5,000 GiB of storage used, you can decrease storage capacity down to 6,251 GiB such that your SSD utilization remains under 80%. You can decrease SSD storage capacity down to the minimum supported size of 1,024 GiB per HA pair.
+ To decrease SSD storage capacity on file systems that contain one or more volumes with more than 50 TiB of data in the SSD tier, you must provision at least 1,536 MB/s of throughput capacity per HA pair. If any volume contains more than 100 TiB of data in the SSD tier, you must provision at least 3,072 MB/s of throughput capacity per HA pair. For volumes with more than 200 TiB of data in the SSD tier, you must provision 6,144 MB/s of throughput capacity per HA pair.
+ **Time between updates** – After modifying SSD storage capacity, provisioned IOPS, or throughput capacity on a file system, you must wait at least six hours before modifying any of these configurations on the same file system again. This is sometimes referred to as a cooldown period.
+ You can increase but not decrease throughput capacity for your file system
+ You cannot add HA pairs to your file system
+  You cannot revert a volume to a previous state (using `volume snapshot restore`) while data in that volume is being moved to the new aggregate. However, you can run `volume snapshot restore` on other volumes that aren't being moved currently. 

# Creating a storage capacity utilization alarm for your file system
<a name="alarm-low-primary-storage"></a>

We recommend that you do not exceed an average SSD storage capacity utilization of 80% on an ongoing basis. Occasional SSD storage utilization spikes above 80% are acceptable. Maintaining an average utilization under 80% provides you with enough capacity to increase your storage without encountering issues. The following procedure shows how to create a CloudWatch alarm that alerts you to when your file system's SSD storage utilization is approaching 80%. 

**To create a file system storage capacity utilization alarm**

You can use the `StorageCapacityUtilization` metric to create an alarm that is triggered when one or more of your FSx for ONTAP file systems have reached a storage utilization threshold. 

1. Open the CloudWatch console at [https://console.aws.amazon.com/cloudwatch/](https://console.aws.amazon.com/cloudwatch/).

1.  In the left navigation pane, under **Alarms**, choose **All alarms**. Then, choose **Create alarm**. Within the create alarm wizard, choose **Select metric**. 

1. In the **graph explorer**, choose the **Multi source query** tab. 

1. In the **query builder**, choose the following: 
   + For **Namespace**, select **AWS/FSx** > **Detailed File System Metrics**. 
   + For **Metric name**, select **MAX(StorageCapacityUtilization)**.
   + For **Filter by**, you can optionally include or exclude specific file systems by their ID. If you leave **Filter by** empty, your alarm will trigger when any of your file systems exceed your alarm’s storage capacity utilization threshold.
   + Leave the rest of the options empty, and choose **Graph query**. 

1. Choose **Select metric**. Back in the wizard, in the **Metric** section, give your metric a **Label**. We recommend keeping the **Period** to 5 minutes.

1.  Under **Conditions**, choose the **Static threshold type**, whenever your metric is **Greater/Equal to 80**. 

1. Choose **Next** to go to the **Configure actions** page. 

**To configure alarm actions**

You can configure a variety of actions for your alarm to trigger when it reaches the threshold you configure. In this example, we choose a Simple Notification Service (SNS) topic, but you can learn about other actions in [Using Amazon CloudWatch alarms](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html) in the *Amazon CloudWatch User Guide*.

1. In the **Notification** section, choose an SNS topic to notify when your alarm is in the `ALARM` state. You can choose an existing topic or create a new one. You will receive a subscription notification that you need to confirm before you’ll receive alarm notifications to the email address. 

1. Choose **Next**. 

**To finish the alarm**

Follow these instructions to complete the process of creating your CloudWatch alarm. 

1. On the **Add name and description** page, give your alarm a name, and optionally a description, then choose **Next**. 

1. Review everything you’ve configured in the **Preview and create** page, and then choose **Create alarm**. 

# Updating storage capacity and provisioned IOPS
<a name="increase-storage-capacity"></a>

You can increase or decrease a file system's SSD-based storage and the amount of provisioned SSD IOPS by using the Amazon FSx console, the AWS CLI, and the API.

## To increase SSD storage capacity or provisioned IOPS for a file system (console)
<a name="increase-storage-console"></a>

1. Open the Amazon FSx console at [https://console.aws.amazon.com/fsx/](https://console.aws.amazon.com/fsx/).

1. In the left navigation pane, choose **File systems**. In the **File systems** list, select the FSx for ONTAP file system that you want to update SSD storage capacity and SSD IOPS for.

1. Choose **Actions** > **Update storage capacity**. Or, in the **Summary** section, choose **Update** next to the file system's **SSD storage capacity** value.

1. To increase SSD storage capacity, choose **Modify storage capacity**.

1. For **Input type**, choose one of the following: 
   + To enter the new SSD storage capacity as a percentage change from the current value, choose **Percentage**.
   + To enter the new value in GiB, choose **Absolute**.

1. Depending on the input type, enter a value for **Desired % increase**.
   + For **Percentage**, enter the percentage increase value. This value must be at least 10 percent greater than the current value.
   + For **Absolute**, enter the new value in GiB, up to the maximum allowed value of 196,608 GiB.

1. For **Provisioned SSD IOPS**, you have two options to modify the number of provisioned SSD IOPS for your file system:
   + If you want Amazon FSx to automatically scale your SSD IOPS to maintain 3 provisioned SSD IOPS per GiB of SSD storage capacity (up to a maximum of 160,000), choose **Automatic**.
   + If you want to specify the number of SSD IOPS, choose **User-provisioned**. Enter an absolute number of IOPS that's at least three times the amount of GiB of your SSD storage tier, and less than or equal to 160,000.
**Note**  
For more information about the maximum number of SSD IOPS that you can provision for your FSx for ONTAP file system, see [Impact of throughput capacity on performance](performance.md#impact-throughput-cap-performance).

1. Choose **Update**.
**Note**  
At the bottom of the prompt, a configuration preview is shown for your new SSD storage capacity and SSD IOPS. For second-generation file systems, the per-HA-pair value is also shown. 

## To increase SSD storage capacity and provisioned IOPS for a file system (CLI)
<a name="increase-storage-cli"></a>

To increase the SSD storage capacity and provisioned IOPS for an FSx for ONTAP file system, use the AWS CLI command [update-file-system](https://docs.aws.amazon.com/cli/latest/reference/fsx/update-file-system.html) or the equivalent [UpdateFileSystem](https://docs.aws.amazon.com/fsx/latest/APIReference/API_UpdateFileSystem.html) API action. Set the following parameters with your values:
+ Set `--file-system-id` to the ID of the file system that you are updating.
+ To increase your SSD storage capacity, set `--storage-capacity` to the target storage capacity value, which must be at least 10 percent greater than the current value.
+ To modify your provisioned SSD IOPS, use the `--ontap-configuration DiskIopsConfiguration` property. This property has two parameters, `Iops` and `Mode`:
  + If you want to specify the number of provisioned IOPS, use `Iops=number_of_IOPS` (up to a maximum of 160,000) and `Mode=USER_PROVISIONED`. The IOPS value must be greater than or equal to three times the requested SSD storage capacity. If you're not increasing the storage capacity, the IOPs value must be greater than or equal to three times the current SSD storage capacity.
  + If you want Amazon FSx to automatically increase your SSD IOPS, use `Mode=AUTOMATIC` and don't use the `Iops` parameter. Amazon FSx will automatically maintain 3 SSD IOPS per GiB of the provisioned SSD storage capacity (up to a maximum of 160,000).
**Note**  
For more information about the maximum number of SSD IOPS that you can provision for your FSx for ONTAP file system, see [Impact of throughput capacity on performance](performance.md#impact-throughput-cap-performance).

The following example increases the file system’s SSD storage to 2000 GiB and sets amount of user provisioned SSD IOPS to 7000.

```
aws fsx update-file-system \
--file-system-id fs-0123456789abcdef0 \
--storage-capacity 2000 \
--ontap-configuration 'DiskIopsConfiguration={Iops=7000,Mode=USER_PROVISIONED}'
```

To monitor the progress of the update, use the [describe-file-systems](https://docs.aws.amazon.com/cli/latest/reference/fsx/describe-file-systems.html) AWS CLI command. Look for the `AdministrativeActions` section in the output.

For more information, see [AdministrativeAction](https://docs.aws.amazon.com/fsx/latest/APIReference/API_AdministrativeAction.html) in the *Amazon FSx for NetApp ONTAP API Reference*.

## To decrease SSD storage capacity for a file system (console)
<a name="decrease-storage-console"></a>

1. Open the Amazon FSx console at [https://console.aws.amazon.com/fsx/](https://console.aws.amazon.com/fsx/).

1. In the left navigation pane, choose **File systems**. In the **File systems** list, select the FSx for ONTAP file system that you want to update SSD storage capacity and SSD IOPS for.

1. Choose **Actions** > **Update file system** > **Update SSD storage capacity/IOPS**. Or, in the **Summary** section, choose **Update** next to the file system's **SSD storage capacity** value.

1. To decrease SSD storage capacity, for **Action type**, choose **Decrease**.

1. For **Input type**, choose one of the following: 
   + To enter the new SSD storage capacity as a percentage change from the current value, choose **Percentage**.
   + To enter the new value in GiB, choose **Absolute**.

1. Depending on the input type, do one of the following.
   + For **Percentage**, enter the **Desired % decrease** value. This value must be at least 9 percent less than the current value.
   + For **Absolute**, enter the **Desired storage capacity** value in GiB.

1. Choose **Update**.
**Note**  
At the bottom of the prompt, a configuration preview is shown for your new SSD storage capacity and SSD IOPS. For second-generation file systems, the per-HA-pair value is also shown. 

## To decrease SSD storage capacity and provisioned IOPS for a file system (CLI)
<a name="decrease-storage-cli"></a>

To decrease the SSD storage capacity and provisioned IOPS for an FSx for ONTAP file system, use the AWS CLI command [update-file-system](https://docs.aws.amazon.com/cli/latest/reference/fsx/update-file-system.html) or the equivalent [UpdateFileSystem](https://docs.aws.amazon.com/fsx/latest/APIReference/API_UpdateFileSystem.html) API action. Set the following parameters with your values:

1. To decrease SSD capacity, use the following command:

   ```
   aws fsx update-file-system \
   --file-system-id fs-0123456789abcdef0 \
   --storage-capacity 4096
   ```

   If you're using the user-provisioned IOPS mode and want to retain your current IOPS level, include the `DiskIopsConfiguration` parameter:

   ```
   aws fsx update-file-system \
   --file-system-id fs-0123456789abcdef0 \
   --storage-capacity 4096 \
   --ontap-configuration 'DiskIopsConfiguration={Iops=15000,Mode=USER_PROVISIONED}'
   ```

1. To monitor the progress of the decrease operation, use the **describe-file-systems** command:

   ```
   aws fsx describe-file-systems --file-system-id fs-0123456789abcdef0
   ```

   The command returns information about the decrease operation in the `AdministrativeActions` section. For example:

   ```
   {
       "FileSystem": {
           "StorageCapacity": 4096,
           "StorageType": "SSD",
           "AdministrativeActions": [
               {
                   "AdministrativeActionType": "FILE_SYSTEM_UPDATE",
                   "Message": "Moving data for [vol1 vol2]. 2 volume(s) remaining. https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/troubleshooting.html",
                   "ProgressPercent": 4,
                   "RequestTime": 1748981251.591,
                   "Status": "IN_PROGRESS",
                   "TargetFileSystemValues": {
                       "StorageCapacity": 4096
                   }
               }
           ]
       }
   }
   ```

To monitor the progress of the update, use the [https://docs.aws.amazon.com/cli/latest/reference/fsx/describe-file-systems.html](https://docs.aws.amazon.com/cli/latest/reference/fsx/describe-file-systems.html) AWS CLI command. Look for the `AdministrativeActions` section in the output.

For more information, see [https://docs.aws.amazon.com/fsx/latest/APIReference/API_AdministrativeAction.html](https://docs.aws.amazon.com/fsx/latest/APIReference/API_AdministrativeAction.html) in the Amazon FSx for NetApp ONTAP API Reference.

# Updating storage capacity dynamically
<a name="automate-storage-capacity-increase"></a>

You can use the following solution to dynamically increase the SSD storage capacity of an FSx for ONTAP file system when the amount of used SSD storage capacity exceeds a threshold that you specify. This AWS CloudFormation template automatically deploys all of the components that are required to define the storage capacity threshold, the Amazon CloudWatch alarm based on this threshold, and the AWS Lambda function that increases the file system’s storage capacity.

The solution automatically deploys all of the components needed, and uses the following parameters:
+ Your FSx for ONTAP file system ID.
+ The used SSD storage capacity threshold (numerical value). This is the percentage at which the CloudWatch alarm will be triggered.
+ The percentage by which to increase the storage capacity (%).
+ The email address used to receive scaling notifications.

**Topics**
+ [Architecture overview](#storage-inc-architecture)
+ [CloudFormation template](#storage-capacity-CFN-template)
+ [Automated deployment with CloudFormation](#fsx-dynamic-storage-increase-deployment)

## Architecture overview
<a name="storage-inc-architecture"></a>

Deploying this solution builds the following resources in the AWS Cloud.

![\[Architecture diagram of the solution to automatically increase the storage capacity of an FSx for ONTAP file system.\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/dynamic-storage-scaling-architecture.png)


The diagram illustrates the following steps:

1. The CloudFormation template deploys a CloudWatch alarm, an AWS Lambda function, an Amazon Simple Notification Service (Amazon SNS) queue, and all required AWS Identity and Access Management (IAM) roles. The IAM role gives the Lambda function permission to invoke the Amazon FSx API operations.

1. CloudWatch triggers an alarm when the file system’s used storage capacity exceeds the specified threshold, and sends a message to the Amazon SNS queue. An alarm is triggered only when the file system’s used capacity exceeds the threshold continuously for a 5-minute period.

1. The solution then triggers the Lambda function that is subscribed to this Amazon SNS topic.

1. The Lambda function calculates the new file system storage capacity based on the specified percent increase value and sets the new file system storage capacity.

1. The original CloudWatch alarm state and results of the Lambda function operations are sent to the Amazon SNS queue.

To receive notifications about the actions that are performed as a response to the CloudWatch alarm, you must confirm the Amazon SNS topic subscription by following the link provided in the **Subscription Confirmation** email.

## CloudFormation template
<a name="storage-capacity-CFN-template"></a>

This solution uses CloudFormation to automate deploying the components that are used to automatically increase the storage capacity of an FSx for ONTAP file system. To use this solution, download the [FSxOntapDynamicStorageScaling](https://solution-references.s3.amazonaws.com/fsx/DynamicScaling/FSxOntapDynamicStorageScaling.yaml) CloudFormation template.

The template uses the **Parameters** described as follows. Review the template parameters and their default values, and modify them for the needs of your file system.



**FileSystemId**  
No default value. The ID of the file system for which you want to automatically increase the storage capacity.

**LowFreeDataStorageCapacityThreshold**  
No default value. Specifies the used storage capacity threshold at which to trigger an alarm and automatically increase the file system's storage capacity, specified in percentage (%) of the file system's current storage capacity. The file system is considered to have low free storage capacity when the used storage exceeds this threshold.

**EmailAddress**  
No default value. Specifies the email address to use for the SNS subscription and receives the storage capacity threshold alerts.

**PercentIncrease**  
Default is **20%**. Specifies the amount by which to increase the storage capacity, expressed as a percentage of the current storage capacity.  
Storage scaling is attempted once every time the CloudWatch alarm enters the `ALARM` state. If your SSD storage capacity utilization remains above the threshold after a storage scaling operation is attempted, the storage scaling operation isn't attempted again.

**MaxFSxSizeinGiB**  
Default is **196608**. Specifies the maximum supported storage capacity for the SSD storage.

## Automated deployment with CloudFormation
<a name="fsx-dynamic-storage-increase-deployment"></a>

The following procedure configures and deploys an CloudFormation stack to automatically increase the storage capacity of an FSx for ONTAP file system. It takes a few minutes to deploy. For more information about creating a CloudFormation stack, see [Creating a stack on the AWS CloudFormation console](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html) in the *AWS CloudFormation User Guide*.

**Note**  
Implementing this solution incurs billing for the associated AWS services. For more information, see the pricing details pages for those services.

Before you start, you must have the ID of the Amazon FSx file system that's running in the Amazon Virtual Private Cloud (Amazon VPC) in your AWS account. For more information about creating Amazon FSx resources, see [Getting started with Amazon FSx for NetApp ONTAP](getting-started.md).

**To launch the automatic storage capacity increase solution stack**

1. Download the [FSxOntapDynamicStorageScaling](https://solution-references.s3.amazonaws.com/fsx/DynamicScaling/FSxOntapDynamicStorageScaling.yaml) CloudFormation template.
**Note**  
Amazon FSx is currently only available in specific AWS Regions. You must launch this solution in an AWS Region where Amazon FSx is available. For more information, see [Amazon FSx endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/fsxn.html) in the *AWS General Reference*.

1. From the CloudFormation console, choose **Create stack > With new resources**.

1. Choose **Template is ready**. In the **Specify template** section, choose **Upload a template file** and upload the template that you downloaded.

1. In **Specify stack details**, enter the values for your automatic storage capacity increase solution.  
![\[The values entered for the Specify stack details page for the CloudFormation template\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/dynamic-storage-capacity-increase-cfn-stack.png)

1. Enter a **Stack name**.

1. For **Parameters**, review the parameters for the template and modify them to meet the needs of your file system. Then choose **Next**.
**Note**  
To receive email notifications when scaling is attempted by this CloudFormation template, confirm the SNS subscription email that you receive after deploying the template.

1. Enter the **Options** settings that you want for your custom solution, and then choose **Next**.

1. For **Review**, review and confirm the solution settings. You must select the check box acknowledging that the template creates IAM resources.

1. Choose **Create** to deploy the stack.

You can view the status of the stack in the CloudFormation console in the **Status** column. You should see a status of **CREATE\$1COMPLETE** in a few minutes.

### Updating the stack
<a name="automate-storage-capacity-increase-update"></a>

After the stack is created, you can update it by using the same template and providing new values for the parameters. For more information, see [Updating stacks directly](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-direct.html) in the *AWS CloudFormation User Guide*.

# Monitoring SSD storage utilization
<a name="monitor-fs-storage-console"></a>

You can monitor your file system's SSD storage capacity utilization using a variety of AWS and NetApp tools. Using Amazon CloudWatch you can monitor storage capacity utilization and set alarms to alert you when storage capacity utilization reaches a customizable threshold.

**Note**  
We recommend that you don't exceed 80% storage capacity utilization of your SSD storage tier. This ensures that tiering functions properly, and provides overhead for new data. If your SSD storage tier is consistently above 80% storage capacity utilization, you can increase your SSD storage tier's capacity. For more information, see [Updating file system SSD storage and IOPS](storage-capacity-and-IOPS.md#increase-primary-storage).

You can view a file system's available SSD storage and the overall storage distribution in the Amazon FSx console. The **Available primary storage capacity** graph displays the amount of available SSD-based storage capacity on a file system over time. The **Storage distribution** graph shows how a file system's overall storage capacity is currently distributed over 3 categories:
+ Capacity pool tier
+ SSD tier - available
+ SSD tier - used

You can monitor your file system's SSD storage capacity utilization in the AWS Management Console, using the following procedure.

**To monitor file system available SSD tier storage capacity (console)**

1. Open the Amazon FSx console at [https://console.aws.amazon.com/fsx/](https://console.aws.amazon.com/fsx/).

1. Choose **File systems** in the left-hand navigation column, then choose the ONTAP file system that you want to view storage capacity information for. The file system detail page appears.

1. In the second panel, choose the **Monitoring & performance** tab, then choose **Storage**. The **Available primary storage capacity** and **Storage capacity utilization per aggregate** graphs are displayed.

# Monitoring storage efficiency savings
<a name="view-storage-efficiency"></a>

 When enabled, you can see how much storage capacity you are saving in the Amazon FSx console, the Amazon CloudWatch console, and the ONTAP CLI.

**To view storage efficiency savings (console)**

The storage efficiency savings displayed in the Amazon FSx console for an FSx for ONTAP file system includes the savings from FlexClones and SnapShots.

1. Open the Amazon FSx console at [https://console.aws.amazon.com/fsx/](https://console.aws.amazon.com/fsx/).

1. Choose the FSx for ONTAP file system that you want to view storage efficiency saving for from the list of **File systems**.

1. Choose **Summary** in the **Monitoring & performance** tab on the second panel in the file system details page.

1. The **Storage efficiency savings** chart shows how much space you are saving as a percentage of your logical data size and in physical bytes.<a name="storage-efficient-ontap-cli"></a>

**To view storage efficiency savings (ONTAP CLI)**

You can see storage efficiency savings of just compaction, compression, and deduplication – without the effects of snapshots and FlexClones – by running the `storage aggregate show-efficiency` command using the ONTAP CLI. For more information, see [storage aggregate show-efficiency](https://docs.netapp.com/us-en/ontap-cli-9131/storage-aggregate-show-efficiency.html) in the NetApp ONTAP Documentation Center.

1. To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace `management_endpoint_ip` with the IP address of the file system's management port.

   ```
   [~]$ ssh fsxadmin@management_endpoint_ip
   ```

   For more information, see [Managing file systems with the ONTAP CLI](managing-resources-ontap-apps.md#fsxadmin-ontap-cli). 

1. The **storage aggregate show-efficiency** command displays information about the storage efficiency of all the aggregates. The storage efficiency is displayed at four different levels:
   + Total
   + Aggregate
   + Volume
   + Snapshot and FlexClone volume

   ```
   ::*> aggr show-efficiency
   
   Aggregate: aggr1
        Node: node1
   
   Total Data Reduction Efficiency Ratio:  3.29:1
   Total Storage Efficiency Ratio:         4.29:1
   Aggregate: aggr2
        Node: node1
   
   Total Data Reduction Efficiency Ratio:  4.50:1
   Total Storage Efficiency Ratio:         5.49:1
   
   cluster::*> aggr show-efficiency -details
   
   Aggregate: aggr1
        Node: node1
   
   Total Data Reduction Ratio:                    2.39:1
   Total Storage Efficiency Ratio:                4.29:1
   
   Aggregate level Storage Efficiency
   (Aggregate Deduplication and Data Compaction): 1.00:1
   Volume Deduplication Efficiency:               5.03:1
   Compression Efficiency:                        1.00:1
   
   Snapshot Volume Storage Efficiency:            8.81:1
   FlexClone Volume Storage Efficiency:           1.00:1
   Number of Efficiency Disabled Volumes:         1
   
   Aggregate: aggr2
        Node: node1
   Total Data Reduction Ratio:                    2.39:1
   Total Storage Efficiency Ratio:                4.29:1
   
   Aggregate level Storage Efficiency
   (Aggregate Deduplication and Data Compaction): 1.00:1
   Volume Deduplication Efficiency:               5.03:1
   Compression Efficiency:                        1.00:1
   
   Snapshot Volume Storage Efficiency:            8.81:1
   FlexClone Volume Storage Efficiency:           1.00:1
   Number of Efficiency Disabled Volumes:         1
   ```

# Monitoring storage capacity and IOPS updates
<a name="monitoring-storage-capacity-increase"></a>

You can monitor the progress of an SSD storage capacity and IOPS update by using the Amazon FSx console, CLI, and API.

## To monitor storage and IOPS updates (console)
<a name="monitor-storage-action-console"></a>

In the **Updates** tab on the **File system details** page for your FSx for ONTAP file system, you can view the 10 most recent updates for each update type.

![\[A recent updates list for a file system as it appears in the Console.\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/fs-updates-panel.png)


For SSD storage capacity and IOPS updates, you can view the following information:

****Update type****  
Supported types are **Storage capacity**, **Mode**, and **IOPS**. The **Mode** and **IOPS** values are listed for all storage capacity and IOPS scaling requests. 

****Target value****  
The value that you specified to update the file system's SSD storage capacity or IOPS to.

****Status****  
The current status of the update. The possible values are as follows:  
+ **Pending** – Amazon FSx received the update request, but hasn't started processing it.
+ **In progress** – Amazon FSx is processing the update request.
+ **Updated; Optimizing** – Amazon FSx increased the file system's SSD storage capacity. The storage-optimization process is now rebalancing your data in the background.
+ **Completed** – The update finished successfully.
+ **Failed** – The update request failed. Choose the question mark (**?**) to see details.

****Progress %****  
Displays the progress of the storage-optimization process as the percentage complete.

****Request time****  
The time that Amazon FSx received the update action request.

## To monitor storage and IOPS updates (CLI)
<a name="monitor-storage-action-cli-api"></a>

You can view and monitor file system SSD storage capacity increase and decrease requests by using the [https://docs.aws.amazon.com/cli/latest/reference/fsx/describe-file-systems.html](https://docs.aws.amazon.com/cli/latest/reference/fsx/describe-file-systems.html) AWS CLI command and the [DescribeFileSystems](https://docs.aws.amazon.com/fsx/latest/APIReference/API_DescribeFileSystems.html) API operation. The `AdministrativeActions` array lists the 10 most recent update actions for each administrative action type. When you increase a file system's SSD storage capacity, two `AdministrativeActions` actions are generated: a `FILE_SYSTEM_UPDATE` and a `STORAGE_OPTIMIZATION` action. When you decrease a file system's SSD storage capacity, only one `AdministrativeActions` action is generated: a `FILE_SYSTEM_UPDATE` action. 

The following example shows an excerpt of the response of a `describe-file-systems` CLI command. The file system has a pending administrative action to increase the SSD storage capacity to 2000 GiB and the provisioned SSD IOPS to 7000.

```
"AdministrativeActions": [
    {
        "AdministrativeActionType": "FILE_SYSTEM_UPDATE",
        "RequestTime": 1586797629.095,
        "Status": "PENDING",
        "TargetFileSystemValues": {
            "StorageCapacity": 2000,
            "OntapConfiguration": {
                "DiskIopsConfiguration": {
                    "Mode": "USER_PROVISIONED",
                    "Iops": 7000
                }
             }
        }
    },
    {
        "AdministrativeActionType": "STORAGE_OPTIMIZATION",
        "RequestTime": 1586797629.095,
        "Status": "PENDING"
    }
]
```

Amazon FSx processes the `FILE_SYSTEM_UPDATE` action first, adding the new larger storage disks to the file system. When the new storage is available to the file system, the `FILE_SYSTEM_UPDATE` status changes to `UPDATED_OPTIMIZING`. The storage capacity shows the new larger value, and Amazon FSx begins processing the `STORAGE_OPTIMIZATION` administrative action. This behavior is shown in the following excerpt of the response of a `describe-file-systems` CLI command. 

The `ProgressPercent` property displays the progress of the storage-optimization process. After the storage-optimization process has completed successfully, the status of the `FILE_SYSTEM_UPDATE` action changes to `COMPLETED`, and the `STORAGE_OPTIMIZATION` action no longer appears.

```
"AdministrativeActions": [
    {
        "AdministrativeActionType": "FILE_SYSTEM_UPDATE",
        "RequestTime": 1586799169.445,
        "Status": "UPDATED_OPTIMIZING",
        "TargetFileSystemValues": {
            "StorageCapacity": 2000,
            "OntapConfiguration": {
                "DiskIopsConfiguration": {
                    "Mode": "USER_PROVISIONED",
                    "Iops": 7000
                }
            }
        }
    },
    {
        "AdministrativeActionType": "STORAGE_OPTIMIZATION",
        "ProgressPercent": 41,
        "RequestTime": 1586799169.445,
        "Status": "IN_PROGRESS"
    }
]
```

When decreasing SSD capacity, the `FILE_SYSTEM_UPDATE` action includes a `Message` property that provides information about which volumes are currently being moved and how many volumes remain. For example:

```
"AdministrativeActions": [
    {
        "AdministrativeActionType": "FILE_SYSTEM_UPDATE",
        "Message": "Moving data for [vol1 vol2]. 2 volume(s) remaining. https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/troubleshooting.html",
        "ProgressPercent": 8,
        "RequestTime": 1748981251.591,
        "Status": "IN_PROGRESS",
        "TargetFileSystemValues": {
            "StorageCapacity": 4096,
            "OntapConfiguration": {
                "DiskIopsConfiguration": {
                    "Mode": "AUTOMATIC",
                    "Iops": 12288
                }
            }
        }
    }
]
```

If the SSD decrease operation is paused because the target aggregate has exceeded 80% utilization, the status will change to `PAUSED` with an appropriate message:

```
"AdministrativeActions": [
    {
        "AdministrativeActionType": "FILE_SYSTEM_UPDATE",
        "Message": "Your file system has insufficient free space in its SSD tier. Please free up space or increase your file system's storage capacity.",
        "ProgressPercent": 8,
        "RequestTime": 1748981251.591,
        "Status": "PAUSED",
        "TargetFileSystemValues": {
            "StorageCapacity": 4096,
            "OntapConfiguration": {
                "DiskIopsConfiguration": {
                    "Mode": "AUTOMATIC",
                    "Iops": 12288
                }
            }
        }
    }
]
```

 If the storage capacity or IOPS update request fails, the status of the `FILE_SYSTEM_UPDATE` action changes to `FAILED`, as shown in the following example. The `FailureDetails` property provides information about the failure.

```
"AdministrativeActions": [
    {
        "AdministrativeActionType": "FILE_SYSTEM_UPDATE",
        "RequestTime": 1586373915.697,
        "Status": "FAILED",
        "TargetFileSystemValues": {
            "StorageCapacity": 2000,
            "OntapConfiguration": {
                "DiskIopsConfiguration": {
                    "Mode": "USER_PROVISIONED",
                    "Iops": 7000
                }
            }
        },
        "FailureDetails": {
            "Message": "failure-message"
        }
    }
]
```

# Volume storage capacity
<a name="volume-storage-capacity"></a>

FSx for ONTAP volumes are virtual resources that you use for grouping data, determining how data is stored, and determining the type of access to your data. Volumes, like folders, don't consume file system storage capacity themselves. Only the data that's stored in a volume consumes SSD storage and, depending on the [volume's tiering policy](#data-tiering-policy), capacity pool storage. You set a volume's size when you create it, and you can change its size later. You can monitor and manage the storage capacity of your FSx for ONTAP volumes using the AWS Management Console, AWS CLI and API, and the ONTAP CLI.

**Topics**
+ [Volume data tiering](#volume-data-tiering)
+ [Snapshots and volume storage capacity](#managing-snapshots)
+ [Volume file capacity](#managing-volume-file-capacity)
+ [Managing storage efficiencies](manage-vol-SE.md)
+ [Enabling autosizing](enable-volume-autosizing.md)
+ [Enabling cloud write mode](cloud-write-mode.md)
+ [Updating storage capacity](manage-volume-capacity.md)
+ [Updating a tiering policy](modify-volume-tiering-policy.md)
+ [Updating the minimum cooling days](set-cooling-days.md)
+ [Updating a volume's cloud retrieval policy](set-cloud-retrieval.md)
+ [Updating the maximum number of files on a volume](increase-volume-max-files.md)
+ [Monitoring volume storage capacity](monitor-volume-storage-console.md)
+ [Monitoring a volume's file capacity](view-volume-file-capacity.md)

## Volume data tiering
<a name="volume-data-tiering"></a>

An Amazon FSx for NetApp ONTAP file system has two storage tiers: primary storage and capacity pool storage. Primary storage is provisioned, scalable, high-performance SSD storage that’s purpose-built for the active portion of your data set. Capacity pool storage is a fully elastic storage tier that can scale to petabytes in size and is cost-optimized for infrequently accessed data.

The data on each volume is automatically tiered to the capacity pool storage tier based on the volume's tiering policy, cooling period, and threshold settings. The following sections describe ONTAP volume tiering policies and the thresholds used to determine when data is tiered to the capacity pool.

**Note**  
FSx for ONTAP supports tiering data to the capacity pool on all SnapLock volumes, regardless of the SnapLock type. For more information, see [How SnapLock works](how-snaplock-works.md).

### Volume tiering policies
<a name="data-tiering-policy"></a>

You determine how to use your FSx for ONTAP file system’s storage tiers by choosing the tiering policy for each of volume on the file system. You choose the tiering policy when you create a volume, and you can modify it at any time with the Amazon FSx console, AWS CLI, API, or using [NetApp management tools](managing-resources-ontap-apps.md). You can choose from one of the following policies that determine which data, if any, is tiered to the capacity pool storage.

**Note**  
Tiering can move your file data and snapshot data to the capacity pool tier. However, file metadata always remains on the SSD tier. For more information, see [How SSD storage is used](managing-storage-capacity.md#how-ssd-is-used).
+ **Auto** – This policy moves all cold data—user data and snapshots—to the capacity pool tier. The cooling rate of data is determined by the policy's cooling period, which by default is 31 days, and is configurable to values between 2–183 days. When the underlying cold data blocks are read randomly (as in typical file access), they are made hot and written to the primary storage tier. When cold data blocks are read sequentially (for example, by an antivirus scan), they remain cold and remain on the capacity pool storage tier. This is the default policy when creating a volume using the Amazon FSx console.
+ **Snapshot Only** – This policy moves only snapshot data to the capacity pool storage tier. The rate at which snapshots are tiered to the capacity pool is determined by the policy's cooling period, which by default is set to 2 days, and is configurable to values between 2–183 days. When cold snapshot data are read, they are made hot and written to the primary storage tier. This is the default policy when creating a volume using the AWS CLI, Amazon FSx API, or the NetApp ONTAP CLI.
+ **All** – This policy marks all user data and snapshot data as cold, and stores it in the capacity pool tier. When data blocks are read, they remain cold and are not written to the primary storage tier. When data is written to a volume with the **All** tiering policy, it is still initially written to the SSD storage tier, and is tiered to the capacity pool by a background process. If the **All** policy is applied to a volume that already contains data, the existing data is tiered from SSD to the capacity pool. Note that file metadata always remains on the SSD tier.
+ **None** – This policy keeps all of your volume’s data on the primary storage tier, and prevents it from being moved to capacity pool storage. If you set a volume to this policy after it uses any other policy, existing data (including snapshots) in the volume that was in capacity pool storage is moved to SSD storage by a background process. This data migration only occurs when your SSD utilization is below 90% and the cloud retrieval policy is set to `promote` or `on-read`. This background process can be sped up by intentionally reading data. For more information, see [Cloud retrieval policies](#cloud-retrieval-policies).

For more information about setting or modifying a volume's tiering policy, see [Updating a tiering policy](modify-volume-tiering-policy.md).

 As a best practice, when migrating data that you plan to store long-term in capacity pool storage, we recommend that you use the **Auto** tiering policy on your volume. With **Auto** tiering, data is stored on the SSD storage tier for a minimum of 2 days (based on the volume's cooling period) before it's moved to the capacity pool tier. ONTAP runs post-process deduplication on data stored in the SSD storage tier periodically, automatically adjusting the frequency based on the rate of data change in the volume—higher rates trigger post-process deduplication jobs more frequently. 

By default, post-process compression is disabled in ONTAP due to the performance impact it can have on ongoing workloads on the file system. You should evaluate the impact on your workload's performance before enabling post-process compression. To enable post-process compression, assume the diagnostic privilege level in the ONTAP CLI and run the following command:

```
::> volume efficiency inactive-data-compression modify -vserver svm-name -volume vol-name -is-enabled true
```

ONTAP runs post-process compression for data that is retained on SSD storage for a minimum of 14 days. For workloads where data is unlikely to be accessed after a shorter period, you can modify the post-process compression settings to run post-process compression sooner. For example, to apply post-process compression savings to data that has not been accessed for 5 days, run the following ONTAP CLI command:

```
::> volume efficiency inactive-data-compression modify -vserver svm-name -volume vol-name -threshold-days 5 -threshold-days-min 2 -threshold-days-max 14
```

For more information about the command, see [volume efficiency inactive-data-compression modify](https://docs.netapp.com/us-en/ontap-cli-9141/volume-efficiency-inactive-data-compression-modify.html)

 By retaining data on SSD, you maximize the transfer speeds of volume backups that you create, as data transfer rates are higher for SSD storage.

### Tiering cooling period
<a name="tiering-cooling-period"></a>

A volume's tiering cooling period sets the amount of time that it takes for data in the SSD tier to be marked as cold. The cooling period applies to the `Auto` and `Snapshot-only` tiering policies. You can set the cooling period to a value in the range of 2–183 days. For more information about setting the cooling period, see [Updating the minimum cooling days](set-cooling-days.md).

Data is tiered 24–48 hours after its cooling period expires. Tiering is a background process that consumes network resources, and has a lower priority than client-facing requests. Tiering activities are throttled when there are ongoing client-facing requests.

### Cloud retrieval policies
<a name="cloud-retrieval-policies"></a>

A volume's cloud retrieval policy sets the conditions that specify when data that's read from the capacity pool tier is allowed to be promoted to the SSD tier. When the cloud retrieval policy is set to anything other than `Default`, this policy overrides the retrieval behavior of your volume’s tiering policy. A volume can have one of the following cloud retrieval policies:
+ **Default** – This policy retrieves tiered data based on the volume's underlying tiering policy. This is the default cloud retrieval policy for all volumes.
+ **Never** – This policy never retrieves tiered data, regardless of whether the reads are sequential or random. This is similar to setting the tiering policy of your volume to **All**, except that you can use it with other policies–**Auto**, **Snapshot-only**–to tier data according to the minimum cooling period instead of immediately.
+ **On-read** – This policy retrieves tiered data for all client-driven data reads. This policy has no effect when using the **All** tiering policy.
+ **Promote** – This policy marks all of a volume’s data that's in the capacity pool for retrieval to the SSD tier. The data is marked the next time the daily background tiering scanner runs. This policy is beneficial for applications that have cyclical workloads that run infrequently, but require SSD tier performance when they do run. This policy has no effect when using the **All** tiering policy.

For information on setting a volume's cloud retrieval policy, see [Updating a volume's cloud retrieval policy](set-cloud-retrieval.md).

### Tiering thresholds
<a name="storage-tiering-thresholds"></a>

A file system's SSD storage capacity utilization determines how ONTAP manages the tiering behavior for all of your volumes. Based on a file system's SSD storage capacity usage, the following thresholds set the tiering behavior as described. For information about how to monitor the capacity utilization of a volume's SSD storage tier, see [Monitoring volume storage capacity](monitor-volume-storage-console.md). 

**Note**  
We recommend that you don't exceed 80% storage capacity utilization of your SSD storage tier. For second-generation file systems, this recommendation applies to both the total average utilization across all of your file system's aggregates and to the utilization of each individual aggregate. This ensures that tiering functions properly, and provides overhead for new data. If your SSD storage tier is consistently above 80% storage capacity utilization, you can increase your SSD storage tier's capacity. For more information, see [Updating file system SSD storage and IOPS](storage-capacity-and-IOPS.md#increase-primary-storage).

FSx for ONTAP uses the following storage capacity thresholds to manage tiering on volumes:
+ **<=50% SSD storage tier utilization** – At this threshold, the SSD storage tier is considered to be underutilized, and only volumes that are using the **All** tiering policy have data tiered to capacity pool storage. Volumes with **Auto** and **Snapshot-only** policies don't tier data at this threshold.
+ **> 50% SSD storage tier utilization** – Volumes with **Auto** and **Snapshot-only** tiering policies tier data based on the tiering minimum cooling days setting. The default setting is 31 days.
+ **>=90% SSD storage tier utilization** – At this threshold, Amazon FSx prioritizes preserving space in the SSD storage tier. Cold data from the capacity pool tier is no longer moved into the SSD storage tier when read for volumes using **Auto** and **Snapshot-only** policies.
+ **>=98% SSD storage tier utilization** – All tiering functionality stops when the SSD storage tier is at or above 98% utilization. You can continue to read from storage tiers, but you can't write to the tiers.

## Snapshots and volume storage capacity
<a name="managing-snapshots"></a>

A *snapshot* is a read-only image of an Amazon FSx for NetApp ONTAP volume at a point in time. Snapshots offer protection against accidental deletion or modification of files in your volumes. With snapshots, your users can easily view and restore individual files or folders from an earlier snapshot.

Snapshots are stored alongside your ﬁle system's data, and they consume the ﬁle system's storage capacity. However, snapshots consume storage capacity only for the portions of ﬁles that changed since the last snapshot. Snapshots are not included in backups of your ﬁle system volumes.

Snapshots are enabled by default on your volumes, using the default snapshot policy. Snapshots are stored in the `.snapshot` directory at the root of a volume. You can manage volume storage capacity for snapshots in the following ways:
+ [Snapshot policies](snapshots-ontap.md#snapshot-policies) – Select a built-in snapshot policy or choose a custom policy that you created in the ONTAP CLI or REST API.
+ [Manually delete snapshots](manually-delete-snapshots.md) – Reclaim storage capacity by deleting snapshots manually.
+ [Create a snapshot autodelete policy](snapshot-autodelete-policy.md) – Create a policy that deletes more snapshots than the default snapshot policy.
+ [Turn off automatic snapshots](disable-snapshots.md) – Conserve storage capacity by turning off automatic snapshots.

For more information, see [Protecting your data with snapshots](snapshots-ontap.md).

## Volume file capacity
<a name="managing-volume-file-capacity"></a>

Amazon FSx for NetApp ONTAP volumes have file pointers that are used to store file metadata such as file name, last accessed time, permissions, size, and to serve as pointers to data blocks. These file pointers are called inodes, and each volume has a finite capacity for the number of inodes, which is called the volume file capacity. When a volume runs low on or exhausts its available files (inodes), you can't write additional data to that volume.

The number of file system objects—files, directories, Snapshot copies—a volume can contain is determined by how many inodes it has. The number of inodes in a volume increases commensurately with the volume's storage capacity (and the number of volume constituents for FlexGroup volumes). By default, FlexVol volumes (or FlexGroup constituents) with a storage capacity of 648 GiB or more all have the same number of inodes: 21,251,126. If you create a volume larger than 648 GiB and you want it to have more than 21,251,126 inodes, you must increase the maximum number of inodes (files) manually. For more information about viewing the maximum number of files for a volume, see [Monitoring a volume's file capacity](view-volume-file-capacity.md).

The default number of inodes on a volume is 1 inode for every 32 KiB of volume storage capacity, up to a volume size of 648 GiB. For a 1 GiB volume:

Volume\$1size\$1in\$1bytes × (1 file ÷ inode\$1size\$1in\$1bytes) = maximum\$1number\$1of\$1files

1,073,741,824 bytes × (1 file ÷ 32,768 bytes) = 32,768 files

You can increase the maximum number of inodes that a volume can contain, up to a maximum of 1 inode for every 4 KiB of storage capacity. For a 1 GiB volume. this increases the maximum number of inodes or files from 32,768 to 262,144:

1,073,741,824 bytes × (1 file ÷ 4096 bytes) = 262,144 files

An FSx for ONTAP volume can have a maximum of 2 billion inodes.

For information about changing the maximum number of files that a volume can store, see [Updating the maximum number of files on a volume](increase-volume-max-files.md).

# Managing storage efficiencies
<a name="manage-vol-SE"></a>

By enabling storage efficiencies on your FSx for ONTAP volumes, you can optimize storage utilization, reduce storage costs, and improve your file system's performance overall.

**Note**  
We recommend enabling storage efficiencies using the Amazon FSx console, API, or AWS CLI to ensure that the optimal storage efficiency settings are applied to your volumes.

ONTAP organizes files into 4 kibibyte (KiB) data blocks. Storage efficiencies take place at the data block level rather than at the level of individual files. When storage efficiencies are enabled, ONTAP employs a combination of data reduction techniques to eliminate duplicate data, compress the size of data, and reorganize the layout of data for optimal disk usage.

Storage efficiencies are applied in two ways. They are applied to data inline (before data is written to disk, in memory) to provide immediate storage savings. They are also applied to data in the background (after the data is written to disk) in the SSD storage tier through periodic efficiency jobs to optimize storage utilization over time. Background storage efficiencies don't run on data after it's tiered to the capacity pool. However, if the data had any storage savings while it was in SSD, these savings are preserved when the data is tiered to the capacity pool.

**Note**  
ONTAP doesn't support enabling storage efficiencies on data protection (DP) volumes. However, storage savings achieved in the source read-writable (RW) volume are preserved when data is replicated to the destination DP volume.

## Compression of data blocks
<a name="compression-SE"></a>

Compression groups are logical groupings of data that are managed and compressed together as a single block. ONTAP automatically packs data blocks into compression groups, which reduces the space consumed on disk. To optimize performance and storage utilization, ONTAP provides a balanced approach to managing data by adjusting the degree of compression that's applied to the data based on its access patterns.

By default, data is compressed inline using 8 KB compression groups to ensure optimal performance when writing data to a volume. Optionally, you can apply heavier compression to data by enabling inactive data compression on a volume to further compress data in SSD. Inactive data compression uses 32 KB compression groups on cold data for additional storage savings. For more information, see the [https://docs.netapp.com/us-en/ontap-cli-9131/volume-efficiency-inactive-data-compression-modify.html#description](https://docs.netapp.com/us-en/ontap-cli-9131/volume-efficiency-inactive-data-compression-modify.html#description) command in the NetApp ONTAP Documentation Center.

**Note**  
Inactive data compression consumes additional CPU and disk IOPS and can be a resource-intensive task. We recommend that you evaluate the performance impact of running inactive data compression on your workload before enabling this feature.

The following image illustrates the storage savings that can be achieved by compressing data blocks.

![\[\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/fsx-ontap-before-compression.png)


## Deduplication of data blocks
<a name="deduplication-SE"></a>

 ONTAP detects and eliminates duplicate data blocks to reduce redundancies in data. The duplicate blocks are replaced with references to shared unique blocks. 

By default, data is deduplicated inline to reduce the storage footprint before data is written to disk. ONTAP also runs a background deduplication scanner at specified intervals to identify and eliminate duplicate data after it's been written to disk. During these scheduled scans, ONTAP processes a change log to identify new or modified data blocks since the last scan that haven't been deduplicated yet. When duplicates are found, ONTAP updates the metadata to point to a single copy of the duplicated blocks and marks the redundant blocks as free space that's ready to be reclaimed.

**Note**  
 ONTAP applies deduplication to 4 KB of incoming writes at a time, so you might see lower deduplication savings when running workloads with writes that are smaller than 4 KB in size.   
   
FSx for ONTAP doesn't support cross-volume deduplication.

The following image illustrates the storage savings that can be achieved with deduplication.

![\[\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/fsx-ontap-before-deduplication.png)


## Compaction of data blocks
<a name="compaction-SE"></a>

ONTAP consolidates partially filled data blocks that are less than 4 KB each into a more efficiently utilized 4 KB block.

By default, data is compacted inline to optimize the layout of data as it's written to disk to minimize storage overhead, reduce fragmentation, and improve read performance.

The following image illustrates the storage savings that can be achieved with compaction.

![\[\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/fsx-ontap-before-compaction.png)


## Example: storage efficiencies
<a name="example-SE"></a>

The following image illustrates how storage efficiencies are applied to data.

![\[\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/fsx-ontap-se-example.png)


# Enabling autosizing
<a name="enable-volume-autosizing"></a>

Volume autosizing so that the volume will automatically grow to a specified size when it reaches a used space threshold. You can do this for FlexVol volume types (the default volume type for FSx for ONTAP) using the [https://docs.netapp.com/us-en/ontap-cli-9111/volume-autosize.html](https://docs.netapp.com/us-en/ontap-cli-9111/volume-autosize.html) ONTAP CLI command.

**To enable volume autosizing (ONTAP CLI)**

1. To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace `management_endpoint_ip` with the IP address of the file system's management port.

   ```
   [~]$ ssh fsxadmin@management_endpoint_ip
   ```

   For more information, see [Managing file systems with the ONTAP CLI](managing-resources-ontap-apps.md#fsxadmin-ontap-cli). 

1. Use the `volume autosize` command as shown, replacing the following values:
   + Replace *`svm_name`* with the name of the SVM that the volume is created on.
   + Replace *`vol_name`* with name of the volume that you want to resize.
   + Replace *`grow_threshold`* with a used space percentage value (such as `90`) at which the volume will automatically increase in size (up to the *`max_size`* value).
   + Replace *`max_size`* with the maximum size that the volume can grow to. Use the format *`integer`*`[KB|MB|GB|TB|PB]`; for example, `300TB`. The maximum size is 300 TB. The default is 120% of the volume size.
   + Replace *min\$1size* with the minimum size that the volume will shrink to. Use the same format as for *max\$1size*.
   + Replace *shrink\$1threshold* with the used space percentage at which the volume will automatically shrink in size.

   ```
   ::> volume autosize -vserver svm_name -volume vol_name -mode grow_shrink -grow-threshold-percent grow_threshold -maximum-size max_size -shrink-threshold-percent shrink_threshold -minimum-size min_size
   ```

1. To show the current autosize setting, run the following command. Replace *svm\$1name* and *vol\$1name* with your information.

   ```
   ::> volume autosize -vserver svm_name -volume vol_name
   ```

# Enabling cloud write mode
<a name="cloud-write-mode"></a>

Use the `volume modify` ONTAP CLI command to enable or disable cloud write mode for an existing volume. For more information, see [https://docs.netapp.com/us-en/ontap-cli-9131/volume-modify.html](https://docs.netapp.com/us-en/ontap-cli-9131/volume-modify.html) in the NetApp ONTAP Documentation Center.

Prerequisites for setting cloud write mode are:
+ The volume must be an existing volume. You can only enable the feature on an existing volume.
+ The volume must be a read-write (RW) volume.
+ The volume must have the **All** tiering policy. For more information about modifying a volume's tiering policy, see [Updating a tiering policy](modify-volume-tiering-policy.md).

Cloud write mode is helpful for cases like migrations, for example, where large amounts of data are transferred to a file system using the NFS protocol.

**To set a volume's cloud write mode (ONTAP CLI)**

1. To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace `management_endpoint_ip` with the IP address of the file system's management port.

   ```
   [~]$ ssh fsxadmin@management_endpoint_ip
   ```

   For more information, see [Managing file systems with the ONTAP CLI](managing-resources-ontap-apps.md#fsxadmin-ontap-cli). 

1. Enter the ONTAP CLI advanced mode using the following command.

   ```
   FSx::> set -privilege advanced
   Warning: These advanced commands are potentially dangerous; use them only when
        directed to do so by NetApp personnel.
   Do you want to continue? {y|n}: y
   ```

1. Use the following command to set the volume’s cloud write mode, replacing the following values:
   + Replace *`svm_name`* with the name of the SVM that the volume is created on.
   + Replace *`vol_name`* with name of the volume for which you are setting cloud write mode.
   + Replace `vol_cw_mode` with either `true` to enable cloud write mode on the volume or `false` to disable it.

   ```
   FSx::> volume modify -vserver svm_name -volume vol_name -is-cloud-write-enabled vol_cw_mode
   ```

   The system responds as follows for a successful request.

   ```
   Volume modify successful on volume vol_name of Vserver svm_name.
   ```

# Updating storage capacity
<a name="manage-volume-capacity"></a>

You can manage volume storage capacity by manually increasing or decreasing volume size using the AWS Management Console, AWS CLI and API, and the ONTAP CLI. You can also enable volume autosizing so that the volume size automatically grows or shrinks when it reaches certain used storage capacity thresholds. You use the ONTAP CLI to manage volume autosizing.<a name="increase-volume-size"></a>

**To change a volume's storage capacity (console)**
+ You can increase or decrease a volume's storage capacity using the Amazon FSx console, AWS CLI, and API. For more information, see [Updating volumes](updating-volumes.md).

You can also use the ONTAP CLI to modify a volume's storage capacity using the [https://docs.netapp.com/us-en/ontap-cli-9111/volume-modify.html](https://docs.netapp.com/us-en/ontap-cli-9111/volume-modify.html) command.

**To modify a volume's size (ONTAP CLI)**

1. To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace `management_endpoint_ip` with the IP address of the file system's management port.

   ```
   [~]$ ssh fsxadmin@management_endpoint_ip
   ```

   For more information, see [Managing file systems with the ONTAP CLI](managing-resources-ontap-apps.md#fsxadmin-ontap-cli). 

1. Use the **volume modify** ONTAP CLI command to modify a volume's storage capacity. Run the following command, using your data in place of the following values:
   + Replace *`svm_name`* with the name of the storage virtual machine (SVM) that the volume is created on.
   + Replace *`vol_name`* with name of the volume that you want to re-size.
   + Replace *`vol_size`* with the new size of the volume in the format *`integer`*`[KB|MB|GB|TB|PB]`; for example, `100GB` to increase the volume size to 100 gigabytes.

   ```
   ::> volume modify -vserver svm_name -volume vol_name -size vol_size
   ```

# Updating a tiering policy
<a name="modify-volume-tiering-policy"></a>

You can modify a volume's tiering policy using the AWS Management Console, AWS CLI and API, and the ONTAP CLI.

## To modify a volume's data tiering policy (console)
<a name="mod-tiering-console"></a>

Use the following procedure to modify a volume's data-tiering policy using the AWS Management Console.

1. Open the Amazon FSx console at [https://console.aws.amazon.com/fsx/](https://console.aws.amazon.com/fsx/).

1. Choose **Volumes** in the left navigation pane, then choose the ONTAP volume for which you want to modify the data-tiering policy.

1. Choose **Update volume** from the **Actions** drop down menu. The **Update volume** window appears.

1. For **Capacity pool tiering policy**, choose the new policy for the volume. For more information, see [Volume tiering policies](volume-storage-capacity.md#data-tiering-policy).

1. Choose **Update** to apply the new policy to the volume.

## To set a volume's tiering policy (CLI)
<a name="mod-tiering-cli"></a>
+ Modify a volume's tiering policy using the [update-volume](https://docs.aws.amazon.com/cli/latest/reference/fsx/update-volume.html) CLI command ([UpdateVolume](https://docs.aws.amazon.com/fsx/latest/APIReference/API_UpdateVolume.html) is the equivalent Amazon FSx API action). The following CLI command example sets a volume's data-tiering policy to `SNAPSHOT_ONLY`.

  ```
  aws fsx update-volume \
      --volume-id fsxvol-abcde0123456789f
      --ontap-configuration TieringPolicy={Name=SNAPSHOT_ONLY}
  ```

  For a successful request, the system responds with the volume description.

  ```
  {
      "Volume": {
          "CreationTime": "2021-10-05T14:27:44.332000-04:00",
          "FileSystemId": "fs-abcde0123456789f",
          "Lifecycle": "CREATED",
          "Name": "vol1",
          "OntapConfiguration": {
              "FlexCacheEndpointType": "NONE",
              "JunctionPath": "/vol1",
              "SecurityStyle": "UNIX",
              "SizeInMegabytes": 1048576,
              "StorageEfficiencyEnabled": true,
              "StorageVirtualMachineId": "svm-abc0123de456789f",
              "StorageVirtualMachineRoot": false,
              "TieringPolicy": {
                  "CoolingPeriod": 2,
                  "Name": "SNAPSHOT_ONLY"
              },
              "UUID": "aaaa1111-bb22-cc33-dd44-abcde01234f5",
              "OntapVolumeType": "RW"
          },
          "ResourceARN": "arn:aws:fsx:us-east-2:111122223333:volume/fs-abcde0123456789f/fsvol-abc012def3456789a",
          "VolumeId": "fsvol-abc012def3456789a",
          "VolumeType": "ONTAP"
      }
  }
  ```

## To modify a volume's tiering policy (ONTAP CLI)
<a name="mod-tiering-netapp-cli"></a>

You use the `volume modify` ONTAP CLI command to set a volume's tiering policy. For more information, see [https://docs.netapp.com/us-en/ontap-cli-9111/volume-modify.html](https://docs.netapp.com/us-en/ontap-cli-9111/volume-modify.html) in the NetApp ONTAP Documentation Center.

1. To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace `management_endpoint_ip` with the IP address of the file system's management port.

   ```
   [~]$ ssh fsxadmin@management_endpoint_ip
   ```

   For more information, see [Managing file systems with the ONTAP CLI](managing-resources-ontap-apps.md#fsxadmin-ontap-cli). 

1. Enter the ONTAP CLI advanced mode using the following command.

   ```
   FSx::> set adv
   
   Warning: These advanced commands are potentially dangerous; use them only when
        directed to do so by NetApp personnel.
   Do you want to continue? {y|n}: y
   ```

1. Use the following command to modify the volume data-tiering policy, replacing the following values:
   + Replace *`svm_name`* with the name of the SVM that the volume is created on.
   + Replace *`vol_name`* with name of the volume for which you are setting the data-tiering policy.
   + Replace *`tiering_policy`* with the desired policy. Valid values are `snapshot-only`, `auto`, `all`, or `none`. For more information, see [Volume tiering policies](volume-storage-capacity.md#data-tiering-policy).

   ```
   FSx::> volume modify -vserver svm_name -volume vol_name -tiering-policy tiering_policy
   ```

# Updating the minimum cooling days
<a name="set-cooling-days"></a>

Minimum cooling days for a volume set the threshold that's used to determine which data is warm and which data is cold. You can set a volume's minimum cooling days using AWS CLI and API, and the ONTAP CLI.

## To set a volume's minimum cooling days (CLI)
<a name="set-cooling-aws-cli"></a>
+ Modify a volume configuration by using the [update-volume](https://docs.aws.amazon.com/cli/latest/reference/fsx/update-volume.html) CLI command ([UpdateVolume](https://docs.aws.amazon.com/fsx/latest/APIReference/API_UpdateVolume.html) is the equivalent Amazon FSx API action). The following CLI command example sets a volume's `CoolingPeriod` to 104 days.

  ```
  aws fsx update-volume \
      --volume-id fsxvol-abcde0123456789f
      --ontap-configuration TieringPolicy={Name=SNAPSHOT_ONLY}
  aws fsx update-volume --volume-id fsvol-006530558c14224ac --ontap-configuration TieringPolicy={CoolingPeriod=104}
  ```

  The system responds with the volume description for a successful request.

  ```
  {
      "Volume": {
          "CreationTime": "2021-10-05T14:27:44.332000-04:00",
          "FileSystemId": "fs-abcde0123456789f",
          "Lifecycle": "CREATED",
          "Name": "vol1",
          "OntapConfiguration": {
              "FlexCacheEndpointType": "NONE",
              "JunctionPath": "/vol1",
              "SecurityStyle": "UNIX",
              "SizeInMegabytes": 1048576,
              "StorageEfficiencyEnabled": true,
              "StorageVirtualMachineId": "svm-abc0123de456789f",
              "StorageVirtualMachineRoot": false,
              "TieringPolicy": {
                  "CoolingPeriod": 104,
                  "Name": "SNAPSHOT_ONLY"
              },
              "UUID": "aaaa1111-bb22-cc33-dd44-abcde01234f5",
              "OntapVolumeType": "RW"
          },
          "ResourceARN": "arn:aws:fsx:us-east-2:111122223333:volume/fs-abcde0123456789f/fsvol-abc012def3456789a",
          "VolumeId": "fsvol-abc012def3456789a",
          "VolumeType": "ONTAP"
      }
  }
  ```

## To set a volume's minimum cooling days (ONTAP CLI)
<a name="set-cooling-ontap-cli"></a>

Use the `volume modify` ONTAP CLI command to set the minimum number of cooling days for an existing volume. For more information, see [https://docs.netapp.com/us-en/ontap-cli-9111/volume-modify.html](https://docs.netapp.com/us-en/ontap-cli-9111/volume-modify.html) in the NetApp ONTAP Documentation Center.

1. To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace `management_endpoint_ip` with the IP address of the file system's management port.

   ```
   [~]$ ssh fsxadmin@management_endpoint_ip
   ```

   For more information, see [Managing file systems with the ONTAP CLI](managing-resources-ontap-apps.md#fsxadmin-ontap-cli). 

1. Enter the ONTAP CLI advanced mode using the following command.

   ```
   FSx::> set adv
   
   Warning: These advanced commands are potentially dangerous; use them only when
        directed to do so by NetApp personnel.
   Do you want to continue? {y|n}: y
   ```

1. Use the following command to change your volume’s tiering minimum cooling days, replacing the following values:
   + Replace *`svm_name`* with the name of the SVM that the volume is created on.
   + Replace *`vol_name`* with name of the volume for which you are setting the cooling days.
   + Replace `cooling_days` with the desired, an integer between 2-183.

   ```
   FSx::> volume modify -vserver svm_name -volume vol_name -tiering-minimum-cooling-days cooling_days
   ```

   The system responds as follows for a successful request.

   ```
   Volume modify successful on volume vol_name of Vserver svm_name.
   ```

# Updating a volume's cloud retrieval policy
<a name="set-cloud-retrieval"></a>

Use the `volume modify` ONTAP CLI command to set the cloud retrieval policy for an existing volume. For more information, see [https://docs.netapp.com/us-en/ontap-cli-9111/volume-modify.html](https://docs.netapp.com/us-en/ontap-cli-9111/volume-modify.html) in the NetApp ONTAP Documentation Center.

**To set a volume's cloud retrieval policy (ONTAP CLI)**

1. To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace `management_endpoint_ip` with the IP address of the file system's management port.

   ```
   [~]$ ssh fsxadmin@management_endpoint_ip
   ```

   For more information, see [Managing file systems with the ONTAP CLI](managing-resources-ontap-apps.md#fsxadmin-ontap-cli). 

1. Enter the ONTAP CLI advanced mode using the following command.

   ```
   FSx::> set adv
   
   Warning: These advanced commands are potentially dangerous; use them only when
        directed to do so by NetApp personnel.
   Do you want to continue? {y|n}: y
   ```

1. Use the following command to set the volume’s cloud retrieval policy, replacing the following values:
   + Replace *`svm_name`* with the name of the SVM that the volume is created on.
   + Replace *`vol_name`* with name of the volume for which you are setting the cloud retrieval policy.
   + Replace `retrieval_policy` with the desired value, either `default`, `on-read`, `never`, or `promote`.

   ```
   FSx::> volume modify -vserver svm_name -volume vol_name -cloud-retrieval-policy retrieval_policy
   ```

   The system responds as follows for a successful request.

   ```
   Volume modify successful on volume vol_name of Vserver svm_name.
   ```

# Updating the maximum number of files on a volume
<a name="increase-volume-max-files"></a>

FSx for ONTAP volumes can run out of file capacity when the number of available inodes, or file pointers, is exhausted.<a name="increase-max-files"></a>

**To increase the maximum number of files on a volume (ONTAP CLI)**

You use the `volume modify` ONTAP CLI command to increase the maximum number of files on a volume. For more information, see [https://docs.netapp.com/us-en/ontap-cli-9111/volume-modify.html](https://docs.netapp.com/us-en/ontap-cli-9111/volume-modify.html) in the NetApp ONTAP Documentation Center.

1. To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace `management_endpoint_ip` with the IP address of the file system's management port.

   ```
   [~]$ ssh fsxadmin@management_endpoint_ip
   ```

   For more information, see [Managing file systems with the ONTAP CLI](managing-resources-ontap-apps.md#fsxadmin-ontap-cli). 

1. Do one of the following, depending on your use case. Replace *`svm_name`* and *`vol_name`* with your values.
   + To configure a volume to always have the maximum number of files (inodes) available, perform the following:

     1. Enter advanced mode in the ONTAP CLI by using the following command.

        ```
        ::> set adv
        ```

     1. After running this command, you'll see this output. Enter `y` to continue.

        ```
        Warning: These advanced commands are potentially dangerous; use them only when
        directed to do so by NetApp personnel.
        Do you want to continue? {y|n}: y
        ```

     1. Enter the following command to always use the maximum number of files on the volume:

        ```
        ::> volume modify -vserver svm_name -volume vol_name -files-set-maximum true
        ```
   + To manually specify the total number of files permitted on the volume, with `max_number_files = (current_size_of_volume) × (1 file ÷ 4 KiB)`, up to a maximum possible value of 2 billion, use the following command:

     ```
     ::> volume modify -vserver svm_name -volume vol_name -files max_number_files
     ```

# Monitoring volume storage capacity
<a name="monitor-volume-storage-console"></a>

 You can view a volume's available storage and it's storage distribution in AWS Management Console, AWS CLI, and the NetApp ONTAP CLI.<a name="volume-capacity-usage"></a>

**To monitor a volume's storage capacity (console)**

The **Available storage** graph displays the amount of free storage capacity on a volume over time. The **Storage distribution** graph shows how a volume's storage capacity is currently distributed over 4 categories:
+ User data
+ Snapshot data
+ Available volume capacity
+ Other data

1. Open the Amazon FSx console at [https://console.aws.amazon.com/fsx/](https://console.aws.amazon.com/fsx/).

1. Choose **Volumes** in the left navigation column, then choose the ONTAP volume that you want to view storage capacity information for. The volume detail page appears.

1. In the second panel, choose the **Monitoring** tab. The **Available storage** and **Storage distribution** graphs display, along with several other graphs.  
![\[\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/fsx-ontap-volume-storage-graphs.png)  
![\[\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/fsx-ontap-volume-storage-graphs2.png)

**To monitor a volume's storage capacity (ONTAP CLI)**

You can monitor how your volume's storage capacity is being consumed by using the `volume show-space` ONTAP CLI command. For more information, see [https://docs.netapp.com/us-en/ontap-cli-9111/volume-show-space.html](https://docs.netapp.com/us-en/ontap-cli-9111/volume-show-space.html) in the NetApp ONTAP Documentation Center.

1. To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace `management_endpoint_ip` with the IP address of the file system's management port.

   ```
   [~]$ ssh fsxadmin@management_endpoint_ip
   ```

   For more information, see [Managing file systems with the ONTAP CLI](managing-resources-ontap-apps.md#fsxadmin-ontap-cli). 

1. View a volume's storage capacity usage by issuing the following command, replacing the following values:
   + Replace *`svm_name`* with the name of the SVM that the volume is created on.
   + Replace *`vol_name`* with name of the volume for which you are setting the data-tiering policy.

   ```
   ::> volume show-space -vserver svm_name -volume vol_name
   ```

   If the command is successful, you'll see output similar to the following:

   ```
   Vserver : svm_name
   Volume  : vol_name
   Feature                                    Used      Used%
   --------------------------------     ----------     ------
   User Data                                 140KB         0%
   Filesystem Metadata                     164.4MB         1%
   Inodes                                  10.28MB         0%
   Snapshot Reserve                        563.2MB         5%
   Deduplication                              12KB         0%
   Snapshot Spill                           9.31GB        85%
   Performance Metadata                      668KB         0%
   
   Total Used                              10.03GB        91%
   
   Total Physical Used                     10.03GB        91%
   ```

   The output of this command shows the amount of physical space that different types of data occupy on this volume. It also shows the percentage of the total volume's capacity that each type of data consumes. In this example, `Snapshot Spill` and `Snapshot Reserve` consume a combined 90 percent of the volume's capacity.

`Snapshot Reserve` shows the amount of disk space reserved for storing Snapshot copies. If the Snapshot copies storage exceeds the reserve space, it spills into the file system and this amount is shown under `Snapshot Spill`.

To increase the amount of available space, you can either [increase the size](manage-volume-capacity.md#increase-volume-size) of the volume, or you can [delete snapshots](snapshots-ontap.md#delete-snapshots) that you are not using, as shown in the following procedures. 

For FlexVol volume types (the default volume type for FSx for ONTAP volumes), you can also enable [volume autosizing](enable-volume-autosizing.md). When you enable autosizing, the volume size automatically increases when it reaches certain thresholds. You can also disable automatic snapshots. Both of these features are explained in the following sections.

# Monitoring a volume's file capacity
<a name="view-volume-file-capacity"></a>

You can use either of the following methods to view the maximum number of files allowed and the number of files already used on a volume.
+ The CloudWatch volume metrics `FilesCapacity` and `FilesUsed`.
+ In the Amazon FSx console, navigate to the **Available files (inodes)** chart in your volume's **Monitoring** tab. The following image shows the **Available files (inodes)** on a volume decreasing over time.  
![\[\]](http://docs.aws.amazon.com/fsx/latest/ONTAPGuide/images/fsx-ontap-available-files.png)

  