HPE OneView
1833431 Members
3338 Online
110052 Solutions
New Discussion

Re: Update-OVServerProfile does not wait on task complete

 
uzimmermann
Frequent Advisor

Update-OVServerProfile does not wait on task complete

We are trying to automate firmware updates for our VMware ESXi systems, as part of the script we run Update-OVServerProfile to update from template.

The command unfortunately returns before the task it is complete, even if we pair it with "Update-OVServerProfile -Confirm:$false | Wait-OVTaskComplete" 

For example I am updating some Gen10 Plus Synergy modules and there are 3 firmware updates. BIOS, 4820C firmware and SPS firmware in this order. For the 4820 firmware it boots the SSP and the task returns as complete while the SSP boots.

The GUI shows the task still in progress. What other ways can I monitor this task to have finished before moving on?

 

4 REPLIES 4
ChrisLynch
HPE Pro

Re: Update-OVServerProfile does not wait on task complete

A few things:

  1. Update-OVServerProfile does wait for tasks to complete by default.  That is why the -Async parameter exists.  Within the Update-OVServerProfile Cmdlet, there is a call to Wait-OVTaskComplete.  However, the predefined timeout period is 20 minutes.  It can be overidden with a call similar to Get-OVServerProfile -Name MyProfile1 | Update-OVServerProfile -Confirm:$false -Async | Wait-OVTaskComplete -Timeout (New-Timespan -Minutes 20).
  2. Since this is a VMware environment, any reason why you aren't using vLCM?
I work at HPE
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
uzimmermann
Frequent Advisor

Re: Update-OVServerProfile does not wait on task complete

Ok, timeout being 20 minutes is the problem as even there were only 3 updates but SPP being involved it takes around 40 minutes.

I worked around this by waiting in a loop with "(get-ovserver -ServerName $server | Get-OVserverProfile),.state" checking for Normal.

 

ChrisLynch
HPE Pro

Re: Update-OVServerProfile does not wait on task complete

Just get the collection of tasks that return from Update-OVServerProfile, storing them into a variable, then loop using Get-OVTask to view its status instead.  You want to watch the task (aka job) running.  If it ends, especially with an error, you need to look at the task object and specifically the taskErrors property.

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

Re: Update-OVServerProfile does not wait on task complete

Hello @uzimmermann,

Let us know if you were able to resolve the issue.

If you have no further query and you are satisfied with the answer then kindly mark the topic as Solved so that it is helpful for all community members.