]> git.proxmox.com Git - ceph.git/blame - ceph/doc/radosgw/multitenancy.rst
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / doc / radosgw / multitenancy.rst
CommitLineData
7c673cae
FG
1=================
2RGW Multi-tenancy
3=================
4
5.. versionadded:: Jewel
6
7The multi-tenancy feature allows to use buckets and users of the same
8name simultaneously by segregating them under so-called ``tenants``.
9This may be useful, for instance, to permit users of Swift API to
10create buckets with easily conflicting names such as "test" or "trove".
11
12From the Jewel release onward, each user and bucket lies under a tenant.
13For compatibility, a "legacy" tenant with an empty name is provided.
14Whenever a bucket is referred without an explicit tenant, an implicit
15tenant is used, taken from the user performing the operation. Since
16the pre-existing users are under the legacy tenant, they continue
17to create and access buckets as before. The layout of objects in RADOS
18is extended in a compatible way, ensuring a smooth upgrade to Jewel.
19
20Administering Users With Explicit Tenants
21=========================================
22
23Tenants as such do not have any operations on them. They appear and
24and disappear as needed, when users are administered. In order to create,
25modify, and remove users with explicit tenants, either an additional
26option --tenant is supplied, or a syntax "<tenant>$<user>" is used
27in the parameters of the radosgw-admin command.
28
29Examples
30--------
31
32Create a user testx$tester to be accessed with S3::
33
34 # radosgw-admin --tenant testx --uid tester --display-name "Test User" --access_key TESTER --secret test123 user create
35
36Create a user testx$tester to be accessed with Swift::
37
38 # radosgw-admin --tenant testx --uid tester --display-name "Test User" --subuser tester:test --key-type swift --access full user create
39 # radosgw-admin --subuser 'testx$tester:test' --key-type swift --secret test123
40
41Note that the subuser with explicit tenant had to be quoted in the shell.
42
43Accessing Buckets with Explicit Tenants
44=======================================
45
46When a client application accesses buckets, it always operates with
47credentials of a particular user. As mentioned above, every user belongs
48to a tenant. Therefore, every operation has an implicit tenant in its
49context, to be used if no tenant is specified explicitly. Thus a complete
50compatibility is maintained with previous releases, as long as the
51referred buckets and referring user belong to the same tenant.
52In other words, anything unusual occurs when accessing another tenant's
53buckets *only*.
54
55Extensions employed to specify an explicit tenant differ according
56to the protocol and authentication system used.
57
58S3
59--
60
61In case of S3, a colon character is used to separate tenant and bucket.
62Thus a sample URL would be::
63
64 https://ep.host.dom/tenant:bucket
65
66Here's a simple Python sample:
67
68.. code-block:: python
69 :linenos:
70
71 from boto.s3.connection import S3Connection, OrdinaryCallingFormat
72 c = S3Connection(
73 aws_access_key_id="TESTER",
74 aws_secret_access_key="test123",
75 host="ep.host.dom",
76 calling_format = OrdinaryCallingFormat())
77 bucket = c.get_bucket("test5b:testbucket")
78
79Note that it's not possible to supply an explicit tenant using
80a hostname. Hostnames cannot contain colons, or any other separators
81that are not already valid in bucket names. Using a period creates an
82ambiguous syntax. Therefore, the bucket-in-URL-path format has to be
83used.
84
85Swift with built-in authenticator
86---------------------------------
87
88TBD -- not in test_multen.py yet
89
90Swift with Keystone
91-------------------
92
93TBD -- don't forget to explain the function of
94 rgw keystone implicit tenants = true
95 in commit e9259486decab52a362443d3fd3dec33b0ec654f
96
97Notes and known issues
98----------------------
99
100Just to be clear, it is not possible to create buckets in other
101tenants at present. The owner of newly created bucket is extracted
102from authentication information.
103
104This document needs examples of administration of Keystone users.
105The keystone.rst may need to be updated.