Supermicro only baseboard serial number set #296

Open
opened 2024-04-29 13:45:25 +02:00 by Garfunkl · 2 comments
Garfunkl commented 2024-04-29 13:45:25 +02:00 (Migrated from github.com)

Describe the bug
On our Supermicro Servers there is nearly never a system or chassis serial number set. That leads to this error:

...
File "/usr/local/lib/python3.9/site-packages/pynetbox/core/endpoint.py", line 147, in get raise ValueError(
ValueError: get() returned more than one result. Check that the kwarg(s) passed are valid for this endpoint or use filter() or all() instead.    

Expected behavior
Maybe fall back to baseboard serial ?

Environment:

  • OS: Rocky Linux 9.3
  • Netbox agent version 0.7.1

Additional context
Working fix in my setup for netbox_agent/vendors/supermicro.py :

def get_service_tag(self):
    default_serial = "0123456789"
    baseboard_serial = self.baseboard[0]['Serial Number'].strip()
    system_serial = str(self.system[0]['Serial Number']).strip() 

    if self.is_blade() or system_serial == default_serial:
        return baseboard_serial
    return system_serial
**Describe the bug** On our Supermicro Servers there is nearly never a system or chassis serial number set. That leads to this error: ``` ... File "/usr/local/lib/python3.9/site-packages/pynetbox/core/endpoint.py", line 147, in get raise ValueError( ValueError: get() returned more than one result. Check that the kwarg(s) passed are valid for this endpoint or use filter() or all() instead. ``` **Expected behavior** Maybe fall back to baseboard serial ? **Environment:** - OS: Rocky Linux 9.3 - Netbox agent version 0.7.1 **Additional context** Working fix in my setup for netbox_agent/vendors/supermicro.py : ``` def get_service_tag(self): default_serial = "0123456789" baseboard_serial = self.baseboard[0]['Serial Number'].strip() system_serial = str(self.system[0]['Serial Number']).strip() if self.is_blade() or system_serial == default_serial: return baseboard_serial return system_serial ```
FlorianHeigl commented 2024-08-31 17:50:56 +02:00 (Migrated from github.com)

Hi,

as a fellow supermicro user I can confirm that patch is needed.

if you have many, could you complain to supermicro of their incompetence so they finally start getting this right?
You might wanna have some conditions that whatever is returned is value is in fact looking like a serial number
(so [0-9A-F]{1,20} or something - don't have one to look at right now)

Hi, as a fellow supermicro user I can confirm that patch is needed. if you have many, could you complain to supermicro of their incompetence so they finally start getting this right? You might wanna have some conditions that whatever is returned is value is in fact looking like a serial number (so [0-9A-F]{1,20} or something - don't have one to look at right now)
Garfunkl commented 2024-09-03 17:10:05 +02:00 (Migrated from github.com)

At least for us, it's probably not the fault of Supermicro. Supermicro doesn't sell its servers directly. We have to buy them from resellers, and on the bill, they show up with a custom serial from the reseller.

For example:
A Supermicro server with the serial supermicro-xyz shows up as reseller-xyz.
I think the resellers are supposed to set those serial numbers, but they nearly never do.

The "workaround" I proposed was to set the system serial number to the motherboard serial number if it is set to the default of "0123456789". Since the motherboard serial is set by Supermicro and is hopefully a unique identifier, this should resolve the issue.

At least for us, it's probably not the fault of Supermicro. Supermicro doesn't sell its servers directly. We have to buy them from resellers, and on the bill, they show up with a custom serial from the reseller. For example: A Supermicro server with the serial supermicro-xyz shows up as reseller-xyz. I think the resellers are supposed to set those serial numbers, but they nearly never do. The "workaround" I proposed was to set the system serial number to the motherboard serial number if it is set to the default of "0123456789". Since the motherboard serial is set by Supermicro and is hopefully a unique identifier, this should resolve the issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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: DGNum/netbox-agent#296
No description provided.