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

mon/OSDMonitor: list osd tree in named bucket #19564

Merged
merged 1 commit into from Jan 6, 2018

Conversation

kungf
Copy link

@kungf kungf commented Dec 17, 2017

easy to get osd status in named bucket.
eg.
"ceph osd tree-ls node-1" will only show osds in bucket node-1,

Signed-off-by: kungf yang.wang@easystack.cn
@yangdongsheng

roots.insert(i);
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

roots is empty if the bucket doesn't exist?

Copy link
Author

@kungf kungf Dec 18, 2017

Choose a reason for hiding this comment

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

@hjwsm1989 yes, nothing to show

@@ -3497,6 +3497,7 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
}
else if (prefix == "osd dump" ||
prefix == "osd tree" ||
prefix == "osd tree-ls" ||
prefix == "osd ls" ||
Copy link
Member

Choose a reason for hiding this comment

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

Seems by accident you changed the mode of this file to be executable ...

Copy link
Author

Choose a reason for hiding this comment

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

thanks, i change it to default

@kungf
Copy link
Author

kungf commented Dec 19, 2017

@liewegas need a review, please

@liewegas
Copy link
Member

Don't we already have 'ceph osd ls-tree ' that does exactly this? (There is also 'ceph osd crush ls ' that returns the immediate child items.)

@kungf
Copy link
Author

kungf commented Dec 19, 2017

@liewegas ceph osd ls-tree only return osd id not with their status and weight, and ceph osd crush ls only return the the direct child items(children may also be bucket ). they don't show the osd status(up, down).
this pr cmd can do:

  1. show all osds in one bucket with status, the bucket can be host, rack, row, root ... ,
  2. can only show wanted status osds(like ceph osd tree up/down/destory),

@liewegas
Copy link
Member

what about s/tree-ls/tree-under/ or tree-from? (The ls-tree vs tree-ls bugs me, and in the other cases 'ls' is always a raw list, not a table.)

@kungf
Copy link
Author

kungf commented Dec 19, 2017

@liewegas it's also hard for me to choose a proper command name .
what about tree-in? tree-under is a little long, tree-in may be easier to knock the keyboard

Signed-off-by: kungf <yang.wang@easystack.cn>
@kungf
Copy link
Author

kungf commented Dec 21, 2017

@liewegas cmd name was changed to tree-under, need a review, please

Copy link
Member

@liewegas liewegas left a comment

Choose a reason for hiding this comment

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

looks good!

@yuriw
Copy link
Contributor

yuriw commented Jan 2, 2018

@yuriw yuriw merged commit 9389190 into ceph:master Jan 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants