Added note and refactor code #16

Merged
PeterSurda merged 6 commits from swapnil/idlers-agent:main into main 2024-06-26 01:47:20 +02:00
Member
No description provided.
swapnil added 2 commits 2024-06-25 11:32:46 +02:00
swapnil added 2 commits 2024-06-25 12:03:01 +02:00
swapnil changed title from main to Added note and refactor code 2024-06-25 12:03:41 +02:00
swapnil added 1 commit 2024-06-25 12:05:44 +02:00
swapnil added 1 commit 2024-06-25 14:15:20 +02:00
Added RAM info in notes
All checks were successful
buildbot/multibuild_parent Build done.
buildbot/travis_bionic Build done.
61909258a0
PeterSurda approved these changes 2024-06-26 01:46:56 +02:00
PeterSurda left a comment
Owner

I'll merge it because the comments I have can be done in next iteration.

I'll merge it because the comments I have can be done in next iteration.
@ -164,0 +169,4 @@
if section['DMIType'] == 1:
chassis_info = section
break
if chassis_info:
Owner

We should also report "baseboard", and "system", if present. Traditional servers seem to report "system" and/or "chassis" whereas custom build machines report only "baseboard" (i.e. motherboard), as there is no way for the motherboard to find out what kind of chassis it is mounted into.

We should also report "baseboard", and "system", if present. Traditional servers seem to report "system" and/or "chassis" whereas custom build machines report only "baseboard" (i.e. motherboard), as there is no way for the motherboard to find out what kind of chassis it is mounted into.
Author
Member

Please share a sample sudo dmidecode -t1 output.
Here's what I see on test2:

root@test2:~# sudo dmidecode -t1
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: System manufacturer
	Product Name: System Product Name
	Version: System Version
	Serial Number: System Serial Number
	UUID: 2aa1f520-d7da-11dd-b8b7-08606ee5b794
	Wake-up Type: Power Switch
	SKU Number: SKU
	Family: To be filled by O.E.M.
Please share a sample `sudo dmidecode -t1` output. Here's what I see on test2: ```bash root@test2:~# sudo dmidecode -t1 # dmidecode 3.3 Getting SMBIOS data from sysfs. SMBIOS 2.7 present. Handle 0x0001, DMI type 1, 27 bytes System Information Manufacturer: System manufacturer Product Name: System Product Name Version: System Version Serial Number: System Serial Number UUID: 2aa1f520-d7da-11dd-b8b7-08606ee5b794 Wake-up Type: Power Switch SKU Number: SKU Family: To be filled by O.E.M. ```
Owner

one:

Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: To Be Filled By O.E.M.
	Product Name: X570D4U
	Version: To Be Filled By O.E.M.
	Serial Number: To Be Filled By O.E.M.
	UUID: 7533e379-96c4-49d9-f452-a8a159c72190
	Wake-up Type: Power Switch
	SKU Number: To Be Filled By O.E.M.
	Family: To Be Filled By O.E.M.

two:

Handle 0x0100, DMI type 1, 27 bytes
System Information
	Manufacturer: Dell Inc.
	Product Name: PowerEdge R630
	Version: Not Specified
	Serial Number: 1W9PPM2
	UUID: 4c4c4544-0057-3910-8050-b1c04f504d32
	Wake-up Type: Power Switch
	SKU Number: SKU=NotProvided;ModelName=PowerEdge R630
	Family: Not Specified
one: ``` Handle 0x0001, DMI type 1, 27 bytes System Information Manufacturer: To Be Filled By O.E.M. Product Name: X570D4U Version: To Be Filled By O.E.M. Serial Number: To Be Filled By O.E.M. UUID: 7533e379-96c4-49d9-f452-a8a159c72190 Wake-up Type: Power Switch SKU Number: To Be Filled By O.E.M. Family: To Be Filled By O.E.M. ``` two: ``` Handle 0x0100, DMI type 1, 27 bytes System Information Manufacturer: Dell Inc. Product Name: PowerEdge R630 Version: Not Specified Serial Number: 1W9PPM2 UUID: 4c4c4544-0057-3910-8050-b1c04f504d32 Wake-up Type: Power Switch SKU Number: SKU=NotProvided;ModelName=PowerEdge R630 Family: Not Specified ```
@ -164,0 +177,4 @@
processor_info = [section for section in self.dmidecode_data if section['DMIType'] == 4]
processor_model = processor_info[0].get('Version', 'Unknown') if processor_info else 'Unknown'
processor_count = len(processor_info)
Owner

I need to verify how it works if there are multiple processors. I have a couple of dual-socket systems, but they always have the same processor model.

I need to verify how it works if there are multiple processors. I have a couple of dual-socket systems, but they always have the same processor model.
Author
Member

Even this part of the code assumes multiple sections with 'DMIType' 4. But only gets 'Version' from the first section. Since you've said "they always have the same processor model", I assume this code should be fine.

Even this part of the code assumes multiple sections with `'DMIType'` 4. But only gets `'Version'` from the first section. Since you've said "they always have the same processor model", I assume this code should be fine.
Owner

Yes looks like it's ok.

Yes looks like it's ok.
PeterSurda marked this conversation as resolved
@ -164,0 +184,4 @@
for ram in ram_info:
size = ram.get('Size', 'Unknown')
speed = ram.get('Speed', 'Unknown')
ecc = 'Yes' if ram.get('Total Width') == '72 bits' and ram.get('Data Width') == '64 bits' else 'No'
Owner

I was looking at some systems, and sometimes both TotalWidth and DataWidth is 72. I'm not really sure what it means. I vaguely remember reading that that's a bug in some DDR4 modules or motherboards. For now I would only check for TotalWidth and ignore DataWidth.

I was looking at some systems, and sometimes both TotalWidth and DataWidth is 72. I'm not really sure what it means. I vaguely remember reading that that's a bug in some DDR4 modules or motherboards. For now I would only check for TotalWidth and ignore DataWidth.
Author
Member

I did some reading on this. TotalWidth is DataWidth + (any extra bits for error correction). So it doesn't matter what the exact number of the TotalWidth is, at least in theory. However, common configuration for ECC memory is to have TotalWidth of 72 bits and a DataWidth of 64, giving extra 8 bits for error checking.

TLDR; to determine if a memory module is ECC or non-ECC, we should compare TotalWidth and DataWidth. if TotalWidth > DataWidth: true else false.

I did some reading on this. TotalWidth is DataWidth + (any extra bits for error correction). So it doesn't matter what the exact number of the TotalWidth is, at least in theory. However, common configuration for ECC memory is to have TotalWidth of 72 bits and a DataWidth of 64, giving extra 8 bits for error checking. TLDR; to determine if a memory module is ECC or non-ECC, we should compare TotalWidth and DataWidth. `if TotalWidth > DataWidth: true else false`.
Owner

It misreports on some DDR4 systems and I haven't found conclusive clarification. I have one system for example which reports TotalWidth 72 and DataWidth 72. But it doesn't influence the amount of available memory.

It misreports on some DDR4 systems and I haven't found conclusive clarification. I have one system for example which reports TotalWidth 72 and DataWidth 72. But it doesn't influence the amount of available memory.
@ -164,0 +187,4 @@
ecc = 'Yes' if ram.get('Total Width') == '72 bits' and ram.get('Data Width') == '64 bits' else 'No'
serial_number = ram.get('Serial Number', 'Unknown')
ram_type = ram.get('Type', 'Unknown')
ram_details.append("Size: {}, Speed: {}, ECC: {}, Serial Number: {}, Type: {}".format(size, speed, ecc, serial_number, ram_type))
Owner

There are actually two speeds reported, one is the specification of the module and the other is configured speed. What you could do, is to report them both separated with "@". E.g. "1866@1333MHz".

There are actually two speeds reported, one is the specification of the module and the other is configured speed. What you could do, is to report them both separated with "@". E.g. "1866@1333MHz".
Author
Member

Example output:

root@test2:~# sudo dmidecode -t17
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.

Handle 0x005D, DMI type 17, 34 bytes
Memory Device
	Array Handle: 0x005E
	Error Information Handle: 0x0062
	Total Width: 64 bits
	Data Width: 64 bits
	Size: 8 GB
	Form Factor: DIMM
	Set: None
	Locator: ChannelA-DIMM0
	Bank Locator: BANK 0
	Type: DDR3
	Type Detail: Synchronous
	Speed: 1600 MT/s
	Manufacturer: Micron
	Serial Number: 1FC8D19A
	Asset Tag: 9876543210
	Part Number: 16KTF1G64AZ-1G9P1
	Rank: 2
	Configured Memory Speed: 1600 MT/s

So "Speed" will be "1600 MT/s @ 1600 MT/s" ?

Example output: ```bash root@test2:~# sudo dmidecode -t17 # dmidecode 3.3 Getting SMBIOS data from sysfs. SMBIOS 2.7 present. Handle 0x005D, DMI type 17, 34 bytes Memory Device Array Handle: 0x005E Error Information Handle: 0x0062 Total Width: 64 bits Data Width: 64 bits Size: 8 GB Form Factor: DIMM Set: None Locator: ChannelA-DIMM0 Bank Locator: BANK 0 Type: DDR3 Type Detail: Synchronous Speed: 1600 MT/s Manufacturer: Micron Serial Number: 1FC8D19A Asset Tag: 9876543210 Part Number: 16KTF1G64AZ-1G9P1 Rank: 2 Configured Memory Speed: 1600 MT/s ``` So "Speed" will be "1600 MT/s @ 1600 MT/s" ?
Owner

Yes.

Yes.
PeterSurda merged commit 61909258a0 into main 2024-06-26 01:47:20 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Sysdeploy/idlers-agent#16
No description provided.