Creating NFS shares

Limitations

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

Prerequisites

To create an NFS share

Admin panel

  1. On the Storage services > NFS > Shares screen, click Add NFS share.
  2. On the Add NFS share pane, specify a unique name and an IP address, which must be unused and, if authentication is enabled, domain resolvable. In addition, this IP address should be within the network subnet of the node’s interface. Click Proceed.
  3. In Share size, specify the size of the share in gigabytes. For users accessing exports, this value will be the filesystem size.
  4. Select the desired tier, failure domain, and data redundancy type.
  5. Click Done.

After the share has been created, you can proceed to creating NFS exports.

Command-line interface

Use the following command:

vinfra service nfs share create --node <node> --ip-address <ip_address> --size <size> --tier {0,1,2,3}
                                (--replicas <norm> | --encoding <M>+<N>) --failure-domain {0,1,2,3,4} <name>
--node <node>
Node ID
--ip-address <ip_address>
IP address of the NFS share
--size <size>
NFS share size, in bytes. You can also specify the following units: KiB for kibibytes, MiB for mebibytes, GiB for gibibytes, TiB for tebibytes, and PiB for pebibytes.
--tier {0,1,2,3}
Storage tier (default: 0)
--replicas <norm>

Storage replication mapping in the format:

  • norm: the number of replicas to maintain (default: 1)
--encoding <M>+<N>

Storage erasure encoding mapping in the format:

  • M: the number of data blocks
  • N: the number of parity blocks
--failure-domain {0,1,2,3,4}
Storage failure domain (default: 0)
<name>
NFS share name

For example, to create the NFS share share1 with the IP address 10.136.18.149 on the node with the ID 923926da-a879-5f56-1b24-1462917ed335, run:

# vinfra service nfs share create share1 --node 923926da-a879-5f56-1b24-1462917ed335 \
--ip-address 10.136.18.149 --size 107374182400 --tier 0 --encoding 1+2 --failure-domain 1

The created NFS share will appear in the vinfra service nfs share list output:

# vinfra service nfs share list
+--------+---------------+------------------------------------------+
| name   | ip_address    | node                                     |
+--------+---------------+------------------------------------------+
| share1 | 10.136.18.149 | cfgd_id: 1                               |
|        |               | has_configd: true                        |
|        |               | id: 923926da-a879-5f56-1b24-1462917ed335 |
|        |               | ip_address: node001.vstoragedomain       |
+--------+---------------+------------------------------------------+