dell / iDRAC-Redfish-Scripting

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

Enable NPAR on NIC #196

Closed TrevorSquillario closed 2 years ago

TrevorSquillario commented 2 years ago

The script SetNetworkDevicePropertiesREDFISH.py sets attributes on a partition or port. I'm trying to enable NPAR on the NIC.

You can do a GET here and see the NPAR status. I'm not seeing any documentation regarding a PATCH method. Any idea if this is an existing or planned feature? /redfish/v1/Systems/System.Embedded.1/NetworkAdapters/{NIC FQDD}

It is possible via XML as a workaround. However, I'd like to see if you can do this natively via Redfish.

<Component FQDD="NIC.Mezzanine.1-1-1">
    <Attribute Name="VirtualizationMode">NPAR</Attribute>
    <Attribute Name="NParEP">Disabled</Attribute>
</Component>
texroemer commented 2 years ago

Hi @TrevorSquillario

DMTF currently doesn't support setting this network property but iDRAC now supports PATCH operation setting this OEM property. Please see script "GetSetOemNetworkDevicePropertiesREDFISH.py" for workflow example.

Example of using the script to set VirtualizationMode to NPAR.

C:\Python39>GetSetOemNetworkDevicePropertiesREDFISH.py -ip 192.168.0.120 -u root -p calvin -a NIC.Mezzanine.3-1-1 -A VirtualizationMode

Attribute Name: VirtualizationMode, Attribute value: NONE

C:\Python39>GetSetOemNetworkDevicePropertiesREDFISH.py -ip 192.168.0.120 -u root -p calvin -s NIC.Mezzanine.3-1-1 -an VirtualizationMode -av NPAR -r y

- INFO, script will be setting network attribute(s) -

Attribute Name: VirtualizationMode, setting new value to: NPAR

- PASS: PATCH command passed to set network attribute pending values and create next reboot config job, status code 202 returned

- PASS, JID_414253102588 next reboot config JID successfully created

- INFO: JobStatus not scheduled, current status is: New
- PASS, JID_414253102588 job id successfully scheduled

- INFO, user selected to reboot the server now to execute the job ID.

- INFO, Current server power state is: On
- PASS, POST command passed to gracefully power OFF server, status code return is 204
- INFO, script will now verify the server was able to perform a graceful shutdown. If the server was unable to perform a graceful shutdown, forced shutdown will be invoked in 5 minutes
- INFO, unable to perform graceful shutdown, server will now perform forced shutdown
- PASS, POST command passed to perform forced shutdown, status code return is 204
- PASS, GET command passed to verify forced shutdown was successful and server is in OFF state
- PASS, Command passed to power ON server, status code return is 204
- INFO, JobStatus not completed, current status: "Task successfully scheduled.", execution time: "0:00:13"

- PASS, job ID JID_414253102588 successfully marked completed

- Final detailed job results -

@odata.context: /redfish/v1/$metadata#DellJob.DellJob
@odata.id: /redfish/v1/Managers/iDRAC.Embedded.1/Oem/Dell/Jobs/JID_414253102588
@odata.type: #DellJob.v1_2_0.DellJob
ActualRunningStartTime: 2022-01-05T17:36:01
ActualRunningStopTime: 2022-01-05T17:37:48
CompletionTime: 2022-01-05T17:37:48
Description: Job Instance
EndTime: TIME_NA
Id: JID_414253102588
JobState: Completed
JobType: NICConfiguration
Message: Job completed successfully.
MessageArgs: []
MessageArgs@odata.count: 0
MessageId: PR19
Name: Configure: NIC.Mezzanine.3-1-1
PercentComplete: 100
StartTime: 2022-01-05T17:28:30
TargetSettingsURI: None

- JOB ID JID_414253102588 completed in 0:03:48

C:\Python39>GetSetOemNetworkDevicePropertiesREDFISH.py -ip 192.168.0.120 -u root -p calvin -a NIC.Mezzanine.3-1-1 -A VirtualizationMode

Attribute Name: VirtualizationMode, Attribute value: NPAR
TrevorSquillario commented 2 years ago

This does it, thanks!!!