Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions BMCsetup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# BMC setup.py - setup the BMC for the host; check for brand and ensure redfish and ipmi over lan are enabled
import time
import subprocess

from wekapyutils.wekassh import RemoteServer

Expand Down Expand Up @@ -49,6 +50,24 @@ def lenovo_parse_return(string):
return trimmed


def get_ipmi_ip(channel=1):
# run 'ipmitool lan print' and extract the ip address from the output and return it
try:
# Run 'ipmitool lan print'
result = subprocess.run(['sudo', 'ipmitool', 'lan', 'print', str(channel)],
capture_output=True, text=True, check=True)
# Extract the IP address
for line in result.stdout.splitlines():
if ":" in line:
key, val = line.split(":", 1)
if key.strip() == "IP Address":
return val.strip()
except Exception as e:
log.error(f"Failed to run ipmitool: {e}, {e.stderr}")
log.error("Are you not running as 'root' and don't have passwordless sudo?")
return None


def bmc_setup(host, user, password):
# check for brand and ensure redfish and ipmi over lan are enabled
# enable redfish
Expand Down
8 changes: 1 addition & 7 deletions RedFishBMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from logging import getLogger

from setuptools.command.build_ext import if_dl
#from setuptools.command.build_ext import if_dl

#from paramiko.util import log_to_file

Expand Down Expand Up @@ -181,16 +181,10 @@ def change_settings(self, settings_dict):
return False

def check_settings(self, settings):
log.info(f"Checking BIOS settings on {self.name}")
if settings is None:
log.info(f"{self.name} There are no settings for this platform in the bios settings configuration file")
return 0

#if self.vendor == "Supermicro":
# settings = self.adjust_supermicro_settings(settings)
# if settings is None:
# return 0

count = 0
for key, value in settings.items():
if key not in self.bios_data.obj.Attributes:
Expand Down
36 changes: 27 additions & 9 deletions bios_settings.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# bios_settings.yml
# This file contains BIOS settings for various systems.
# It is used to configure BIOS settings for optimal performance and functionality.
# Each section represents a specific system or system type, with nested settings for different components.
#
# THESE SETTINGS ARE WHAT BIOS_TOOL CHANGES ON THE SERVER(S).

WEKA:
AMD:
'*':
Expand All @@ -17,7 +24,7 @@ WEKA:
BootMode: Uefi
SecureBoot: Disabled
SerialComm: OnConRedir
IommuSupport: Disabled
IommuSupport: Enabled
ProcX2Apic: Disabled
WEKApod - R6615:
LogicalProc: Disabled
Expand All @@ -36,9 +43,20 @@ WEKA:
BootMode: Uefi
SecureBoot: Disabled
SerialComm: OnConRedir
IommuSupport: Disabled
IommuSupport: Enabled
ProcX2Apic: Disabled

Intel:
WEKApod 2100C:
CpuInterconnectBusLinkPower: Disabled
EnergyEfficientTurbo: Disabled
EnergyPerformanceBias: MaxPower
PcieAspmL1: Disabled
ProcC1E: Disabled
ProcCStates: Disabled
ProcPwrPerf: MaxPerf
SriovGlobalEnable: Enabled
SysProfile: PerfOptimized
UncoreFrequency: MaxUFS
Dell Inc.:
AMD:
PowerEdge R6615:
Expand Down Expand Up @@ -165,13 +183,13 @@ Supermicro:
DFCstates_7103: Disabled
DeterminismControl_00F4: Manual
GlobalC_stateControl_00CD: Disabled
IOMMU_00EA: Disabled
IOMMU_00EA: Enabled
NUMANodesPerSocket_703E: NPS1
PowerProfileSelection_00F8: Maximum IO Performance Mode
SMTControl_00CB: Disabled
'*':
ACPISRATL3CacheAsNUMADomain: Disabled
IOMMU: Disabled
IOMMU: Enabled
NUMANodesPerSocket: NPS1
SMTControl: Disabled
DFCstates: Disabled
Expand All @@ -190,26 +208,26 @@ Supermicro:
Lenovo:
AMD:
ThinkSystem SR635 V3:
Secured_Core_IOMMU: Disabled
Secured_Core_IOMMU: Enabled
Processors_P_state1: Disabled
Processors_P_state2: Disabled
Processors_GlobalC_stateControl: Disabled
Processors_DeterminismSlider: Performance
Processors_DFC_States: Disabled
DevicesandIOPorts_IOMMU: Disabled
DevicesandIOPorts_IOMMU: Enabled
Processors_SMTMode: Disabled
Power_PCIePowerBrake: Disabled
OperatingModes_ChooseOperatingMode: CustomMode
LegacyBIOS_LegacyBIOS: Disabled
Processors_SOCP_states: P0
'*':
Secured_Core_IOMMU: Disabled
Secured_Core_IOMMU: Enabled
Processors_P_state1: Disabled
Processors_P_state2: Disabled
Processors_GlobalC_stateControl: Disabled
Processors_DeterminismSlider: Performance
Processors_DFC_States: Disabled
DevicesandIOPorts_IOMMU: Disabled
DevicesandIOPorts_IOMMU: Enabled
Processors_SMTMode: Disabled
Power_PCIePowerBrake: Disabled
OperatingModes_ChooseOperatingMode: CustomMode
Expand Down
Loading