Code Monkey home page Code Monkey logo

ceph-iscsi-cli's Introduction

ceph-iscsi-cli installs a targetcli-like interface to allow multiple ceph/iscsi
gateways to be managed from a single interface. The CLI interfaces with the API
exposed in the rbd-target-gw daemon running on each gateway.

Here's an example of the shell interface the gwcli tool provides;

/> ls
o- / .................................................................................. [...]
  o- clusters ................................................................. [Clusters: 1]
  | o- ceph ..................................................................... [HEALTH_OK]
  |   o- pools ................................................................... [Pools: 3]
  |   | o- ec ........................................ [(2+1), Commit: 0b/40G (0%), Used: 0b]
  |   | o- iscsi ..................................... [(x3), Commit: 0b/20G (0%), Used: 18b]
  |   | o- rbd ....................................... [(x3), Commit: 8G/20G (40%), Used: 5K]
  |   o- topology ......................................................... [OSDs: 3,MONs: 3]
  o- disks ................................................................... [8G, Disks: 5]
  | o- rbd.disk_1 ............................................................. [disk_1 (1G)]
  | o- rbd.disk_2 ............................................................. [disk_2 (2G)]
  | o- rbd.disk_3 ............................................................. [disk_3 (2G)]
  | o- rbd.disk_4 ............................................................. [disk_4 (1G)]
  | o- rbd.disk_5 ............................................................. [disk_5 (2G)]
  o- iscsi-target .............................................................. [Targets: 1]
    o- iqn.2003-01.com.redhat.iscsi-gw:ceph-gw ................................ [Gateways: 2]
      o- gateways ..................................................... [Up: 2/2, Portals: 2]
      | o- rh7-gw1 .................................................... [192.168.122.69 (UP)]
      | o- rh7-gw2 ................................................... [192.168.122.104 (UP)]
      o- hosts ................................................................... [Hosts: 2]
        o- iqn.1994-05.com.redhat:myhost1 ........................ [Auth: None, Disks: 1(1G)]
        | o- lun 0 ......................................... [rbd.disk_1(1G), Owner: rh7-gw2]
        o- iqn.1994-05.com.redhat:rh7-client .......... [LOGGED-IN, Auth: CHAP, Disks: 1(2G)]
          o- lun 0 ......................................... [rbd.disk_5(2G), Owner: rh7-gw2]


The rbd-target-api daemon utilises the flask's internal development server to
provide the REST api. It is normally not used in a production context, but
given this specific use case it provides a simple way to provide an admin
interface - at least for the first release!

The API has been tested with Firefox RESTclient add-on with https (based on a common
self-signed certificate). With the certificate in place on each gateway you can
add basic auth credentials to match the local api configuration in the RESTclient
and use the client as follows;

Add a Header content type for application/x-www-form-urlencoded
METHOD: PUT        URL: https://192.168.122.69:5001/api/gateway/rh7-gw1
select the urlencoded content type and the basic auth credentials
add the required variables to the body section in the client ui
  eg. ip_address=192.168.122.69
Click 'SEND'


Curl Examples
If the UI is not your thing, curl probably is! Here's an example of using
curl to create a gateway node.

curl --insecure --user admin:admin -d "ip_address=192.168.122.104" \
     -X PUT https://192.168.122.69:5001/api/gateway/rh7-gw2


## Installation
### Via RPM
Simply install the provided rpm with
```rpm -ivh ceph-iscsi-cli-<ver>.el7.noarch.rpm```

### Manually

The following packages are required by ceph-iscsi-cli and must be
installed before starting the rbd-target-api service:

python-rtslib
ceph-iscsi-config
python-requests
python-configshell
python-flask
pyOpenSSL

To install the python package that provides the application logic, run the provided setup.py script
i.e. ```> python setup.py install```

For the management daemon (rbd-target-api), simply copy the following files into their equivalent places on each gateway
- <archive_root>/usr/lib/systemd/system/rbd-target-api.service  --> /lib/systemd/system
- <archive_root>/usr/bin/rbd-target-api--> /usr/bin

## Configuration

Once the package is in installed, the Ceph ceph-iscsi-cli instructions found
here:

http://docs.ceph.com/docs/master/rbd/iscsi-target-cli/

can be used to create a iscsi-gateway.cfg and create a target.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.