Skip to content

create_file_system_from_backup

create_file_system_from_backup(
    *,
    config_overrides: Optional[FSxClientConfig] = None,
    backup_id: Optional[BackupId] = None,
    client_request_token: Optional[ClientRequestToken] = None,
    subnet_ids: Optional[SubnetIds] = None,
    security_group_ids: Optional[SecurityGroupIds] = None,
    tags: Optional[Tags] = None,
    windows_configuration: Optional[CreateFileSystemWindowsConfiguration] = None,
    lustre_configuration: Optional[CreateFileSystemLustreConfiguration] = None,
    storage_type: Optional[StorageType] = None,
    kms_key_id: Optional[KmsKeyId] = None,
    file_system_type_version: Optional[FileSystemTypeVersion] = None,
    open_zfs_configuration: Optional[CreateFileSystemOpenZFSConfiguration] = None,
    storage_capacity: Optional[StorageCapacity] = None,
    network_type: Optional[NetworkType] = None,
) -> CreateFileSystemFromBackupResponse

Creates a new Amazon FSx for Lustre, Amazon FSx for Windows File Server, or Amazon FSx for OpenZFS file system from an existing Amazon FSx backup.

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

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

  • Returns the description of the file system.

Parameters like the Active Directory, default share name, automatic backup, and backup settings default to the parameters of the file system that was backed up, unless overridden. You can explicitly supply other settings.

By using the idempotent operation, you can retry a CreateFileSystemFromBackup call 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 a success message as long as the parameters are the same.

The CreateFileSystemFromBackup 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.

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

    Specifies the IDs of the subnets that the file system will be accessible from. For Windows MULTI_AZ_1 file system 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 property.

    Windows SINGLE_AZ_1 and SINGLE_AZ_2 file system deployment types, Lustre file systems, and OpenZFS file systems 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 for the security groups that apply to the specified network interfaces created for file system access. These security groups apply to all network interfaces. This value isn't returned in later DescribeFileSystem requests.

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

    The tags to be applied to the file system at file system creation. The key value of the Name tag appears in the console as the file system name.

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

    The configuration for this Microsoft Windows file system.

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

    Sets the storage type for the Windows, OpenZFS, or Lustre file system that you're creating from a backup. Valid values are SSD, HDD, and INTELLIGENT_TIERING.

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

    • Set to HDD to use hard disk drive storage. HDD is supported on SINGLE_AZ_2 and MULTI_AZ_1 FSx for Windows File Server 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.

    The default value is SSD.

    HDD and SSD storage types have different minimum storage capacity requirements. A restored file system's storage capacity is tied to the file system that was backed up. You can create a file system that uses HDD storage from a backup of a file system that used SSD storage if the original SSD file system had a storage capacity of at least 2000 GiB.

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

    Sets the version for the Amazon FSx for Lustre file system that you're creating from a backup. Valid values are 2.10, 2.12, and 2.15.

    You can enter a Lustre version that is newer than the backup's FileSystemTypeVersion setting. If you don't enter a newer Lustre version, it defaults to the backup's setting.

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

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

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

    Sets the storage capacity of the OpenZFS file system that you're creating from a backup, in gibibytes (GiB). Valid values are from 64 GiB up to 524,288 GiB (512 TiB). However, the value that you specify must be equal to or greater than the backup's storage capacity value. If you don't use the StorageCapacity parameter, the default is the backup's StorageCapacity value.

    If used to create a file system other than OpenZFS, you must provide a value that matches the backup's StorageCapacity value. If you provide any other value, Amazon FSx responds with an HTTP status code 400 Bad Request.

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

    Sets the network type for the Amazon FSx for OpenZFS file system that you're creating from a backup.

Raises:

  • ActiveDirectoryError –

    An Active Directory error.

  • BackupNotFound –

    No Amazon FSx backups were found based upon the supplied parameters.

  • 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.

  • 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_from_backup(
    self,
    *,
    config_overrides: Optional[FSxClientConfig] = None,
    backup_id: Optional["capo_fsx.types.backup_id.BackupId"] = None,
    client_request_token: Optional[
        "capo_fsx.types.client_request_token.ClientRequestToken"
    ] = 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,
    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,
    storage_type: Optional["capo_fsx.types.storage_type.StorageType"] = None,
    kms_key_id: Optional["capo_fsx.types.kms_key_id.KmsKeyId"] = 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,
    storage_capacity: Optional[
        "capo_fsx.types.storage_capacity.StorageCapacity"
    ] = None,
    network_type: Optional["capo_fsx.types.network_type.NetworkType"] = None,
) -> "capo_fsx.types.create_file_system_from_backup_response.CreateFileSystemFromBackupResponse":
    """<p>Creates a new Amazon FSx for Lustre, Amazon FSx for Windows File Server, or Amazon FSx for OpenZFS file system from an existing Amazon FSx backup.</p> <p>If a file system with the specified client request token exists and the parameters match, this operation returns the description of the file system. If a file system with the specified client request token exists but the parameters don't match, this call returns <code>IncompatibleParameterError</code>. If a file system with the specified client request token doesn't exist, this operation does the following:</p> <ul> <li> <p>Creates a new Amazon FSx file system from backup with an assigned ID, and an initial lifecycle state of <code>CREATING</code>.</p> </li> <li> <p>Returns the description of the file system.</p> </li> </ul> <p>Parameters like the Active Directory, default share name, automatic backup, and backup settings default to the parameters of the file system that was backed up, unless overridden. You can explicitly supply other settings.</p> <p>By using the idempotent operation, you can retry a <code>CreateFileSystemFromBackup</code> call 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 a success message as long as the parameters are the same.</p> <note> <p>The <code>CreateFileSystemFromBackup</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>
        subnet_ids: <p>Specifies the IDs of the subnets that the file system will be accessible from. For Windows <code>MULTI_AZ_1</code> file system 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> property.</p> <p>Windows <code>SINGLE_AZ_1</code> and <code>SINGLE_AZ_2</code> file system deployment types, Lustre file systems, and OpenZFS file systems 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 for the security groups that apply to the specified network interfaces created for file system access. These security groups apply to all network interfaces. This value isn't returned in later <code>DescribeFileSystem</code> requests.</p>
        tags: <p>The tags to be applied to the file system at file system creation. The key value of the <code>Name</code> tag appears in the console as the file system name.</p>
        windows_configuration: <p>The configuration for this Microsoft Windows file system.</p>
        storage_type: <p>Sets the storage type for the Windows, OpenZFS, or Lustre file system that you're creating from a backup. 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 and OpenZFS deployment types.</p> </li> <li> <p>Set to <code>HDD</code> to use hard disk drive storage. HDD is supported on <code>SINGLE_AZ_2</code> and <code>MULTI_AZ_1</code> FSx for Windows File Server 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> The default value is <code>SSD</code>. </p> <note> <p>HDD and SSD storage types have different minimum storage capacity requirements. A restored file system's storage capacity is tied to the file system that was backed up. You can create a file system that uses HDD storage from a backup of a file system that used SSD storage if the original SSD file system had a storage capacity of at least 2000 GiB.</p> </note>
        file_system_type_version: <p>Sets the version for the Amazon FSx for Lustre file system that you're creating from a backup. Valid values are <code>2.10</code>, <code>2.12</code>, and <code>2.15</code>.</p> <p>You can enter a Lustre version that is newer than the backup's <code>FileSystemTypeVersion</code> setting. If you don't enter a newer Lustre version, it defaults to the backup's setting.</p>
        open_zfs_configuration: <p>The OpenZFS configuration for the file system that's being created. </p>
        storage_capacity: <p>Sets the storage capacity of the OpenZFS file system that you're creating from a backup, in gibibytes (GiB). Valid values are from 64 GiB up to 524,288 GiB (512 TiB). However, the value that you specify must be equal to or greater than the backup's storage capacity value. If you don't use the <code>StorageCapacity</code> parameter, the default is the backup's <code>StorageCapacity</code> value.</p> <p>If used to create a file system other than OpenZFS, you must provide a value that matches the backup's <code>StorageCapacity</code> value. If you provide any other value, Amazon FSx responds with an HTTP status code 400 Bad Request. </p>
        network_type: <p>Sets the network type for the Amazon FSx for OpenZFS file system that you're creating from a backup.</p>

    Raises:
        capo_fsx.errors.active_directory_error.ActiveDirectoryError: <p>An Active Directory error.</p>
        capo_fsx.errors.backup_not_found.BackupNotFound: <p>No Amazon FSx backups were found based upon the supplied parameters.</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_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_from_backup_request.CreateFileSystemFromBackupRequest]",
    ) -> OperationResponse[
        "capo_fsx.types.create_file_system_from_backup_response.CreateFileSystemFromBackupResponse"
    ]:
        import capo_fsx._operations.aws_simba_api_service_v20180301.create_file_system_from_backup

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

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

        return (
            capo_fsx.types.create_file_system_from_backup_request.redact_sensitive(
                input_
            )
        )

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

        return (
            capo_fsx.types.create_file_system_from_backup_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateFileSystemFromBackup",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_fsx.types.create_file_system_from_backup_request.CreateFileSystemFromBackupRequest = {}
    if backup_id is not None:
        input_["backup_id"] = backup_id
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    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 windows_configuration is not None:
        input_["windows_configuration"] = windows_configuration
    if lustre_configuration is not None:
        input_["lustre_configuration"] = lustre_configuration
    if storage_type is not None:
        input_["storage_type"] = storage_type
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id
    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 storage_capacity is not None:
        input_["storage_capacity"] = storage_capacity
    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