dell / iDRAC-Redfish-Scripting

Python and PowerShell scripting for Dell EMC PowerEdge iDRAC REST API with DMTF Redfish
GNU General Public License v2.0
606 stars 279 forks source link

Network Slot Virtualization Mode #50

Closed kgrvamsi closed 5 years ago

kgrvamsi commented 5 years ago

Which Redfish API can give the following information

racadm get NIC.DeviceLevelConfig.5
Security Alert: Certificate is invalid - unable to get local issuer certificate
Continuing execution. Use -S option for racadm to stop execution on certificate-related errors.
[Key=NIC.Slot.2-1-1#DeviceLevelConfig]
#INTEL_AdapterPBA=J0000-000
#NParEP=Disabled
#NumberVFSupported=128
#PartitionStateInterpretation=Fixed
#RDMASupport=Unavailable
#SRIOVSupport=Available
#VFAllocBasis=Device
#VFAllocMult=16
VirtualizationMode=SRIOV
kgrvamsi commented 5 years ago

@texroemer can you help me on this?

texroemer commented 5 years ago

Hi @kgrvamsi

These are OEM properties and the only way to currently get these with Redfish is to use Server Configuration Profile (SCP) feature. With SCP, you can perform a local export to get read only attributes for a specific NIC port which will display this information.

Example below is running SCP to get read only attributes for NIC.Integrated.1-1-1 port which reports the properties you are looking for.

C:\Python27>ExportSystemConfigurationLocalREDFISH.py -ip 192.168.0.120 -u root -p calvin -t NIC.Integrated.1-1-1 -i 2

<SystemConfiguration Model="PowerEdge R740xd" ServiceTag="CDZZR71" TimeStamp="Wed Mar 13 12:16:29 2019">
<!--Export type is Normal,RO,XML,Selective-->
<!--Exported configuration may contain commented attributes. Attributes may be commented due to dependency, destructive nature, preserving server identity or for security reasons.-->
<Component FQDD="NIC.Integrated.1-1-1">
    <!--ReadOnly  <Attribute Name="PXEBootSupport">Available</Attribute>-->
    <!--ReadOnly  <Attribute Name="iSCSIBootSupport">Available</Attribute>-->
    <!--ReadOnly  <Attribute Name="FCoEBootSupport">Unavailable</Attribute>-->
    <!--ReadOnly  <Attribute Name="NicPartitioningSupport">Unavailable</Attribute>-->
    <!--ReadOnly  <Attribute Name="FlexAddressing">Available</Attribute>-->
    <!--ReadOnly  <Attribute Name="TOESupport">Unavailable</Attribute>-->
    <!--ReadOnly  <Attribute Name="iSCSIOffloadSupport">Unavailable</Attribute>-->
    <!--ReadOnly  <Attribute Name="iSCSIDualIPVersionSupport">Unavailable</Attribute>-->
    <Attribute Name="BlnkLeds">0</Attribute>
    **<!--ReadOnly  <**Attribute Name="INTEL_AdapterPBA">J24844-007**</Attribute>-->**
    <!--ReadOnly  <Attribute Name="DeviceName">Intel(R) Ethernet 10G 4P X550/I350 rNDC</Attribute>-->
    <!--ReadOnly  <Attribute Name="ChipMdl">Intel X550</Attribute>-->
    <!--ReadOnly  <Attribute Name="PCIDeviceID">1563</Attribute>-->
    <!--ReadOnly  <Attribute Name="BusDeviceFunction">19:00:00</Attribute>-->
    <!--ReadOnly  <Attribute Name="LinkStatus">Connected</Attribute>-->
    <!--ReadOnly  <Attribute Name="MacAddr">24:6E:96:51:12:FC</Attribute>-->
    <!-- <Attribute Name="VirtMacAddr">00:00:00:00:00:00</Attribute>-->
    **<!--ReadOnly  <**Attribute Name="SRIOVSupport">Available**</Attribute>-->
    <!--ReadOnly  <**Attribute Name="RDMASupport">Unavailable**</Attribute>-->
    <!--ReadOnly  <**Attribute Name="NumberVFSupported">64**</Attribute>-->
    <!--ReadOnly  <**Attribute Name="VFAllocBasis">Port**</Attribute>-->
    <!--ReadOnly  <**Attribute Name="VFAllocMult">1**</Attribute>-->
    <Attribute Name="**VirtualizationMode">NONE**</Attribute>**
    <Attribute Name="LegacyBootProto">NONE</Attribute>
    <!--ReadOnly  <Attribute Name="LnkSpeed">AutoNeg</Attribute>-->
    <Attribute Name="WakeOnLan">Enabled</Attribute>
    <!-- <Attribute Name="VLanId">100</Attribute>-->
    <!-- <Attribute Name="NumberVFAdvertised">64</Attribute>-->
    <!--ReadOnly  <Attribute Name="FamilyVersion">19.0.1</Attribute>-->
    <!--ReadOnly  <Attribute Name="EFIVersion">7.0.19</Attribute>-->
    <Attribute Name="TcpIpViaDHCP">Disabled</Attribute>
    <!-- <Attribute Name="IscsiViaDHCP">Disabled</Attribute>-->
    <Attribute Name="ChapAuthEnable">Disabled</Attribute>
    <!-- <Attribute Name="ChapMutualAuth">Disabled</Attribute>-->
    <!--ReadOnly  <Attribute Name="IpVer">IPv4</Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorIpAddr">192.168.0.130</Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorSubnet">255.0.0.0</Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorGateway">0.0.0.0</Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorName"></Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorChapId"></Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorChapPwd"></Attribute>-->
    <!-- <Attribute Name="FirstTgtIpAddress">0.0.0.0</Attribute>-->
    <!-- <Attribute Name="FirstTgtTcpPort">3260</Attribute>-->
    <!-- <Attribute Name="FirstTgtBootLun">0</Attribute>-->
    <!-- <Attribute Name="FirstTgtIscsiName"></Attribute>-->
    <!-- <Attribute Name="FirstTgtChapPwd"></Attribute>-->
</Component>
</SystemConfiguration>

@odata.type: #DellJob.v1_0_1.DellJob JobState: Completed Description: Job Instance TargetSettingsURI: None @odata.id: /redfish/v1/Managers/iDRAC.Embedded.1/Jobs/JID_524973875216 @odata.context: /redfish/v1/$metadata#DellJob.DellJob MessageArgs: [] CompletionTime: 2019-03-13T12:16:31 PercentComplete: 100 StartTime: TIME_NOW MessageId: SYS043 Message: Successfully exported Server Configuration Profile EndTime: None Id: JID_524973875216 JobType: ExportConfiguration Name: Export Configuration

Exported attributes also saved in file: 2019-3-13_131742_export.xml

kgrvamsi commented 5 years ago

@texroemer can we expect these attributes as part of a Get request over redfish api instead exporting it to a xml or any other format in later versions of IDRAC?

texroemer commented 5 years ago

@kgrvamsi

Sorry about the late reply.

Yes, GET request using OEM URI extension for these attributes is planned to be added in a future iDRAC release, most likely 4.00 which is scheduled to be available end of this year.

kgrvamsi commented 5 years ago

Closing this as the above process @texroemer explained perfectly worked

aviv12825 commented 5 years ago

Hi,

Im re-asking this question again - maybe somthing changed since March..especially regarding setting SRIOV by redfish API - >
Which Redfish API can give the following information :

racadm get NIC.DeviceLevelConfig.5 Security Alert: Certificate is invalid - unable to get local issuer certificate Continuing execution. Use -S option for racadm to stop execution on certificate-related errors. [Key=NIC.Slot.2-1-1#DeviceLevelConfig]

INTEL_AdapterPBA=J0000-000

NParEP=Disabled

NumberVFSupported=128

PartitionStateInterpretation=Fixed

RDMASupport=Unavailable

SRIOVSupport=Available

VFAllocBasis=Device

VFAllocMult=16

VirtualizationMode=SRIOV

texroemer commented 5 years ago

Hi @aviv12825

Support for get/set these attributes will be available in iDRAC release 4.00 which is scheduled to be posted this Dec. Current iDRAC firmware version, the only way to get/set these attributes is using Server Configuration Profile feature with Redfish.

aviv12825 commented 5 years ago

@texroemer thank you for the input. I have sent a GET command to: https://10.0.0.214/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/NIC.Embedded.1

And I got the fowlling: (there is SRIOV setting inside - isnt this what we are looking for ?) please see below: {"@odata.context":"/redfish/v1/$metadata#NetworkAdapter.NetworkAdapter","@odata.id":"/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/NIC.Embedded.1","@odata.type":"#NetworkAdapter.v1_0_1.NetworkAdapter","Controllers":[{"ControllerCapabilities":{"DataCenterBridging":{"Capable":false},"NPIV":{"MaxDeviceLogins":0,"MaxPortLogins":0},"NetworkDeviceFunctionCount":2,"NetworkPortCount":2,"VirtualizationOffload":{"SRIOV":{"SRIOVVEPACapable":false},"VirtualFunction":{"DeviceMaxCount":0,"MinAssignmentGroupSize":0,"NetworkPortMaxCount":0}}},"FirmwarePackageVersion":"21.20.5","Links":{"NetworkDeviceFunctions":[{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/NIC.Embedded.1/NetworkDeviceFunctions/NIC.Embedded.1-1-1"},{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/NIC.Embedded.1/NetworkDeviceFunctions/NIC.Embedded.2-1-1"}],"NetworkDeviceFunctions@odata.count":2,"NetworkPorts":[{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/NIC.Embedded.1/NetworkPorts/NIC.Embedded.1-1"},{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/NIC.Embedded.1/NetworkPorts/NIC.Embedded.2-1"}],"NetworkPorts@odata.count":2}}],"Description":"Network Adapter View","Id":"NIC.Embedded.1","Name":"Network Adapter View","NetworkDeviceFunctions":{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/NIC.Embedded.1/NetworkDeviceFunctions"},"NetworkPorts":{"@odata.id":"/redfish/v1/Systems/System.Embedded.1/NetworkAdapters/NIC.Embedded.1/NetworkPorts"},"Status":{"Health":null,"HealthRollup":null,"State":"Enabled"}}

10x

texroemer commented 5 years ago

Redfish DTMF is very limited on what properties will be returned for network cards. As you can see in the output, SRIOV capability is reported but not all other properties as you can see from RACADM. Until OEM Get support is added, you can use Server Configuration Profile feature to get this information for any network port. See example below where i only pass in network port FQDD for Target parameter, it returns the same read only attributes you can get from RACADM:

C:\Python27>ExportSystemConfigurationLocalREDFISH.py -ip 192.168.0.120 -u root -p calvin -t NIC.Embedded.1-1-1 -i 2

<SystemConfiguration Model="PowerEdge C6420" ServiceTag="M536C3S" TimeStamp="Thu Jun 27 08:20:51 2019">
<!--Export type is Normal,RO,XML,Selective-->
<!--Exported configuration may contain commented attributes. Attributes may be commented due to dependency, destructive nature, preserving server identity or for security reasons.-->
<Component FQDD="NIC.Embedded.1-1-1">
    <!--ReadOnly  <Attribute Name="PXEBootSupport">Available</Attribute>-->
    <!--ReadOnly  <Attribute Name="iSCSIBootSupport">Available</Attribute>-->
    <!--ReadOnly  <Attribute Name="FCoEBootSupport">Unavailable</Attribute>-->
    <!--ReadOnly  <Attribute Name="NicPartitioningSupport">Unavailable</Attribute>-->
    <!--ReadOnly  <Attribute Name="FlexAddressing">Available</Attribute>-->
    <!--ReadOnly  <Attribute Name="TOESupport">Unavailable</Attribute>-->
    <!--ReadOnly  <Attribute Name="iSCSIOffloadSupport">Unavailable</Attribute>-->
    <!--ReadOnly  <Attribute Name="iSCSIDualIPVersionSupport">Unavailable</Attribute>-->
    <Attribute Name="BlnkLeds">0</Attribute>
    <!--ReadOnly  <Attribute Name="INTEL_AdapterPBA">106500-000</Attribute>-->
    <!--ReadOnly  <Attribute Name="DeviceName">Intel(R) Gigabit I350-t LOM</Attribute>-->
    <!--ReadOnly  <Attribute Name="ChipMdl">Intel i350</Attribute>-->
    <!--ReadOnly  <Attribute Name="PCIDeviceID">1521</Attribute>-->
    <!--ReadOnly  <Attribute Name="BusDeviceFunction">04:00:00</Attribute>-->
    <!--ReadOnly  <Attribute Name="LinkStatus">Connected</Attribute>-->
    <!--ReadOnly  <Attribute Name="MacAddr">80:18:44:7A:13:C5</Attribute>-->
    <!-- <Attribute Name="VirtMacAddr">00:00:00:00:00:00</Attribute>-->
    <!--ReadOnly  <Attribute Name="SRIOVSupport">Unavailable</Attribute>-->
    <!--ReadOnly  <Attribute Name="RDMASupport">Unavailable</Attribute>-->
    <!--ReadOnly  <Attribute Name="NumberVFSupported">8</Attribute>-->
    <!--ReadOnly  <Attribute Name="VFAllocBasis">Port</Attribute>-->
    <!--ReadOnly  <Attribute Name="VFAllocMult">1</Attribute>-->
    <!--ReadOnly  <Attribute Name="VirtualizationMode">NONE</Attribute>-->
    <Attribute Name="LegacyBootProto">PXE</Attribute>
    <Attribute Name="LnkSpeed">AutoNeg</Attribute>
    <Attribute Name="WakeOnLan">Disabled</Attribute>
    <!-- <Attribute Name="VLanId">0</Attribute>-->
    <!--ReadOnly  <Attribute Name="FamilyVersion">18.0.0</Attribute>-->
    <!--ReadOnly  <Attribute Name="EFIVersion">7.4.11</Attribute>-->
    <Attribute Name="TcpIpViaDHCP">Enabled</Attribute>
    <Attribute Name="IscsiViaDHCP">Enabled</Attribute>
    <Attribute Name="ChapAuthEnable">Disabled</Attribute>
    <!-- <Attribute Name="ChapMutualAuth">Disabled</Attribute>-->
    <!--ReadOnly  <Attribute Name="IpVer">IPv4</Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorIpAddr">0.0.0.0</Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorSubnet">0.0.0.0</Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorGateway">0.0.0.0</Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorName"></Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorChapId"></Attribute>-->
    <!-- <Attribute Name="IscsiInitiatorChapPwd"></Attribute>-->
    <!-- <Attribute Name="FirstTgtIpAddress">0.0.0.0</Attribute>-->
    <!-- <Attribute Name="FirstTgtTcpPort">3260</Attribute>-->
    <!-- <Attribute Name="FirstTgtBootLun">0</Attribute>-->
    <!-- <Attribute Name="FirstTgtIscsiName"></Attribute>-->
    <!-- <Attribute Name="FirstTgtChapPwd"></Attribute>-->
</Component>
</SystemConfiguration>

@odata.type: #DellJob.v1_0_1.DellJob JobState: Completed Description: Job Instance TargetSettingsURI: None @odata.id: /redfish/v1/Managers/iDRAC.Embedded.1/Jobs/JID_616416491208 @odata.context: /redfish/v1/$metadata#DellJob.DellJob MessageArgs: [] CompletionTime: 2019-06-27T08:20:53 PercentComplete: 100 StartTime: TIME_NOW MessageId: SYS043 Message: Successfully exported Server Configuration Profile EndTime: None Id: JID_616416491208 JobType: ExportConfiguration Name: Export Configuration

Exported attributes also saved in file: 2019-6-27_102049_export.xml

kgrvamsi commented 5 years ago

I implemented the same flow what @texroemer suggested in my go redfish library.....check here for reference https://github.com/kgrvamsi/redfishapi/blob/1a98e7a1dd5ae739916f44269d2152542e0c2cc5/dell.go#L691

mogamal1 commented 2 years ago

@texroemer Just wondering if SRIOV on NICs by redfish API already implemented and if yes can you provide me the API Thank you

texroemer commented 2 years ago

Hi @mogamal1

OEM network attributes (including SRIOV) are now supported in iDRAC9 (supported in 5.10 version) for GET and PATCH operations.

URI:

/redfish/v1/Chassis/System.Embedded.1/NetworkAdapters//NetworkDeviceFunctions//Oem/Dell/DellNetworkAttributes/

URI example:

/redfish/v1/Chassis/System.Embedded.1/NetworkAdapters/NIC.Integrated.1/NetworkDeviceFunctions/NIC.Integrated.1-1-1/Oem/Dell/DellNetworkAttributes/NIC.Integrated.1-1-1?$select=Attributes

Script has also been posted to support setting these attributes:

https://github.com/dell/iDRAC-Redfish-Scripting/blob/master/Redfish%20Python/GetSetOemNetworkDevicePropertiesREDFISH.py

Thanks Tex