Skip to content

Fix smartpqi arcconf parsing for mixed SSD/HDD arrays with 4K block sizes#137

Open
andaaron wants to merge 2 commits intoproject-machine:mainfrom
andaaron:parse
Open

Fix smartpqi arcconf parsing for mixed SSD/HDD arrays with 4K block sizes#137
andaaron wants to merge 2 commits intoproject-machine:mainfrom
andaaron:parse

Conversation

@andaaron
Copy link

  1. Handle "4K Bytes" and other SI-suffixed block size tokens that caused strconv.Atoi failures on newer hardware.
  2. Split multiple logical devices within a single arcconf output chunk.
  3. Map new InterfaceType variants ("SATA SSD", "SAS 4K").
  4. Parse Channel and Protocol from physical device output.
  5. Fix GetDiskType returning HDD for the first non-matching drive.

…izes

1. Handle "4K Bytes" and other SI-suffixed block size tokens that caused
strconv.Atoi failures on newer hardware.
2. Split multiple logical devices within a single arcconf output chunk.
3. Map new InterfaceType variants ("SATA SSD", "SAS 4K").
4. Parse Channel and Protocol from physical device output.
5. Fix GetDiskType returning HDD for the first non-matching drive.

Signed-off-by: Andrei Aaron <andaaron@cisco.com>
@andaaron andaaron marked this pull request as ready for review February 27, 2026 21:17
Copy link
Collaborator

@raharper raharper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding some additional support and with tests!

I left some minor items; I think mostly around the parseBlockSize; I'd like to simplify and make it clear we're looking at the Disk "geometry" or "sector size" or "native block"; rather than anything related to capacity of a disk.

Please take a look.

logDevs := []LogicalDevice{}
// parseBlockSize parses a block size token that may use SI suffixes
// (e.g. "512", "4K", "1M"). Returns the value in bytes.
func parseBlockSize(raw string) (int, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd appreciate a comment here that this is related to Disk "native" BlockSize (or SectorSize); which are typically 512, 4K, and I guess 1M;

we don't expect to see 1G or even larger size;

We should probably drop support for G in the multiplier.

This function should not be used for converting "human size" fields into bytes, like the "SizeMB" field; since the int return type is not large enough (we'd need an int64 or the size of disks we find in ND etc).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented the function similar to the other comment. I took "4K", "4k", "4096" into consideration as I don't have a guarantee of what format the tool would output.

Signed-off-by: Andrei Aaron <andaaron@cisco.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants