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 custom SMART parameter option #1079

Closed
phillxnet opened this Issue Jan 5, 2016 · 11 comments

Comments

Projects
None yet
2 participants
@phillxnet
Member

phillxnet commented Jan 5, 2016

Thanks to @Sudowoodo and @kcomer in the following forum threads for identifying the specific need for custom smart options, ie "-d sat" and "-d 3ware,0" respectively.
http://forum.rockstor.com/t/s-m-a-r-t-for-usb-drives/834
http://forum.rockstor.com/t/s-m-a-r-t-support-is-not-available-for-this-disk/830/7
Please update the above forum threads on progress with this issue.

N.B. a complexity of this issue is that this custom setting needs to be stored / applied per drive to account for mixed drive / controller environments.

@schakrava schakrava added this to the Kilauea Iki milestone Jan 23, 2016

@phillxnet

This comment has been minimized.

Member

phillxnet commented Feb 9, 2016

Noting smartmontools page for usb devices / bridges and their respective custom options:-
https://www.smartmontools.org/wiki/USB

@phillxnet

This comment has been minimized.

Member

phillxnet commented Feb 9, 2016

Awaiting possible extension of Disk model to accommodate custom smart options per disk.

@phillxnet

This comment has been minimized.

Member

phillxnet commented Feb 9, 2016

I have an external USB to SATA enclosure that requires "-d usbjmicron,p" to have smart function so I can have a look at this issue once the approach to take with regard to how / where we store the custom smart options is finalized.

@phillxnet

This comment has been minimized.

Member

phillxnet commented Mar 9, 2016

We now have a "smart_options" db field in our disk model:
src/rockstor/storageadmin/models/disk.py which was added in:
phillxnet@cc7cfc1

@phillxnet

This comment has been minimized.

Member

phillxnet commented Mar 9, 2016

Having only had a quickly discussed with @schakrava on this issue I propose that we have an icon next to the cell for each drive on the Disks page under the S.M.A.R.T column, akin to the icons in the drive name column and serial column, This icon's mouse over will indicate the possibility of adding custom smart parameters, clicking will enable that option by presenting either a dialogue or a page to allow for entry of these parameters. This icon will always be presented irrespective of the smart available status as in some cases (SanDisk Extreme USB 3.0 for example) the custom parameters will change the reading of smart availability (when calling the base device which is proper). A disk re-scan via _update_disk_state() will be required to update this state but this is called anyway when refreshing the Disks page.

The UI logic of the Disks table will show existing previously entered custom parameters by the aforementioned icon, if any such options exist. As these options are linked to the disk model they should travel with the serial number of the device, given the function of _update_disk_state() which will have to be modified to preserve these settings over a disk refresh.

I have started on adding this feature as indicated and will be working against this issue with any relevant commits.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 9, 2016

add edit icon in smart area of disks table rockstor#1079
Also display custom smart options if found to be !null.
Correct collection variable inclusion of diskRole(; to ,)

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 9, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 9, 2016

add initial custom smart options entry page template rockstor#1079
Based on blink_disks.jst template used to configure blink rate for
drive light blink mechanism.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 9, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 9, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 9, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 9, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 9, 2016

@phillxnet

This comment has been minimized.

Member

phillxnet commented Mar 9, 2016

Recall of current per drive custom smart option still buggy (seems to affect only entries with spaces in) but UI entry and presentation of custom smart options along with db modification mechanism mostly in place now.

TODO:

  • get smart commands to lookup the custom smart options and use them on the appropriate drive.
  • debug and maybe add more input validation.
  • correct validation to allow empty entry to clear previous value or a clear value button.
@phillxnet

This comment has been minimized.

Member

phillxnet commented Mar 9, 2016

I hope to continue with this on Friday/Saturday and expect it to be first draft / ready for review soon there after.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 11, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 11, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 11, 2016

allow empty submit to clear current options rockstor#1079
Add explanation in mouse over and additionally strip white space.
@phillxnet

This comment has been minimized.

Member

phillxnet commented Mar 11, 2016

From here on in the commits associated with this issue assume the prior merge of #1206 as the smart device re-write layer established in that pr are to be expanded here to add the custom options and if need be re-write the target device in the case of some raid controllers.
ie a normal call might be:-
Smartctrl -H --info /dev/sda
but the same call to a device behind for example a 3ware/LSI 9750 controller would initially require the custom options of -d 3ware,0 (for the first port on the 3ware controller) and then a re-write of /dev/sda to /dev/twl0 as the first 3ware controller. I am initially assuming in these cases that the custom smart options will include the controller and port.
ie user enters "-d 3ware,0 /dev/twl0" for custom smart options as then we cater for multiple controllers.
When when see the /dev/tw + e|a|l in these custom options then we drop the /dev/sda name as the disk behind raid syntax already has it's port and controller specified. Hence using the same device re-write mechanism.

Note that this assumes a one to one mapping of sda types to raid ports, ie JBOD mode. Otherwise we have a far more complex mapping issue. This is consistent with typical btrfs raid assumptions, ie direct access to individual disks not raid logical devices.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 11, 2016

refactor return type of smart device wrapper to list rockstor#1079
Allows for centralized /dev/ path addition and to simplify the
inplace construction of the various smart command line
arguments by list concatenation.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 11, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 11, 2016

@phillxnet

This comment has been minimized.

Member

phillxnet commented Mar 11, 2016

TODO:

  • use the custom options now available in all smart commands
  • attempt to modify target device appropriately for disks behind raid controllers
  • name re-factor to more appropriately represent the custom options + smart target dev pre-processor
  • debug some commands not receiving up-to-date custom smart options.

I will try and continue with this issue tomorrow.
Progress note: most major parts complete for first draft.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 12, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 12, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

allow empty submit to clear current options rockstor#1079
Add explanation in mouse over and additionally strip white space.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

refactor return type of smart device wrapper to list rockstor#1079
Allows for centralized /dev/ path addition and to simplify the
inplace construction of the various smart command line
arguments by list concatenation.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

add get_dev_options to centrally manage drive specific smart options r…
…ockstor#1079

This allows for the separation of finding the base device and enabling
the substitution of smart target devices in the case of some raid
controllers. That is if custom options for a device contain a raid dev
target then we use that not the drive device name.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

further input validation progress rockstor#1079
Initial raid dev target validation but incomplete

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

use older js 'for' mechanism rockstor#1079
The for var of array worked but even with ECMAv6
enabled I was receiving errors in editor so may be just
editor but replacing just in case.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 15, 2016

fix bug on fresh db fields of smart_options rockstor#1079
This field when first read is of type None so deal
with this by guard and bundle with empty string
code path. Plus typo on form page.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 19, 2016

actively accept empty entry and trim begin & end rockstor#1079
Empty entry is used as a removal of existing options
mechanism; accept pro-actively in initial syntactic
checks. Also trim() leading and trailing white space.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 19, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 19, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 19, 2016

remove input validation development logging rockstor#1079
Plus minor comment improvements. Also spaces around
value in template.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 19, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 19, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 19, 2016

fix existing bug where smart test page alert was not shown rockstor#1079


Also improved alert message to suggest custom options may be required.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 19, 2016

fix existing bug where smart tabs alert header was not shown rockstor…
…#1079

Also move recently added test alert suggestion of custom options to
this header alert as more generally applicable and avoids repetition.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 19, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 19, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 21, 2016

reformat smartcustom_disks.js using spaces rockstor#1079
PyCharm "ReFormat Code" defaults - 4 spaces based.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 21, 2016

reformat disks.js using spaces rockstor#1079
PyCharm "ReFormat Code" defaults - 4 spaces based.

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 21, 2016

phillxnet added a commit to phillxnet/rockstor-core that referenced this issue Mar 21, 2016

reformat disk_details_layout_view.js using spaces rockstor#1079
PyCharm "ReFormat Code" defaults - 4 spaces based.

@schakrava schakrava closed this in 50946dd Mar 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment