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

How to add a new Boot Source when it is not available #75

Closed kgrvamsi closed 5 years ago

kgrvamsi commented 5 years ago

I want to add a new boot source and I'm trying to use the following api but not sure how to do this call (PATCH)

/redfish/v1/Systems/System.Embedded.1/BootSources/Settings

I already have NIC.Integrated.1-1-1 but I want to add NIC.Integrated.1-4-1.

Can anyone help me how to do this?

texroemer commented 5 years ago

Hi @kgrvamsi

If you are trying to add a new NIC device to the boot order, you must enable the NIC device itself to show up in the BIOS boot order.

Since you are using BIOS boot mode based off the NIC FQDD name you listed, you must enable Legacy Boot Protocol setting on the NIC itself for it to show up in the boot order. Currently we don't support setting legacy boot protocol attribute using PATCH command (this support is coming in future iDRAC release though) but you can use Server Configuration Profile to configure this attribute.

Example below shows getting current BIOS boot order, then using SCP with ImportBuffer parameter to set Legacy boot protocol to PXE for NIC.Integrated.1-4-1. Once SCP job is marked completed, check the boot order and it should report NIC.Integrated.1-4-1 now.

Example of the body i pass in for SCP ImportBuffer:

payload = {"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<Component FQDD=\"NIC.Integrated.1-4-1\"><Attribute Name=\"LegacyBootProto\">PXE"}

C:\Python27>GetBiosBootOrderBootSourceStateREDFISH.py -ip 192.168.0.120 -u root -p calvin

Index: 0 Enabled: true Id: BIOS.Setup.1-1#BootSeq#HardDisk.List.1-1#81dc1ab05577b0942967953640301e64 Name: HardDisk.List.1-1

Index: 1 Enabled: true Id: BIOS.Setup.1-1#BootSeq#NIC.Integrated.1-3-1#d5abab1da8c0d948729f6bfe325f39da Name: NIC.Integrated.1-3-1

C:\Python27>ImportSystemConfigurationLocalREDFISH.py -ip 192.168.0.120 -u root -p calvin

@odata.type: #DellJob.v1_0_2.DellJob JobState: Completed Description: Job Instance TargetSettingsURI: None MessageArgs: [] CompletionTime: 2019-08-21T20:56:24 PercentComplete: 100 StartTime: TIME_NOW MessageId: SYS053 Message: Successfully imported and applied Server Configuration Profile. EndTime: None Id: JID_664385336060 JobType: ImportConfiguration Name: Import Configuration

C:\Python27>GetBiosBootOrderBootSourceStateREDFISH.py -ip 192.168.0.120 -u root -p calvin

Index: 0 Enabled: true Id: BIOS.Setup.1-1#BootSeq#HardDisk.List.1-1#81dc1ab05577b0942967953640301e64 Name: HardDisk.List.1-1

Index: 1 Enabled: true Id: BIOS.Setup.1-1#BootSeq#NIC.Integrated.1-3-1#d5abab1da8c0d948729f6bfe325f39da Name: NIC.Integrated.1-3-1

Index: 2 Enabled: true Id: BIOS.Setup.1-1#BootSeq#NIC.Integrated.1-4-1#ddac3082e9d47796f9a5e474986fc65b Name: NIC.Integrated.1-4-1

kgrvamsi commented 5 years ago

Hi @texroemer thanks for the quick reply

I'm trying to replicate this command over redfish api

racadm set BIOS BiosBootSettings.BootSeq NIC.Integrated 1-4-1,HardDisk.List.1-1

and i assume once i run the above command i can see those as part of the BootSources api right?

texroemer commented 5 years ago

The RACADM command you stated is used for only changing the ordering of BIOS boot order devices, it will not add new devices to the boot order list.

Are you wanting to change current boot order or add a new boot order device, then change the boot order?

kgrvamsi commented 5 years ago

add a new boot order device and then change the boot order @texroemer .

BTW confused on this payload you mentioned before...is there any typo?

{"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<Component FQDD="NIC.Integrated.1-4-1"><Attribute Name="LegacyBootProto">PXE"}

kgrvamsi commented 5 years ago

This worked for me { "ShareParameters": { "Target": "ALL" }, "ImportBuffer": "<SystemConfiguration><Component FQDD=\"NIC.Integrated.1-4-1\"><Attribute Name=\"LegacyBootProto\">PXE</Attribute></Component></SystemConfiguration>" }

texroemer commented 5 years ago

Yes, that's correct. Sorry about that, when i copied and pasted payload example, I forgot to paste it as code.

kgrvamsi commented 5 years ago

Np .....Thanks for guiding me to the right way.....i can see the interface once i imported the configuration.... Appreciate your help

texroemer commented 5 years ago

No problem, glad to help!

kgrvamsi commented 5 years ago

@texroemer i have one more question on how to delete a added boot device?

texroemer commented 5 years ago

Hi @kgrvamsi

If you want to completely remove a device from the boot order, you must either delete the device or change a current setting on the device itself. Examples would be if you have a RAID volume and you see a RAID entry in the boot order, you would delete the RAID volume. Or if you have a NIC port in the boot order, you can set Legacy Boot Protocol attribute to None.