A common customers requirement is to test Object Storage on Ceph (SES).
This is possible with Ceph Object Gateway which provides two interfaces:

  • Amazon S3 RESTful API
  • OpenStack Swfit API

In this lab we will focused on OpenStack Swfit API
In SES3, this is very easy using ceph-deploy

Install the new node

We will use a node with hostname: radosgw01, install Ceph packages and push the admin keys:

$ ceph-deploy install radosgw01
$ ceph-deploy admin radosgw01

Install Ceph RADOS Gateway

$ ceph-deploy --overwrite-conf rgw create radosgw01:rgw.rdgw01

Verify:

cephadm@sesadm:~/ses3> ceph-deploy rgw list
[ceph_deploy.conf][DEBUG ] found configuration file at: /home/cephadm/.cephdeploy.conf
[ceph_deploy.cli][INFO  ] Invoked (1.5.32): /usr/bin/ceph-deploy rgw list
[ceph_deploy.cli][INFO  ] ceph-deploy options:
[ceph_deploy.cli][INFO  ]  username                      : None
[ceph_deploy.cli][INFO  ]  verbose                       : False
[ceph_deploy.cli][INFO  ]  overwrite_conf                : False
[ceph_deploy.cli][INFO  ]  subcommand                    : list
[ceph_deploy.cli][INFO  ]  quiet                         : False
[ceph_deploy.cli][INFO  ]  cd_conf                       : <ceph_deploy.conf.cephdeploy.Conf instance at 0x7faeea97f2d8>
[ceph_deploy.cli][INFO  ]  cluster                       : ceph
[ceph_deploy.cli][INFO  ]  func                          : <function rgw at 0x7faeeadb1f50>
[ceph_deploy.cli][INFO  ]  ceph_conf                     : None
[ceph_deploy.cli][INFO  ]  default_release               : False
radosgw01:rgw.rdgw01
cephadm@sesadm:~/ses3>

Also verify on the node is the radosgw is running

cephadm@radosgw01:~> ps -fea | grep rados | grep -v grep
ceph      1899     1  2 23:46 ?        00:00:00 /usr/bin/radosgw -f --cluster ceph --name client.rgw.rdgw01 --setuser ceph --setgroup ceph
cephadm@radosgw01:~>

Create the Swift user

cephadm@radosgw01:~> sudo radosgw-admin user create --uid=nublado --display-name="Nubla.do Labs" --email="tester@nubla.do"
{
    "user_id": "nublado",
    "display_name": "Nubla.do Labs",
    "email": "tester@nubla.do",
    "suspended": 0,
    "max_buckets": 1000,
    "auid": 0,
    "subusers": [],
    "keys": [
        {
            "user": "nublado",
            "access_key": "AN1HMBYS34Y89AYE86Z9",
            "secret_key": "TC6tXAiY0aSlywHoDqi81gU5QIdXFelruDg0yKra"
        }
    ],
    "swift_keys": [],
    "caps": [],
    "op_mask": "read, write, delete",
    "default_placement": "",
    "placement_tags": [],
    "bucket_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "user_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "temp_url_keys": []
}

cephadm@radosgw01:~>
cephadm@radosgw01:~> sudo radosgw-admin subuser create --uid=nublado --subuser=nublado:swift --access=full
{
    "user_id": "nublado",
    "display_name": "Nubla.do Labs",
    "email": "tester@nubla.do",
    "suspended": 0,
    "max_buckets": 1000,
    "auid": 0,
    "subusers": [
        {
            "id": "nublado:swift",
            "permissions": "full-control"
        }
    ],
    "keys": [
        {
            "user": "nublado",
            "access_key": "AN1HMBYS34Y89AYE86Z9",
            "secret_key": "TC6tXAiY0aSlywHoDqi81gU5QIdXFelruDg0yKra"
        }
    ],
    "swift_keys": [
        {
            "user": "nublado:swift",
            "secret_key": "xx3s47NlgIq1p2Y3zMrk0sYy0lhVVMvVP1UWOtKc"
        }
    ],
    "caps": [],
    "op_mask": "read, write, delete",
    "default_placement": "",
    "placement_tags": [],
    "bucket_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "user_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "temp_url_keys": []
}

cephadm@radosgw01:~>
cephadm@radosgw01:~> sudo radosgw-admin key create --gen-secret --subuser=nublado:swift --key-type=swift
{
    "user_id": "nublado",
    "display_name": "Nubla.do Labs",
    "email": "tester@nubla.do",
    "suspended": 0,
    "max_buckets": 1000,
    "auid": 0,
    "subusers": [
        {
            "id": "nublado:swift",
            "permissions": "full-control"
        }
    ],
    "keys": [
        {
            "user": "nublado",
            "access_key": "AN1HMBYS34Y89AYE86Z9",
            "secret_key": "TC6tXAiY0aSlywHoDqi81gU5QIdXFelruDg0yKra"
        }
    ],
    "swift_keys": [
        {
            "user": "nublado:swift",
            "secret_key": "U73Dx3xZrcpP2cXYLCfgx21jfOuzOiGOBzPcLq1l"
        }
    ],
    "caps": [],
    "op_mask": "read, write, delete",
    "default_placement": "",
    "placement_tags": [],
    "bucket_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "user_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "temp_url_keys": []
}

cephadm@radosgw01:~>

Put attention on the last output, specifically in this part:

"swift_keys": [
        {
            "user": "nublado:swift",
            "secret_key": "U73Dx3xZrcpP2cXYLCfgx21jfOuzOiGOBzPcLq1l"
        }
    ],

Those will be our credentials.

Test the service

Install on some client (the admin node, for this lab) the Swift client:

# zypper in python-swiftclient

sesadm:~ # swift -A http://radosgw01:7480/auth/1.0 -U nublado:swift -K 'U73Dx3xZrcpP2cXYLCfgx21jfOuzOiGOBzPcLq1l' stat
                    Account: v1
                 Containers: 0
                    Objects: 0
                      Bytes: 0
                X-Timestamp: 1470027862.48641
X-Account-Bytes-Used-Actual: 0
                 X-Trans-Id: tx000000000000000000002-00579ed856-1035-default
               Content-Type: text/plain; charset=utf-8
              Accept-Ranges: bytes
sesadm:~ #

Voil√°

Check the full documentation of python-swiftclient for more examples:
http://docs.openstack.org/developer/python-swiftclient/

And also read the full documentation of SUSE for this deploy:
https://www.suse.com/documentation/ses-3/book_storage_admin/data/cha_ceph_gw.html

Easy, right?

Billy Vera © 2017. All Rights Reserved.

The opinions expressed in this blog are purely my own and are not in any way endorsed by my employer.

Proudly published with Ghost using Ghostium Theme