Setting up an Amazon FSx for OpenZFS file system - FSx for OpenZFS

Setting up an Amazon FSx for OpenZFS file system

If you are getting started with FSx for OpenZFS for the first time, follow these steps to learn how to create your file system, mount it from an Amazon EC2 instance, and clean up your resources once you are done.

Prerequisites

Before you use Amazon FSx for the first time, make sure that you have completed the following tasks:

Sign up for an AWS account

If you do not have an AWS account, complete the following steps to create one.

To sign up for an AWS account
  1. Open https://portal.aws.amazon.com/billing/signup.

  2. Follow the online instructions.

    Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad.

    When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access.

AWS sends you a confirmation email after the sign-up process is complete. At any time, you can view your current account activity and manage your account by going to https://aws.amazon.com/ and choosing My Account.

Create a user with administrative access

After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so that you don't use the root user for everyday tasks.

Secure your AWS account root user
  1. Sign in to the AWS Management Console as the account owner by choosing Root user and entering your AWS account email address. On the next page, enter your password.

    For help signing in by using root user, see Signing in as the root user in the AWS Sign-In User Guide.

  2. Turn on multi-factor authentication (MFA) for your root user.

    For instructions, see Enable a virtual MFA device for your AWS account root user (console) in the IAM User Guide.

Create a user with administrative access
  1. Enable IAM Identity Center.

    For instructions, see Enabling AWS IAM Identity Center in the AWS IAM Identity Center User Guide.

  2. In IAM Identity Center, grant administrative access to a user.

    For a tutorial about using the IAM Identity Center directory as your identity source, see Configure user access with the default IAM Identity Center directory in the AWS IAM Identity Center User Guide.

Sign in as the user with administrative access
  • To sign in with your IAM Identity Center user, use the sign-in URL that was sent to your email address when you created the IAM Identity Center user.

    For help signing in using an IAM Identity Center user, see Signing in to the AWS access portal in the AWS Sign-In User Guide.

Assign access to additional users
  1. In IAM Identity Center, create a permission set that follows the best practice of applying least-privilege permissions.

    For instructions, see Create a permission set in the AWS IAM Identity Center User Guide.

  2. Assign users to a group, and then assign single sign-on access to the group.

    For instructions, see Add groups in the AWS IAM Identity Center User Guide.

Step 1: Create a file system

The following procedures detail how to create a file system using the Quick create and Standard create options on the Amazon FSx console. For instructions on how to create a file system using the AWS CLI instead of the AWS Management Console, see Creating an Amazon FSx for OpenZFS file system.

Use the Quick create option to rapidly and easily create a file system with the default root volume configuration. This configuration automatically creates one root volume named fsx with a path of /fsx, a record size of 128 KiB, and an NFS exports setting in which Client addresses is an asterisk (*) and NFS options is rw,crossmnt. With these settings, any clients permitted by your VPC and security group settings can access the volume with read and write permissions. The file system data is encrypted at rest using your default service managed AWS KMS key, named aws/fsx/ (default).

Use the Standard create option to create a file system with a customized root volume configuration. For a list of the file system properties that you can customize, see Configurable file system properties. We recommend using Standard create only when you are familiar with FSx for OpenZFS file systems and volumes.

Quick create (recommended)

To create a file system using Quick create

  1. Open the Amazon FSx console at https://console.aws.amazon.com/fsx/.

  2. On the dashboard, choose Create file system to start the file system creation wizard.

  3. On the Select file system type page, choose Amazon FSx for OpenZFS, and then choose Next. The Create OpenZFS file system page appears. For Creation method, choose Quick create. To create a file system using the Standard create method, see Creating an Amazon FSx for OpenZFS file system.

  4. In the Quick configuration section, for File system name - optional, enter a name for your file system. It's easier to find and manage your file systems when you name them. You can use a maximum of 256 Unicode letters, white space, and numbers, plus these special characters: + - (hyphen) = . _ (underscore) : /.

  5. For Deployment type, select either Multi-AZ or Single-AZ.

    • Multi-AZ file systems replicate your data and support failover across multiple Availability Zones in the same AWS Region.

    • Single-AZ file systems ensure self-healing recovery within a single Availability Zone by automatically detecting and addressing component failures.

    For more information, see Deployment type availability and File system performance.

  6. For SSD storage capacity, specify the storage capacity of your file system, in gibibytes (GiBs). Enter any whole number in the range of 64–524,288.

  7. For Virtual Private Cloud (VPC), choose the Amazon VPC that you want to associate with your file system.

  8. For Subnet, choose the subnet in which your file system's elastic network interface resides.

  9. Choose Next.

  10. Review the file system configuration shown on the Create OpenZFS file system page. For your reference, note which file system settings you can modify after the file system is created.

  11. Choose Create file system.

Standard create

To create a file system using Standard create

  1. Open the Amazon FSx console at https://console.aws.amazon.com/fsx/.

  2. On the dashboard, choose Create file system to start the file system creation wizard.

  3. On the Select file system type page, choose FSx for OpenZFS , and then choose Next. The Create file system page appears.

  4. For Creation method, choose Standard create.

    Begin your configuration with the File system details section.

  5. For File system name - optional, enter a name for your file system. It's easier to find and manage your file systems when you name them. You can use a maximum of 256 Unicode letters, white space, and numbers, plus these special characters: + - = . _ : /

  6. For Deployment type, choose Multi-AZ, Single-AZ 2, or Single-AZ 1.

    • Multi-AZ file systems replicate your data and support failover across multiple Availability Zones in the same AWS Region.

    • Single-AZ 2 and Single-AZ 1 file systems provide automatic self-healing within a single Availability Zone.

    For more information, see Deployment type availability and File system performance.

  7. For Storage capacity, enter the storage capacity of your file system, in GiB. Enter any whole number from 64–524288.

  8. For Provisioned SSD IOPS, you have two options to provision the number of IOPS for your file system:

    • Choose Automatic (the default) if you want Amazon FSx to automatically provision 3 IOPS per GB of SSD storage.

    • Choose User-provisioned if you want to specify the number of IOPS, up to the maximum for your file system. You pay for SSD IOPS that you provision above 3 IOPS per GB of SSD storage.

  9. Throughput capacity is the sustained speed at which the file server that hosts your file system can serve data. For Throughput capacity, choose from two options to provide your desired throughput capacity in MB per second (MB/s).

    • Choose the default Recommended throughput capacity if you want Amazon FSx to automatically choose the throughput capacity. The recommended value is based on the storage capacity that you choose.

    • Choose Specify throughput capacity if you want to specify the throughput capacity value.

      • For Multi-AZ and SINGLE_AZ_2 file systems, valid values are 160, 320, 640, 1280, 2560, 3840, 5120, 7680, or 10240 MBps.

      • For SINGLE_AZ_1 file systems, valid values are 64, 128, 256, 512, 1024, 2048, 3072, or 4096 MB/s.

      You pay for throughput capacity that you provision that exceeds the recommended amount.

    You can increase the amount of throughput capacity as needed at any time after you create the file system. For more information, see Modifying throughput capacity.

  10. In the Network & security section, provide networking and security group information:

    • For Virtual Private Cloud (VPC), choose the Amazon VPC that you want to associate with your file system.

    • For VPC Security Groups, the ID for the default security group for your VPC should already be populated.

    • For Subnet, choose any value from the list of available subnets. If you are creating a Multi-AZ file system, also choose a Standby subnet for the standby file server.

    • (Multi-AZ only) For Select route tables, specify the VPC route tables in which rules for routing traffic to the correct file server will be created. Select all VPC route tables associated with the subnets in which your clients are located. By default, Amazon FSx selects your VPC's default route table.

    • (Multi-AZ only) Endpoint IP address range specifies the IP address range in which the endpoints to access your file system are created. You have three options for the endpoint IP address range:

      • Unallocated IP address range from your VPC – Amazon FSx chooses a block of 16 available IP addresses from the VPC’s CIDR range to use as the endpoint IP address range for the file system.

      • Floating IP address range outside your VPC – Amazon FSx chooses a 198.19.x.0/24 address range.

      • Enter an IP address range – You can provide a CIDR range of your own choosing. The IP address range that you choose can either be inside or outside the VPC’s IP address range, as long as it doesn't overlap with any subnet.

  11. In the Encryption section, for Encryption key, choose the AWS Key Management Service (AWS KMS) encryption key that protects your file system's data at rest.

  12. For Root volume configuration, you can set the following options for the file system's root volume:

    • For Data compression type, choose the type of compression to use for your volume—either Zstandard, LZ4, or No compression. Zstandard compression provides more data compression and higher read throughput than LZ4 compression. LZ4 compression provides less compression and higher write throughput performance than Zstandard compression. For more information about the storage and performance benefits of the volume data compression options, see Data compression.

    • For Copy tags to snapshots, choose whether to copy tags to the volume's snapshot.

    • For NFS exports, you can modify or remove the default client configuration setting. Client configurations determine client access and permissions for the volume.

      To provide additional client configurations:

      1. In the Client addresses field, specify which clients can access the volume. Enter an asterisk (*) for any client, a specific IP address, or a CIDR range of IP addresses.

      2. In the NFS options field, enter a comma-delimited set of export options. For example, enter rw to allow read and write permissions to the volume for the specified Client addresses.

      3. Choose Add client configuration.

      4. Repeat the procedure to add another client configuration.

      For more information, see NFS exports.

    • For Record size, choose whether to use the default suggested record size of 128 KiB, or to set a custom suggested record size for the volume. Workloads that write in fixed small or large record sizes might benefit from setting a custom record size, such as database workloads (small record size) or media streaming workloads (large record size). We recommend using the default setting in most cases. For more information about setting record size, see Configurable volume properties.

    • For User and group quotas, you can set a storage quota for a user or group:

      1. For Quota type, choose USER or GROUP.

      2. For User or group ID, choose the ID number for the user or group.

      3. For Usage quota, choose the storage quota number for the user or group.

      4. Choose Add quota.

      5. Repeat the procedure to add a quota for another user or group.

  13. In Backup and maintenance - optional, you can set the following options:

    • For Daily automatic backup, choose Enabled for automatic daily backups. This option is enabled by default.

    • For Daily automatic backup window, set the time of the day in Coordinated Universal Time (UTC) that you want the daily automatic backup window to start. The window is 30 minutes starting from this specified time. This window can't overlap with the weekly maintenance backup window.

    • For Automatic backup retention period, set a period from 1–90 days to retain automatic backups.

    • For Weekly maintenance window, you can set the time of the week that you want the maintenance window to start. Day 1 is Monday, 2 is Tuesday, and so on. The window is 30 minutes starting from this specified time. This window can't overlap with the daily automatic backup window.

  14. For Tags - optional, you can enter a key and value to add tags to your file system. A tag is a case-sensitive key-value pair that helps you manage, filter, and search for your file system.

    Choose Next.

  15. Review the file system configuration on the Create file system page. Note which file system settings you can modify after the file system is created.

  16. Choose Create file system.

After your file system is created, you can create additional volumes as needed to organize your data. Any new volumes that you create will be children of the root volume. For more information on how to create additional volumes, see Creating an Amazon FSx for OpenZFS volume.

Step 2: Mount your file system from an Amazon EC2 instance

Once you have created your file system, you can access the data stored within it by mounting individual volumes on your client from an Amazon Elastic Compute Cloud (Amazon EC2) instance. FSx for OpenZFS supports a wide variety of compute instances and operating systems using the Network File System (NFS) protocol (v3, v4.0, v4.1, and v4.2), including Amazon EC2 instances running Linux, macOS, and Microsoft Windows.

The following instructions detail how to mount a volume from an Amazon EC2 instance on a Linux, macOS, or Windows client. Note that you can also view and copy the exact commands needed to mount any FSx for OpenZFS volume by choosing Attach on the details page for that volume in the Amazon FSx console.

Note

The commands to mount a volume require the DNS name of the file system in which the volume is created. To identify a file system's DNS name in the Amazon FSx console, choose File systems, then choose the FSx for OpenZFS file system whose volume you are mounting. The DNS name will be displayed in the Network & security panel. This information can also be found in the response of the DescribeVolumes API operation.

Linux client

To mount a volume from an Amazon EC2 instance on Linux

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. Create or select an Amazon EC2 instance running Amazon Linux 2 that is in the same virtual private cloud (VPC) as your file system. For more information about launching an instance, see Step 1: Launch an instance in the Amazon EC2 User Guide.

  3. Connect to your Amazon EC2 Linux instance. For more information, see Connect to your Linux instance in the Amazon EC2 User Guide.

  4. Open a terminal on your Amazon EC2 instance using secure shell (SSH), and log in with the appropriate credentials.

  5. If you are using CentOS, RedHat, or Ubuntu, install the NFS client. This step is not necessary if you are using the latest version of the Amazon Linux 2.

    • For CentOS and RedHat use the following command: sudo yum –y install nfs-utils

    • For Ubuntu use this command: sudo apt-get -y install nfs-common

  6. Create a directory on your Amazon EC2 instance for the volume's local mount path with the following command. In the following example, replace fsx with your desired location.

    sudo mkdir /fsx
  7. Use the following mount command to mount your Amazon FSx for OpenZFS file system to the directory that you created. Replace the following:

    • Replace nfs-version with an NFS protocol version, such as 4.2.

    • Replace fs-dns-name with the DNS name or the IP address of the file system.

    • Replace volume-path with the path of the volume to mount. For example, use /fsx to mount the root volume or a path such as /fsx/sales to mount the top-level fsx/sales directory.

    • Replace local-mount-path with the directory path of your local mount path, such as /fsx for the directory you created in step 5.

    sudo mount -t nfs -o nfsvers= nfs-version fs-dns-name:volume-path local-mount-path

    The following example uses sample values.

    sudo mount -t nfs -o nfsvers= 4.2 fs01234567.fsx.us-east-1.amazonaws.com:/fsx /fsx

    You can also use the IP address of the file system instead of its DNS name.

    sudo mount -t nfs -o nfsvers= 4.2 198.51.100.5:/fsx /fsx

If you have issues with your Amazon EC2 instance (such as connections timing out), see Troubleshoot EC2 instances in the Amazon EC2 User Guide.

macOS client
To mount a volume from an Amazon EC2 instance on macOS
  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. Create or select an Amazon EC2 Mac instance running the macOS that is in the same VPC as the file system.

    For more information on launching an instance, see Step 1: Launch an instance in the Amazon EC2 User Guide.

  3. Connect to your Amazon EC2 Mac instance. For more information, see Connect to your Linux instance in the Amazon EC2 User Guide.

  4. Open a terminal on your EC2 Mac instance using secure shell (SSH), and log in with the appropriate credentials.

  5. Create a directory on the EC2 instance for mounting the volume as follows:

    sudo mkdir /localpath
  6. Mount the volume using the following command.

    sudo mount -t nfs -o resvport file-system-dns-name:/vol_path mount-point

    The following example uses sample values.

    sudo mount -t nfs -o resvport fs-01234567890abcde5.fsx.us-east-1.amazonaws.com:/fsx/vol1 /fsx
Windows
To mount a volume from an Amazon EC2 instance on Windows
Note

Mounting FSx for OpenZFS volumes to Windows clients leverages the NFS v3 protocol. The following instructions include the necessary steps to install the NFS client on your Windows-based EC2 instance.

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. Create or select an Amazon EC2 instance running Microsoft Windows that is in the same VPC as the file system.

    For more information on launching an instance, see Step 1: Launch an instance in the Amazon EC2 User Guide.

  3. Connect to your Amazon EC2 Windows instance. For more information, see Connecting to your Windows instance in the Amazon EC2 User Guide.

  4. Open PowerShell as an administrator, and install the NFS client.

    Install-WindowsFeature -Name NFS-Client

    If prompted to do so, restart and reconnect to your Windows instance.

  5. Open a command prompt window with standard user privileges. If you run the mount command as Administrator, the mounted drive will not appear in File Explorer.

    Note

    To ensure this mounted drive appears in File Explorer, please open the Command Prompt window with standard user privileges. If you run this command as Administrator, it will not appear in File Explorer.

  6. You can mount the drive using a command prompt, or using a Powershell path

    1. Mount the volume to any available drive letter by running the following command, replacing Z: with any available drive letter:

      • Replace filesystem-dns-name with the DNS name or the IP address of the file system.

      • Replace vol_path with the path of the FSx for OpenZFS volume you are trying to mount.

      • Replace Z: with any available drive letter.

      mount \\filesystem-dns-name\vol_path Z:

      The following example uses sample values.

      mount \\fs-01234567890abcdef1.fsx.us-east-1.amazonaws.com\fsx\vol1 Z:
    2. You can also mount the file system using the following Powershell path:

      New-PSDrive -Name "Z" -PSProvider "FileSystem" -Root "\\filesystem-dns-name\" -Persist

      The following example uses a sample file system DNS name.

      New-PSDrive -Name "Z" -PSProvider "FileSystem" -Root "\\fs-0239c0e31af65bff1.fsx.us-east-1.amazonaws.com\fsx\" -Persist

Step 3: Clean up your resources

Follow these steps to clean up your resources, delete your file system as needed, and protect your AWS account.

To clean up your resources and delete your file system
  1. On the Amazon EC2 console, terminate your instance. For more information, see Terminate Your Instance in the Amazon EC2 User Guide.

  2. Open the Amazon FSx console at https://console.aws.amazon.com/fsx/.

  3. On the Amazon FSx console, delete your file system. When you delete a file system, all volumes and automatic backups are deleted automatically. However, you still must delete any manually created backups. The following steps outline this process.

    1. From the console dashboard, choose the name of the file system that you created for this exercise.

    2. For Actions, choose Delete file system.

    3. In the Delete file system dialog box that opens, decide whether you want to create a final backup. If you do, provide a name for the final backup. Any automatically created backups are also deleted.

      Important

      New file systems can be created from backups. We recommend that you create a final backup as a best practice. If you find you don't need it after a certain period of time, you can delete this and other manually created backups.

    4. Enter the ID of the file system that you want to delete in the File system ID box.

    5. Choose Delete file system.

    6. The file system is now being deleted, and its status in the dashboard changes to DELETING. When the file system has been deleted, it no longer appears in the dashboard. Any automatic backups are deleted along with the file system.

    7. Now you can delete any manually created backups for your file system. From the left-side navigation, choose Backups.

    8. From the dashboard, choose any backups that have the same File system ID as the file system that you deleted, and choose Delete backup. Be sure to retain the final backup, if you created one.

    9. The Delete backups dialog box opens. Keep the check box selected for the IDs of the backups that you want to delete, and then choose Delete backups.

    Your Amazon FSx file system and any related automatic backups are now deleted, along with any manual backups that you chose to delete as well.