User Tools

Site Tools


ceph:create_bucket

Creating buckets for Object Storage Gateway

Documentation
Name: Creating buckets for Object Storage Gateway
Description: How to create a bucket owned by a user for the ceph object storage gateway
Modification date :24/10/2018
Owner:dodger@ciberterminal.net
Notify changes to:Owner
Tags: ceph, object storage

PRE-requisites

Instructions

  1. Access salt-master
  2. Go to s3_wrapper plugin path: /home/bofher/scripts/ceph
  3. You must fill the access_key and secret_key in the pycfg file.
  4. Create the bucket with s3_wrapper:
python s3_wrapper_v3.py --createbucket newbucket

OLD Instructions

radosgw-admin does not provide any method to create a bucket with it…
So is necessary to use the API.
I've written a very simple python script to create the bucket:

create_bucket.py
import boto.s3.connection
access_key = 'THEACCESSKEY'
secret_key = 'THESECRETKEY'
 
conn = boto.connect_s3(
        aws_access_key_id=access_key,
        aws_secret_access_key=secret_key,
        host='THE_OSGW_NODE', port=80,
        is_secure=False, calling_format=boto.s3.connection.OrdinaryCallingFormat(),
       )
 
bucket = conn.create_bucket('BUCKET_NAME')
for bucket in conn.get_all_buckets():
    print(bucket.name)
    print(bucket.creation_date)

Replace the variables:

  • THEACCESSKEY
  • THESECRETKEY
  • THE_OSGW_NODE
  • BUCKET_NAME
ceph/create_bucket.txt · Last modified: 2019/07/18 09:17 (external edit)