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

GetIdracLcSystemAttributesREDFISH.py does not work #8

Closed jimbr70 closed 6 years ago

jimbr70 commented 6 years ago

The urls all give error 404. The Bios Get Attributes sample works, proof env ir up, but cannot get the iDRAC, System, nor LC to work. Error 404 - attributes element apparently does not exist. This is against iDRAC 2.50.50.50 Will check back here in hope of a correction. What am I doing? need to setup server to pxe boot, need to enable ipmi, ... But if the simple calls to get attribute info do not work, I need another path.

jonas-werner commented 6 years ago

I believe the paths in "GetIdracLcSystemAttributesREDFISH.py" are only valid for 14G servers.

For 13G the quick and easy way to change settings is to export and import server config files (SCP). This works for essentially any setting the server is equipped with.

For example for IPMI:

  1. Set "ExportSystemConfigurationLocalREDFISH.py" to export the section you want (iDRAC for the IPMI setting). This is done on the following line in the script: payload = {"ExportFormat":"XML","ShareParameters":{"Target":"iDRAC"}}

You can use "All" for all settings or otherwise System, RAID, etc for other sections.

  1. Run "ExportSystemConfigurationLocalREDFISH.py" against the server you wish to pull the settings from.
  2. Modify the resulting XML file (Change <Attribute Name="IPMILan.1#Enable">Enabled</Attribute>)
  3. Run "ImportSystemConfigurationLocalFilenameREDFISH.py" and use your modified XML file as input

This will change any settings on the server to match the XML file.

For booting to PXE:

You can either use the Redfish script to change the boot order or modify the setting directly in the same fashion as the IPMI setting. Either update the "boot once" variable to PXE for a one-off boot target change or update the boot order for a permanent change.

texroemer commented 6 years ago

Jonas is correct. Get / Set iDRAC, System or Lifecycle Controller attributes using Redfish is currently only supported with iDRAC 9 on 14G. iDRAC 8 on 12G / 13G doesn't have support yet but support will be added for future iDRAC release.

I also updated the scripts to check for supported iDRAC version and return warning if current iDRAC version detected doesn't support this feature.

Thanks

texroemer commented 6 years ago

Forgot to mention you can get Lifecycle controller / iDRAC or System attributes using Server Configuration Profile feature. Here's an example of running the script and getting only LifeCycle Controller attributes. Before running the script, i modified the dictionary to pass in a target value of "LifecycleController" to get only these attributes.

Dictionary i modified:

payload = {"ExportFormat":"XML","ShareParameters":{"Target":"LifecycleController"}}

Example of running the script:

C:\Python27>ExportSystemConfigurationLocalREDFISH.py 192.168.0.100 root calvin

SystemConfiguration Model="PowerEdge R730" ServiceTag="CDVB7R1" TimeStamp="Tue Mar 13 17:51:00 2018"> !--Export type is Normal,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="LifecycleController.Embedded.1"> Attribute Name="LCAttributes.1#CollectSystemInventoryOnRestart">Enabled Attribute Name="LCAttributes.1#PartConfigurationUpdate">Apply always Attribute Name="LCAttributes.1#PartFirmwareUpdate">Match firmware of replaced part !-- Enabled--> Attribute Name="LCAttributes.1#IPChangeNotifyPS">Off Attribute Name="LCAttributes.1#VirtualAddressManagementApplication"> Attribute Name="LCAttributes.1#ProvisioningServer"> Attribute Name="LCAttributes.1#BIOSRTDRequested">False Attribute Name="LCAttributes.1#AutoUpdate">Disabled Attribute Name="LCAttributes.1#AutoBackup">Disabled /Component> /SystemConfiguration>

Job ID = JID_209814562259 Name = Export: Server Configuration Profile Message = Successfully exported Server Configuration Profile JobStatus = Completed

JID_209814562259 completed in: 0:00:02

Exported attributes also saved in file: 2018-3-13_19513_export.xml

C:\Python27>

jimbr70 commented 6 years ago

Appreciate various comments, from which I have a very good working implementation. Helped tremendously to know of version compatibility.

texroemer commented 6 years ago

Good to hear!

Thanks

jimbr70 commented 6 years ago

Hi,

I hope you don’t mind my reply here… There must be some document or method to find which redfish API to use based on the data item you want. Is there? I need to retrieve the values for FCoE WWN. I have all other items I need working but can’t find the api for this one. We’re on 2.50.50.50

Thank you, Jim Brannan | Field Solutions Engineer Office: +530-878-1123 Mobile: +916-719-8063 Work Week: Mon-Thurs, PDT OOO: 5/28, 7/2, 8/13-8/17 Email: jim.b@quali.commailto:jim.b@quali.com Web: www.quali.comhttp://www.quali.com/

[cid:image001.jpg@01D26B41.6DBC7800]http://www.quali.com/ D e v O p s A u t o m a t i o n [cid:image002.jpg@01D1D515.346663D0]https://twitter.com/qualisystems[cid:image003.jpg@01D1D515.346663D0]https://www.facebook.com/QualiSystems [cid:image004.jpg@01D1D515.346663D0] https://www.linkedin.com/company/qualisystems [cid:image005.jpg@01D1D515.346663D0] http://www.youtube.com/user/QualiSystems [cid:image006.jpg@01D1D515.346663D0] https://plus.google.com/+Qualisystems1/posts

texroemer commented 6 years ago

Hi,

This is currently not supported by iDRAC in current shipping versions but support will be available in next iDRAC8 release 2.60 which will be posted Q2 of this year (June - July time frame). Once 2.60 iDRAC version is released, to get FCoE WWN using Redfish, you will run a GET on URI:

"redfish/v1/Systems/System.Embedded.1/NetworkAdapters/"FC ID"/NetworkDeviceFunctions/"FC port ID""

Example:

"redfish/v1/Systems/System.Embedded.1/NetworkAdapters/FC.Slot.4/NetworkDeviceFunctions/FC.Slot.4-1"

As a workaround for now, you can get this information using RACADM:

Example:

racadm>>get fc.PortConfig.1 racadm get fc.PortConfig.1 [Key=FC.Slot.4-1#PortConfig]

DeviceName=QLogic QLE2740 32Gb FC Adapter

PortNumber=1

PortSpeed=Auto VirtualWWN=20:00:00:24:FF:12:FC:B1 VirtualWWPN=21:00:00:24:FF:12:FC:B1

WWN=20:00:00:24:FF:12:FC:B1

WWPN=21:00:00:24:FF:12:FC:B1