All Products
Search
Document Center

Cloud Storage Gateway:Create a share

Last Updated:Sep 20, 2024

This topic describes how to create a share in the Cloud Storage Gateway (CSG) console. After a share is created, you can mount the share on a local directory. The share of a gateway is linked to the Object Storage Service (OSS) bucket that is mapped to the gateway. Your operations on data in the share are applied to data in the mapped bucket.

Prerequisites

  1. A file gateway is created. For more information, see Create a file gateway.

  2. A cache disk is attached to the gateway. For more information, see Attach a cache disk.

  3. An Object Storage Service (OSS) bucket is created. For more information, see Create buckets.

    Note
    • CSG supports Standard, Infrequent Access (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. If the file gateway uses a Network File System (NFS) share, no error is returned, but a certain level of I/O latency occurs. If the file gateway uses a Server Message Block (SMB) share, a short-lived error occurs, and the read operation is successful after the restoration process is 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 initiate 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, this operation requires object restoration, which takes some time to complete. This increases the time required for object uploads and even causes upload failures if not enough time is left to upload data in the cache. We recommend that you do not connect a gateway to an 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.

Procedure

  1. Log on to the CSG console.

  2. At the top of the page, select the region where the file gateway resides.

  3. In the left-side navigation pane, click Gateways. On the page that appears, locate the file gateway and 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, configure the parameters and click Next. The following table describes the parameters.

    Parameter

    Description

    Cross-region 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 a bucket that resides only in the same region as the gateway.

    OSS Endpoint

    The endpoint of the region in which the bucket is located.

    Bucket Name

    You can select an existing bucket from the drop-down list. You can also select the Subdirectory check box and enter a subdirectory of the bucket in the text box that appears.

    Note
    • The name of a subdirectory can contain only letters and digits.

    • Starting from V1.0.38, you can map the root directory of a file system to a subdirectory of the bucket. This way, you can isolate file access requests.

    • You can specify an existing subdirectory or a subdirectory that does not exist in the bucket. After you create a share, the specified subdirectory serves as the root directory and stores all related files and directories.

    • Buckets for which back-to-origin routing is configured are not supported.

    • CSG cannot guarantee that only one write operation is performed on an object. Therefore, buckets for which retention policies are configured are not supported.

    Encrypt

    The data encryption setting. Valid values: None, Server-side Encryption, and Gateway-side Encryption.

    If you select Server-side Encryption, you must specify a Key ID. You can create a key in the Key Management Service (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). Keys that are imported from KMS are supported.

    After you enable server-side encryption, files that are uploaded to OSS from the share are encrypted by using KMS-managed keys. You can call the GetObject 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 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 bucket is connected over SSL.

  6. In the Basic Information step, configure the parameters and click Next. The following table describes the parameters.

    Parameter

    Description

    Share Name

    The name of the Network File System (NFS) or Server Message Block (SMB) share. If you set the Protocol parameter to NFS, the share name is also used as the virtual path of the share when the mount operation is performed based on 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 protocol that you use to connect to the OSS bucket. Valid values: NFS and SMB.

    • The NFS protocol is suitable if you need to access OSS buckets from a Linux operating system.

    • The SMB protocol is suitable if you need to access OSS buckets from a Windows operating system.

    Cache

    Select an existing cache disk.

    Note

    If the size of the cache disk is less than 5 TB, 20% of the cache disk size is reserved for metadata storage. If the size of the cache disk is greater than 5 TB, 1 TB is reserved for metadata storage. For example, if the size of the cache disk is 40 GB, the available data cache space is 32 GB. If the size of the cache disk is 20 TB, the available data cache space is 19 TB.

    User Mapping

    The user mapping between the NFS client and the NFS server. This parameter is available only when you set Protocol to NFS. Valid values:

    • none: The NFS client user is not mapped to the nobody user on the NFS server.

    • root_squash: The NFS client that uses the root identity is 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

    Specify whether to enable the archive feature. This parameter is available only if you set the Protocol parameter to NFS and the User Mapping parameter 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 directly manage files. When you read data from an archived file, a request to restore the file is also initiated. This causes a certain level of latency before you can actually read the archived file.

    Note

    Basic file gateways do not support the archive feature.

    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 on which the share is mounted. 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 Queue(formerly MNS). Adding a share to a synchronization group incurs Message Queue(formerly MNS)costs. For more information about billing, see Background information.

    Advanced Settings

    After you select the Advanced Settings check box, the Advanced Settings step appears.

  7. In the Advanced Settings step, configure the 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 on-premises cache disk stores only metadata and the user data that is frequently accessed. The bucket stores full 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

    Specify whether to optimize the performance for applications that frequently and randomly read and write small amounts of data.

    Bypass Cache Read

    By default, if a cache miss occurs for a read request to a gateway, the gateway downloads the requested data from the associated OSS bucket to the cache disk. This process involves a certain level of data prefetching. However, if read requests are completely random reads and the size of the cache disk is far smaller than the size of data in the OSS bucket, prefetching data to the cache disk may not deliver satisfactory performance. In this case, consider enabling this feature. We recommend that you enable this feature only when it is necessary.

    Upload Optimization

    If you select Yes, cached data is cleared in real time. This feature is suitable for cloud backup scenarios.

    Reverse Sync

    Specify whether to synchronize metadata of objects in the OSS bucket to the on-premises cache disk. This feature is suitable for disaster recovery, data restoration, and data sharing.

    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 calling the OSS API. For more information, see Pricing of OSS.

    • If you select the Add to Sync Group check box in the Basic Information step, this parameter is unavailable.

    Reverse Sync Interval

    If you set Reverse Sync to Yes, you must set the Reverse Sync Interval parameter. The reverse synchronization interval ranges from 15 seconds to 36,000 seconds. The default reverse synchronization interval is 900 seconds.

    Note
    • If the bucket contains a large number of objects, we recommend that you set the interval to a value greater than 3,600 seconds. Otherwise, repeated scans result in frequent OSS API calls. This causes an increase in fees generated by OSS API calls.

    • If you configure the cache mode and data download for the share, you must specify an interval within the range from 3,600 seconds and 36,000 seconds.

    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 bucket stores full data.

    NFS V4 Optimization

    Select whether to optimize the upload efficiency if an NFSv4 file system is mounted. If you select Yes, you cannot mount an NFSv3 file system.

    Sync Latency

    Specify a period of time to delay the upload of files. The Sync Latency feature prevents frequent on-premises modifications from creating a large number of fragments in OSS. Default value: 5. Maximum value: 120. Unit: seconds.

    Replication Mode Advanced Settings

    If you set Mode to Replication Mode, you can select the Replication Mode Advanced Settings check box. Then, the Replication Mode Advanced Settings step appears.

  8. In the Replication Mode Advanced Settings step, configure the parameters and then click Next. The following table describes the parameters.

    Parameter

    Description

    Configure Directory in Replication Mode

    Specify the directories that contain the data to which the replication mode applies.

    • If you do not select this check box, the replication mode is applied to all data in the share.

    • If you select the check box, click Add Directory to specify directories that contain the data to which you want to apply the replication mode. 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 also enable the data download feature.

    • The specified directories are relative to the root directory of the share. For example, if the directory to which you want to apply the replication mode is /mnt/myshare/mydir/ and the mount point is /mnt/myshare, you can enter /mydir/.

    Data Download

    Reverse synchronization and express synchronization synchronize only the metadata. The data download feature allows you to download all data or data in the specified directories to the local client. If you enable reverse synchronization or express synchronization, you can select Yes to enable data download.

    Note
    • If you want to use the data download feature, the size of the cache disk must be 1.1 times larger than the size of the data to download. When you plan cache disk size, consider the expected size growth of data in the bucket.

    • 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 download all the data.

    • The data download feature supports only write-once-read-many storage. If multiple users access the bucket at the same time (including but not limited to direct access or access through the gateway), only one user can upload files to the bucket, and 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.

    Download Speed Limit

    After you enable data download, you must set this parameter. You can specify a speed limit within 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

    After you enable data download, you must set this parameter. The reverse synchronization interval ranges from 3,600 seconds to 36,000 seconds. The default reverse synchronization interval is 3,600 seconds.

    Note
    • If the bucket contains a large number of objects, we recommend that you set the interval to a value greater than 3,600 seconds. Otherwise, repeated scans result in frequent OSS API calls. This causes an increase in fees generated by OSS API calls.

    • Reverse synchronization is triggered only when you access the specified directories. To ensure that the data in other directories can be downloaded and new data can be downloaded in real time, use the express synchronization feature. For more information, see Configure express synchronization.

  9. In the Confirmation step, verify your settings and click OK.

What to do next

Access a share