Project

General

Profile

Feature #23455

Detach device from mirrored boot pool

Added by Alexander Kolganov over 1 year ago. Updated 11 months ago.

Status:
Resolved
Priority:
Nice to have
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Estimated time:
Sprint:
Severity:
New
Backlog Priority:
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:

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

Related to FreeNAS - Bug #21336: Add ability to attach smaller disk to a larger oneResolved2017-02-21

Associated revisions

Revision bf3d98ad (diff)
Added by William Grzybowski over 1 year ago

feat(middlewared): add zfs.pool.detach method

Method to detach a device from a pool.

Ticket: #23455

Revision 4c16b2e3 (diff)
Added by William Grzybowski over 1 year ago

feat(middlewared): add boot.detach as a shortcut for zfs.pool.detach

Ticket: #23455

Revision 33bd4db1 (diff)
Added by William Grzybowski over 1 year ago

feat(gui): use middleware to detach boot pool disk

Ticket: #23455

Revision 11577f2c (diff)
Added by William Grzybowski about 1 year ago

feat(middlewared): add zfs.pool.detach method

Method to detach a device from a pool.

Ticket: #23455

Revision 76fc7414 (diff)
Added by William Grzybowski about 1 year ago

feat(middlewared): add boot.detach as a shortcut for zfs.pool.detach

Ticket: #23455

Revision 9d16de80 (diff)
Added by William Grzybowski about 1 year ago

feat(gui): use middleware to detach boot pool disk

Ticket: #23455

Revision f238a58f (diff)
Added by Dru Lavigne 12 months ago

Doc detach boot pool device.
Ticket: #23455

History

#1 Updated by Alexander Kolganov over 1 year ago

  • File debug-bfreenas-20170419195126.txz added

#2 Updated by Bonnie Follweiler over 1 year ago

  • Assignee set to Kris Moore
  • Seen in changed from Unspecified to Master - FreeNAS Nightlies

FreeNAS-9.10-MASTER-201704180409 (b713a96)

#3 Avatar?id=14398&size=24x24 Updated by Kris Moore over 1 year 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 over 1 year 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 Avatar?id=14398&size=24x24 Updated by Kris Moore over 1 year 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 over 1 year ago

  • Status changed from Unscreened to Screened

#7 Updated by Sean Fagan over 1 year 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 Avatar?id=14398&size=24x24 Updated by Kris Moore over 1 year 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 over 1 year 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 over 1 year ago

  • File deleted (debug-bfreenas-20170419195126.txz)

#11 Updated by William Grzybowski over 1 year ago

  • Subject changed from Boot device to Detach device from mirrored boot pool

#12 Updated by William Grzybowski over 1 year ago

  • Private changed from Yes to No

#14 Updated by William Grzybowski over 1 year ago

  • Status changed from Screened to Ready For Release

#15 Updated by Dru Lavigne about 1 year ago

  • Target version changed from 11.1 to 11.1-BETA1

#16 Updated by Dru Lavigne 12 months ago

  • Status changed from Ready For Release to Resolved

#17 Updated by Bonnie Follweiler 11 months 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 11 months ago

  • Related to Bug #21336: Add ability to attach smaller disk to a larger one added

Also available in: Atom PDF