• Scalable File Service

sfs
  1. Help Center
  2. Scalable File Service
  3. API Reference(cli)
  4. API Description
  5. File Sharing
  6. Creating a Shared File System

Creating a Shared File System

Function

This interface is used to create a shared file system.

NOTE:

This interface is an asynchronous interface. Successful command execution only indicates that the command is successfully delivered. Later, you can query the status and path of the shared file system by referring to Querying Details About a Shared File System to identify whether the creation is complete and successful.

After a share is created successfully, the share can be used only after you add share access rules by referring to Adding Share Access Rules.

Command

  • Usage
    manila create [--snapshot-id <snapshot-id>] [--name <name>]
                  [--metadata [<key=value> [<key=value> ...]]]
                  [--share-network <network-info>]
                  [--description <description>] [--share-type <share-type>]
                  [--public] [--availability-zone <availability-zone>]
                  [--consistency-group <consistency-group>]
                  <share_protocol> <size>
  • Parameter description

    Name

    Mandatory

    Type

    Description

    share_protocol

    Yes

    string

    Specifies the protocol for sharing file systems. The value is NFS.

    size

    Yes

    int

    Specifies the size of the shared file system in GB.

    snapshot-id

    No

    string

    Specifies the UUID (0 to 36 characters) of the source snapshot that was used to create the shared file system. This parameter is reserved, because snapshots are not supported currently.

    name

    No

    string

    Specifies the name of the shared file system. The value contains 0 to 255 characters.

    metadata

    No

    object

    Specifies the metadata information used to create the share. The value consists of one or more key and value pairs organized as a dictionary of strings.

    CAUTION:

    For security concerns, the API for modifying the metadata field is not enabled. Therefore, ensure that the parameters and values are correct when creating a share with data encryption using the metadata field.

    WARNING:

    Unless otherwise specified (for example, #sfs_crypt_key_id), the keys that comply with the following rules in the metadata field are for internal use of the system. Do not customize the settings to avoid internal system errors caused by conflicts with system predefined keys.

    • Key share_used. Key share_used is used to indicate the used capacity of the share.
    • Keys that start with #sfs. The SFS system uses the keys that start with #sfs for internal use. Do not customize the key unless otherwise specified.

    share-network

    No

    string

    Specifies the UUID or name of the share network to which the share service belongs or will be created. This parameter is reserved, because share network management is not supported currently.

    description

    No

    string

    Describes the shared file system. The value contains 0 to 255 characters.

    share-type

    No

    string

    Specifies the share type. This value determines the storage service type for the shared file system, such as high-performance storage (composed of SSDs) or large-capacity storage (composed of SATA disks). Currently, only one service type is supported and the value is automatically set to default. Do not manually set it, because the file service will fail to be applied for if an unsupported type is entered.

    public

    No

    boolean

    (Since API v2.8) Specifies the level of visibility for the shared file system. If this parameter is set to true, the share can be queried by other tenants using interfaces such as the one in Querying Details About a Shared File System. If this parameter is set to false, the share is visible only to the tenant who creates it. The default value is false.

    NOTE:

    Share access rules added by different tenants are isolated from each other. Therefore, even if a share is set to be visible to other tenants, the share can only be queried by other tenants using the interface in Querying Details About a Shared File System. Other tenants are not allowed to mount or use the share.

    consistency-group

    No

    string

    (Since API v2.4) Specifies the UUID of the consistency group in which the shared file system will be created. The share type of share_network_id of the consistency group must be consistent with share_type. SFS does not support the consistency group. Therefore, this parameter is reserved and you do not need to fill in this parameter.

    • Description of field metadata (when creating a share with the encryption function)
      When creating a share with the encryption function, obtain the key ID, domain ID, and key alias of the encryption key using the HTTPS request by referring to section Querying the List of CMKs in the Key Management Service API Reference. Then, in the metadata field, set the key-value pairs according to the following table. Ensure that the key-value pairs in the metadata field are correct.

      Key

      Value Type

      Mandatory

      Description

      #sfs_crypt_key_id

      string

      Yes

      Specifies the encryption key ID.

      If this string, as well as #sfs_crypt_domain_id and #sfs_crypt_alias exist at the same time, the data encryption function is enabled.

      #sfs_crypt_domain_id

      string

      Yes

      Specifies the tenant domain ID.

      If this string, as well as #sfs_crypt_key_id and #sfs_crypt_alias exist at the same time, the data encryption function is enabled.

      #sfs_crypt_alias

      string

      Yes

      Specifies the encryption key alias in metadata.

      If this string, as well as #sfs_crypt_key_id and #sfs_crypt_domain_id exist at the same time, the data encryption function is enabled.

      NOTE:
      • You are advised to use the default primary key sfs/default to create an encrypted share. For details, see section "File System Encryption" and "Managing Encrypted File Systems" in the Scalable File Service User Guide.
  • Example command
     manila create NFS 10 --name sharename
  • Example command (creating a share with data encryption)
     manila create NFS 10 --name sharename --metadata "#sfs_crypt_key_id"=9130c90d-73b8-4203-b790-d49f98d503df "#sfs_crypt_domain_id"=3b2d9670690444c582942801ed7d457b "#sfs_crypt_alias"=sfs/default

Response

  • Parameter description

    Name

    Mandatory

    Type

    Description

    status

    Yes

    string

    Specifies the status of the shared file system. This interface is an asynchronous interface. The available value of status is only creating.

    share_type_name

    Yes

    string

    Specifies the name of a share type. A share type is used to specify the type of the storage service to be allocated. Currently, only one share type is provided for SFS and the value is fixed to default.

    description

    Yes

    string

    Describes the shared file system.

    availability_zone

    Yes

    string

    Specifies the availability zone.

    share_network_id

    Yes

    string

    Specifies the UUID of the share network. This parameter is reserved, because share network management is not supported currently.

    host

    Yes

    string

    Specifies the host name of the shared file system.

    access_rules_status

    Yes

    string

    Specifies the configuration status of the access rule. Possible values are active (effective), error (configuration failed), syncing (configuration in progress).

    snapshot_id

    No

    string

    Specifies the UUID of the source snapshot that was used to create the shared file system. This parameter is reserved, because snapshots are not supported currently.

    is_public

    No

    bool

    (Since API v2.8) Specifies the level of visibility for the shared file system. If this parameter is set to true, the share can be queried by other tenants using interfaces such as the one in Querying Details About a Shared File System. If this parameter is set to false, the share is visible only to the tenant who creates it. The default value is false.

    NOTE:

    Share access rules added for different tenants are isolated from each other. Therefore, even if a share is set to be visible to other tenants, the share can only be queried by other tenants using the interface in Querying Details About a Shared File System. Other tenants are not allowed to mount or use the share.

    task_state

    Yes

    string

    Specifies the data migration status. This parameter is reserved, because data migration is not supported currently.

    snapshot_support

    Yes

    boolean

    Specifies whether snapshots are supported. This parameter is reserved, because snapshots are not supported currently.

    id

    Yes

    string

    Specifies the UUID of the shared file system.

    size

    Yes

    integer

    Specifies the size of the shared file system in GB.

    name

    No

    string

    Specifies the name of the shared file system.

    share_type

    Yes

    string

    Specifies the UUID of the share type.

    has_replicas

    Yes

    boolean

    Specifies whether replicas exist. This parameter is reserved, because replication is not supported currently.

    replication_type

    No

    string

    Specifies the replication type. This parameter is reserved, because replication is not supported currently.

    created_at

    Yes

    string

    Specifies the date and time stamp when the shared file system was created.

    share_proto

    Yes

    string

    Specifies the protocol for sharing file systems.

    consistency_group_id

    No

    string

    Specifies the UUID of the consistency group. This parameter is reserved, because consistency groups are not supported currently.

    source_cgsnapshot_member_id

    Yes

    string

    Specifies the UUID of the snapshot's source. This parameter is reserved, because consistency snapshot is not supported currently.

    project_id

    Yes

    string

    Specifies the UUID of the project in which the shared file system was created.

    metadata

    No

    object

    Sets that one or more metadata key and value pairs as a dictionary of strings.

  • Example response
+-----------------------------+-------------------------------------+
| Property                    | Value                                |
+-----------------------------+-------------------------------------+
| status                      | creating                             |
| share_type_name             | default                              |
| description                 | None                                 |
| availability_zone           | None                                 |
| share_network_id            | None                                 |
| host                        |                                      |
| access_rules_status         | active                               |
| snapshot_id                 | None                                 |
| is_public                   | False                                |
| task_state                  | None                                 |
| snapshot_support            | True                                 |
| id                          | b4e1665d-2a63-4056-855a-4902720a2a07 |
| size                        | 10                                   |
| name                        | None                                 |
| share_type                  | 500fcfac-357b-4f0f-beeb-240d09da4dab |
| has_replicas                | False                                |
| replication_type            | None                                 |
| created_at                  | 2017-12-27T02:14:38.983181           |
| share_proto                 | NFS                                  |
| consistency_group_id        | None                                 |
| source_cgsnapshot_member_id | None                                 |
| project_id                  | 703fdd5a62c84cbfb1385c212881f695     |
| metadata                    | {}                                   |
+-----------------------------+-------------------------------------+