Project

General

Profile

Bug #26668

Ensure that a disk can not be selected to replace itself

Added by Michael Dexter almost 2 years ago. Updated over 1 year ago.

Status:
Done
Priority:
Nice to have
Assignee:
Waqar Ahmed
Category:
Middleware
Target version:
Seen in:
Severity:
Low
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

FreeNAS-11.0-U4 (54848d13b) will allow the user to attempt to replace a host spare with itself.

Is this a desirable scenario? It throws a traceback either way.

See the attached screenshot.

Presumably, the disk representing the spare should not be made available as a replacement device.

Traceback information:

POST
Request URL: http://10.0.0.185/storage/zpool-test/disk/replace/gptid/c19d0b95-c9e2-11e7-b294-3860775656f5/
Software Version: FreeNAS-11.0-U4 (54848d13b)
Exception Type: MiddlewareError
Exception Value:
[MiddlewareError: b'Unable to GPT format the disk "da3": gpart: geom \'da3\': File exists\n']
Exception Location: ./freenasUI/middleware/notifier.py in __gpt_labeldisk, line 410
Server time: Wed, 15 Nov 2017 01:03:37 -0800
Traceback

Environment:

Software Version: FreeNAS-11.0-U4 (54848d13b)
Request Method: POST
Request URL: http://10.0.0.185/storage/zpool-test/disk/replace/gptid/c19d0b95-c9e2-11e7-b294-3860775656f5/

Traceback:
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
39. response = get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in legacy_get_response
249. response = self._get_response(request)
File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
178. response = middleware_method(request, callback, callback_args, callback_kwargs)
File "./freenasUI/freeadmin/middleware.py" in process_view
162. return login_required(view_func)(request, *view_args, **view_kwargs)
File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
23. return view_func(request, *args, **kwargs)
File "./freenasUI/storage/views.py" in zpool_disk_replace
951. if form.done():
File "./freenasUI/storage/forms.py" in done
2039. passphrase=passfile
File "./freenasUI/middleware/notifier.py" in zfs_replace_disk
1086. self.
_gpt_labeldisk(type="freebsd-zfs", devname=to_disk, swapsize=swapsize)
File "./freenasUI/middleware/notifier.py" in __gpt_labeldisk
410. raise MiddlewareError(f'Unable to GPT format the disk "{devname}": {error}')

Exception Type: MiddlewareError at /storage/zpool-test/disk/replace/gptid/c19d0b95-c9e2-11e7-b294-3860775656f5/
Exception Value: [MiddlewareError: b'Unable to GPT format the disk "da3": gpart: geom \'da3\': File exists\n']

GET

No GET data
POST

Variable Value
all ''
force 'on'
replace_disk 'da3'
__form_id 'form_ZFSDiskReplacementForm'
FILES

No FILES data
COOKIES

Variable Value
csrftoken '0x5BmA2R0foWHiMhSZ5V9taVGTSTFJjRtoawCXQwnnW2QYEn1RPZbL1BAwPApRaU'
fntreeSaveStateCookie 'root'
sessionid 'zs9nuvio3cb4u63zx2jxnjayablrr270'
META

Variable Value

ReplaceSpareWithSpare.jpg (154 KB) ReplaceSpareWithSpare.jpg Michael Dexter, 11/15/2017 01:09 AM
13059

History

#1 Updated by Dru Lavigne almost 2 years ago

  • Assignee changed from Release Council to William Grzybowski

#2 Updated by William Grzybowski almost 2 years ago

  • Status changed from Unscreened to Screened
  • Priority changed from No priority to Nice to have
  • Target version set to 11.3

#3 Avatar?id=14398&size=24x24 Updated by Kris Moore over 1 year ago

  • Status changed from Screened to Not Started

#4 Updated by William Grzybowski over 1 year ago

  • Assignee changed from William Grzybowski to Waqar Ahmed
  • Target version changed from 11.3 to 11.2-RC2

Waqar, another one for you. Will require a bit of understanding about ZFS but fix should not be too difficult.

#5 Updated by Waqar Ahmed over 1 year ago

  • Status changed from Not Started to In Progress
  • % Done changed from 0 to 90

#6 Updated by William Grzybowski over 1 year ago

  • Severity set to Low

#7 Updated by Waqar Ahmed over 1 year ago

  • Status changed from In Progress to Done
  • % Done changed from 90 to 100

#8 Updated by Dru Lavigne over 1 year ago

  • Subject changed from Spare can be replaced by itself to Ensure that a disk can not be selected to replace itself
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#9 Updated by Dru Lavigne over 1 year ago

Bonnie: this will need to be tested in both the old UI and the new UI.

#10 Updated by Dru Lavigne over 1 year ago

  • Target version changed from 11.2-RC2 to 11.2-BETA1

#11 Updated by Dru Lavigne over 1 year ago

  • Status changed from Done to Ready for Testing

#12 Updated by Bonnie Follweiler over 1 year ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

Passed Testing in FreeNAS-11-MASTER-201805030407

#13 Updated by Dru Lavigne over 1 year ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF