HPE OneView
1826269 Members
3605 Online
109692 Solutions
New Discussion

Re: with PowerShell is it possible to update \ activate firmware installation to Immediate

 
SOLVED
Go to solution
DDDave
Member

with PowerShell is it possible to update \ activate firmware installation to Immediately

 
6 REPLIES 6
DDDave
Member

Re: with PowerShell is it possible to update \ activate firmware installation to Immediate

Should have  said this is in HP Openview 

ChrisLynch
HPE Pro

Re: with PowerShell is it possible to update \ activate firmware installation to Immediate

Can you please describe in more detail on what you are trying to do?  Are you first trying to stage the baseline update installation and then activate later?  Are you trying to install the baseline update immediately?  What Cmdlets are you using and can you provide a sample snippet of your code?

I work at HPE
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
DDDave
Member

Re: with PowerShell is it possible to update \ activate firmware installation to Immediate

Hi Chris, so te profle has been set, now trying to stage the deployement to installl imdetialy by updating the servers profile

$profile = Get-OVServerProfile -Name "Server_profile"

# Assuming $profile already contains the server profile data
$profile.firmware.manageFirmware = $true
$profile.firmware.forceInstallFirmware = $true # Forcing the firmware installation
$profile.firmware.firmwareInstallType = "FirmwareOnly"
$profile.firmware.firmwareActivationType = "Immediate"
$profile.firmware.firmwareScheduleDateTime = [DateTime]::Now.ToString("yyyy-MM-ddTHH:mm:ss") # Scheduling now

# Apply the changes
Save-OVServerProfile -InputObject $profile

Result

Appliance Name Owner Created Duration TaskState PercentComplete
--------- ---- ----- ------- -------- --------- ---------------
0.0.0.0 Update domain\username 10/22/2024 8:01:59 AM 00:00:00 Error 100

 

type : ServerProfileV12
uri : /rest/server-profiles/4a88dcb5-4bb7-48c8-a790-037ccbf6f9bc
profileUUID : 4a88dcb5-4bb7-48c8-a790-037ccbf6f9bc
name : xxxxxxxxxxx
description :
serialNumber : xxxxxxxxx
uuid : 36353738-3936-5A43-3238-303230464C46
iscsiInitiatorName : iqn.2015-02.com.hpe:oneview-4a88dcb5-4bb7-48c8-a790-037ccbf6f9bc
iscsiInitiatorNameType : AutoGenerated
serverProfileTemplateUri : /rest/server-profile-templates/55178810-5502-4326-bcd3-d4771d83f473
templateCompliance : Compliant
serverHardwareUri : /rest/server-hardware/36353738-3936-5A43-3238-303230464C46
serverHardwareTypeUri : /rest/server-hardware-types/6E67F36C-3697-4F7E-8E63-8E25DB8B6F92
enclosureGroupUri :
enclosureUri :
enclosureBay :
affinity :
associatedServer : xxxxxxx
hideUnusedFlexNics :
firmware : @{firmwareBaselineUri=/rest/firmware-drivers/SPP_Gen10x_FULL_2024-09-00-00; manageFirmware=True; forceInstallFirmware=False; firmwareInstallType=FirmwareOnly; firmwareScheduleDateTime=; firmwareActivationType=NotScheduled;
reapplyState=NotApplying; consistencyState=Inconsistent}
macType : Physical
wwnType : Physical
serialNumberType : Physical
category : server-profiles
created : 2024-10-12T07:57:20.222Z
modified : 2024-10-16T10:57:39.840Z
status : OK
state : Normal
serverHardwareReapplyState : NotApplying
inProgress : False
taskUri : /rest/tasks/7e46dadb-020e-4374-9109-2e70c310595c
connectionSettings : @{reapplyState=NotApplying; connections=System.Object[]}
bootMode : @{manageMode=False; mode=; pxeBootPolicy=; secureBoot=Unmanaged}
boot : @{manageBoot=False; order=System.Object[]}
bios : @{manageBios=False; overriddenSettings=System.Object[]; reapplyState=NotApplying; consistencyState=Unknown}
managementProcessor : @{reapplyState=NotApplying; manageMp=False; mpSettings=System.Object[]}
localStorage : @{sasLogicalJBODs=System.Object[]; controllers=System.Object[]; reapplyState=NotApplying}
sanStorage : @{manageSanStorage=False; volumeAttachments=System.Object[]; sanSystemCredentials=System.Object[]; reapplyState=NotApplying}
osDeploymentSettings : @{osDeploymentPlanUri=; osVolumeUri=; forceOsDeployment=False; osCustomAttributes=System.Object[]; reapplyState=NotApplying; deployMethod=; deploymentPortId=; deploymentMac=}
scopesUri : /rest/scopes/resources/rest/server-profiles/4a88dcb5-4bb7-48c8-a790-037ccbf6f9bc
serviceManager :
eTag : 1729076087012/33
refreshState : NotRefreshing

ChrisLynch
HPE Pro
Solution

Re: with PowerShell is it possible to update \ activate firmware installation to Immediate

You need to examine the task resource that is returned.  You can amend the Save-OVServerProfile call with -OutVariable Task, then look at the $Task variable contents.  Typically, you will want to look at $Task[0].taskErrors. An example:

# Attempt to save the server profile resource
Save-OVServerProfile -InputObject $profile -OutVariable Task

# If the task returned had an error, let's look at it
if ($Task.taskState -eq "Error") {

    Write-Host "Error reason: " $Task.stateReason

    # Examine each potential task error message
    ForEach ($t in $Task.taskErrors) {

        Write-Host "Error Description: " $t.message
        Write-Host "Error Code: " $t.errorCode
        Write-Host "Error Recommended Actions: " $t.recommendedActions

    }

}
I work at HPE
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
DDDave
Member

Re: with PowerShell is it possible to update \ activate firmware installation to Immediate

Hi Chris

 

Thanks for that the issue was the date format

Error reason: ValidationError
Error Description: The specified firmware activation schedule "2024-10-23T08:25:14" is not valid.
Error Code: InvalidDateTimeForFirmwareSchedule
Error Recommended Actions: Specify a valid date and time in the format yyyy-MM-ddTHH:mm:ss.SSSZ.

 

Updated line to

$profile.firmware.firmwareScheduleDateTime = [DateTime]::Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ") # Scheduling now

and now works like a charm 

Sunitha_Mod
Honored Contributor

Re: with PowerShell is it possible to update \ activate firmware installation to Immediate

Hello @DDDave,

That's Awesome! 

We are extremely glad to know the issue has been resolved and we appreciate you for keeping us updated.