to use the "prompt" directive for better rendering.
Signed-off-by: Kefu Chai <kchai@redhat.com>
#. As ``root``, execute the Ansible playbook:
- ::
+ .. prompt:: bash #
- # cd /usr/share/ceph-ansible
- # ansible-playbook site.yml --limit iscsigws
+ cd /usr/share/ceph-ansible
+ ansible-playbook site.yml --limit iscsigws
.. note::
The Ansible playbook will handle RPM dependencies, setting up daemons,
#. Verify the configuration from an iSCSI gateway node:
- ::
+ .. prompt:: bash #
- # gwcli ls
+ gwcli ls
.. note::
See the `Configuring the iSCSI Target using the Command Line Interface`_
target service during the deployment. Below are the outcomes of when
interacting with the ``rbd-target-api`` Systemd service.
-::
+.. prompt:: bash #
- # systemctl <start|stop|restart|reload> rbd-target-api
+ systemctl <start|stop|restart|reload> rbd-target-api
- ``reload``
A purge operation will fail, if RBD images have snapshots or clones
and are exported through the Ceph iSCSI gateway.
+.. highlight:: console
+
::
[root@rh7-iscsi-client ceph-ansible]# ansible-playbook purge_gateways.yml
In order to install all the packages needed to run iSCSI with Ceph, you need to download them directly from their repository by using Git.
On CentOS/RHEL execute:
-::
+.. prompt:: bash >
- > sudo yum install git
+ sudo yum install git
On Debian/Ubuntu execute:
-::
+.. prompt:: bash >
- > sudo apt install git
+ sudo apt install git
To know more about Git and how it works, please, visit https://git-scm.com
Ceph iSCSI specific requirements are that the following build options must be
enabled:
- ::
+ .. code-block:: ini
CONFIG_TARGET_CORE=m
CONFIG_TCM_USER2=m
Installation:
- ::
+ .. prompt:: bash >
- > git clone https://github.com/open-iscsi/tcmu-runner
- > cd tcmu-runner
+ git clone https://github.com/open-iscsi/tcmu-runner
+ cd tcmu-runner
Run the following command to install all the needed dependencies:
- ::
+ .. prompt:: bash >
- > ./extra/install_dep.sh
+ ./extra/install_dep.sh
Now you can build the tcmu-runner.
To do so, use the following build command:
- ::
+ .. prompt:: bash >
- > cmake -Dwith-glfs=false -Dwith-qcow=false -DSUPPORT_SYSTEMD=ON -DCMAKE_INSTALL_PREFIX=/usr
- > make install
+ cmake -Dwith-glfs=false -Dwith-qcow=false -DSUPPORT_SYSTEMD=ON -DCMAKE_INSTALL_PREFIX=/usr
+ make install
Enable and start the daemon:
- ::
+ .. prompt:: bash >
- > systemctl daemon-reload
- > systemctl enable tcmu-runner
- > systemctl start tcmu-runner
+ systemctl daemon-reload
+ systemctl enable tcmu-runner
+ systemctl start tcmu-runner
rtslib-fb
Installation:
- ::
+ .. prompt:: bash >
- > git clone https://github.com/open-iscsi/rtslib-fb.git
- > cd rtslib-fb
- > python setup.py install
+ git clone https://github.com/open-iscsi/rtslib-fb.git
+ cd rtslib-fb
+ python setup.py install
configshell-fb
--------------
Installation:
- ::
+ .. prompt:: bash >
- > git clone https://github.com/open-iscsi/configshell-fb.git
- > cd configshell-fb
- > python setup.py install
+ git clone https://github.com/open-iscsi/configshell-fb.git
+ cd configshell-fb
+ python setup.py install
targetcli-fb
------------
Installation:
- ::
+ .. prompt:: bash >
- > git clone https://github.com/open-iscsi/targetcli-fb.git
- > cd targetcli-fb
- > python setup.py install
- > mkdir /etc/target
- > mkdir /var/target
+ git clone https://github.com/open-iscsi/targetcli-fb.git
+ cd targetcli-fb
+ python setup.py install
+ mkdir /etc/target
+ mkdir /var/target
.. warning:: The ceph-iscsi tools assume they are managing all targets
on the system. If targets have been setup and are being managed by
Installation:
- ::
+ .. prompt:: bash >
- > git clone https://github.com/ceph/ceph-iscsi.git
- > cd ceph-iscsi
- > python setup.py install --install-scripts=/usr/bin
- > cp usr/lib/systemd/system/rbd-target-gw.service /lib/systemd/system
- > cp usr/lib/systemd/system/rbd-target-api.service /lib/systemd/system
+ git clone https://github.com/ceph/ceph-iscsi.git
+ cd ceph-iscsi
+ python setup.py install --install-scripts=/usr/bin
+ cp usr/lib/systemd/system/rbd-target-gw.service /lib/systemd/system
+ cp usr/lib/systemd/system/rbd-target-api.service /lib/systemd/system
Enable and start the daemon:
- ::
+ .. prompt:: bash >
- > systemctl daemon-reload
- > systemctl enable rbd-target-gw
- > systemctl start rbd-target-gw
- > systemctl enable rbd-target-api
- > systemctl start rbd-target-api
+ systemctl daemon-reload
+ systemctl enable rbd-target-gw
+ systemctl start rbd-target-gw
+ systemctl enable rbd-target-api
+ systemctl start rbd-target-api
Installation is complete. Proceed to the setup section in the
`main ceph-iscsi CLI page`_.
#. As ``root``, on all iSCSI gateway nodes, install the
``ceph-iscsi`` package:
- ::
+ .. prompt:: bash #
- # yum install ceph-iscsi
+ yum install ceph-iscsi
#. As ``root``, on all iSCSI gateway nodes, install the ``tcmu-runner``
package:
- ::
+ .. prompt:: bash #
- # yum install tcmu-runner
+ yum install tcmu-runner
**Setup:**
like the iSCSI configuration. To check if this pool has been created
run:
- ::
+ .. prompt:: bash #
- # ceph osd lspools
+ ceph osd lspools
If it does not exist instructions for creating pools can be found on the
`RADOS pool operations page
#. As ``root``, on a iSCSI gateway node, create a file named
``iscsi-gateway.cfg`` in the ``/etc/ceph/`` directory:
- ::
+ .. prompt:: bash #
- # touch /etc/ceph/iscsi-gateway.cfg
+ touch /etc/ceph/iscsi-gateway.cfg
#. Edit the ``iscsi-gateway.cfg`` file and add the following lines:
- ::
+ .. code-block:: ini
[config]
# Name of the Ceph storage cluster. A suitable Ceph configuration file allowing
#. As ``root``, on all iSCSI gateway nodes, enable and start the API
service:
- ::
+ .. prompt:: bash #
- # systemctl daemon-reload
+ systemctl daemon-reload
- # systemctl enable rbd-target-gw
- # systemctl start rbd-target-gw
+ systemctl enable rbd-target-gw
+ systemctl start rbd-target-gw
- # systemctl enable rbd-target-api
- # systemctl start rbd-target-api
+ systemctl enable rbd-target-api
+ systemctl start rbd-target-api
**Configuring:**
#. As ``root``, on a iSCSI gateway node, start the iSCSI gateway
command-line interface:
- ::
+ .. prompt:: bash #
- # gwcli
+ gwcli
#. Go to iscsi-targets and create a target with the name
iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw:
- ::
+ .. code-block:: console
> /> cd /iscsi-target
> /iscsi-target> create iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw
same IPs used for management operations listed in trusted_ip_list,
but it is recommended that different IPs are used.
- ::
+ .. code-block:: console
> /iscsi-target> cd iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/gateways
> /iscsi-target...-igw/gateways> create ceph-gw-1 10.172.19.21
the skipchecks=true argument must be used. This will avoid the Red Hat kernel
and rpm checks:
- ::
+ .. code-block:: console
> /iscsi-target> cd iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/gateways
> /iscsi-target...-igw/gateways> create ceph-gw-1 10.172.19.21 skipchecks=true
#. Add a RBD image with the name disk_1 in the pool rbd:
- ::
+ .. code-block:: console
> /iscsi-target...-igw/gateways> cd /disks
> /disks> create pool=rbd image=disk_1 size=90G
#. Create a client with the initiator name iqn.1994-05.com.redhat:rh7-client:
- ::
+ .. code-block:: console
> /disks> cd /iscsi-target/iqn.2003-01.com.redhat.iscsi-gw:iscsi-igw/hosts
> /iscsi-target...eph-igw/hosts> create iqn.1994-05.com.redhat:rh7-client
#. Set the client's CHAP username to myiscsiusername and password to
myiscsipassword:
- ::
+ .. code-block:: console
> /iscsi-target...at:rh7-client> auth username=myiscsiusername password=myiscsipassword
#. Add the disk to the client:
- ::
+ .. code-block:: console
> /iscsi-target...at:rh7-client> disk add rbd/disk_1