This topic describes how to create a file gateway and configure a share in the Cloud Storage Gateway (CSG) console.

Prerequisites

  1. An Alibaba Cloud account is created and real-name verification for the account is completed. For more information, see Create an Alibaba Cloud account
    Note We recommend that you log on to the CSG console as a RAM user. For more information, see Use RAM to implement account-based access control.
  2. CSG is activated.

    When you log on to the for the first time, the CSG console provides instructions on how to activate CSG.

  3. A virtual private cloud (VPC) is available in the region where you want to create a cloud file gateway. For more information, see Create a VPC with an IPv4 CIDR block.
  4. An Elastic Compute Service (ECS) instance is available in the region where you want to create a cloud file gateway. The ECS instance runs in the VPC. For more information, see Create an ECS instance.
    Note If your on-premises server is connected to a virtual private cloud (VPC) over an Express Connect circuit, you can also perform the following steps on your server.
  5. An Object Storage Service (OSS) bucket is created. For more information, see Create buckets.
    Note
    • CSG supports Standard, IA, and Archive OSS buckets.
    • If you request to read an archived file from a gateway for which the archive feature is disabled, a request to restore the file is initiated. This operation does not return an error, and file is read after it is restored, which may take some time to complete.
    • When a client writes a file to a file gateway, the gateway records at least two actions: writing the file and setting the file modification time. The gateway merges the two actions where possible. However, the gateway may still send multiple operations on the object to the bucket where the object is stored. The CopyObject operation is called to store the file modification time as a piece of metadata of the object in the bucket. If the object is an Archive or Cold Archive object, the restoration process is initiated. This increases the time required to perform operations on objects. We recommend that you do not connect a file gateway to an Archive or Cold Archive bucket. If files that are written from a file gateway to OSS are infrequently modified, we recommend that you store the files in a Standard or IA bucket first and configure a lifecycle rule that changes the storage class of the files to Archive or Cold Archive. This reduces unnecessary restoration operations and optimizes storage costs and efficiency.

Step 1: Create a file gateway

  1. Log on to the CSG console.
  2. In the top navigation bar, select the region where you want to create a file gateway.
  3. In the left-side navigation pane, click Gateways. On the page that appears, select the gateway cluster from the Current Gateway Cluster drop-down list. Click Create.
    If you do not have a gateway cluster, click Create Gateway Cluster on the Overview page to create a gateway cluster.
  4. In the Gateway Information step, set the parameters and click Next. The following table describes the parameters.
    Parameter Description
    Name The name of the file gateway that you want to create.
    Location The location where you want to deploy the gateway. Valid values: On-premises and Alibaba Cloud.
    • On-premises: The file gateway is deployed in your data center. You can deploy an on-premises file gateway in the CSG console or in the on-premises file gateway console.
    • Alibaba Cloud: The file gateway is deployed on Alibaba Cloud. You can deploy a cloud file gateway only in the CSG console.
    Type The type of the gateway that you want to create. Select File Gateway.
  5. In the Gateway Configurations step, set the parameters and click Next.

    If you set Location to Alibaba Cloud, you must set the parameters in this step. The following table describes the parameters.

    Parameter Description
    Edition The edition of the gateway that you want to create. Valid values: Basic, Standard, Enhanced, and Performance Optimized. For more information, see Specifications.
    VPC The virtual private cloud (VPC) in which you want to deploy the file gateway.
    Note The specified VPC must be the VPC in which your Elastic Compute Service (ECS) instance or on-premises resides.
    VSwitch The vSwitch that is connected to the file gateway.
    Note
    • The specified vSwitch must be the same vSwitch that is connected to your ECS instance or on-premises host.
    • If no gateway resource is available in the zone where the specified vSwitch resides, create a vSwitch in another zone.
    Public Network Bandwidth The public bandwidth.
    Note
    • By default, Public Network Bandwidth is not selected. If you want to use a gateway that resides in another region or require express synchronization across regions, you must select and set the Public Network Bandwidth parameter. For more information, see Upgrade the public bandwidth.
    • Valid values: 6 Mbit/s to 200 Mbit/s.
  6. In the Billing Information step, set the parameters and click Next. The following table describes the parameters.
    Parameter Description
    Billing Method The billing method for the gateway. Valid values: Pay-as-you-go and Subscription. For more information, see Billable items and billing methods.

    If you select Subscription, you are redirected to the Cloud Storage Gateway (Subscription) page after you create the file gateway. Complete the payment as prompted. For more information, see Purchase a subscription gateway.

    Expiration Policy The expiration policy for the gateway. Valid values: Switch to Pay-as-you-go and Release.
  7. In the Confirmation step, verify your settings and click Completed.
    • After you create a cloud file gateway, the system completes the deployment in 5 to 10 minutes. If Running is displayed in the Status column, the gateway is activated and deployed.
    • After you create an on-premises file gateway, click Activate Gateway in the Actions column. In the Activate Gateway dialog box, set the required parameters to activate the gateway. For more information, see the Activate the gateway section of the Deploy an on-premises console for a file gateway topic.

Step 2: Add a cache disk

Note This section describes how to add a cache disk for a cloud file gateway. To add a cache disk for an on-premises file gateway, you must go to the platform where the on-premises gateway console is deployed. For more information, see Add disks.
  1. Log on to the CSG console.
  2. Select the region where the file gateway resides.
  3. In the left-side navigation pane, click Gateways. On the page that appears, click the ID of the file gateway.
  4. In the left-side navigation pane, click Cache. On the Cache page, click Create Cache.
  5. In the Add Cache dialog box, set the following parameters:
    • Capacity: the size of the cache disk that you want to create. Valid values: 40 GB to 32 TB.
    • Type: the type of the cache disk that you want to create. Valid values: Ultra Disk, Standard SSD, and ESSD.
    Note
    • Basic gateway: The maximum cache capacity is 1 TB. PL3 is not available for ESSD cache disks.
    • Standard gateway: The maximum cache capacity is 2 TB.
  6. Click OK.
    If you create a subscription file gateway, you are redirected to the Cloud Storage Gateway Cache Disk (Subscription) page after you create a cache disk. Complete the payment as prompted. For more information, see Purchase a cache disk.

Step 3: Create a share

  1. Log on to the CSG console.
  2. In the upper-left corner, select the region where the file gateway resides.
  3. In the left-side navigation pane, click Gateways. On the page that appears, click the ID of the file gateway.
  4. In the left-side navigation pane, click Share. On the Shares page, click Create.
  5. In the Bucket Settings step, set the parameters and click Next. The following table describes the parameters.
    Parameter Description
    Cross-border binding
    • If you select Yes, you can access a bucket that resides in a different region from the gateway.
    • If you select No, you can access only a bucket that resides in the same region as the gateway.
    OSS Bucket Region Select the region where the bucket resides.
    Bucket Name You can select an existing bucket from the drop-down list. You can also enter a subdirectory of the bucket in the Subdirectory field.

    The Subdirectory field supports only letters and digits.

    Note
    • In version 1.0.38 and later, you can map the root directory of a file system to a subdirectory of a bucket. This way, you can isolate file access requests.
    • You can specify an existing subdirectory or a new subdirectory. After you create a share, the specified subdirectory serves as the root directory. All the related files and directories are stored in the root directory.
    • Back-to-origin buckets are not supported.
    Encrypt Valid values: None, Server-side Encryption, and Gateway-side Encryption.

    If you select Server-side Encryption, you must set the Key ID parameter. You can create a key in the KMS console. For more information, see Create a CMK.

    If you enable the server-side encryption feature in OSS, you can bring your own key (BYOK). You can use keys that are imported from Key Management Service (KMS).

    After you enable the server-side encryption feature in OSS, files that are uploaded to OSS from the shares are encrypted by using KMS-managed keys. You can call the GetObject API operation to check whether the specified file is encrypted. If the value of the x-oss-server-side-encryption field is KMS and the value of the x-oss-server-side-encryption-key-id field is the key ID in the response header, the file is encrypted.

    Note
    • Only the users in the whitelist can use this feature. The gateway-side encryption feature is available only for enhanced and performance-optimized gateways. For more information, see Enable gateway encryption.
    • When you create a key in the KMS console, you must select the region in which the OSS bucket resides.
    Use SSL to connect Bucket If you select Yes, the share is connected to the OSS bucket over SSL.
  6. In the Basic Information step, set the parameters and click Next. The following table describes the parameters.
    Parameter Description
    Share Name The name of the NFS or SMB share that you want to create. If you set the Protocol parameter to NFS, the share name also specifies the virtual path of NFS version 4 (NFSv4).

    The name must be 1 to 32 characters in length, and can contain letters and digits. The name cannot start with a digit.

    Protocol The name of the protocol that you use to connect to the OSS bucket. Valid values: NFS and SMB.
    • You can use the NFS protocol if you need to access OSS buckets from a Linux operating system.
    • You can use the SMB protocol if you need to access OSS buckets from a Windows operating system.
    Cache Select an existing cache disk.
    Note For a cache disk whose capacity is less than 5 TB, 20% of the space is used to store metadata. For a cache disk whose capacity is 5 TB or larger, 1 TB of the space is used to store metadata. For example, if you create a cache disk whose capacity is 40 GB, the available cache space for storing files is 32 GB. If you create a cache disk whose capacity is 20 TB, the available cache space for storing files is 19 TB.
    User Mapping

    Maps an NFS client user to an NFS server user. This parameter is available only when you set Protocol to NFS. Valid values:

    • none: NFS client users are not mapped to the nobody user on the NFS server.
    • root_squash: NFS clients that use the root identity are mapped to the nobody user on the NFS server.
    • all_squash: The NFS client is mapped to the nobody user on the NFS server regardless of the identity that the client uses.
    • all_anonymous: The NFS client is mapped to the anonymous user on the NFS server regardless of the identity that the client uses.
    Archive This parameter is available only if you set Protocol to NFS and User Mapping to none.
    • If you select Yes, the archive feature is enabled. You can use the archive feature to archive and restore files in a share.
    • If you select No, the archive feature is disabled. You cannot use the archive feature to manage files. When you read data from an archived file, a request to restore the file is also initiated. This can cause some latency before you can read the archived file.
    Note Basic file gateways do not support the archive feature.
    Browsable Specifies whether the share can be accessed by using Network Neighborhood.
    Windows Permission Support The Windows access control list. For more information, see Enable Windows access-based enumeration.
    Add to Sync Group You can enable the express synchronization feature for the share and add the share to a synchronization group. Then, all changes made to the data stored in the associated OSS bucket are synchronized to the on-premises client of the share. When you select the Add to Sync Group check box, the Reverse Sync check box is automatically cleared.
    Note
    • To enable this feature, create a synchronization group first. Make sure that the synchronization group and the share use the same OSS bucket. For more information about how to create a synchronization group, see Configure express synchronization.
    • Only Standard, Enhanced, and Performance Optimized gateways support the express synchronization feature.
    • The express synchronization feature is implemented based on Alibaba Cloud Message Service. After you add a share to a sync group, you are charged for Message Service. For more information, see Configure express synchronization.
    Advanced Settings After you select the Advanced Settings check box, the Advanced Settings step appears.
  7. In the Advanced Settings step, set the required parameters, and then click Next. The following table describes the parameters.
    Parameter Description
    Mode
    • Replication Mode: In this mode, two backups are created for all data. One backup is stored in the on-premises cache disk and the other backup is stored in the associated OSS bucket.
    • Cache Mode: In this mode, the backup that is stored in the on-premises cache disk contains only metadata and the user data that is frequently accessed. The backup that is stored in the OSS bucket contains all data.
    Transfer Acceleration This feature accelerates data transfer across regions by using the public bandwidth of the gateway. Before you use this feature, make sure that the transfer acceleration feature is enabled for the associated OSS bucket.
    Fragmentation Optimization Specifies whether to optimize the performance for applications that frequently and randomly read and write small amounts of data.
    Direct IO Mode Data is directly read from and written to the cache disk.
    Upload Optimization If you select Yes, cached data is cleared in real time. This feature is suitable for cloud backup scenarios.
    Reverse Sync Specifies whether to synchronize metadata stored in the OSS bucket to the on-premises cache disk. This feature is suitable for disaster recovery, data restoration, and data sharing scenarios.
    Note
    • During a reverse synchronization process, the system scans all objects in the bucket. If the number of objects is large, you are charged for OSS API calls. For more information, see OSS pricing.
    • If you select the Add to Sync Group check box in the Basic Information step, the Reverse Sync parameter is unavailable.
    Reverse Sync Interval If you set Reverse Sync to Yes, you must set the Reverse Sync Interval parameter. Valid values: 15 to 36000. Default value: 36000. Unit: seconds.
    Note If the bucket contains a large number of objects, we recommend that you set the interval to a value that is greater than 3,600 seconds. If the interval is less than 3,600 seconds, repeated scans are performed, which results in frequent OSS API calls and increased API request fees.
    Ignore Deletions If you select Yes, the data that is deleted from the on-premises cache disk is not deleted from the OSS bucket. The backup that is stored in the OSS bucket contains all data.
    NFS V4 Optimization Specifies whether to optimize the upload efficiency for NFSv4 files. If you select Yes, you cannot mount an NFSv3 file system on your on-premises host.
    Sync Latency You can specify a period of time to delay the upload of files that you modified and closed. The Sync Latency feature prevents OSS file fragmentation that is caused by frequent on-premises modifications. Default value: 5. Maximum value: 120. Unit: seconds.
    Replication Mode Advanced Settings This parameter is available only if you set Mode to Replication Mode. After you select the Replication Mode Advanced Settings check box, the Replication Mode Advanced Settings step appears.
  8. On the Replication Mode Advanced Settings tab, set the following parameters, and then click Next.
    Parameter Description
    Configure Directory in Replication Mode Allows you to specify the files to which the replication mode applies.
    • If you do not select this check box, the replication mode applies to all data in the share.
    • After you select the check box, click Add Directory to add directories. The replication mode is applied to the specified directories. The rest of the data uses the cache mode.
    Note
    • If you change the mode of a directory from cache to replication, the files in the directory can be synchronized only when the data download feature is also enabled. We recommend that you enable the data download feature in replication mode.
    • You can specify relative directories under the root directory of the share. For example, if the actual directory is /mnt/myshare/mydir/ and the mount point is /mnt/myshare, enter /mydir/.
    Data Download By default, the reverse synchronization and express synchronization features synchronize the metadata between the OSS bucket and the on-premises cache disk. The data download feature allows you to download data from OSS to the local cache disk. After you enable the Reverse Sync or Configure express synchronization feature, you can set Data Download to Yes.
    Note
    • If you download data in replication mode, the capacity of the cache disk must be 10% larger than the size of the files that you want to replicate. Plan the cache capacity based on the expected growth of the bucket usage.
    • When you enable the data download feature for the first time, a full scan is triggered. This process may reduce the performance of the gateway. We recommend that you enable the data download feature during off-peak hours and wait for the system to replicate all data.
    • The data download feature supports only write-once-read-many storage. If multiple users access the bucket at the same time over the gateway or OSS bucket, only one user can upload files to the bucket. Other users can only download data. Data loss may occur if multiple users write data to and read data from the bucket at the same time. Proceed with caution.
    Download Speed Limit This parameter is available only if you enable the Data Download feature in replication mode. The download speed must be in the range of 0 MB/s to 1,280 MB/s. If you set this parameter to 0 MB/s, the download speed is unlimited.
    Reverse Sync Interval This parameter is available only if you enable the Data Download feature in replication mode. Valid values: 3600 to 36000. Default value: 36000. Unit: seconds.
    Note
    • If the bucket contains a large number of objects, we recommend that you set the interval to a value that is greater than 3,600 seconds. If the interval is less than 3,600 seconds, repeated scans are performed, which results in frequent OSS API calls and increased API request fees.
    • Reverse synchronization is triggered only when you access the directory. To make sure that the data in other directories can be downloaded and new data can be downloaded in real time, use the Configure express synchronization feature.
  9. In the Confirmation step, verify your settings and click Completed.

Access a share

After you create a share, you can access the share from a client. For more information, see Access an NFS share directory.