-
Notifications
You must be signed in to change notification settings - Fork 6k
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
ceph-disk,osd: add support for crush device classes #14436
Conversation
lgtm! |
The fallback to 'osd create' for both commands is sort of weird at first blush but makes sense since the crush location update (and/or device class) might be disabled. |
If the OSD does not exist in the crushmap, it is implicitly created. Signed-off-by: Loic Dachary <loic@dachary.org>
src/ceph-disk/ceph_disk/main.py
Outdated
@@ -1922,6 +1922,10 @@ def parser(): | |||
help='unique OSD uuid to assign this disk to', | |||
) | |||
parser.add_argument( | |||
'--crush-class', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be --crush-device-class maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have ceph osd crush class {ls,rm,create} and it looked vaguely consistent to have --crush-class. But if it feels weird I can change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should change osd crush set-device-class to osd crush set-class so they all look the same ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the context CrushWrapper we use device but in the mon we use osd. In the context of ceph osd crush repeating device or even crush is redundant and we can just have set-class instead. I used set-device-class initially because the CrushWrapper function has the same name but in retrospect I think it was not a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I buy that argument. Let's go with it!
src/osd/OSD.cc
Outdated
@@ -3021,6 +3021,43 @@ int OSD::shutdown() | |||
return r; | |||
} | |||
|
|||
int OSD::mon_cmd_maybe_osd_create(string &cmd) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline before {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, fixed and repushed
Signed-off-by: Loic Dachary <loic@dachary.org>
I think it's consistent, but I worry that we have both "type" and "class" and the user can be easily confused. If we refer to them as "bucket type" and "device class" throughout then they will be less likely to be mixed up... |
that's sensible. Shall we change ceph osd crush class {rm,ls,create} to ceph osd crush device-class {rm,ls,create} then ? |
i'm happy with either option; you decide! :)
|
/home/jenkins-build/build/workspace/ceph-pull-requests/src/test/erasure-code/test-erasure-eio.sh:85return 1 /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/erasure-code/test-erasure-eio.sh:11return 1 /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/erasure-code/test-erasure-eio.sh:17return 1 /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/erasure-code/test-erasure-eio.sh:26return 1 /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/erasure-code/test-erasure-eio.sh:39return 1 jenkins test this please |
@liewegas I prefer class and crush_class over device_class :-) |
👍
|
Fixes: http://tracker.ceph.com/issues/19513 Signed-off-by: Loic Dachary <loic@dachary.org>
repushed after renaming crush_class into crush_device_class |
@liewegas I think I addressed your remarks. Did I forget something ? |
@liewegas pls merge |
http://tracker.ceph.com/issues/19513