Feature #23455
Detach device from mirrored boot pool
Description
I can not find an opportunity to destroy mirrored boot device. The console provides this feature via 'zpool deatach' option.
This can be useful if one of mirrored boot device has unrecoverable error.
Related issues
Associated revisions
History
#1
Updated by Alexander Kolganov almost 4 years ago
- File debug-bfreenas-20170419195126.txz added
#2
Updated by Bonnie Follweiler almost 4 years ago
- Assignee set to Kris Moore
- Seen in changed from Unspecified to Master - FreeNAS Nightlies
FreeNAS-9.10-MASTER-201704180409 (b713a96)
#3
Updated by Kris Moore almost 4 years ago
- Assignee changed from Kris Moore to Sean Fagan
Sean, Any issues you think adding this functionality to the middleware and then exposed somewhere in the new UI?
#4
Updated by Sean Fagan almost 4 years ago
- Assignee changed from Sean Fagan to Kris Moore
None at all, I'm utterly shocked it's not already there -- Corral had it.
I was convinced FN9 had it already but sure enough, all I can do is replace. Wow. I guess the thinking was, we shouldn't let people shoot themselves in the foot if they were already walking on two feet?
Detaching is far easier than attaching (no having to wait), but we'd want to handle the case where the selected device is not visible for some reason, and the case where the pool is degraded due to other reasons.
#5
Updated by Kris Moore almost 4 years ago
- Tracker changed from Bug to Feature
- Assignee changed from Kris Moore to William Grzybowski
- Priority changed from No priority to Nice to have
- Target version set to 11.1
Over to William for the middleware side of things, then we can open ticket for UI.
#6
Updated by William Grzybowski almost 4 years ago
- Status changed from Unscreened to Screened
#7
Updated by Sean Fagan almost 4 years ago
First whack would be something like:
diff --git a/gui/middleware/notifier.py b/gui/middleware/notifier.py index 1ba2ed71f..e498a35b3 100755 --- a/gui/middleware/notifier.py +++ b/gui/middleware/notifier.py @@ -5485,6 +5485,14 @@ class notifier(metaclass=HookMetaclass): return True + def bootenv_detach_disk(self, label, devname): + """Remove a disk from the bool""" + + proc = self._pipeopen("/sin/zpool detach freenas-boot %sp2" % (devname, )) + err = proc.communicate()[1] + if proc.returncode != 0: + raise MiddlewareError('Failed to detach disk: %s' % err) + def bootenv_replace_disk(self, label, devname): """Attach a new disk to the pool"""
But I'm not sure if that's entirely right. Note that it doesn't check pool status, verify the disk is in the pool, etc.
I'd also suggest it use libzfs instead of trying to parse the output of the zfs/zpool commands, but that's just me.
#8
Updated by Kris Moore almost 4 years ago
Sean, is this something in your capabilities to tackle then? Not like William is running short of things to do ;)
#9
Updated by Sean Fagan almost 4 years ago
No more than I just did -- I have no idea how it'd be tested or integrated. Not yet, anyway.
#10
Updated by William Grzybowski almost 4 years ago
- File deleted (
debug-bfreenas-20170419195126.txz)
#11
Updated by William Grzybowski almost 4 years ago
- Subject changed from Boot device to Detach device from mirrored boot pool
#12
Updated by William Grzybowski almost 4 years ago
- Private changed from Yes to No
#14
Updated by William Grzybowski over 3 years ago
- Status changed from Screened to Ready For Release
#15
Updated by Dru Lavigne over 3 years ago
- Target version changed from 11.1 to 11.1-BETA1
#16
Updated by Dru Lavigne over 3 years ago
- Status changed from Ready For Release to Resolved
#17
Updated by Bonnie Follweiler over 3 years ago
- Needs QA changed from Yes to No
- QA Status Test Passes FreeNAS added
- QA Status deleted (
Not Tested)
It passed but there is no way to re-attach. This issue is being addressed in another bug ticket.
#18
Updated by Bonnie Follweiler over 3 years ago
- Related to Bug #21336: Add ability to attach smaller disk to a larger one added