|45 Drives Knowledge Base
||KB450229 - Setup and configuration of iSCSI gateways on Ceph cluster
This guide will explain how to set up and configure iSCSI gateways to serve out RBD's on your Ceph cluster. The prerequisites are important because we manage our own Ceph-iSCSI repository that is needed to ensure smooth deployment using this guide.
The hosts file can be found in /etc/ansible/hosts or if you have a symlink to /usr/share/ceph-ansible/hosts you can edit it from there.
add to your hosts file and underneath add either the FQDN of your iSCSI gateways if you have DNS records or hosts files set up, or just use the IP addresses for the iSCSI gateways if DNS records/hosts are not configured.
It will look similar to this
# ansible-playbook iscsi.yml
# ansible-playbook dashboard.yml
First log in either physically or through SSH to the first gateway. Once in the terminal, run the command gwcli then add this machine to the gateways list. By hostname and IP address. Once this is complete, do this exact process again physically from the other gateways remaining that were added.
NOTE 1: It is necessary that these commands are run individually from the respective physical terminals of each gateway. Once this is complete, all remaining configuration can be done via the dashboard.
NOTE 2: After running gwcli, once you type cd to move to the iscsi target directory, if you do not see an iscsi target as a path, you may have to exit gwcli, log into the dashboard, goto BLOCK, then ISCSI, then targets. If you do not see a IQN name under targets such as iqn.2001-07.com.ceph:1586801147283, you will have to click CREATE. It will make a pre-defined target name. Click the red CreateTarget button. It may fail, but it will now be accessible in gwcli and you can continue with the next steps.
remove < > brackets when inputting any commands
# gwcli Warning: Could not load preferences file /root/.gwcli/prefs.bin. > cd / iscsi-targets/iqn.2001-07.*************/gateways /iscsi-target...7283/gateways> create <Hostname> AND <IP-address-of-ISCSI-host> EXAMPLE /iscsi-target...7283/gateways> create iscsi1 192.168.2.10 Adding gateway, sync'ing 0 disk(s) and 0 client(s) ok /iscsi-target...7283/gateways> exit
From the Ceph Dashboard, go to the iSCSI tab from within the Block menu. Once in here, click on Targets sub-menu then click on your newly created iSCSI target and finally, click edit.
From the Edit screen, be sure to add your newly configured Portals. These will remain added once you add them the first time. Then, begin adding all the RBD images you would like to use for your iSCSI target. You will need to add these images here first before you begin to add them to different initiators. Once you add your images, you can then begin adding different initiators you will be connecting with. If you are using CHAP, you may enter the user name and password from here, otherwise if you are using no CHAP you won't add anything here. Finally, you will add specific images to each initiator.