Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgr/dashboard_v2: Pool controller #20823

Merged
merged 3 commits into from Mar 12, 2018
Merged

Conversation

rjfd
Copy link
Contributor

@rjfd rjfd commented Mar 9, 2018

This PR implements the pool controller that can be used to retrive OSD pools info.

Two endpoints are enabled by this controller: /api/pool and /api/pool/<pool_name>

The endpoints support two parameters:

  • attrs: comma separated list of pool info attributes (to filter which attributes should be returned)
  • stats: boolean (to include pools stats in the response)

Example:

curl -H "Content-Type: application/json" -X GET  http://localhost:43216/api/pool/cephfs_metadata_a\?stats\=true\&attrs\=type,stats | jq

{
  "stats": {
    "quota_objects": {
      "series": [
        [
          1520614275.325569,
          0
        ]
      ],
      "rate": 0,
      "latest": 0
    },
    "bytes_used": {
      "series": [
        [
          1520614275.325569,
          2246
        ]
      ],
      "rate": 0,
      "latest": 2246
    },
    "max_avail": {
      "series": [
        [
          1520614275.325569,
          9554860032
        ]
      ],
      "rate": 0,
      "latest": 9554860032
    },
    # ...
  },
  "type": "replicated",
  "pool_name": "cephfs_metadata_a"
}

Signed-off-by: Ricardo Dias rdias@suse.com

Signed-off-by: Ricardo Dias <rdias@suse.com>
@rjfd
Copy link
Contributor Author

rjfd commented Mar 12, 2018

@sebastian-philipp
Copy link
Contributor

sebastian-philipp commented Mar 12, 2018

This is quite incomplete. We're missing info that we right now display in oA

@rjfd
Copy link
Contributor Author

rjfd commented Mar 12, 2018

@sebastian-philipp could you be more specific?

I don't know what missing information you are talking about, but the current information returned is enough for what dashboard is showing in the frontend, and addresses the requirements for the RBD management feature.
If future frontend features require information that is missing from this controller, then they just need to add it.

@sebastian-philipp
Copy link
Contributor

sebastian-philipp commented Mar 12, 2018

I don't know what missing information you are talking about

When looking at http://demo.openattic.org/openattic/ we're missing

  • erasure_code_profile
  • application_metadata
  • pg_num
  • size
  • type
  • crush_ruleset
  • compression_mode

the current information returned is enough for what dashboard is showing in the frontend, and will require for the RBD management feature.

Exactly. But not for replacing the Pool view.

If future frontend features require information that is missing from this controller, then they just need to
add it.

+1

@LenzGr
Copy link
Contributor

LenzGr commented Mar 12, 2018

I think it's fine to get this initial implementation ready for merging, so the basic infrastructure and code path is in place. Afterwards, let's look into adding the missing information that gets us in par with the functionality provided by openATTIC.

@ricardoasmarques
Copy link
Contributor

I agree with @LenzGr.

This PR provides the necessary information to implement the RBD form, Pool form will be done latter.

@rjfd
Copy link
Contributor Author

rjfd commented Mar 12, 2018

@sebastian-philipp

we're missing erasure_code_profile

Actually the information returned in this implementation also returns the erasure_code_profile:

Example of output for an erasure-code pool:

$ curl -H "Content-Type: application/json" -X GET  http://localhost:43247/api/pool/rbd_ec | jq
{
  "cache_target_full_ratio_micro": 800000,
  "fast_read": false,
  "stripe_width": 8192,
  "flags_names": "hashpspool,ec_overwrites",
  "tier_of": -1,
  "hit_set_grade_decay_rate": 0,
  "pg_placement_num": 10,
  "use_gmt_hitset": true,
  "last_force_op_resend_preluminous": "0",
  "quota_max_bytes": 0,
  "erasure_code_profile": "default",
  "expected_num_objects": 0,
  "size": 3,
  "snap_seq": 0,
  "auid": 0,
  "cache_min_flush_age": 0,
  "hit_set_period": 0,
  "min_read_recency_for_promote": 0,
  "target_max_objects": 0,
  "pg_num": 10,
  "type": 3,
  "grade_table": [],
  "pool_name": "rbd_ec",
  "cache_min_evict_age": 0,
  "snap_mode": "selfmanaged",
  "cache_mode": "none",
  "min_size": 3,
  "cache_target_dirty_high_ratio_micro": 600000,
  "object_hash": 2,
  "application_metadata": {
    "rbd": {}
  },
  "write_tier": -1,
  "cache_target_dirty_ratio_micro": 400000,
  "pool": 14,
  "removed_snaps": "[]",
  "crush_rule": 1,
  "tiers": [],
  "hit_set_params": {
    "type": "none"
  },
  "last_force_op_resend": "0",
  "pool_snaps": [],
  "quota_max_objects": 0,
  "options": {},
  "hit_set_count": 0,
  "flags": 5,
  "target_max_bytes": 0,
  "snap_epoch": 0,
  "hit_set_search_last_n": 0,
  "last_change": "72",
  "min_write_recency_for_promote": 0,
  "read_tier": -1
}

Exactly. But not for replacing the Pool view.

The purpose of this PR is not a replacement of the oA Pool view, but rather to add the infrastructure for dashboard future features.

Copy link
Contributor

@ricardoasmarques ricardoasmarques left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is working well when integrated with the RBD form that I'm working on.


@ApiController('pool')
@AuthRequired()
class PoolController(RESTController):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either s/PoolController/Pool/ or we should add the Controller postfix to all controllers.

res['pool_name'] = pool['pool_name']
return res

@classmethod
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staticmethod? You don't use cls here.

Signed-off-by: Ricardo Dias <rdias@suse.com>
@rjfd
Copy link
Contributor Author

rjfd commented Mar 12, 2018

@sebastian-philipp addressed your comments.

@LenzGr LenzGr merged commit 8bd3434 into ceph:master Mar 12, 2018
epuertat pushed a commit to rhcs-dashboard/ceph that referenced this pull request Jul 17, 2018
mgr/dashboard_v2: Pool controller

Reviewed-by: Ricardo Marques <rimarques@suse.com>
Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit 8bd3434)
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants