-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add option to zpool status to print guids #2012
Conversation
I emailed the Open ZFS list about this last night and the first (and so far only) reply is extremely positive: http://lists.open-zfs.org:8080/pipermail/developer/2013-December/000439.html There appears to be no need to worry about objections from other Open ZFS implementations. Their multipath implementations also benefit from this. |
wca in #open-zfs on freenode asked that I change zpool_vdev_name() to be less fragile. In specific, he would like me to modify the interface to accept an nvlist of parameters so that additional ones can be added without modification to the libzfs interface. I plan to do this in a few days. I will keep the pull request open pending that update. |
Got this compiled and worked perfectly.
Thank you very much Mr Yao. |
@ryao I'm all for this as well, once you've made the requested changes I'll give it a look! |
@ryao What's the status of this? |
@behlendorf I wrote it to help a user and it has been on the back burner since. It is on my list of things to revise as soon as I push out the taskq refactoring. The taskq refactoring was delayed as other things came up, but I have the prototype running on m live system with only a few regressions that left to address before pushing it. In specific, I need to fix the zvol dispatch to avoid taking a mutex in an interrupt context (which is okay on Illumos/Solaris), implement a subset of the cyclic interface in the SPL (partially done) and rework the deadman code to use it. |
@behlendorf I have pushed an updated commit that addresses @wca's comment. |
Excellent! Thanks! Really minor nit: zpool_vdev_name()'s 'args' arg is probably more of an 'opts'; it only contains options. |
@wca I have updated the commit to use By the way, should I append your |
I have not reviewed the entire patch, I was merely offering an improvement in the name of API stability. For the file scope functions it doesn't matter, but exported APIs deserve a bit more care. In any case, the spirit of this change is fine by me. |
The use of vdev GUIDs are a necessary workaround in edge cases where the names provided by `zpool status` are not accepted by the zpool detach/offline/remove/replace commands. The current method of obtaining them uses zdb, but this does not work in all cases (see openzfs#1530). This provides a method of obtaining vdev GUIDs that is more reliable and straightforward than zdb. It would be better to fix all edge cases that require the use of GUIDs as a workaround, but Linux's /dev design makes it difficult to anticipate such edge cases, which makes this option necessary. Note that this adds a new boolean parameter to `zpool_vdev_name`, which changes the libzfs interface. Closes openzfs#2011 Signed-off-by: Richard Yao <ryao@gentoo.org>
@behlendorf I have done a refresh to fix cstyle warnings. This version should be merge-able. |
The sole failure is openzfs/spl#371, which is unrelated to this patch. It should be safe to merge this. |
I'd like to get this in to 0.6.4. If we could get some additional testing and reviews it would help speed up getting this merged. |
Thanks to @rottegift's championing of this pull request, it is now cherry picked in OpenZFS on OS X master: |
Works great. It'd be nice if zpool status -g also gives the pool guid, though. |
I like that idea. Tweak the patch to print the pool guid instead of it's name when |
A recent commit, e02b533, broke this patch. It adds references to |
I had to chance to look these patches over and while the definitely work and are safe to use, I think we need to explore a cleaner way to add this support. The bulk of the changes in the patch are caused by trying to pass the
Either option would also allow us to extend the |
The use of vdev GUIDs are a necessary workaround in edge cases where the names provided by zpool status are not accepted by the zpool detach/offline/remove/replace commands. The current method of obtaining them uses zdb, but this does not work in all cases (see openzfs#1530). This provides a method of obtaining vdev GUIDs that is more reliable and straightforward than zdb. It would be better to fix all edge cases that require the use of GUIDs as a workaround, but Linux's /dev design makes it difficult to anticipate such edge cases, which makes this option necessary. Note that this adds a new boolean parameter to zpool_vdev_name, which changes the libzfs interface. Closes openzfs#2011 Signed-off-by: Richard Yao ryao@gentoo.org
The use of vdev GUIDs are a necessary workaround in edge cases where the names provided by zpool status are not accepted by the zpool detach/offline/remove/replace commands. The current method of obtaining them uses zdb, but this does not work in all cases (see openzfs#1530). This provides a method of obtaining vdev GUIDs that is more reliable and straightforward than zdb. It would be better to fix all edge cases that require the use of GUIDs as a workaround, but Linux's /dev design makes it difficult to anticipate such edge cases, which makes this option necessary. Note that this adds a new boolean parameter to zpool_vdev_name, which changes the libzfs interface. Closes openzfs#2011 Signed-off-by: Richard Yao ryao@gentoo.org
The use of vdev GUIDs are a necessary workaround in edge cases where the names provided by zpool status are not accepted by the zpool detach/offline/remove/replace commands. The current method of obtaining them uses zdb, but this does not work in all cases (see openzfs#1530). This provides a method of obtaining vdev GUIDs that is more reliable and straightforward than zdb. It would be better to fix all edge cases that require the use of GUIDs as a workaround, but Linux's /dev design makes it difficult to anticipate such edge cases, which makes this option necessary. Note that this adds a new boolean parameter to zpool_vdev_name, which changes the libzfs interface. Closes openzfs#2011 Signed-off-by: Richard Yao ryao@gentoo.org
The use of vdev GUIDs are a necessary workaround in edge cases where the names provided by zpool status are not accepted by the zpool detach/offline/remove/replace commands. The current method of obtaining them uses zdb, but this does not work in all cases (see openzfs#1530). This provides a method of obtaining vdev GUIDs that is more reliable and straightforward than zdb. It would be better to fix all edge cases that require the use of GUIDs as a workaround, but Linux's /dev design makes it difficult to anticipate such edge cases, which makes this option necessary. Note that this adds a new boolean parameter to zpool_vdev_name, which changes the libzfs interface. Closes openzfs#2011 Signed-off-by: Richard Yao ryao@gentoo.org
Closing is favor or #4343. |
The use of vdev GUIDs are a necessary workaround in edge cases where the
names provided by
zpool status
are not accepted by the zpooldetach/offline/remove/replace commands. The current method of obtaining
them uses zdb, but this does not work in all cases (see
#1530).
This provides a method of obtaining vdev GUIDs that is more reliable and
straightforward than zdb. It would be better to fix all edge cases that
require the use of GUIDs as a workaround, but Linux's /dev design makes
it difficult to anticipate such edge cases, which makes this option
necessary.
Note that this adds a new boolean parameter to
zpool_vdev_name
, whichchanges the libzfs interface.
Closes #2011
Signed-off-by: Richard Yao ryao@gentoo.org