Available Storage on FSx


I am using the CLI and Boto3 trying to get the current available storage for an FSx. Using the describe_file_systems function I can get the capacity but I am looking to get either current storage or available storage. How can I get one of these items programmatically?

asked a year ago400 views
2 Answers

The documentation here suggests that "describe-file-systems" can be used to check the status of the file.

Since there is no option to filter by status in the request, we can use an if statement to display only those whose "Lifecycle" is "AVAILABLE".

This is a sample, but I thought the following would show only the available file storage capacity.

import boto3

client = boto3.client('fsx')

response = client.describe_file_systems()

file_systems_list = response['FileSystems']

for file_system in file_systems_list:
  if file_system['Lifecycle'] == 'AVAILABLE':
profile picture
answered a year ago


You can get this information from CloudWatch Metrics programmatically.

Documentation on how you can get this with the CLI is available here:


The metric names will differ slightly based on which FSx you are using. You can list the available metrics using aws cloudwatch list-metrics --namespace AWS/FSx

Below is an example for FSx ONTAP, which will show the minimum storage used in the past 24hrs, you can change your start / end time and period to suit your needs.

aws cloudwatch get-metric-statistics --namespace AWS/FSx --metric-name StorageUsed --start-time "$(date -d '-1 day' '+%F %T')" --end-time "$(date -d '-1 hour' '+%F %T')" --period 86400 --statistics Minimum --region
 eu-west-2 --dimensions Name=FileSystemId,Value=<<File System ID HERE>>
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions