Skip to content

create_file_system

create_file_system(
    *,
    config_overrides: Optional[FSxClientConfig] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    file_system_type: Optional[FileSystemType] = None,
    storage_capacity: Optional[StorageCapacity] = None,
    storage_type: Optional[StorageType] = None,
    subnet_ids: Optional[SubnetIds] = None,
    security_group_ids: Optional[SecurityGroupIds] = None,
    tags: Optional[Tags] = None,
    kms_key_id: Optional[KmsKeyId] = None,
    windows_configuration: Optional[CreateFileSystemWindowsConfiguration] = None,
    lustre_configuration: Optional[CreateFileSystemLustreConfiguration] = None,
    ontap_configuration: Optional[CreateFileSystemOntapConfiguration] = None,
    file_system_type_version: Optional[FileSystemTypeVersion] = None,
    open_zfs_configuration: Optional[CreateFileSystemOpenZFSConfiguration] = None,
    network_type: Optional[NetworkType] = None,
) -> CreateFileSystemResponse

Creates a new, empty Amazon FSx file system. You can create the following supported Amazon FSx file systems using the CreateFileSystem API operation:

  • Amazon FSx for Lustre

  • Amazon FSx for NetApp ONTAP

  • Amazon FSx for OpenZFS

  • Amazon FSx for Windows File Server

This operation requires a client request token in the request that Amazon FSx uses to ensure idempotent creation. This means that calling the operation multiple times with the same client request token has no effect. By using the idempotent operation, you can retry a CreateFileSystem operation without the risk of creating an extra file system. This approach can be useful when an initial call fails in a way that makes it unclear whether a file system was created. Examples are if a transport level timeout occurred, or your connection was reset. If you use the same client request token and the initial call created a file system, the client receives success as long as the parameters are the same.

If a file system with the specified client request token exists and the parameters match, CreateFileSystem returns the description of the existing file system. If a file system with the specified client request token exists and the parameters don't match, this call returns IncompatibleParameterError. If a file system with the specified client request token doesn't exist, CreateFileSystem does the following:

  • Creates a new, empty Amazon FSx file system with an assigned ID, and an initial lifecycle state of CREATING.

  • Returns the description of the file system in JSON format.

The CreateFileSystem call returns while the file system's lifecycle state is still CREATING. You can check the file-system creation status by calling the DescribeFileSystems operation, which returns the file system state along with other information.

Parameters:

  • client_request_token (Optional[ClientRequestToken], default: None ) –

    A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent creation. This string is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.

  • file_system_type (Optional[FileSystemType], default: None ) –

    The type of Amazon FSx file system to create. Valid values are WINDOWS, LUSTRE, ONTAP, and OPENZFS.

  • storage_capacity (Optional[StorageCapacity], default: None ) –

    Sets the storage capacity of the file system that you're creating, in gibibytes (GiB).

    FSx for Lustre file systems - The amount of storage capacity that you can configure depends on the value that you set for StorageType and the Lustre DeploymentType, as follows:

    • For SCRATCH_2, PERSISTENT_2, and PERSISTENT_1 deployment types using SSD storage type, the valid values are 1200 GiB, 2400 GiB, and increments of 2400 GiB.

    • For PERSISTENT_1 HDD file systems, valid values are increments of 6000 GiB for 12 MB/s/TiB file systems and increments of 1800 GiB for 40 MB/s/TiB file systems.

    • For SCRATCH_1 deployment type, valid values are 1200 GiB, 2400 GiB, and increments of 3600 GiB.

    FSx for ONTAP file systems - The amount of storage capacity that you can configure depends on the value of the HAPairs property. The minimum value is calculated as 1,024 * HAPairs and the maximum is calculated as 524,288 * HAPairs.

    FSx for OpenZFS file systems - The amount of storage capacity that you can configure is from 64 GiB up to 524,288 GiB (512 TiB).

    FSx for Windows File Server file systems - The amount of storage capacity that you can configure depends on the value that you set for StorageType as follows:

    • For SSD storage, valid values are 32 GiB-65,536 GiB (64 TiB).

    • For HDD storage, valid values are 2000 GiB-65,536 GiB (64 TiB).

  • storage_type (Optional[StorageType], default: None ) –

    Sets the storage class for the file system that you're creating. Valid values are SSD, HDD, and INTELLIGENT_TIERING.

    • Set to SSD to use solid state drive storage. SSD is supported on all Windows, Lustre, ONTAP, and OpenZFS deployment types.

    • Set to HDD to use hard disk drive storage, which is supported on SINGLE_AZ_2 and MULTI_AZ_1 Windows file system deployment types, and on PERSISTENT_1 Lustre file system deployment types.

    • Set to INTELLIGENT_TIERING to use fully elastic, intelligently-tiered storage. Intelligent-Tiering is only available for OpenZFS file systems with the Multi-AZ deployment type and for Lustre file systems with the Persistent_2 deployment type.

    Default value is SSD. For more information, see Storage type options in the FSx for Windows File Server User Guide, FSx for Lustre storage classes in the FSx for Lustre User Guide, and Working with Intelligent-Tiering in the Amazon FSx for OpenZFS User Guide.

  • subnet_ids (Optional[SubnetIds], default: None ) –

    Specifies the IDs of the subnets that the file system will be accessible from. For Windows and ONTAP MULTI_AZ_1 deployment types,provide exactly two subnet IDs, one for the preferred file server and one for the standby file server. You specify one of these subnets as the preferred subnet using the WindowsConfiguration > PreferredSubnetID or OntapConfiguration > PreferredSubnetID properties. For more information about Multi-AZ file system configuration, see Availability and durability: Single-AZ and Multi-AZ file systems in the Amazon FSx for Windows User Guide and Availability and durability in the Amazon FSx for ONTAP User Guide.

    For Windows SINGLE_AZ_1 and SINGLE_AZ_2 and all Lustre deployment types, provide exactly one subnet ID. The file server is launched in that subnet's Availability Zone.

  • security_group_ids (Optional[SecurityGroupIds], default: None ) –

    A list of IDs specifying the security groups to apply to all network interfaces created for file system access. This list isn't returned in later requests to describe the file system.

    You must specify a security group if you are creating a Multi-AZ FSx for ONTAP file system in a VPC subnet that has been shared with you.

  • tags (Optional[Tags], default: None ) –

    The tags to apply to the file system that's being created. The key value of the Name tag appears in the console as the file system name.

  • windows_configuration (Optional[CreateFileSystemWindowsConfiguration], default: None ) –

    The Microsoft Windows configuration for the file system that's being created.

  • file_system_type_version (Optional[FileSystemTypeVersion], default: None ) –

    For FSx for Lustre file systems, sets the Lustre version for the file system that you're creating. Valid values are 2.10, 2.12, and 2.15:

    • 2.10 is supported by the Scratch and Persistent_1 Lustre deployment types.

    • 2.12 is supported by all Lustre deployment types, except for PERSISTENT_2 with a metadata configuration mode.

    • 2.15 is supported by all Lustre deployment types and is recommended for all new file systems.

    Default value is 2.10, except for the following deployments:

    • Default value is 2.12 when DeploymentType is set to PERSISTENT_2 without a metadata configuration mode.

    • Default value is 2.15 when DeploymentType is set to PERSISTENT_2 with a metadata configuration mode.

  • open_zfs_configuration (Optional[CreateFileSystemOpenZFSConfiguration], default: None ) –

    The OpenZFS configuration for the file system that's being created.

  • network_type (Optional[NetworkType], default: None ) –

    The network type of the Amazon FSx file system that you are creating. Valid values are IPV4 (which supports IPv4 only) and DUAL (for dual-stack mode, which supports both IPv4 and IPv6). The default is IPV4. Supported for FSx for OpenZFS, FSx for ONTAP, and FSx for Windows File Server file systems.

Raises:

  • ActiveDirectoryError –

    An Active Directory error.

  • BadRequest –

    A generic error indicating a failure with a client request.

  • IncompatibleParameterError –

    The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.

  • InternalServerError –

    A generic error indicating a server-side failure.

  • InvalidExportPath –

    The path provided for data repository export isn't valid.

  • InvalidImportPath –

    The path provided for data repository import isn't valid.

  • InvalidNetworkSettings –

    One or more network settings specified in the request are invalid.

  • InvalidPerUnitStorageThroughput –

    An invalid value for PerUnitStorageThroughput was provided. Please create your file system again, using a valid value.

  • MissingFileSystemConfiguration –

    A file system configuration is required for this operation.

  • ServiceLimitExceeded –

    An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_fsx/_services/f_sx.py
def create_file_system(
    self,
    *,
    config_overrides: Optional[FSxClientConfig] = None,
    client_request_token: Optional[
        "capo_fsx.types.client_request_token.ClientRequestToken"
    ] = None,
    file_system_type: Optional[
        "capo_fsx.types.file_system_type.FileSystemType"
    ] = None,
    storage_capacity: Optional[
        "capo_fsx.types.storage_capacity.StorageCapacity"
    ] = None,
    storage_type: Optional["capo_fsx.types.storage_type.StorageType"] = None,
    subnet_ids: Optional["capo_fsx.types.subnet_ids.SubnetIds"] = None,
    security_group_ids: Optional[
        "capo_fsx.types.security_group_ids.SecurityGroupIds"
    ] = None,
    tags: Optional["capo_fsx.types.tags.Tags"] = None,
    kms_key_id: Optional["capo_fsx.types.kms_key_id.KmsKeyId"] = None,
    windows_configuration: Optional[
        "capo_fsx.types.create_file_system_windows_configuration.CreateFileSystemWindowsConfiguration"
    ] = None,
    lustre_configuration: Optional[
        "capo_fsx.types.create_file_system_lustre_configuration.CreateFileSystemLustreConfiguration"
    ] = None,
    ontap_configuration: Optional[
        "capo_fsx.types.create_file_system_ontap_configuration.CreateFileSystemOntapConfiguration"
    ] = None,
    file_system_type_version: Optional[
        "capo_fsx.types.file_system_type_version.FileSystemTypeVersion"
    ] = None,
    open_zfs_configuration: Optional[
        "capo_fsx.types.create_file_system_open_zfs_configuration.CreateFileSystemOpenZFSConfiguration"
    ] = None,
    network_type: Optional["capo_fsx.types.network_type.NetworkType"] = None,
) -> "capo_fsx.types.create_file_system_response.CreateFileSystemResponse":
    """<p>Creates a new, empty Amazon FSx file system. You can create the following supported Amazon FSx file systems using the <code>CreateFileSystem</code> API operation:</p> <ul> <li> <p>Amazon FSx for Lustre</p> </li> <li> <p>Amazon FSx for NetApp ONTAP</p> </li> <li> <p>Amazon FSx for OpenZFS</p> </li> <li> <p>Amazon FSx for Windows File Server</p> </li> </ul> <p>This operation requires a client request token in the request that Amazon FSx uses to ensure idempotent creation. This means that calling the operation multiple times with the same client request token has no effect. By using the idempotent operation, you can retry a <code>CreateFileSystem</code> operation without the risk of creating an extra file system. This approach can be useful when an initial call fails in a way that makes it unclear whether a file system was created. Examples are if a transport level timeout occurred, or your connection was reset. If you use the same client request token and the initial call created a file system, the client receives success as long as the parameters are the same.</p> <p>If a file system with the specified client request token exists and the parameters match, <code>CreateFileSystem</code> returns the description of the existing file system. If a file system with the specified client request token exists and the parameters don't match, this call returns <code>IncompatibleParameterError</code>. If a file system with the specified client request token doesn't exist, <code>CreateFileSystem</code> does the following:</p> <ul> <li> <p>Creates a new, empty Amazon FSx file system with an assigned ID, and an initial lifecycle state of <code>CREATING</code>.</p> </li> <li> <p>Returns the description of the file system in JSON format.</p> </li> </ul> <note> <p>The <code>CreateFileSystem</code> call returns while the file system's lifecycle state is still <code>CREATING</code>. You can check the file-system creation status by calling the <a href="https://docs.aws.amazon.com/fsx/latest/APIReference/API_DescribeFileSystems.html">DescribeFileSystems</a> operation, which returns the file system state along with other information.</p> </note>

    Args:
        client_request_token: <p>A string of up to 63 ASCII characters that Amazon FSx uses to ensure idempotent creation. This string is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.</p>
        file_system_type: <p>The type of Amazon FSx file system to create. Valid values are <code>WINDOWS</code>, <code>LUSTRE</code>, <code>ONTAP</code>, and <code>OPENZFS</code>.</p>
        storage_capacity: <p>Sets the storage capacity of the file system that you're creating, in gibibytes (GiB).</p> <p> <b>FSx for Lustre file systems</b> - The amount of storage capacity that you can configure depends on the value that you set for <code>StorageType</code> and the Lustre <code>DeploymentType</code>, as follows:</p> <ul> <li> <p>For <code>SCRATCH_2</code>, <code>PERSISTENT_2</code>, and <code>PERSISTENT_1</code> deployment types using SSD storage type, the valid values are 1200 GiB, 2400 GiB, and increments of 2400 GiB.</p> </li> <li> <p>For <code>PERSISTENT_1</code> HDD file systems, valid values are increments of 6000 GiB for 12 MB/s/TiB file systems and increments of 1800 GiB for 40 MB/s/TiB file systems.</p> </li> <li> <p>For <code>SCRATCH_1</code> deployment type, valid values are 1200 GiB, 2400 GiB, and increments of 3600 GiB.</p> </li> </ul> <p> <b>FSx for ONTAP file systems</b> - The amount of storage capacity that you can configure depends on the value of the <code>HAPairs</code> property. The minimum value is calculated as 1,024 * <code>HAPairs</code> and the maximum is calculated as 524,288 * <code>HAPairs</code>. </p> <p> <b>FSx for OpenZFS file systems</b> - The amount of storage capacity that you can configure is from 64 GiB up to 524,288 GiB (512 TiB).</p> <p> <b>FSx for Windows File Server file systems</b> - The amount of storage capacity that you can configure depends on the value that you set for <code>StorageType</code> as follows:</p> <ul> <li> <p>For SSD storage, valid values are 32 GiB-65,536 GiB (64 TiB).</p> </li> <li> <p>For HDD storage, valid values are 2000 GiB-65,536 GiB (64 TiB).</p> </li> </ul>
        storage_type: <p>Sets the storage class for the file system that you're creating. Valid values are <code>SSD</code>, <code>HDD</code>, and <code>INTELLIGENT_TIERING</code>.</p> <ul> <li> <p>Set to <code>SSD</code> to use solid state drive storage. SSD is supported on all Windows, Lustre, ONTAP, and OpenZFS deployment types.</p> </li> <li> <p>Set to <code>HDD</code> to use hard disk drive storage, which is supported on <code>SINGLE_AZ_2</code> and <code>MULTI_AZ_1</code> Windows file system deployment types, and on <code>PERSISTENT_1</code> Lustre file system deployment types.</p> </li> <li> <p>Set to <code>INTELLIGENT_TIERING</code> to use fully elastic, intelligently-tiered storage. Intelligent-Tiering is only available for OpenZFS file systems with the Multi-AZ deployment type and for Lustre file systems with the Persistent_2 deployment type.</p> </li> </ul> <p>Default value is <code>SSD</code>. For more information, see <a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/optimize-fsx-costs.html#storage-type-options"> Storage type options</a> in the <i>FSx for Windows File Server User Guide</i>, <a href="https://docs.aws.amazon.com/fsx/latest/LustreGuide/using-fsx-lustre.html#lustre-storage-classes">FSx for Lustre storage classes</a> in the <i>FSx for Lustre User Guide</i>, and <a href="https://docs.aws.amazon.com/fsx/latest/OpenZFSGuide/performance-intelligent-tiering">Working with Intelligent-Tiering</a> in the <i>Amazon FSx for OpenZFS User Guide</i>.</p>
        subnet_ids: <p>Specifies the IDs of the subnets that the file system will be accessible from. For Windows and ONTAP <code>MULTI_AZ_1</code> deployment types,provide exactly two subnet IDs, one for the preferred file server and one for the standby file server. You specify one of these subnets as the preferred subnet using the <code>WindowsConfiguration > PreferredSubnetID</code> or <code>OntapConfiguration > PreferredSubnetID</code> properties. For more information about Multi-AZ file system configuration, see <a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/high-availability-multiAZ.html"> Availability and durability: Single-AZ and Multi-AZ file systems</a> in the <i>Amazon FSx for Windows User Guide</i> and <a href="https://docs.aws.amazon.com/fsx/latest/ONTAPGuide/high-availability-multiAZ.html"> Availability and durability</a> in the <i>Amazon FSx for ONTAP User Guide</i>.</p> <p>For Windows <code>SINGLE_AZ_1</code> and <code>SINGLE_AZ_2</code> and all Lustre deployment types, provide exactly one subnet ID. The file server is launched in that subnet's Availability Zone.</p>
        security_group_ids: <p>A list of IDs specifying the security groups to apply to all network interfaces created for file system access. This list isn't returned in later requests to describe the file system.</p> <important> <p>You must specify a security group if you are creating a Multi-AZ FSx for ONTAP file system in a VPC subnet that has been shared with you.</p> </important>
        tags: <p>The tags to apply to the file system that's being created. The key value of the <code>Name</code> tag appears in the console as the file system name.</p>
        windows_configuration: <p>The Microsoft Windows configuration for the file system that's being created.</p>
        file_system_type_version: <p>For FSx for Lustre file systems, sets the Lustre version for the file system that you're creating. Valid values are <code>2.10</code>, <code>2.12</code>, and <code>2.15</code>:</p> <ul> <li> <p> <code>2.10</code> is supported by the Scratch and Persistent_1 Lustre deployment types.</p> </li> <li> <p> <code>2.12</code> is supported by all Lustre deployment types, except for <code>PERSISTENT_2</code> with a metadata configuration mode.</p> </li> <li> <p> <code>2.15</code> is supported by all Lustre deployment types and is recommended for all new file systems.</p> </li> </ul> <p>Default value is <code>2.10</code>, except for the following deployments:</p> <ul> <li> <p>Default value is <code>2.12</code> when <code>DeploymentType</code> is set to <code>PERSISTENT_2</code> without a metadata configuration mode.</p> </li> <li> <p>Default value is <code>2.15</code> when <code>DeploymentType</code> is set to <code>PERSISTENT_2</code> with a metadata configuration mode.</p> </li> </ul>
        open_zfs_configuration: <p>The OpenZFS configuration for the file system that's being created.</p>
        network_type: <p>The network type of the Amazon FSx file system that you are creating. Valid values are <code>IPV4</code> (which supports IPv4 only) and <code>DUAL</code> (for dual-stack mode, which supports both IPv4 and IPv6). The default is <code>IPV4</code>. Supported for FSx for OpenZFS, FSx for ONTAP, and FSx for Windows File Server file systems.</p>

    Raises:
        capo_fsx.errors.active_directory_error.ActiveDirectoryError: <p>An Active Directory error.</p>
        capo_fsx.errors.bad_request.BadRequest: <p>A generic error indicating a failure with a client request.</p>
        capo_fsx.errors.incompatible_parameter_error.IncompatibleParameterError: <p>The error returned when a second request is received with the same client request token but different parameters settings. A client request token should always uniquely identify a single request.</p>
        capo_fsx.errors.internal_server_error.InternalServerError: <p>A generic error indicating a server-side failure.</p>
        capo_fsx.errors.invalid_export_path.InvalidExportPath: <p>The path provided for data repository export isn't valid.</p>
        capo_fsx.errors.invalid_import_path.InvalidImportPath: <p>The path provided for data repository import isn't valid.</p>
        capo_fsx.errors.invalid_network_settings.InvalidNetworkSettings: <p>One or more network settings specified in the request are invalid.</p>
        capo_fsx.errors.invalid_per_unit_storage_throughput.InvalidPerUnitStorageThroughput: <p>An invalid value for <code>PerUnitStorageThroughput</code> was provided. Please create your file system again, using a valid value.</p>
        capo_fsx.errors.missing_file_system_configuration.MissingFileSystemConfiguration: <p>A file system configuration is required for this operation.</p>
        capo_fsx.errors.service_limit_exceeded.ServiceLimitExceeded: <p>An error indicating that a particular service limit was exceeded. You can increase some service limits by contacting Amazon Web Services Support.</p>
        capo_fsx.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_fsx.types.create_file_system_request.CreateFileSystemRequest]",
    ) -> OperationResponse[
        "capo_fsx.types.create_file_system_response.CreateFileSystemResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.create_file_system

        output, http_response = (
            capo_fsx._operations.aws_simba_api_service_v20180301.create_file_system.create_file_system(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_fsx.types.create_file_system_request.CreateFileSystemRequest",
    ) -> dict[str, Any]:
        import capo_fsx.types.create_file_system_request

        return capo_fsx.types.create_file_system_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_fsx.types.create_file_system_response.CreateFileSystemResponse",
    ) -> dict[str, Any]:
        import capo_fsx.types.create_file_system_response

        return capo_fsx.types.create_file_system_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateFileSystem",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_fsx.types.create_file_system_request.CreateFileSystemRequest = {}
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if file_system_type is not None:
        input_["file_system_type"] = file_system_type
    if storage_capacity is not None:
        input_["storage_capacity"] = storage_capacity
    if storage_type is not None:
        input_["storage_type"] = storage_type
    if subnet_ids is not None:
        input_["subnet_ids"] = subnet_ids
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if tags is not None:
        input_["tags"] = tags
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id
    if windows_configuration is not None:
        input_["windows_configuration"] = windows_configuration
    if lustre_configuration is not None:
        input_["lustre_configuration"] = lustre_configuration
    if ontap_configuration is not None:
        input_["ontap_configuration"] = ontap_configuration
    if file_system_type_version is not None:
        input_["file_system_type_version"] = file_system_type_version
    if open_zfs_configuration is not None:
        input_["open_zfs_configuration"] = open_zfs_configuration
    if network_type is not None:
        input_["network_type"] = network_type

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output