// Module included in the following assemblies:
//
// * storage/container_storage_interface/persistent-storage-csi-smb-cifs.adoc

:_mod-docs-content-type: PROCEDURE
[id="persistent-storage-csi-smb-cifs-create-sc_{context}"]
= Creating a storage class for CIFS/SMB

After installing the Operator, you should create a storage class for dynamic provisioning of Common Internet File System (CIFS) dialect/Server Message Block (SMB) protocol volumes.

.Prerequisites
* You are logged in to the running {product-title} cluster.

* You have SMB server installed and know the following information about the server:
** Hostname
** Share name
** Username and password

.Procedure
To create a storage class:

. Create a Secret for access to the Samba server using the following command with the following example YAML file:
+
[source,cli]
--
$ oc create -f <file_name>.yaml
--
+
[source,yaml]
.Secret example YAML file
--
apiVersion: v1
kind: Secret
metadata:
  name: smbcreds <1>
  namespace: samba-server <2>
stringData:
  username: <username> <3>
  password: <password> <4>
--
<1> Name of the Secret.
<2> Namespace for the Secret.
<3> Username for the Secret.
<4> Password for the Secret.

. Create a storage class using the following command with the following example YAML file:
+
[source,cli]
--
$ oc create -f <file_name>.yaml
--
+
[source,yaml]
.Storage class example YAML file
--
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: samba
provisioner: smb.csi.k8s.io
parameters:
  source: //<hostname>/<shares> <1>
  csi.storage.k8s.io/provisioner-secret-name: smbcreds <2>
  csi.storage.k8s.io/provisioner-secret-namespace: samba-server <3>
  csi.storage.k8s.io/node-stage-secret-name: smbcreds <2>
  csi.storage.k8s.io/node-stage-secret-namespace: samba-server <3>
reclaimPolicy: Delete
volumeBindingMode: Immediate
mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - noperm
  - mfsymlinks
  - cache=strict
  - noserverino
--
<1> The Samba server must be installed somewhere and reachable from the cluster with `<hostname>` being the hostname for the Samba server and `<shares>` the path the server is configured to have among the exported shares.
<2> Name of Secret that was set in the previous step.
<3> Namespace for the Secret that was set in the previous step.

