Bug 1255002

Summary: Document Swift Storage policy configuration
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: shilpa <smanjara>
Component: DocumentationAssignee: John Wilkins <jowilkin>
Status: CLOSED CURRENTRELEASE QA Contact: ceph-qe-bugs <ceph-qe-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.3.0CC: hnallurv, kdreyer, ngoswami
Target Milestone: rc   
Target Release: 1.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-05 22:55:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description shilpa 2015-08-19 12:14:47 UTC
Description of problem:
It would be nice to have Storage policy configuration explained in the document.

Version-Release number of selected component (if applicable):
ceph 1.3.0

Here are the steps I followed and it worked for me.

1. Create a new pool ".rgw.buckets.special" with desired options for example: pool customized with erasure-coding, a particular CRUSH ruleset, number of replicas, pg num, pgp num 

2. Configure placement_targets in region and zone maps:

a. #radosgw-admin region get > region.json

Add an entry “special-placement” under placement_target

{
 "name": "default",
 "api_name": "",
 "is_master": "true",
 "endpoints": [],
 "hostnames": [],
 "master_zone": "",
 "zones": [
 {
 "name": "default",
 "endpoints": [],
 "log_meta": "false",
 "log_data": "false",
 "bucket_index_max_shards": 5
 }
 ],
 "placement_targets": [
 {
 "name": "default-placement",
 "tags": []
 },
 {
 "name": "special-placement",
 "tags": []
 }
 ],
 "default_placement": "default-placement"
}


b. #radosgw-admin region set < region.json

5. Edit the zone file and add the new placement policy key under placement_pool.

a. #radosgw-admin zone get > zone.json

{
 "domain_root": ".rgw",
 "control_pool": ".rgw.control",
 "gc_pool": ".rgw.gc",
 "log_pool": ".log",
 "intent_log_pool": ".intent-log",
 "usage_log_pool": ".usage",
 "user_keys_pool": ".users",
 "user_email_pool": ".users.email",
 "user_swift_pool": ".users.swift",
 "user_uid_pool": ".users.uid",
 "system_key": {
 "access_key": "",
 "secret_key": ""
 },
 "placement_pools": [
 {
 "key": "default-placement",
 "val": {
 "index_pool": ".rgw.buckets.index",
 "data_pool": ".rgw.buckets",
 "data_extra_pool": ".rgw.buckets.extra"
 }
 },
 {
 "key": "special-placement",
 "val": {
 "index_pool": ".rgw.buckets.index",
 "data_pool": ".rgw.buckets.special",
 "data_extra_pool": ".rgw.buckets.extra"
 }
 }
 ]
}

b. Set the new zone configuration

#radosgw-admin zone set < zone.json


6. Update the region map.

#radosgw-admin regionmap update

“special-placement” should be listed as a placement_target.

7. Now restart the radosgw service.

#/etc/init.d/radosgw restart


Usage example:

#curl -i http://10.0.0.1/swift/v1/TestContainer/file.txt -X PUT -H "X-Storage-Policy: special-placement" -H "X-Auth-Token: AUTH_rgwtxxxxxx"
HTTP/1.1 201 Created
etag: d41d8cd98f00b204e9800998ecf8427e
Last-Modified: Mon, 27 Jul 2015 11:34:39 GMT
Content-type: text/plain; charset=utf-8
Content-Length: 0

Comment 3 shilpa 2015-09-23 07:10:19 UTC
Verified the doc