Getting Server Profile Template information, converting it to PowerShell commands and reimporting it by using the automatically generated PowerShell code.
Using following command to generate the PowerShell code:
PowerShell Code for converting the Server Profile Templates into scripts works fine but you are not able to use the generated code to reimport the Server Profile Template because DirectoryGroups and ManageIloSettings parameters are not set correctly.
Here are the examples of two sections in the code, I will show only the differences. For the whole code and profile in JSON I will contact separately.
1. # ------------------- iLO Settings Policy
Generated
$iloSettings = New-OVServerProfileIloPolicy .... -DirectoryGroups $mpLocalAccounts -ManageIloHostname $mpHostName
> $mpLocalAccounts - no such variable at all
Generate manually a simple Server Profile Template with at least one Directory Group and iLO settings modifications.
Run "Get-OVServerProfileTemplate | ConvertTo-OVPowerShellScript" to generate PowerShell code for this Server Profile Template
Try to reimport the Server Profile Template by using the automatically generated PowerShell code
You will get an error that will state missing/invalid arguments.
Workaround: manually add correct variables and parameters into the automatically generated code will make the code runable.
Example execution with error message:
New-OVServerProfileIloPolicy : Cannot validate argument on parameter 'DirectoryGroups'. The argument is null or empty.
Provide an argument that is not null or empty, and then try the command again.
At line:88 char:292
+ ... s $mpDirectoryServerAddress -DirectoryGroups $mpLocalAccounts -Manage ...
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [New-OVServerProfileIloPolicy], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,New-OVServerProfileIloPolicy
New-OVServerProfileTemplate : Missing an argument for parameter 'ManageIloSettings'. Specify a parameter of type
'System.Boolean' and try again.
At line:90 char:510
+ ... -BiosConsistencyChe
```cking $biosConsistency -ManageIloSettings -IloSet ...
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-OVServerProfileTemplate], ParameterBindingException
+ FullyQualifiedErrorId : MissingArgument,New-OVServerProfileTemplate
Version Information
HPE OneView PowerShell Library Version (Get-HPOVVersion or $PSLibraryVersion):
Expected Behavior
Getting Server Profile Template information, converting it to PowerShell commands and reimporting it by using the automatically generated PowerShell code. Using following command to generate the PowerShell code:
Get-OVServerProfileTemplate -name $name | ConvertTo-OVPowerShellScript | Out-File $path
Actual Behavior
PowerShell Code for converting the Server Profile Templates into scripts works fine but you are not able to use the generated code to reimport the Server Profile Template because DirectoryGroups and ManageIloSettings parameters are not set correctly. Here are the examples of two sections in the code, I will show only the differences. For the whole code and profile in JSON I will contact separately.
1. # ------------------- iLO Settings Policy
Generated
How it should be
2. # -------------- Attributes for advanced settings
Generated
How it should be
Steps to reproduce
Example execution with error message:
Version Information
HPE OneView PowerShell Library Version (
Get-HPOVVersion
or$PSLibraryVersion
):HPE OneView Appliance Version (Get-HPOVVersion -ApplianceVer):
OneView 6.30. Tested at OneView, Synergy OV, OV DCS, Synergy DCS. BL gen10, DL gen10, Synergy gen10.
Output from $PSVersionTable on your Windows Host: