Project

General

Profile

Feature #45965

Feature #39478: mgr/dashboard: new RGW workflows & RGW enhancements

mgr/dashboard: Display users current quota usage

Added by Lenz Grimmer over 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Component - RGW
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
pacific
Reviewed:
Affected Versions:
Pull request ID:

Description

As a follow-up to #45011 it would probably make sense to show a user's quota in the data table in a similar fashion.

Currently, that information is somewhat hidden in the details when clicking the user's table row.

Having the quota information included in the toplevel data table would make it possible to search and sort the user list for these values.


Related issues

Related to Dashboard - Feature #45011: mgr/dashboard: Display users current bucket quota usage Resolved
Copied to Dashboard - Backport #49944: pacific: mgr/dashboard: Display users current quota usage Resolved

History

#1 Updated by Lenz Grimmer over 3 years ago

  • Related to Feature #45011: mgr/dashboard: Display users current bucket quota usage added

#2 Updated by Avan Thakkar over 3 years ago

  • Status changed from New to In Progress
  • Assignee set to Avan Thakkar
  • Backport set to octopus
  • Pull request ID set to 36402

#3 Updated by Volker Theile over 3 years ago

Are you missing that information? https://github.com/ceph/ceph/blob/master/src/rgw/rgw_user.cc#L413

  op_type_to_str(info.op_mask, buf, sizeof(buf));
  encode_json("op_mask", (const char *)buf, f);
  encode_json("system", (bool)info.system, f);
  encode_json("admin", (bool)info.admin, f);
  encode_json("default_placement", info.default_placement.name, f);
  encode_json("default_storage_class", info.default_placement.storage_class, f);
  encode_json("placement_tags", info.placement_tags, f);
  encode_json("bucket_quota", info.bucket_quota, f);
  encode_json("user_quota", info.user_quota, f);
  encode_json("temp_url_keys", info.temp_url_keys, f);

I'm wondering because that information is returned by the Admin OPS API, see https://github.com/ceph/ceph/blob/master/src/rgw/rgw_rest_user.cc#L91.

#4 Updated by Avan Thakkar over 3 years ago

Volker Theile wrote:

Are you missing that information? https://github.com/ceph/ceph/blob/master/src/rgw/rgw_user.cc#L413

[...]

I'm wondering because that information is returned by the Admin OPS API, see https://github.com/ceph/ceph/blob/master/src/rgw/rgw_rest_user.cc#L91.

The user_quota contains
"user_quota": {
"enabled": false,
"check_on_raw": false,
"max_size": -1,
"max_size_kb": 0,
"max_objects": -1
}
which is not enough information to calculate the usage.
Additional information required: {
"stats": {
"size": 0,
"size_actual": 0,
"size_utilized": 0,
"size_kb": 0,
"size_kb_actual": 0,
"size_kb_utilized": 0,
"num_objects": 0
}
which we get from CLI using "radosgw-admin user stats --uid=<uid>" command, which I don't think Admin OPS API is returning (atleast not for rgw-user)

#5 Updated by Avan Thakkar about 3 years ago

  • Assignee deleted (Avan Thakkar)
  • Pull request ID deleted (36402)

#6 Updated by Avan Thakkar about 3 years ago

  • Status changed from In Progress to Need More Info

#7 Updated by Avan Thakkar over 2 years ago

Upon further investigation: The RGW-users usage info is not exposed in RGW Admin ops API. I can see CLI command for user stats `radosgw-admin user stats --uid=<uid>` , but this isn't exposed in any of existing RGW-users API or as a seperate endpoint. Also I tried

$ curl -kX GET "https://localhost:11000/api/rgw/user?stats=true" -H  "accept: application/vnd.ceph.api.v1.0+json" -H  "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJjZXBoLWRhc2hib2FyZCIsImp0aSI6IjcxMzViZGU1LTk1Y2MtNDcyMC1hNTAxLWQzY2E5NDNiZTU2YiIsImV4cCI6MTYxNDc4Mjg1OSwiaWF0IjoxNjE0NzU0MDU5LCJ1c2VybmFtZSI6ImFkbWluIn0.WTwnXFvcmssar-nwhtfDHdE4ES5nn8SLXuGSZdQYUjg" 

{"status": "500 Internal Server Error", "detail": "The server encountered an unexpected condition which prevented it from fulfilling the request.", "request_id": "662e60ad-6f87-4486-8c15-5d990fe53a00"}

But it seems like this only works for buckets but not users. So I think maybe RGw team needs to expose this as a API.
Required payload for API: https://tracker.ceph.com/issues/45965#note-4
Or am I missing something here? @Casey Bodley thoughts?

#8 Updated by Casey Bodley over 2 years ago

the radosgw /admin/user api supports a ?stats param for this

#9 Updated by Alfonso Martínez over 2 years ago

Also I saw that apart from the one that Casey pointed out:
GET /admin/user?stats=true&uid=<user-id>

It seems this endpoints also provides needed info:
GET /admin/metadata/user?key=<user-id>

#10 Updated by Avan Thakkar over 2 years ago

  • Status changed from Need More Info to Fix Under Review
  • Pull request ID set to 36402

#11 Updated by Ernesto Puerta over 2 years ago

  • Backport changed from octopus to pacific

#12 Updated by Ernesto Puerta over 2 years ago

  • Status changed from Fix Under Review to Pending Backport

#13 Updated by Backport Bot over 2 years ago

  • Copied to Backport #49944: pacific: mgr/dashboard: Display users current quota usage added

#14 Updated by Ernesto Puerta over 2 years ago

  • Status changed from Pending Backport to Resolved

#15 Updated by Ernesto Puerta over 2 years ago

  • Project changed from mgr to Dashboard
  • Category changed from 143 to Component - RGW

Also available in: Atom PDF