Navigation Menu

Skip to content

Commit

Permalink
-- Fixed New-HPOVServerProfileConnection where -VirtualFunctions para…
Browse files Browse the repository at this point in the history
…meter was not being honored correctly, and iSCSI connection type regression.

-- Fixed Get-HPOVIloSso to return correct iLO REST API root URI based on iLO4 or iLO5.
  • Loading branch information
ChrisLynchHPE committed Dec 3, 2018
1 parent 6338605 commit afe73ad
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 39 deletions.
7 changes: 4 additions & 3 deletions HPOneView.410.psd1
Expand Up @@ -27,7 +27,7 @@ THE SOFTWARE.
RootModule = 'HPOneView.410.psm1'

# Version number of this module.
ModuleVersion = '4.10.1865.3905'
ModuleVersion = '4.10.1889.2173'

# ID used to uniquely identify this module
GUID = '2c99a71e-361b-4ec0-b168-060eac70561d'
Expand Down Expand Up @@ -123,7 +123,7 @@ THE SOFTWARE.
LicenseUri = 'https://github.com/HewlettPackard/POSH-HPOneView/blob/master/LICENSE';
ProjectUri = 'http://hewlettpackard.github.io/POSH-HPOneView';
IconUri = '';
ReleaseNotes = 'Release 4.10.1865.3905
ReleaseNotes = 'Release 4.10.1889.2173
* Updated New-HPOVServerProfile and New-HPOVServerProfileTemplate with -PassThru parameter, which will return the object back to the caller to modify it before creating it with Save-HPOVServerProfile or Save-HPOVServerProfileTemplate Cmdlets.
* [#372] Updated HostOSType parameters for New-HPOVServerProfile, New-HPOVServerProfileTemplate, and New-HPOVServerProfileAttachVolume Cmdlets.
Expand All @@ -135,8 +135,9 @@ THE SOFTWARE.
* Fixed Get-HPOVInterconnect where SAS Interconnects were not part of the API call to index.
* Fixed Copy-HPOVServerProfile where server hardware validation was incorrectly being handled.
* Fixed New-HPOVServerProfile where server hardware validation was incorrectly being handled.
* Fixed New-HPOVServerProfileConnection where -VirtualFunctions parameter was not being honored correctly.
* Fixed New-HPOVServerProfileConnection where -VirtualFunctions parameter was not being honored correctly, and iSCSI connection type regression.
* Fixed New-HPOVSnmpConfiguration which was missing SNMPv3 configuration parameters.
* Fixed Get-HPOVIloSso to return correct iLO REST API root URI based on iLO4 or iLO5.
* [#382] Fixed New-HPOVServerProfileTemplate where -BootMode $false would not set the appropriate values to unmanage settings.
* Updated New-HPOVServerProfile to make -AssignmentType a non-mandatory parameter, which now defaults to "Server".
* Added Cmdlets to get and set HPE Synergy Reserved VLAN Range; Get-HPOVReservedVlanRange, Set-HPOVReservedVlanRange'
Expand Down
111 changes: 91 additions & 20 deletions HPOneView.410.psm1
Expand Up @@ -33,7 +33,7 @@ THE SOFTWARE.
#>

# Set HPOneView POSH Library Version
[Version]$ModuleVersion = '4.10.1865.3905'
[Version]$ModuleVersion = '4.10.1889.2173'
New-Variable -Name PSLibraryVersion -Scope Global -Value (New-Object HPOneView.Library.Version($ModuleVersion)) -Option Constant -ErrorAction SilentlyContinue
$Global:CallStack = Get-PSCallStack
$script:ModuleVerbose = [bool]($Global:CallStack | Where-Object { $_.Command -eq "<ScriptBlock>" }).position.text -match "-verbose"
Expand Down Expand Up @@ -958,6 +958,7 @@ function NewObject
[switch]$ServerProfileBootMode,
[switch]$ServerProfileBootModeLegacyBios,
[switch]$ServerProfileEthernetConnection,
[switch]$ServerProfileIscsiConnection,
[switch]$ServerProfileFCConnection,
[switch]$ServerProfileEthBootableConnection,
[switch]$ServerProfileEthBootableConnectionWithTargets,
Expand Down Expand Up @@ -2521,11 +2522,12 @@ function NewObject
};
firmware = [PSCustomObject]@{

manageFirmware = $false;
firmwareBaselineUri = $null;
forceInstallFirmware = $false;
firmwareInstallType = 'FirmwareAndOSDrivers';
firmwareActivationType = 'Immediate'
manageFirmware = $false;
firmwareBaselineUri = $null;
forceInstallFirmware = $false;
firmwareInstallType = 'FirmwareAndOSDrivers';
firmwareActivationType = 'Immediate';
firmwareScheduleDateTime = $null

};
boot = [PSCustomObject]@{
Expand Down Expand Up @@ -2908,6 +2910,28 @@ function NewObject

}

'ServerProfileIscsiConnection'
{

Return [PSCustomObject]@{

id = 1;
functionType = 'Ethernet';
name = $null;
portId = $null;
networkUri = $null;
requestedMbps = 2000;
boot = $null;
macType = 'Virtual';
mac = $null;
ipv4 = $null;
lagName = $null;
ApplianceConnection = $null

}

}

'ServerProfileFCConnection'
{

Expand Down Expand Up @@ -31666,6 +31690,21 @@ function Get-HPOVIloSso
"[{0}] Server Profile was provided." -f $MyInvocation.InvocationName.ToString().ToUpper(), $InputObject.name | Write-Verbose
$_uri = $InputObject.serverHardwareUri

# get server hardware from resource
try
{

$_Server = Send-HPOVRequest -Uri $_uri -Hostname $InputObject.ApplianceConnection

}

Catch
{

$PSCmdlet.ThrowTerminatingError($_)

}

}

else
Expand All @@ -31674,6 +31713,8 @@ function Get-HPOVIloSso
"[{0}] Server Hardware was provided." -f $MyInvocation.InvocationName.ToString().ToUpper(), $InputObject.name | Write-Verbose
$_uri = $InputObject.uri

$_Server = $InputObject

}

if ($PSBoundParameters['RemoteConsoleOnly'])
Expand Down Expand Up @@ -31719,8 +31760,6 @@ function Get-HPOVIloSso
else
{

# Get-HPOVServer | Select -First 1 | Get-HPOVIloSso -IloRestSession -OutVariable IloUrl

"[{0}] Generating and returning iLO REST/RedFish SSO Session object" -f $MyInvocation.InvocationName.ToString().ToUpper() | Write-Verbose

Try
Expand Down Expand Up @@ -31752,8 +31791,28 @@ function Get-HPOVIloSso
}

"[{0}] Building iLO Session Object." -f $MyInvocation.InvocationName.ToString().ToUpper() | Write-Verbose

switch ($_Server.mpModel)
{

'iLO5'
{

$_RootUri = "https://{0}/redfish/v1" -f ([URI]$_ssoresp.iloSsoUrl).Host

}

'iLO4'
{

$_RootUri = "https://{0}/rest/v1" -f ([URI]$_ssoresp.iloSsoUrl).Host

}

}

$IloSession = NewObject -IloRestSession
$IloSession.RootUri = "https://{0}/rest/v1" -f ([URI]$_ssoresp.iloSsoUrl).Host
$IloSession.RootUri = $_RootUri
$IloSession.'X-Auth-Token' = $SessionID.Replace('sessionKey=',$null)

$IloSession
Expand Down Expand Up @@ -66128,7 +66187,7 @@ function Get-HPOVReservedVlanRange

}

# // TODO: DOC UNITTEST
# // TODO: UNITTEST
function Set-HPOVReservedVlanRange
{

Expand Down Expand Up @@ -87367,14 +87426,7 @@ function New-HPOVServerProfileTemplate

}

if ("UEFI" -eq $BootMode -and $ServerHardwareType.model -match "Gen9" -and -not $PSBoundParameters['SecureBoot'])
{

$_spt.bootMode.secureBoot = 'Disabled'

}

elseif ("UEFIOptimized" -eq $BootMode -and $ServerHardwareType.model -match "Gen9" -and -not $PSBoundParameters['SecureBoot'])
if ($ServerHardwareType.model -match "Gen9" -and -not $PSBoundParameters['SecureBoot'])
{

$_spt.bootMode.secureBoot = 'Unmanaged'
Expand Down Expand Up @@ -89970,7 +90022,19 @@ function New-HPOVServerProfileConnection
{"ethernet-networks", "network-sets" -contains $_}
{

$_conn = NewObject -ServerProfileEthernetConnection
if ($ConnectionType -eq 'iSCSI' -or ('IscsiPrimary', 'IscsiSecondary' -contains $Priority) -or $PSCmdlet.ParameterSetName -eq "ISCSI")
{

$_conn = NewObject -ServerProfileIscsiConnection

}

else
{

$_conn = NewObject -ServerProfileEthernetConnection

}

}

Expand Down Expand Up @@ -90136,7 +90200,8 @@ function New-HPOVServerProfileConnection
}

$_conn.boot.iscsi = NewObject -IscsiBootEntry
$_conn | Add-Member -NotePropertyName ipv4 -NotePropertyValue (NewObject -IscsiIPv4Configuration)
# $_conn.ipv4 | Add-Member -NotePropertyName ipv4 -NotePropertyValue (NewObject -IscsiIPv4Configuration)
$_conn.ipv4 = NewObject -IscsiIPv4Configuration

if ($PSBoundParameters['BootVolumeSource'])
{
Expand Down Expand Up @@ -90355,6 +90420,12 @@ function New-HPOVServerProfileConnection

}

# elseif (-not $PSboundParameters['Virtualfunctions'] -and $_conn.functionType -eq 'Ethernet' -and $PSCmdlet.ParameterSetName -ne 'ISCSI')
# {


# }

if ($PSboundParameters['UserDefined'])
{

Expand Down
Expand Up @@ -4,7 +4,7 @@
<SupportedUICultures>
<UICulture>
<UICultureName>en-US</UICultureName>
<UICultureVersion>4.10.1865.3907</UICultureVersion>
<UICultureVersion>4.10.1889.2173</UICultureVersion>
</UICulture>
</SupportedUICultures>
</HelpInfo>
2 changes: 1 addition & 1 deletion Server.format.ps1xml
Expand Up @@ -823,7 +823,7 @@
<View>
<Name>Enclosure</Name>
<ViewSelectedBy>
<TypeName>HPOneView.Enclosure</TypeName>
<TypeName>HPOneView.Servers.Enclosure</TypeName>
</ViewSelectedBy>
<TableControl>
<AutoSize/>
Expand Down

0 comments on commit afe73ad

Please sign in to comment.