• Applicable for UVS Manager 2.14.17+
  • Prepare a CentOS 7 environment, here I'm using CentOS 7.8.2003.


A. Ceph RBD & SAMBA settings

Go to UVS Manager WebUI

1. Create RBD images for SAMBA

1-1. Select the menu "CEPH" -> "Pools". Create a pool "rbd".

1-2. Select the menu "CEPH" -> "Images" Create an image "samba".

2. Setup SAMBA Gateway server

Login your Gateway

2-1. Install Ceph & SAMBA packages. (part-1)

$ vi /etc/yum.repos.d/ceph.repo
$ cat /etc/yum.repos.d/ceph.repo

[ceph]
name=Ceph packages for $basearch
baseurl=https://download.ceph.com/rpm-nautilus/el7/$basearch
enabled=1
priority=2
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc


[ceph-noarch]
name=Ceph noarch packages
baseurl=https://download.ceph.com/rpm-nautilus/el7/noarch
enabled=1
priority=2
gpgcheck=1
gpgkey=https://download.ceph.com/keys/release.asc

2-2. Install Ceph & SAMBA packages. (part-2)

$ yum install epel-release -y 
$ yum install samba samba-client samba-common targetcli ceph-common -y 

2-3. Copy Ceph Configuration to the gateway.

$ CEPH_MON_IP=192.168.1.158 
$ scp ${CEPH_MON_IP}:/etc/ceph/ceph.c* /etc/ceph/ 

2-4. Test the Ceph commands & rbd/samba image

$ ceph -v
$ rbd info rbd/samba

2-5. Try to map the rbd/samba image

$ vi /etc/ceph/rbdmap
$ cat /etc/ceph/rbdmap
rbd/samba       id=admin,keyring=/etc/ceph/ceph.client.admin.keyring
$ rbdmap map
$ lsblk
$ ls -l /dev/rbd/rbd/samba

2-6. Format the rbd/samba image as xfs filesystem.

$ lsblk
$ ls -l /dev/rbd/rbd/samba
$ mkfs.xfs /dev/rbd/rbd/samba

2-7. Set fstab and mount the samba image

$ mkdir -p /samba-rbd
$ vi /etc/fstab
$ cat /etc/fstab | tail -n1
/dev/rbd/rbd/samba      /samba-rbd      xfs     noauto  0 0
$ systemctl stop rbdmap
$ systemctl daemon-reload
$ systemctl start rbdmap
$ mount | grep samba-rbd
/dev/rbd0 on /samba-rbd type xfs (rw,relatime,seclabel,attr2,inode64,sunit=8192,swidth=8192,noquota)

2-8. Edit samba configuration

$ vi /etc/samba/smb.conf
$ cat /etc/samba/smb.conf | tail -n7
[samba-rbd]
        comment = Samba RBD
        valid users = @samba
        browsable = Yes
        read only = No
        inherit acls = Yes
        path = /samba-rbd

2-9. Set samba account, firewall & selinux

$ adduser samba
$ chown -R samba:samba /samba-rbd/
$ chcon -t samba_share_t /samba-rbd/
$ firewall-cmd --permanent --zone=public --add-service=samba
$ firewall-cmd --reload
$ setsebool -P samba_export_all_ro=1 samba_export_all_rw=1

2-10. Set password and start the SAMBA service

$ smbpasswd -a samba
$ systemctl enable smb nmb
$ systemctl start smb nmb

B. Try to attach the SAMBA Gateway

1. On windows

1-1. Open a folder and type \\${SAMBA_SERVER_IP}, enter the samba account, and the passwd you just set.