Managing SMB clusters by using imperative method

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

Before you begin

Before you begin, make sure that you have the following prerequisites in place:
  • 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.
  • Set the earmark for SMB. For more information see, Earmarking a file system subvolume.

About this task

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

Creating SMB clusters

Create SMB clusters by using the imperative method.

Create a new logical cluster, which is identified by the cluster ID value. The cluster create command must specify the authentication mode the cluster uses. Authentication mode is either custom users or groups, also known as a stand-alone server, with the user keyword.
ceph smb cluster create CLUSTER_ID {user} [--domain-realm=DOMAIN_REALM] 
[--domain-join-user-pass=DOMAIN_JOIN_USER_PASS] 
[--define-user-pass=DEFINE_USER_PASS] [--custom-dns=CUSTOM_DNS] 
[--placement=PLACEMENT] [--clustering=CLUSTERING]
For example,
auth_mode: user
[ceph: root@host01 ~]# ceph smb cluster create smb1 user --define_user_pass user1%passwd --placement label:smb --clustering default

auth_mode: AD
[ceph: root@host01 ~]# ceph smb cluster create smb1 active-directory --domain_realm samba.qe --domain_join_user_pass Administrator%RT@123 --custom_dns 10.71.34.153 --placement label:smb --clustering default
Table 1 lists the parameters that are required for creating the cluster.
Table 1. Creating cluster parameters
Parameters Description
auth_mode Specify either user or active-directory.
cluster_id A unique string identifying the cluster.
clustering Optional. Control if a cluster abstraction actually uses SMB’s clustering mechanism. The value may be one of default, always, or never. A default value indicates that clustering should be enabled if the placement count value is any value other than 1. A value of always enables clustering regardless of the placement count. A value of never disables clustering regardless of the placement count. If unspecified, default is assumed.
custom_dns IP addresses to override default DNS resolvers.
define_user_pass Authentication details for a user in the user-auth mode in the form <username>%<password>. This parameter accepts multiple username and password combinations. For example,
--define-user-pass=alice%foo --define-user-pass=bob%bar --define-user-pass=charlie%baz
domain_join_user_pass Credentials in the form <username>%<password> for joining SMB servers to the AD domain.
domain_realm Required for Active Directory setups.
password_filter Optional. One of none or base64. If the filter is none the password values on the command line are assumed to be plain text. If the filter is base64 the password values are assumed to be obscured with base64 encoding the string. If --password-filter-out is not specified this filter will also be applied to the output.
password_filter_out Optional. One of none, base64, or hidden. If the filter is none the password fields in the output are emitted as plain text. If the filter is base64 password fields will be obscured by base64 encoding the string. If the filter is hidden the password values will be replaced by an invalid generic replacement string containing only asterisks.
placement A specification for Ceph orchestration placement.
public_addrs Optional. A string in the form of <ipaddress/prefixlength>[%<destination interface>]. Supported only when using SMB’s clustering. Assign virtual IP addresses that will be managed by the clustering subsystem and may automatically move between nodes running SMB containers.

Listing SMB clusters

By listing SMB clusters, you can help ensure robust data protection and efficient management. The listing of cluster IDs output defaults to JSON. Select YAML encoding with the --format=yaml option.
List all SMB clusters by using the smb cluster ls command.
ceph smb cluster ls [--format=FORMAT]
For example,
[ceph: root@host01 ~]# ceph smb cluster ls
[
  "smb1"
]

Removing SMB clusters

Delete an SMB cluster by using the imperative method.
ceph smb cluster rm CLUSTER_ID