Managing SMB shares by using imperative method

Learn how to create, list, or remove SMB shares by using imperative specific command-line instructions.

Before you begin

  • Ensure that the SMB module is configured with cephadm orchestration to function properly.
  • Gather information about the domain if you are using active-directory.
  • Create a domain user to join to active directory (AD).
  • Determine whether you need to use custom_dns setting.
  • Which users to define if you are not using AD.

About this task

This method uses commands like ceph smb share create and ceph smb share rm, similar to those used in Ceph NFS manager module on the command line.

Creating SMB shares

About this task

Learn to create SMB shares by using the imperative method.

Procedure

Create a new SMB share, hosted by the named cluster, that maps to the given CephFS volume and path.
ceph smb share create CLUSTER_ID SHARE_ID CEPHFS_VOLUME PATH [--share-name=SHARE_NAME] [--subvolume=SUBVOLUME_NAME] [--readonly]

Use the CLUSTER_ID that is provided while creating the SMB cluster. For more information, see Managing SMB clusters by using imperative method.

Table 1 lists the parameters that are required for creating the cluster.
Table 1. Creating share parameters
Parameters Description
cluster_id A short string uniquely identifying the cluster.
share_id A short string uniquely identifying the share
cephfs_volume The name of the CephFS volume to be shared.
path A path relative to the root of the volume and/or subvolume.
share_name Optional. The public name of the share, visible to clients. If not provided the share_id will be used automatically.
subvolume

Optional. A subvolume name in the form [<subvolumegroup>/]<subvolume>. The option causes the path to be relative to the CephFS subvolume specified.

readonly Creates a read-only share.

Removing SMB shares

About this task

Learn to remove SMB shares by using the imperative method.

Procedure

Remove an SMB Share from the cluster.
ceph smb share rm CLUSTER_ID SHARE_ID

Listing SMB shares

About this task

The listing of cluster IDs output defaults to JSON, select YAML encoding with the --format=yaml option.

Procedure

List the cluster by using the smb share ls command.
ceph smb share ls CLUSTER_ID [--format=FORMAT]