Home - HewlettPackard/sdflexutils GitHub Wiki

Welcome to the sflexutils wiki!

sdflexutils is a library for interfacing and managing HPE Superdome Flex 280 and Superdome Flex Servers. This library is used by OpenStack Ironic hardware type sdflex-redfish for managing Superdome Flex 280 and Superdome Flex Servers in OpenStack Ironic environment. This hardware type is provided by sdflex-ironic-driver.

sdflexutils library can also be used independently (without OpenStack Ironic) to perform the following tasks remotely on Superdome Flex 280 and Superdome Flex systems.

  • Power operations
    • get power status
    • power ON / OFF
    • reset server
  • Virtual media operations
    • get / enable virtual media
    • get virtual media device status
    • insert / eject virtual media
  • get / set Boot device (Boot source) setting
  • Enable / Disable Secure boot
  • get / set BIOS settings
    • get current bios settings
    • get pending bios settings
    • set bios settings
  • get / set http_boot_uri
  • Server Firmware update

Table of Contents

Installing sdflexutils

Install sdflexutils PyPI module:

 pip3 install sdflexutils

Prerequisites

  • Python3
  • For inserting virtual media, images should be hosted either on NFS server or CIFS server

Usage Examples

For interfacing with the Superdome Flex Server, use SDFlexClient object:

get_host_power_status()

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.get_host_power_status()

Response

 'OFF'

set_host_power(target_value)

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.set_host_power("ON")
 >>> sdflex_client.get_host_power_status()

Response

 'ON'
 >>> sdflex_client.set_host_power("OFF")
 >>> sdflex_client.get_host_power_status()

Response

 'OFF'

reset_server()

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.reset_server()

get_vmedia_status()

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.get_vmedia_status()

Response

 False

enable_vmedia(value)

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.enable_vmedia(True)
 >>> sdflex_client.get_vmedia_status()

Response

 True

get_vmedia_device_status(device)

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.get_vmedia_device_status("cd0")

Snippets from the redfish response

 "Image": null
 "Inserted": false
 "TransferMethod": null
 "Id": "CD0"

Insert virtual media with NFS protocol

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> data = {'remote_image_share_type': 'nfs'}
 >>> sdflex_client.insert_vmedia("nfs://10.10.1.20/home/ubuntu/nfsfolder/bp-SuperdomeFlex-2021-10-04-00.iso", "cd0", data)
 >>> sdflex_client.get_vmedia_device_status("cd0")

Snippets from the redfish response

 "Image": "nfs://10.10.1.20/home/ubuntu/nfsfolder/bp-SuperdomeFlex-2021-10-04-00.iso"
 "Inserted": true
 "TransferProtocolType": "NFS"
 "Id": "CD0"

NOTE:
In client.SDFlexClient, IP is Superdome Flex RMC IP address and Partition0 is Superdome Flex nPar partition ID In sdflex_client.insert_vmedia, IP in the image url is NFS server IP address and cd0 is the target device

Insert virtual media with CIFS protocol

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> data = {'remote_image_user_name': 'guest', 'remote_image_user_password': 'guest', 'remote_image_share_type': 'cifs'}
 >>> sdflex_client.insert_vmedia("cifs://10.10.1.20/home/ubuntu/cifsfolder/bp-SuperdomeFlex-2021-10-04-00.iso", "cd0", data)
 >>> sdflex_client.get_vmedia_device_status("cd0")

Snippets from the redfish response

 "Image": "cifs://10.10.1.20/home/ubuntu/cifsfolder/bp-SuperdomeFlex-2021-10-04-00.iso"
 "Inserted": true
 "TransferProtocolType": "CIFS"
 "Id": "CD0"

NOTE:

In client.SDFlexClient, IP is Superdome Flex RMC IP address and Partition0 is Superdome Flex nPar partition ID
In sdflex_client.insert_vmedia, IP in the image url is CIFS server IP address and cd0 is the target device
In data, remote_image_user_name is to be set with cifs user name and remote_image_user_password is cifs user password

eject_vmedia(device)

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.eject_vmedia("cd0")
 >>> sdflex_client.get_vmedia_device_status("cd0")

Snippets from the redfish response

 "Image": null
 "Inserted": false
 "TransferMethod": null
 "Id": "CD0"

get_allowed_system_boot_source_values()

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client._get_sushy_system().get_allowed_system_boot_source_values()

Response with sdflexutils version 1.5.x

 {<BootSource.HDD: 'Hdd'>, <BootSource.SD_CARD: 'SDCard'>, <BootSource.CD: 'Cd'>, <BootSource.USB: 'Usb'>, <BootSource.UEFI_HTTP: 'UefiHttp'>, 
 <BootSource.NONE: 'None'>, <BootSource.UEFI_SHELL: 'UefiShell'>, <BootSource.REMOTE_DRIVE: 'RemoteDrive'>, <BootSource.BIOS_SETUP: 'BiosSetup'>, 
 <BootSource.PXE: 'Pxe'>}

Response with sdflexutils version 1.4.x

 {'pxe', 'usb', 'none', 'sd card', 'cd', 'bios setup', 'uefi shell', 'hdd', 'uefi http'}

get_system_boot_source and enabled

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client._get_sushy_system().boot.target
 >>> sdflex_client._get_sushy_system().boot.enabled

Response with sdflexutils version 1.5.x

 <BootSource.HDD: 'Hdd'>
 <BootSourceOverrideEnabled.CONTINUOUS: 'Continuous'>

Response with sdflexutils version 1.4.x

 'hdd'
 'continuous'

set_system_boot_source(target_device, enabled=frequency)

With sdflexutils version 1.5.x

 >>> import sushy
 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client._get_sushy_system().set_system_boot_source(sushy.BootSource.PXE, enabled=sushy.BootSourceOverrideEnabled.ONCE)
 >>> sdflex_client._get_sushy_system().boot.target
 >>> sdflex_client._get_sushy_system().boot.enabled

Response

 <BootSource.PXE: 'Pxe'>
 <BootSourceOverrideEnabled.ONCE: 'Once'>

With sdflexutils version 1.4.x

 >>> import sushy
 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client._get_sushy_system().set_system_boot_source('pxe', 'once')
 >>> sdflex_client._get_sushy_system().boot.target
 >>> sdflex_client._get_sushy_system().boot.enabled

Response

 'pxe'
 'once'

NOTE:
Valid values for enabled (boot frequency) are:

  • sdflexutils version 1.5.x: enabled=sushy.BootSourceOverrideEnabled.ONCE, enabled=sushy.BootSourceOverrideEnabled.CONTINUOUS, enabled=sushy.BootSourceOverrideEnabled.DISABLED
  • sdflexutils version 1.4.x: 'once', 'continuous', 'disabled'

get_secure_boot_mode()

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.get_secure_boot_mode()

Response

 False

set_secure_boot_mode()

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.set_secure_boot_mode(True)
 >>> sdflex_client.get_secure_boot_mode()

Response

 False

Response for get_secure_boot_mode() after reboot / power cycle

 True

get_current_bios_settings()

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.get_current_bios_settings()

Response

 {'AdjSecPrefetch': 'Enabled', 'AdvancedMemProtection': 'ADDDC', 'AllowPcieSlotOpRoms': 'Enabled', 'BootSlots': '3,5,8', 'DcuIpPrefetcher': 'Enabled', 
 'DcuStreamPrefetcher': 'Enabled', 'Dhcpv4': 'Enabled', 'Eadr': 'Disabled', 'EistCoordType': 'HW_ALL', 'EnergyEfficientTurbo': 'Enabled', 
 'EnergyPerfBias': 'BalancedPerf', 'EnhancedProcPerf': 'Disabled', 'ErrorInjection': 'Enabled', 'FastStringOperation': 'Enabled', 'HThread': 
 'Disabled', 'HwPrefetcher': 'Enabled', 'IntelDmiLinkFreq': 'Auto', 'IntelNicDmaChannels': 'Enabled', 'IntelProcVt': 'Enabled', 'IntelProcVtd': 'Auto', 
 'IntelUpiPowerManagement': 'Enabled', 'Ipv4Address': '', 'Ipv4Gateway': '', 'Ipv4PrimaryDNS': '', 'Ipv4PxeServerAddress': '', 'Ipv4SecondaryDNS': '', 
 'Ipv4SubnetMask': '', 'Ipv6Address': '', 'Ipv6ConfigPolicy': 'Automatic', 'Ipv6Gateway': '', 'Ipv6PrimaryDNS': '', 'Ipv6SecondaryDNS': '', 
 'LlcDeadLineAlloc': 'Enabled', 'LlcPrefetch': 'Disabled', 'LocalRemoteThreshold': 'Auto', 'MaxMemBusFreqMHz': 'Auto', 'MemOfflineTestRepair': 
 'Disabled', 'MemPatrolScrubbing': 'Enabled', 'MemRefreshRate': 'Refreshx1', 'MinProcIdlePkgState': 'C6NonRetention', 'MinProcIdlePower': 'C6', 
 'MmiohGranularity': '64GB', 'NumaGroupSizeOpt': 'Clustered', 'PageRetireSupport': 'Enabled', 'PmemAppDirectSnoopyMode': 'Disabled', 
 'PmemAutoFwUpdate': 'Enabled', 'PmemPerformance': 'BandwidthOptimized', 'PmemQos': 'Disabled', 'PowerRegulator': 'OsControl', 'ProcTurbo': 'Enabled', 
 'ProcX2Apic': 'Auto', 'SnoopThrottleConfig': 'Auto', 'Sriov': 'Enabled', 'SubNumaClustering': 'Disabled', 'ThermalMonStatusFilter': 'Disabled', 
 'UncoreFreqScaling': 'Auto', 'UpiIrqThreshold': 14, 'UpiRrqThreshold': 10, 'UrlBootFile': '', 'UrlBootFile2': '', 'UsbControl': 'UsbEnabled', 
 'WorkloadProfile': 'MC'}

set_bios_settings(data)

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> data = {"UrlBootFile": "http://1.1.1.1:8010/bootx64.efi", "Dhcpv4": "Disabled"}
 >>> sdflex_client.set_bios_settings(data)
 >>> sdflex_client.get_current_bios_settings()
 {'AdjSecPrefetch': 'Enabled', 'AdvancedMemProtection': 'ADDDC', 'AllowPcieSlotOpRoms': 'Enabled', 'BootSlots': '3,5,8', 'DcuIpPrefetcher': 'Enabled', 
 'DcuStreamPrefetcher': 'Enabled', 'Dhcpv4': 'Enabled', 'Eadr': 'Disabled', 'EistCoordType': 'HW_ALL', 'EnergyEfficientTurbo': 'Enabled', 
 'EnergyPerfBias': 'BalancedPerf', 'EnhancedProcPerf': 'Disabled', 'ErrorInjection': 'Enabled', 'FastStringOperation': 'Enabled', 'HThread': 
 'Disabled', 'HwPrefetcher': 'Enabled', 'IntelDmiLinkFreq': 'Auto', 'IntelNicDmaChannels': 'Enabled', 'IntelProcVt': 'Enabled', 'IntelProcVtd': 'Auto', 
 'IntelUpiPowerManagement': 'Enabled', 'Ipv4Address': '', 'Ipv4Gateway': '', 'Ipv4PrimaryDNS': '', 'Ipv4PxeServerAddress': '', 'Ipv4SecondaryDNS': '', 
 'Ipv4SubnetMask': '', 'Ipv6Address': '', 'Ipv6ConfigPolicy': 'Automatic', 'Ipv6Gateway': '', 'Ipv6PrimaryDNS': '', 'Ipv6SecondaryDNS': '', 
 'LlcDeadLineAlloc': 'Enabled', 'LlcPrefetch': 'Disabled', 'LocalRemoteThreshold': 'Auto', 'MaxMemBusFreqMHz': 'Auto', 'MemOfflineTestRepair': 
 'Disabled', 'MemPatrolScrubbing': 'Enabled', 'MemRefreshRate': 'Refreshx1', 'MinProcIdlePkgState': 'C6NonRetention', 'MinProcIdlePower': 'C6', 
 'MmiohGranularity': '64GB', 'NumaGroupSizeOpt': 'Clustered', 'PageRetireSupport': 'Enabled', 'PmemAppDirectSnoopyMode': 'Disabled', 
 'PmemAutoFwUpdate': 'Enabled', 'PmemPerformance': 'BandwidthOptimized', 'PmemQos': 'Disabled', 'PowerRegulator': 'OsControl', 'ProcTurbo': 'Enabled', 
 'ProcX2Apic': 'Auto', 'SnoopThrottleConfig': 'Auto', 'Sriov': 'Enabled', 'SubNumaClustering': 'Disabled', 'ThermalMonStatusFilter': 'Disabled', 
 'UncoreFreqScaling': 'Auto', 'UpiIrqThreshold': 14, 'UpiRrqThreshold': 10, 'UrlBootFile': '', 'UrlBootFile2': '', 'UsbControl': 'UsbEnabled', 
 'WorkloadProfile': 'MC'}
 >>> sdflex_client.get_pending_bios_setting()
 {'AdjSecPrefetch': 'Enabled', 'AdvancedMemProtection': 'ADDDC', 'AllowPcieSlotOpRoms': 'Enabled', 'BootSlots': '3,5,8', 'DcuIpPrefetcher': 'Enabled', 
 'DcuStreamPrefetcher': 'Enabled', 'Dhcpv4': 'Disabled', 'Eadr': 'Disabled', 'EistCoordType': 'HW_ALL', 'EnergyEfficientTurbo': 'Enabled', 
 'EnergyPerfBias': 'BalancedPerf', 'EnhancedProcPerf': 'Disabled', 'ErrorInjection': 'Enabled', 'FastStringOperation': 'Enabled', 'HThread': 
 'Disabled', 'HwPrefetcher': 'Enabled', 'IntelDmiLinkFreq': 'Auto', 'IntelNicDmaChannels': 'Enabled', 'IntelProcVt': 'Enabled', 'IntelProcVtd': 'Auto', 
 'IntelUpiPowerManagement': 'Enabled', 'Ipv4Address': '', 'Ipv4Gateway': '', 'Ipv4PrimaryDNS': '', 'Ipv4PxeServerAddress': '', 'Ipv4SecondaryDNS': '', 
 'Ipv4SubnetMask': '', 'Ipv6Address': '', 'Ipv6ConfigPolicy': 'Automatic', 'Ipv6Gateway': '', 'Ipv6PrimaryDNS': '', 'Ipv6SecondaryDNS': '', 
 'LlcDeadLineAlloc': 'Enabled', 'LlcPrefetch': 'Disabled', 'LocalRemoteThreshold': 'Auto', 'MaxMemBusFreqMHz': 'Auto', 'MemOfflineTestRepair': 
 'Disabled', 'MemPatrolScrubbing': 'Enabled', 'MemRefreshRate': 'Refreshx1', 'MinProcIdlePkgState': 'C6NonRetention', 'MinProcIdlePower': 'C6', 
 'MmiohGranularity': '64GB', 'NumaGroupSizeOpt': 'Clustered', 'PageRetireSupport': 'Enabled', 'PmemAppDirectSnoopyMode': 'Disabled', 
 'PmemAutoFwUpdate': 'Enabled', 'PmemPerformance': 'BandwidthOptimized', 'PmemQos': 'Disabled', 'PowerRegulator': 'OsControl', 'ProcTurbo': 'Enabled', 
 'ProcX2Apic': 'Auto', 'SnoopThrottleConfig': 'Auto', 'Sriov': 'Enabled', 'SubNumaClustering': 'Disabled', 'ThermalMonStatusFilter': 'Disabled', 
 'UncoreFreqScaling': 'Auto', 'UpiIrqThreshold': 14, 'UpiRrqThreshold': 10, 'UrlBootFile': 'http://1.1.1.1:8010/bootx64.efi', 'UrlBootFile2': '', 
 'UsbControl': 'UsbEnabled', 'WorkloadProfile': 'MC'}

NOTE:

  • After performing BIOS settings, some of the the parameters need reboot to reflect the changed values in the current bios settings. To know whether it has set the values for the given parameters before rebooting, use get_pending_bios_settings() instead of get_current_bios_settings.
  • You can set one or more bios parameters with values as a dictionary to data variable and pass it to set_bios_setting(data) call

get_pending_bios_setting()

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.get_pending_bios_setting()

Response

 {'AdjSecPrefetch': 'Enabled', 'AdvancedMemProtection': 'ADDDC', 'AllowPcieSlotOpRoms': 'Enabled', 'BootSlots': '3,5,8', 'DcuIpPrefetcher': 'Enabled', 
 'DcuStreamPrefetcher': 'Enabled', 'Dhcpv4': 'Disabled', 'Eadr': 'Disabled', 'EistCoordType': 'HW_ALL', 'EnergyEfficientTurbo': 'Enabled', 
 'EnergyPerfBias': 'BalancedPerf', 'EnhancedProcPerf': 'Disabled', 'ErrorInjection': 'Enabled', 'FastStringOperation': 'Enabled', 'HThread': 
 'Disabled', 'HwPrefetcher': 'Enabled', 'IntelDmiLinkFreq': 'Auto', 'IntelNicDmaChannels': 'Enabled', 'IntelProcVt': 'Enabled', 'IntelProcVtd': 'Auto', 
 'IntelUpiPowerManagement': 'Enabled', 'Ipv4Address': '', 'Ipv4Gateway': '', 'Ipv4PrimaryDNS': '', 'Ipv4PxeServerAddress': '', 'Ipv4SecondaryDNS': '', 
 'Ipv4SubnetMask': '', 'Ipv6Address': '', 'Ipv6ConfigPolicy': 'Automatic', 'Ipv6Gateway': '', 'Ipv6PrimaryDNS': '', 'Ipv6SecondaryDNS': '', 
 'LlcDeadLineAlloc': 'Enabled', 'LlcPrefetch': 'Disabled', 'LocalRemoteThreshold': 'Auto', 'MaxMemBusFreqMHz': 'Auto', 'MemOfflineTestRepair': 
 'Disabled', 'MemPatrolScrubbing': 'Enabled', 'MemRefreshRate': 'Refreshx1', 'MinProcIdlePkgState': 'C6NonRetention', 'MinProcIdlePower': 'C6', 
 'MmiohGranularity': '64GB', 'NumaGroupSizeOpt': 'Clustered', 'PageRetireSupport': 'Enabled', 'PmemAppDirectSnoopyMode': 'Disabled', 
 'PmemAutoFwUpdate': 'Enabled', 'PmemPerformance': 'BandwidthOptimized', 'PmemQos': 'Disabled', 'PowerRegulator': 'OsControl', 'ProcTurbo': 'Enabled', 
 'ProcX2Apic': 'Auto', 'SnoopThrottleConfig': 'Auto', 'Sriov': 'Enabled', 'SubNumaClustering': 'Disabled', 'ThermalMonStatusFilter': 'Disabled', 
 'UncoreFreqScaling': 'Auto', 'UpiIrqThreshold': 14, 'UpiRrqThreshold': 10, 'UrlBootFile': 'http://1.1.1.1:8010/bootx64.efi', 'UrlBootFile2': '', 
 'UsbControl': 'UsbEnabled', 'WorkloadProfile': 'MC'}

NOTE:
get_pending_bios_Setting() is enabled from sdflexutils version 1.5.x, use the following method with sdflexutils version 1.4.x

 >>> sdflex_client._get_sushy_system().bios.pending_attributes

get_http_boot_uri()

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.get_http_boot_uri()

Response

set_http_boot_uri()

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems/Partition0')
 >>> sdflex_client.set_http_boot_uri("http://1.1.1.1:8010/bootx64.efi")
 >>> sdflex_client.get_http_boot_uri()

Response

 'http://1.1.1.1:8010/bootx64.efi'

Server firmware update

 >>> from sdflexutils import client
 >>> sdflex_client = client.SDFlexClient('https://10.10.1.57', 'administrator', 'password', 'redfish/v1/Systems')
 >>> sdflex_client.update_firmware("https://1.1.1.1/baseline_20221028_1.40.60_STABLE/ch-fw.tars", reinstall=False, exclude_npar_fw=False)

The parameters reinstall and exclude_npar_fw are optional and the default value for these parameters is False.

⚠️ **GitHub.com Fallback** ⚠️