Configure HPE G10 Server BIOS via PowerShell

Last post was about configuring HPE smart array and create logical drives on HPE G10 servers via PowerShell (HPE Scripting Tools for PowerShell). This post is about configuring HPE G10 BIOS via PowerShell by using HPE BIOS cmdlets. As I have mentioned in the last post, there are cmdltes available for Smart Array, BIOS, iLO and OA which helping administrators to configure and deploy servers faster than regular ways and without no additional cost.

In order to configure HPE BIOS via PowerShell, you need to download and install HPE Scripting Tools for PowerShell:

Scripting Tools for Windows PowerShell

Sample Script

The below script will configure BIOS configuration for database server on HPE DL580 G10:

$Servers= "iLO IP1","iLO IP2"
$Credential=Get-Credential
ForEach ($Server in $Servers)
{
	$BIOSConnection= Connect-HPEBIOS -IP $Server -Credential $Credential -DisableCertificateAuthentication
	$iLOConnection= Connect-HPEiLO -IP $Server -Credential $Credential -DisableCertificateAuthentication
	Start-Sleep -s 30
	#Restore Defaults
	Reset-HPEBIOSUserDefault -Connection $BIOSConnection -RestoreDefault
	Start-Sleep -s 30
	$HostPower= Get-HPEiLoServerPower -Connection $iLOConnection
	If ($HostPower.Power -eq "Off")
	{
		Set-HPEiLoServerPower -Connection $iLOConnection -Power on
	}
	Else
	{
		Reset-HPEiLO -Connection $iLOConnection -Device Server -Confirm:$false
	}
	Disconnect-HPEiLO -Connection $iLOConnection
	Disconnect-HPEBIOS -Connection $BIOSConnection
}
Start-Sleep -s 900
ForEach ($Server in $Servers)
{
	$BIOSConnection= Connect-HPEBIOS -IP $Server -Credential $Credential -DisableCertificateAuthentication
	$iLOConnection= Connect-HPEiLO -IP $Server -Credential $Credential -DisableCertificateAuthentication
	#Workload Profile
	Set-HPEBIOSWorkloadProfile -Connection $BIOSConnection -WorkloadProfile Custom
	#Server Availability
	Set-HPEBIOSServerAvailability -Connection $BIOSConnection -PowerButton Disabled -PowerOnDelay 60Second
	#Processor Options
	Set-HPEBIOSProcessorOption -Connection $BIOSConnection -IntelHyperthreading Enabled -ProcessorX2ApicSupport Disabled
	#Memory Options
	Set-HPEBIOSAdvancedMemoryProtection -Connection $BIOSConnection -AdvancedMemoryProtection AdvancedECCSupport
	Set-HPEBIOSMemoryConfiguration -Connection $BIOSConnection -MemoryRefreshRate Refreshx1 -MemoryPatrolScrubbing Disabled 
	#Virtualization Options
	Set-HPEBIOSVirtualization -Connection $BIOSConnection -CPUVirtualization Disabled  -Intel_VT_d2 Disabled -SR_IOV Disabled
	#Boot Options
	Set-HPEBIOSBootMode -Connection $BIOSConnection -BootMode UEFIMode
	#Power and Performance Options
	Set-HPEBIOSAdvancedPerformanceTuningOption -Connection $BIOSConnection -ProcessorJitterControl Disabled -ProcessorJitterControlOptimization ZeroLatency -EnergyEfficientTurbo Disabled -UncoreFrequencyScaling Maximum -NUMAGroupSizeOptimization Clustered -SubNUMAClustering Disabled 
	Set-HPEBIOSPowerRegulator -Connection $BIOSConnection -PowerRegulator OSControlMode
	Set-HPEBIOSProcessorPower -Connection $BIOSConnection -MinimumProcessorIdlePowerCoreState C1EState -MinimumProcessorIdlePowerPackageState PackageC3State -EnergyPerformanceBias MaximumPerformance -CollaborativePowerControl Disabled -IntelDMILinkFrequency Auto
	Set-HPEBIOSIntelTurboBoost -Connection $BIOSConnection -IntelTurboBoost Disabled
	Set-HPEBIOSPrefetcher -Connection $BIOSConnection -HWPrefetcher Enabled -AdjacentSectorPrefetch Enabled -DCUStreamerPrefetcher Enabled -DCUIPPrefetcher Enabled -LLCPrefetcher Disabled -XPTPrefetcher Auto
	Set-HPEBIOSUPILinkPower -Connection $BIOSConnection -IntelUPILinkPowerManagement Disabled 
	$HostPower= Get-HPEiLoServerPower -Connection $iLOConnection
	If ($HostPower.Power -eq "Off")
	{
		Set-HPEiLoServerPower -Connection $iLOConnection -Power on
	}
	Else
	{
		Reset-HPEiLO -Connection $iLOConnection -Device Server -Confirm:$false
	}
	Disconnect-HPEiLO -Connection $iLOConnection
	Disconnect-HPEBIOS -Connection $BIOSConnection
}

The above script needs same credential on multiple servers if you want to configure BIOS on multiple servers at same time. Also don’t run script on server that server has production server, it has been created for first deployment. Replace “iLO IP 1” and others with your servers’ iLO IP addresses.

Further Reading

Why Device Bay IP Doesn’t Change in HPE BladeSystem?

[Script]: Enable/Disable vMotion on VMKernel Ports via PowerCLI

Configure NTP on iLO via HPE Scripting Tools for Windows PowerShell

How to Create Logical Drive on HPE DL580 G10 by PowerShell

Davoud Teimouri

Davoud Teimouri is as a professional blogger, vExpert 2015/2016/2017/2018/2019, VCA, MCITP. This blog is started with simple posts and now, it has large following readers.

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to our newsletter and join other subscribers

Holler Box