Creating NFS shares
Limitations
- The redundancy mode of an NFS share cannot be changed after its creation.
Prerequisites
- A clear understanding of the concept Storage policies.
- The NFS cluster is created by following the instructions in Creating the NFS cluster.
To create an NFS share
Admin panel
- Open the Storage services > NFS > Shares screen, and then click Add share.
-
In the Add share window, specify a unique name and 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.
-
To authenticate clients in an NFS share, do the following:
- Create a principal with its key table for the share in Kerberos KDC (Key Distribution Center), as described in Authenticating NFS share users via Kerberos.
-
Upload the corresponding keytab file.
- Click Next.
-
On the next step, specify the share size, in gibibytes, and redundancy parameters, such as a storage tier, failure domain, and redundancy mode. For users accessing exports, the share size will be the size of the file system.
- Click Add.
After the share is created, you can proceed to create 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} [--krb-keytab <krb-keytab>] <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 blocksN
: the number of parity blocks
--failure-domain {0,1,2,3,4}
- Storage failure domain (default: 0)
--krb-keytab <krb-keytab>
- Kerberos keytab file
<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 | +--------+---------------+------------------------------------------+