Post by max on Sept 23, 2017 19:32:20 GMT
Our PXE server provisioning system likes to know the MAC addresses of the first network port of all servers.
And it would be nice if we could retrieve those automatically through Redfish, instead of the current practice of having an admin enter them manually into the system.
Problem is that although the MAC addresses can be retrieved through /redfish/v1/Systems/$systemname/EthernetInterfaces/$interfacename there is currently no easy way for a script to figure out which network interface belongs to the first port, and which to the second, etc., without requiring the user to select the interface manually.
When asked for a list of Ethernet interfaces vendors currently seem to return them in some undefined order:
Yes, a person can understand "/NIC.Integrated.1-1-1" is the first network port on this system.
But it is the third item in the collection, and not the first, which makes things hard to script without knowing the naming convention of each vendor, which is not standardized either.
In this particular case an alphabetic sort on id could have put the right port on top, but that may not always be the case either. E.g. I don't know what the ids would be like if an extra PCIe NIC card is added.
Can we add a rule that EthernetInterfaceCollection should be ordered based on port number and that integrated mainboard NIC ports are listed before other ones?
Or add an integer network port number field inside each EthernetInterface instead of just a textual description?
Or some other way to figure out which EthernetInterface is used for PXE boots?
And it would be nice if we could retrieve those automatically through Redfish, instead of the current practice of having an admin enter them manually into the system.
Problem is that although the MAC addresses can be retrieved through /redfish/v1/Systems/$systemname/EthernetInterfaces/$interfacename there is currently no easy way for a script to figure out which network interface belongs to the first port, and which to the second, etc., without requiring the user to select the interface manually.
When asked for a list of Ethernet interfaces vendors currently seem to return them in some undefined order:
$ curl -k -u user:password https://192.168.178.76/redfish/v1/Systems/System.Embedded.1/EthernetInterfaces
{"@odata.context":"/redfish/v1/$metadata#EthernetInterfaceCollection.EthernetInterfaceCollection","@odata.id":"/redfish/v1/Systems/System.Embedded.1/EthernetInterfaces","@odata.type":"#EthernetInterfaceCollection.EthernetInterfaceCollection","Description":"Collection of Ethernet Interfaces for this System","Members":[{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/EthernetInterfaces/NIC.Integrated.1-3-1"},{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/EthernetInterfaces/NIC.Integrated.1-4-1"},{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/EthernetInterfaces/NIC.Integrated.1-1-1"},{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/EthernetInterfaces/NIC.Integrated.1-2-1"}],"Members@odata.count":4,"Name":"System Ethernet Interface Collection"}
Yes, a person can understand "/NIC.Integrated.1-1-1" is the first network port on this system.
But it is the third item in the collection, and not the first, which makes things hard to script without knowing the naming convention of each vendor, which is not standardized either.
In this particular case an alphabetic sort on id could have put the right port on top, but that may not always be the case either. E.g. I don't know what the ids would be like if an extra PCIe NIC card is added.
Can we add a rule that EthernetInterfaceCollection should be ordered based on port number and that integrated mainboard NIC ports are listed before other ones?
Or add an integer network port number field inside each EthernetInterface instead of just a textual description?
Or some other way to figure out which EthernetInterface is used for PXE boots?