Re: [ceph-users] change radosgw object owner

2018-03-08 Thread Ryan Leimenstoll
Hi Robin, 

Thanks for the pointer! My one concern though is that it didn’t seem to update 
the original object owner’s quota however, which is a bit of a sticking point. 
Is this expected (and is there a workaround)? I will admit to being a bit naive 
to how radosgw’s quota system works under the hood. 

Thanks,
Ryan

> On Mar 6, 2018, at 2:54 PM, Robin H. Johnson  wrote:
> 
> On Tue, Mar 06, 2018 at 02:40:11PM -0500, Ryan Leimenstoll wrote:
>> Hi all, 
>> 
>> We are trying to move a bucket in radosgw from one user to another in an 
>> effort both change ownership and attribute the storage usage of the data to 
>> the receiving user’s quota. 
>> 
>> I have unlinked the bucket and linked it to the new user using: 
>> 
>> radosgw-admin bucket unlink —bucket=$MYBUCKET —uid=$USER
>> radosgw-admin bucket link —bucket=$MYBUCKET —bucket-id=$BUCKET_ID 
>> —uid=$NEWUSER
>> 
>> However, perhaps as expected, the owner of all the objects in the
>> bucket remain as $USER. I don’t believe changing the owner is a
>> supported operation from the S3 protocol, however it would be very
>> helpful to have the ability to do this on the radosgw backend. This is
>> especially useful for large buckets/datasets where copying the objects
>> out and into radosgw could be time consuming.
> At the raw radosgw-admin level, you should be able to do it with
> bi-list/bi-get/bi-put. The downside here is that I don't think the BI ops are
> exposed in the HTTP Admin API, so it's going to be really expensive to chown
> lots of objects.
> 
> Using a quick example:
> # radosgw-admin \
>  --uid UID-CENSORED \
>  --bucket BUCKET-CENSORED \
>  bi get \
>  --object=OBJECTNAME-CENSORED
> {
>"type": "plain",
>"idx": "OBJECTNAME-CENSORED",
>"entry": {
>"name": "OBJECTNAME-CENSORED",
>"instance": "",
>"ver": {
>"pool": 5,
>"epoch": 266028
>},
>"locator": "",
>"exists": "true",
>"meta": {
>"category": 1,
>"size": 1066,
>"mtime": "2016-11-17 17:01:29.668746Z",
>"etag": "e7a75c39df3d123c716d5351059ad2d9",
>"owner": "UID-CENSORED",
>"owner_display_name": "UID-CENSORED",
>"content_type": "image/png",
>"accounted_size": 1066,
>"user_data": ""
>},
>"tag": "default.293024600.1188196",
>"flags": 0,
>"pending_map": [],
>"versioned_epoch": 0
>}
> }
> 
> -- 
> Robin Hugh Johnson
> Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
> E-Mail   : robb...@gentoo.org
> GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
> GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136
> ___
> ceph-users mailing list
> ceph-users@lists.ceph.com
> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com


Re: [ceph-users] change radosgw object owner

2018-03-06 Thread Yehuda Sadeh-Weinraub
On Tue, Mar 6, 2018 at 11:40 AM, Ryan Leimenstoll
 wrote:
> Hi all,
>
> We are trying to move a bucket in radosgw from one user to another in an 
> effort both change ownership and attribute the storage usage of the data to 
> the receiving user’s quota.
>
> I have unlinked the bucket and linked it to the new user using:
>
> radosgw-admin bucket unlink —bucket=$MYBUCKET —uid=$USER
> radosgw-admin bucket link —bucket=$MYBUCKET —bucket-id=$BUCKET_ID 
> —uid=$NEWUSER
>
> However, perhaps as expected, the owner of all the objects in the bucket 
> remain as $USER. I don’t believe changing the owner is a supported operation 
> from the S3 protocol, however it would be very helpful to have the ability to 
> do this on the radosgw backend. This is especially useful for large 
> buckets/datasets where copying the objects out and into radosgw could be time 
> consuming.
>
>  Is this something that is currently possible within radosgw? We are running 
> Ceph 12.2.2.

Maybe try to copy objects into themselves with the new owner (as long
as it can read it, if not then you first need to change the objects'
acls to allow read)? Note that you need to do a copy that would retain
the old meta attributes of the old object.

Yehuda

>
> Thanks,
> Ryan Leimenstoll
> rleim...@umiacs.umd.edu
> University of Maryland Institute for Advanced Computer Studies
> ___
> ceph-users mailing list
> ceph-users@lists.ceph.com
> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com


Re: [ceph-users] change radosgw object owner

2018-03-06 Thread Robin H. Johnson
On Tue, Mar 06, 2018 at 02:40:11PM -0500, Ryan Leimenstoll wrote:
> Hi all, 
> 
> We are trying to move a bucket in radosgw from one user to another in an 
> effort both change ownership and attribute the storage usage of the data to 
> the receiving user’s quota. 
> 
> I have unlinked the bucket and linked it to the new user using: 
> 
> radosgw-admin bucket unlink —bucket=$MYBUCKET —uid=$USER
> radosgw-admin bucket link —bucket=$MYBUCKET —bucket-id=$BUCKET_ID 
> —uid=$NEWUSER
> 
> However, perhaps as expected, the owner of all the objects in the
> bucket remain as $USER. I don’t believe changing the owner is a
> supported operation from the S3 protocol, however it would be very
> helpful to have the ability to do this on the radosgw backend. This is
> especially useful for large buckets/datasets where copying the objects
> out and into radosgw could be time consuming.
At the raw radosgw-admin level, you should be able to do it with
bi-list/bi-get/bi-put. The downside here is that I don't think the BI ops are
exposed in the HTTP Admin API, so it's going to be really expensive to chown
lots of objects.

Using a quick example:
# radosgw-admin \
  --uid UID-CENSORED \
  --bucket BUCKET-CENSORED \
  bi get \
  --object=OBJECTNAME-CENSORED
{
"type": "plain",
"idx": "OBJECTNAME-CENSORED",
"entry": {
"name": "OBJECTNAME-CENSORED",
"instance": "",
"ver": {
"pool": 5,
"epoch": 266028
},
"locator": "",
"exists": "true",
"meta": {
"category": 1,
"size": 1066,
"mtime": "2016-11-17 17:01:29.668746Z",
"etag": "e7a75c39df3d123c716d5351059ad2d9",
"owner": "UID-CENSORED",
"owner_display_name": "UID-CENSORED",
"content_type": "image/png",
"accounted_size": 1066,
"user_data": ""
},
"tag": "default.293024600.1188196",
"flags": 0,
"pending_map": [],
"versioned_epoch": 0
}
}

-- 
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
E-Mail   : robb...@gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136


signature.asc
Description: Digital signature
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com