Repository navigation
mgr/nfs: NFS commands to enable, disable and get QOS config for cluster and export - #61283
ShwetaBhosale1 wants to merge 1 commit into
Conversation
7efdc68 to
5638aa6
Compare
5638aa6 to
e54c5b6
Compare
f738e59 to
168dda6
Compare
c5aa8a8 to
6e56e2c
Compare
|
jenkins retest this please |
1 similar comment
|
jenkins retest this please |
dc3b4cd to
9d218ea
Compare
|
jenkins test api |
adk3798
left a comment
There was a problem hiding this comment.
There's nothing here that looks like it wouldn't work to me (assuming the way the blocks are being formatted with the QoS parameters the way ganesha is expecting). I have a handful of minor comments below. Beyond that, as a high level thing, I think this might be easier to follow if we tried to convert sets of QoS parameters into the QoS object you created ASAP and then only turn it back into block/dict form at the last second when we have to. When I see things like
if kwargs:
export.qos_block.update_bandwidths(**kwargs)
else:
export.qos_block.update_bandwidths('0', '0', '0', '0', '0', '0')
or
self.update_cluster_qos(cluster_id, True, True, combined_bw_ctrl, qos_type, **kwargs)
and
self.update_cluster_qos(cluster_id, False, False, False)
I can't help but think it would be easier to understand if we passed a QOS object that encapsulates all these parameters rather than passing a bunch of values and having unknown "kwargs" included. On that same note, I'm wondering if we should attach the QOS validation/check functions to the QOS object (and maybe move these new QOS things into their own file given there's a number of them) just to have them in one place. But overall, this seems like it gets the job done.
There was a problem hiding this comment.
unless there's a reason not to, I'd think we want those attributes to be like
per_share = 'PerShare'
so that we could do checks like if <qos-type> == QOSType.per_share. I saw one instance of
if clust_qos_obj.qos_type == QOSType._2:
during review and something like that would be easier to understand with the naming scheme I'm suggesting.
There was a problem hiding this comment.
I have updated it to below as we need to map qos_type to int. Let me know if it looks ok?
class UserQoSType(Enum):
per_share = 'PerShare'
per_client = 'PerClient'
per_share_per_client = 'PerShare_PerClient'
class QOSType(Enum):
PerShare = 1
PerClient = 2
PerShare_PerClient = 3
ba3bb61 to
3456ed0
Compare
66c81bb to
6dd4f5e
Compare
adk3798
left a comment
There was a problem hiding this comment.
LGTM assuming the blocks being written match what ganesha is expecting. Will have to see once a version is released we can test with
…er and export fixes: https://tracker.ceph.com/issues/69458 Signed-off-by: Shweta Bhosale <[email protected]>
6dd4f5e to
2a0875e
Compare
|
jenkins test api |
|
jenkins test make check arm64 |
|
jenkins test api |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
|
Closing this PR as this commit is already there in PR: #61826 |
NFS commands to enable, disable and get QOS ratelimiting config for cluster and export
fixes: https://tracker.ceph.com/issues/69458
Signed-off-by: Shweta Bhosale [email protected]
Cluster commands:
The cluster level QOS config will get store in RADOS object 'qosconf-nfs' in cluster namespace. And this object URL will be added in 'conf-nfs'. At the time of NFS cluster creation, the qos block will not present, It will get added when the qos enabled command is run for first time. Enable and disable commands will restart NFS cluster.
Below is the example of qos block:
when enabled
when disabled
For enable command:
1. If combined bandwith control is disabled
a. If qos_type is pershare, then export_writebw and export_readbw parameters are compulsory
b. If qos_type is perclient, then client_writebw and client_readbw parameters are compulsory
c. If qos_type is pershare_perclient then export_writebw, export_readbw, client_writebw and
client_readbw are compulsory parameters
2. If combined bandwidth control is enabled
a. If qos_type is pershare, then export_rw_bw parameter is compulsory
b. If qos_type is perclient, then client_rw_bw parameter is compulsory
c. If qos_type is pershare_perclient, then export_rw_bw and client_rw_bw parameters are compulsory
we are accepting bandwidths in human readable format and storing after converting to bytes. Also for qos_type, we are accepting string, but storing as int. Get qos will show human readable format.
nfs cluster qos enable bandwidth_control <cluster_id> <qos_type:PerShare|PerClient|PerShare_PerClient> [--combined-rw-bw-ctrl] [--max_export_write_bw ] [--max_export_read_bw ] [--max_client_write_bw ] [--max_client_read_bw ] [--max_export_combined_bw ] [--max_client_combined_bw ] [--format ]
nfs cluster qos disable bandwidth_control <cluster_id>
nfs cluster qos get <cluster_id> [--format ]
Export commands
When export is created, there will be no QOS block, it will get added when qos enable command is run for first time. This will add QOS block in existing RADOS object for export.
Below is the example of export block when qos block is present
When enabled
when disabled
For enable command:
There are 2 cases to consider, based on QOS type set on cluster level
1. If combined bandwith control is disabled
a. If qos_type is pershare, then export_writebw and export_readbw parameters are compulsory
b. If qos_type is perclient, then can't enable export level qos
c. If qos_type is pershare_perclient then export_writebw, export_readbw, client_writebw and
client_readbw are compulsory parameters
2. If combined bandwidth control is enabled
a. If qos_type is pershare, then export_rw_bw parameter is compulsory
b. If qos_type is perclient, then can't enable export level qos
c. If qos_type is pershare_perclient, then export_rw_bw and client_rw_bw parameters are compulsory
nfs export qos enable bandwidth_control <cluster_id> <pseudo_path> [--combined-rw-bw-ctrl] [--max_export_write_bw ] [--max_export_read_bw ] [--max_client_write_bw ] [--max_client_read_bw ] [--max_export_combined_bw ] [--max_client_combined_bw ]
nfs export qos disable bandwidth_control <cluster_id> <pseudo_path>
nfs export qos get <cluster_id> <pseudo_path> [--format ]
Existing command affected by this changes: nfs export apply <cluster_id> [--format ]
Tetsing logs:
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e