Search code examples
apirestbios

how do I use ilorest to Configuring AMD Preferred IO Bus Number


there are enough instructions out there to do that manually, but I need it to be done using a script. https://support.hpe.com/hpesc/public/docDisplay?docId=sd00001068en_us&docLocale=en_US&page=t_config_AMD_preferred_IO_bus_number.html Use the Preferred IO Bus Number option to avail an improved PCIe performance.

Prerequisites Ensure that you have enabled the Preferred IO Bus AMD option. Procedure From the System Utilities screen, select System Configuration > BIOS/Platform Configuration (RBSU) > Power and Performance Options > I/O Options > Preferred IO Bus Number. Enter the PCI bus number [ranging from 0 to 255] of a device to receive Preferred IO. All end-points on the same AMD NorthBridge I/O (NBIO) receive the same improved performance.

Save your setting.


Solution

  • Took a while, but found it!

    hexNum=<the PCI number of the card I want preferred>
    hname=`hostname`
    decNum=$(echo "obase=10; ibase=16; $hexNum" | bc)
    
    # get the current value
    ilorest --cache-dir=${hname} login ${hname}-ilo -u $user -p $pass
    ilorest --cache-dir=${hname} select bios --url ${hname}-ilo -u $user -p $pass
    echo showing the current PreferredIOBusNumber
    ilorest --cache-dir=${hname} get PreferredIOBusNumber ${hname}-ilo -u $user -p $pass
    CurrentPIOBN=`ilorest --cache-dir=${hname} get PreferredIOBusNumber ${hname}-ilo -u $user -p $pass | grep PreferredIOBusNumber | cut -f2 -d '='`
    if [[ $CurrentPIOBN == $decNum ]]; then echo The correct PreferredIOBusNumber is already set, exiting with success ; exit 0 ; fi
    # set the new value
    ilorest --cache-dir=${hname} set PreferredIOBusNumber=$decNum
    ilorest --cache-dir=${hname} commit PreferredIOBusNumber ${hname}-ilo -u $user -p $pass