Skip to content

fix: serial_number handling#1873

Merged
stevekeay merged 1 commit intomainfrom
fix_node_serial_number
Mar 26, 2026
Merged

fix: serial_number handling#1873
stevekeay merged 1 commit intomainfrom
fix_node_serial_number

Conversation

@haseebsyed12
Copy link
Contributor

@haseebsyed12 haseebsyed12 commented Mar 25, 2026

  • inspect_hook_node_name_check: use only serial_number field, drop sku fallback
  • nautobot_device_sync: set serial_number unconditionally from serial_number field
Screenshot 2026-03-26 at 07 52 19

@haseebsyed12 haseebsyed12 force-pushed the fix_node_serial_number branch from 3827e83 to 8f12d1e Compare March 25, 2026 19:31
haseebsyed12 pushed a commit that referenced this pull request Mar 26, 2026
@haseebsyed12 haseebsyed12 requested a review from a team March 26, 2026 02:18
@haseebsyed12 haseebsyed12 marked this pull request as ready for review March 26, 2026 02:19
Copy link
Contributor

@stevekeay stevekeay left a comment

Choose a reason for hiding this comment

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

Each server has one "serial number" which appears on a label on the outside of the chassis.

We have always stored this in Nautobot's "serial number" field.

On Dell: the serial number is called a "service tag". It has length 7 and contains characters [0-9A-Z]. (A dell server has many other serial numbers, one for each of it's parts. The long "serial_number" reported in redfish is the serial number of the motherboard, which is not relevant to us.) In the redfish system data, the service tag appears in the "sku" field. Ironic redfish inspection has been copying both "sku" and "serial number" verbatim to the inventory data, and various attempts to fix this have led to some confusion.

On HP: there is a "Server Serial Number" that appears on the chassis, and if memory serves, it appears in the serial number field in redfish. HP serial numbers look like "MXQ622051C".

We don't expect to enrol any HP servers for the time being, but I think we would decide which field to use like if manufacturer contains "dell" then "sku" else "serial_number".

@grizzlydev
Copy link

Totally agree, let's not add another field, we should singularly use the thing that appears outside of the chassis, that's the only point - a natural key that spans real world and virtual.

So for Dells we should se the service tag field (whatever that is called in DRAC APIs/ Redfish) into the serial field in Nautobot AND an Ironic node extra{} field called serial

@cardoe
Copy link
Contributor

cardoe commented Mar 26, 2026

Ironic redfish inspection has been copying both "sku" and "serial number" verbatim to the inventory data, and various attempts to fix this have led to some confusion.

This was temporary while we worked through the patches upstream. We had pulled the changes in locally before they landed upstream. They are now upstream. There is no sku field in the inventory. It's only "serial number" and has been for a few weeks.

@haseebsyed12
Copy link
Contributor Author

picked nodes from dev/staging/prod below are the results. explicitly set inspect-interface to idrac-redfish and tested. I see serial number present in inventory after inspect for all these nodes and no sku.

    "system_vendor": {
        "product_name": "PowerEdge R7615 (SKU=0AF7;ModelName=PowerEdge R7615)",
        "serial_number": "4HLWXB4",
        "manufacturer": "Dell Inc.",
        "firmware": {
            "vendor": "Dell Inc.",
            "version": "1.14.1",
            "build_date": "08/08/2025"
        }
    },
    "system_vendor": {
        "product_name": "PowerEdge R7615",
        "serial_number": "4HLWXB4",
        "manufacturer": "Dell Inc.",
        "system_uuid": "4c4c4544-0048-4c10-8057-b4c04f584234"
    },
]

[
    "system_vendor": {
        "product_name": "PowerEdge R7615",
        "serial_number": "MXFC4003C500DH",
        "manufacturer": "Dell Inc.",
        "sku": "DM6PC14",
        "system_uuid": "4c4c4544-004d-3610-8050-c4c04f433134"
    },
    "system_vendor": {
        "product_name": "PowerEdge R7615",
        "serial_number": "DM6PC14",
        "manufacturer": "Dell Inc.",
        "system_uuid": "4c4c4544-004d-3610-8050-c4c04f433134"
    }
]

[
    "system_vendor": {
        "product_name": "PowerEdge R7615 (SKU=0AF7;ModelName=PowerEdge R7615)",
        "serial_number": "GL6PC14",
        "manufacturer": "Dell Inc.",
        "firmware": {
            "vendor": "Dell Inc.",
            "version": "1.6.10",
            "build_date": "12/08/2023"
        }
    }
    "system_vendor": {
        "product_name": "PowerEdge R7615",
        "serial_number": "GL6PC14",
        "manufacturer": "Dell Inc.",
        "system_uuid": "4c4c4544-004c-3610-8050-c7c04f433134"
    },
]

@haseebsyed12 haseebsyed12 force-pushed the fix_node_serial_number branch from 8f12d1e to ac29245 Compare March 26, 2026 11:58
@haseebsyed12 haseebsyed12 requested review from a team and stevekeay March 26, 2026 11:59
Copy link
Contributor

@stevekeay stevekeay left a comment

Choose a reason for hiding this comment

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

We were saying we don't need a custom field, the serial_number field that exists already in nautobot is sufficient for this.

@haseebsyed12 haseebsyed12 force-pushed the fix_node_serial_number branch from ac29245 to 40e21dc Compare March 26, 2026 12:36
@haseebsyed12 haseebsyed12 changed the title fix: serial_number and service_tag handling fix: serial_number handling Mar 26, 2026
@haseebsyed12 haseebsyed12 force-pushed the fix_node_serial_number branch from 40e21dc to 44861cf Compare March 26, 2026 12:52
@haseebsyed12 haseebsyed12 requested review from a team and stevekeay March 26, 2026 12:53
- inspect_hook_node_name_check: use only serial_number field, drop sku fallback
- nautobot_device_sync: set serial_number unconditionally from serial_number field
@haseebsyed12 haseebsyed12 force-pushed the fix_node_serial_number branch from 44861cf to 0d21dd9 Compare March 26, 2026 13:41
@haseebsyed12
Copy link
Contributor Author

Tests from Staging

{
    "before": {
        "system_vendor": {
            "product_name": "PowerEdge R7615",
            "serial_number": "CNFCP00375007B",
            "manufacturer": "Dell Inc.",
            "sku": "8Q9PC14",
            "system_uuid": "4c4c4544-0051-3910-8050-b8c04f433134"
        }
    },
    "after_agent": {
        "system_vendor": {
            "product_name": "PowerEdge R7615 (SKU=0AF7;ModelName=PowerEdge R7615)",
            "serial_number": "8Q9PC14",
            "manufacturer": "Dell Inc.",
            "firmware": {
                "vendor": "Dell Inc.",
                "version": "1.6.10",
                "build_date": "12/08/2023"
            }
        }
    },
    "after_redfish": {
        "system_vendor": {
            "product_name": "PowerEdge R7615",
            "serial_number": "8Q9PC14",
            "manufacturer": "Dell Inc.",
            "system_uuid": "4c4c4544-0051-3910-8050-b8c04f433134"
        }
    }
}

@stevekeay stevekeay added this pull request to the merge queue Mar 26, 2026
Merged via the queue into main with commit 10dfad6 Mar 26, 2026
62 checks passed
@stevekeay stevekeay deleted the fix_node_serial_number branch March 26, 2026 17:42
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.

5 participants