Creating SMB shares

Limitations

  • The redundancy mode of an SMB share cannot be changed after its creation.

Prerequisites

To create an SMB share

Admin panel

  1. Go to Storage services > File storages > Shares and click Add share.
  2. In the Add share window, configure the share parameters:

    • Specify a unique name.
    • Specify the share size in gibibytes (GiB).

      For users accessing exports, the share size will be the size of the file system.

    • Choose whether to use a case-insensitive file system. This enables case-insensitive file operations, which can improve performance and reduce storage overhead. However, it may increase the risk of data corruption if not properly configured.
    • Select the redundancy parameters, such as a storage tier, failure domain, and redundancy mode.

      If the desired encoding mode is not listed, you can create a custom scheme by specifying the number of data fragments and parity fragments used for recovery. For more details, refer to Redundancy modes.

  3. Click Add.

After the share is created, you can proceed to create SMB exports.

Command-line interface

Use the following command:

vinfra service file-storage share create --size <size> [--node <node>] [--vdisk-count <vdisk-count>] [--stopped]
                                         [--case-insensitive] --tier {0,1,2,3} (--replicas <norm[:min]> | 
                                         --encoding <M>+<N>) --failure-domain {0,1,2,3,4} <name>
--size <size>
Share size in bytes. Minimum size is 8G. Example: 100G, 1T.
--node <node>
Node ID or hostname
--vdisk-count <vdisk-count>
Number of virtual disks
--stopped
Create a stopped share
--case-insensitive
Create a case-insensitive share
--tier {0,1,2,3}
Storage tier
--encoding <M>+<N>

Storage erasure encoding mapping in the format:

  • M: number of data blocks
  • N: number of parity blocks

To see a full list of available redundancy schemes, run the vinfra cluster storage-redundancies command.

--failure-domain {0,1,2,3,4}
Storage failure domain
--replicas <norm>

Storage replication mapping in the format:

  • norm: the number of replicas to maintain (default: 1)
<name>
SMB share name

For example, to create the SMB share share1 on the node node001, run:

# vinfra service file-storage share create share1 --node node001 --size 512G --tier 0 --encoding 1+2 --failure-domain 1

The created share will appear in the vinfra service file-storage share list output:

# vinfra service file-storage share list
+--------------------------------------+--------------------------------------+--------+--------------+---------+
| share_id                             | node_id                              | name   | size         | status  |
+--------------------------------------+--------------------------------------+--------+--------------+---------+
| 5652d4e4-a542-4c54-8f36-95290c951762 | 1f9803f9-2ab9-51cd-f010-208ed2424811 | share1 | 549755813888 | running |
+--------------------------------------+--------------------------------------+--------+--------------+---------+