-
Notifications
You must be signed in to change notification settings - Fork 0
[MINOR] First shot of clean-archi for smartarray PR. #10
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
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9a7ccc4
[MINOR] First shot of clean-archi for smartarray PR.
vdaviot f61b3cb
[MINOR] Add tests and move stuff around. Only physicaldrivesgetter te…
vdaviot e3b9ba9
[MINOR] Lint.
vdaviot ef8472c
[MINOR] Address review comments.
vdaviot 0c6b6da
[PATCH] Physicaldrivegetter tests are passing.
vdaviot 2023b7c
[PATCH] Repaired megaraid tests.
vdaviot 8de4390
[MINOR] Lasts comments, tests and lint OK.
vdaviot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| package blinker | ||
|
|
||
| import ( | ||
| "strconv" | ||
|
|
||
| "github.com/pkg/errors" | ||
|
|
||
| "github.com/scality/raidmgmt/pkg/domain/entities/physicaldrive" | ||
| "github.com/scality/raidmgmt/pkg/domain/ports" | ||
| "github.com/scality/raidmgmt/pkg/implementation/commandrunner" | ||
| ) | ||
|
|
||
| type SSACLI struct { | ||
| commandrunner.CommandRunner | ||
| } | ||
|
|
||
| var _ ports.Blinker = &SSACLI{} | ||
|
|
||
| func NewSSACLI() *SSACLI { | ||
| return &SSACLI{} | ||
| } | ||
|
|
||
| // StartBlink starts blinking a physical drive. | ||
| func (s *SSACLI) StartBlink(metadata *physicaldrive.Metadata) error { | ||
| err := s.blink(metadata, "on") | ||
| if err != nil { | ||
| return errors.Wrap(err, "failed to start blinking physical drive") | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| // StopBlink stops blinking a physical drive. | ||
| func (s *SSACLI) StopBlink(metadata *physicaldrive.Metadata) error { | ||
| err := s.blink(metadata, "off") | ||
| if err != nil { | ||
| return errors.Wrap(err, "failed to stop blinking physical drive") | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| // blink makes a physical drive blink. | ||
| func (s *SSACLI) blink(metadata *physicaldrive.Metadata, action string) error { | ||
| slot := metadata.Slot.Format() | ||
|
|
||
| args := []string{ | ||
| "controller", | ||
| "slot=" + strconv.Itoa(metadata.CtrlMetadata.ID), | ||
| "physicaldrive", | ||
| slot, | ||
| "modify", | ||
| "led=" + action, | ||
| } | ||
|
|
||
| _, err := s.CommandRunner.Run(args) | ||
| if err != nil { | ||
| return errors.Wrapf(err, "failed to blink physical drive %s", slot) | ||
| } | ||
|
|
||
| return nil | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
|
|
||
| HPE Smart Array P816i-a SR Gen10 in Slot 0 (Embedded) (sn: PWXLA0CRHF10FM) | ||
|
|
89 changes: 89 additions & 0 deletions
89
pkg/implementation/controllergetter/controller/show/all_detail.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
|
|
||
| HPE Smart Array P816i-a SR Gen10 in Slot 0 (Embedded) | ||
| Bus Interface: PCI | ||
| Slot: 0 | ||
| Serial Number: PWXLA0CRHF10FM | ||
| RAID 6 Status: Enabled | ||
| Controller Status: OK | ||
| Hardware Revision: A | ||
| Firmware Version: 5.00 | ||
| Firmware Supports Online Firmware Activation: False | ||
| Rebuild Priority: High | ||
| Expand Priority: Medium | ||
| Surface Scan Delay: 3 secs | ||
| Surface Scan Mode: Idle | ||
| Parallel Surface Scan Supported: Yes | ||
| Current Parallel Surface Scan Count: 1 | ||
| Max Parallel Surface Scan Count: 16 | ||
| Queue Depth: Automatic | ||
| Monitor and Performance Delay: 60 min | ||
| Elevator Sort: Enabled | ||
| Degraded Performance Optimization: Disabled | ||
| Inconsistency Repair Policy: Disabled | ||
| Write Cache Bypass Threshold Size: 1040 KiB | ||
| Wait for Cache Room: Disabled | ||
| Surface Analysis Inconsistency Notification: Disabled | ||
| Post Prompt Timeout: 15 secs | ||
| Cache Board Present: True | ||
| Cache Status: OK | ||
| Cache Ratio: 10% Read / 90% Write | ||
| Configured Drive Write Cache Policy: Disable | ||
| Unconfigured Drive Write Cache Policy: Default | ||
| Total Cache Size: 4.0 | ||
| Total Cache Memory Available: 3.8 | ||
| Battery Backed Cache Size: 3.8 | ||
| No-Battery Write Cache: Disabled | ||
| SSD Caching RAID5 WriteBack Enabled: True | ||
| SSD Caching Version: 2 | ||
| Cache Backup Power Source: Batteries | ||
| Battery/Capacitor Count: 1 | ||
| Battery/Capacitor Status: OK | ||
| SATA NCQ Supported: True | ||
| Spare Activation Mode: Activate on physical drive failure (default) | ||
| Spare Spindown Policy Supported: False | ||
| Controller Temperature (C): 64 | ||
| Capacitor Temperature (C): 50 | ||
| Number of Ports: 4 Internal only | ||
| Encryption: Not Set | ||
| Express Local Encryption: False | ||
| SED Based Encryption Supported: False | ||
| Driver Name: smartpqi | ||
| Driver Version: Linux 2.1.24-046 | ||
| WWN Port: 51402EC0167C85E0 | ||
| PCI Address (Domain:Bus:Device.Function): 0000:5C:00.0 | ||
| Negotiated PCIe Data Rate: PCIe 3.0 x8 (7880 MB/s) | ||
| Controller Mode: Mixed | ||
| Port Max Phy Rate Limiting Supported: False | ||
| Latency Scheduler Setting: Disabled | ||
| Current Power Mode: MaxPerformance | ||
| Survival Mode: Enabled | ||
| Host Serial Number: 2M21210201 | ||
| Sanitize Erase Supported: True | ||
| Sanitize Lock: None | ||
| Sensor ID: 0 | ||
| Location: Capacitor | ||
| Current Value (C): 50 | ||
| Max Value Since Power On: 52 | ||
| Sensor ID: 1 | ||
| Location: ASIC | ||
| Current Value (C): 64 | ||
| Max Value Since Power On: 67 | ||
| Sensor ID: 2 | ||
| Location: Unknown | ||
| Current Value (C): 50 | ||
| Max Value Since Power On: 52 | ||
| Primary Boot Volume: None | ||
| Secondary Boot Volume: None | ||
| SPDM Supports Get Slot Certificate Chain: no | ||
| SPDM Supports Get Controller Info : no | ||
| SPDM Supports Get Slot Info : no | ||
| SPDM Supports Set Import Certificate : no | ||
| SPDM Supports Set Invalidate Slot : no | ||
| Surface Scan Completion Supported: False | ||
| Persistent Event Log Policy Change Supported: False | ||
| UEFI Health Reporting Mode Supported: False | ||
| Firmware Supports NVMe Log Pages: False | ||
| Firmware Supports NAND Field: False | ||
| Firmware Supports NOR Field: False | ||
|
|
||
|
|
112 changes: 112 additions & 0 deletions
112
pkg/implementation/controllergetter/controller/show/config.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
|
|
||
| HPE Smart Array P816i-a SR Gen10 in Slot 0 (Embedded) (sn: PWXLA0CRHF10FM) | ||
|
|
||
|
|
||
|
|
||
| Internal Drive Cage at Port 1I, Box 1 (Index 0), OK | ||
|
|
||
|
|
||
|
|
||
| Internal Drive Cage at Port 2I, Box 2 (Index 1), OK | ||
|
|
||
|
|
||
|
|
||
| Internal Drive Cage at Port 3I, Box 3 (Index 2), OK | ||
|
|
||
|
|
||
|
|
||
| Internal Drive Cage at Port 4I, Box 6 (Index 3), OK | ||
|
|
||
|
|
||
| Port Name: 1I (Mixed) | ||
|
|
||
| Port Name: 2I (Mixed) | ||
|
|
||
| Port Name: 3I (Mixed) | ||
|
|
||
| Port Name: 4I (Mixed) | ||
|
|
||
| Array A (Solid State SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 1 (745.18 GB, RAID 1, OK) | ||
|
|
||
| physicaldrive 4I:6:1 (port 4I:box 6:bay 1, SAS SSD, 800 GB, OK) | ||
| physicaldrive 4I:6:2 (port 4I:box 6:bay 2, SAS SSD, 800 GB, OK) | ||
|
|
||
|
|
||
| Array B (SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 2 (5.46 TB, RAID 0, OK) | ||
|
|
||
| physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS HDD, 6 TB, OK) | ||
|
|
||
|
|
||
| Array C (SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 3 (5.46 TB, RAID 0, OK) | ||
|
|
||
| physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS HDD, 6 TB, OK) | ||
|
|
||
|
|
||
| Array D (SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 4 (5.46 TB, RAID 0, OK) | ||
|
|
||
| physicaldrive 2I:2:1 (port 2I:box 2:bay 1, SAS HDD, 6 TB, OK) | ||
|
|
||
|
|
||
| Array E (SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 5 (5.46 TB, RAID 0, OK) | ||
|
|
||
| physicaldrive 2I:2:2 (port 2I:box 2:bay 2, SAS HDD, 6 TB, OK) | ||
|
|
||
|
|
||
| Array F (SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 6 (5.46 TB, RAID 0, OK) | ||
|
|
||
| physicaldrive 2I:2:3 (port 2I:box 2:bay 3, SAS HDD, 6 TB, OK) | ||
|
|
||
|
|
||
| Array G (SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 7 (5.46 TB, RAID 0, OK) | ||
|
|
||
| physicaldrive 2I:2:4 (port 2I:box 2:bay 4, SAS HDD, 6 TB, OK) | ||
|
|
||
|
|
||
| Array H (SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 8 (5.46 TB, RAID 0, OK) | ||
|
|
||
| physicaldrive 3I:3:1 (port 3I:box 3:bay 1, SAS HDD, 6 TB, OK) | ||
|
|
||
|
|
||
| Array I (SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 9 (5.46 TB, RAID 0, OK) | ||
|
|
||
| physicaldrive 3I:3:2 (port 3I:box 3:bay 2, SAS HDD, 6 TB, OK) | ||
|
|
||
|
|
||
| Array J (SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 10 (5.46 TB, RAID 0, OK) | ||
|
|
||
| physicaldrive 3I:3:3 (port 3I:box 3:bay 3, SAS HDD, 6 TB, OK) | ||
|
|
||
|
|
||
| Array K (SAS, Unused Space: 0 MB) | ||
|
|
||
| logicaldrive 11 (5.46 TB, RAID 0, OK) | ||
|
|
||
| physicaldrive 3I:3:4 (port 3I:box 3:bay 4, SAS HDD, 6 TB, OK) | ||
|
|
||
| Unassigned | ||
|
|
||
| physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS HDD, 2 TB, OK) | ||
| physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS HDD, 2 TB, OK) | ||
|
|
||
| SEP (Vendor ID HPE, Model Smart Adapter) 379 (WWID: 51402EC0167C85F0) | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.