Skip to content

Commit 5dd11d5

Browse files
committed
Adding D3940 storage examples
Added D3940 logical jbod server profile exmamples Signed-off-by: Chris Lynch <chris.lynch@hpe.com>
1 parent aad1665 commit 5dd11d5

8 files changed

+235
-34
lines changed

EcoSystemCodeBehindDemo.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#
1919
# VERSION 4.0
2020
#
21-
# (C) Copyright 2013-2019 Hewlett Packard Enterprise Development LP
21+
# (C) Copyright 2013-2020 Hewlett Packard Enterprise Development LP
2222
##############################################################################
2323
<#
2424
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -41,7 +41,7 @@ THE SOFTWARE.
4141
#>
4242
##############################################################################
4343
$ApplianceHostname = "appliance.lab.local"
44-
if (-not (Get-Module HPOneview.420))
44+
if (-not (Get-Module HPOneview.420))
4545
{
4646

4747
Import-Module HPOneView.420
@@ -79,7 +79,7 @@ Get-HPOVServer -ServerHardwareType $SY480Gen10SHT -NoProfile | out-Host
7979

8080
$TemplateName = "Hypervisor Cluster Node Template v1"
8181
$TemplateDescription = "Corp standard hypervisor cluster node, version 1.0"
82-
$eg = Get-HPOVEnclosureGroup -Name "DCS Synergy Default EG" -ErrorAction Stop
82+
$eg = Get-HPOVEnclosureGroup -Name "DCS Synergy Default EG" -ErrorAction Stop
8383
$Baseline = Get-HPOVBaseline -File SPP_2017_10_20171215_for_HPE_Synergy_Z7550-96455.iso
8484
$con1 = Get-HPOVNetwork -Name "Management Network (VLAN1)" -ErrorAction Stop | New-HPOVServerProfileConnection -ConnectionID 1 -Name 'Management Network (VLAN1) Connection 1' -Bootable -Priority Primary
8585
$con2 = Get-HPOVNetwork -Name "Management Network (VLAN1)" -ErrorAction Stop | New-HPOVServerProfileConnection -ConnectionID 2 -Name 'Management Network (VLAN1) Connection 2'
@@ -120,7 +120,7 @@ pause
120120
# Create Server Profile from Server Profile Template, searching for a SY480 Gen10 server with at least 4 CPU and 512GB of RAM
121121
Get-HPOVServer -ServerHardwareType $SY480Gen10SHT -NoProfile -ErrorAction Stop | ? { ($_.processorCount * $_.processorCoreCount) -ge 4 -and $_.memoryMb -ge (512 * 1024) } | Select -First 2 -OutVariable svr | out-Host
122122

123-
pause
123+
pause
124124

125125
# Make sure servers are powered off
126126
$svr | Stop-HPOVServer -Confirm:$false | Wait-HPOVTaskComplete | out-Host
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
##############################################################################
2+
# Add-ExistingLJOBToServerProfile.ps1
3+
#
4+
# Script to attach an existing HPE Synergy SAS Logical JBOD resource to an
5+
# existing server profile resource.
6+
#
7+
# Used with HPE OneView 5.00 PowerShell library
8+
#
9+
# VERSION 1.0
10+
#
11+
# (C) Copyright 2013-2020 Hewlett Packard Enterprise Development LP
12+
##############################################################################
13+
<#
14+
Permission is hereby granted, free of charge, to any person obtaining a copy
15+
of this software and associated documentation files (the "Software"), to deal
16+
in the Software without restriction, including without limitation the rights
17+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
copies of the Software, and to permit persons to whom the Software is
19+
furnished to do so, subject to the following conditions:
20+
21+
The above copyright notice and this permission notice shall be included in
22+
all copies or substantial portions of the Software.
23+
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30+
THE SOFTWARE.
31+
#>
32+
##############################################################################
33+
34+
class sasLogicalJBOD
35+
{
36+
37+
[int]$id = $null;
38+
[string]$deviceSlot = "Mezz 1";
39+
[string]$name = $null;
40+
[string]$description = $null;
41+
[int]$numPhysicalDrives = $null;
42+
[string]$driveMinSizeGB = $null;
43+
[string]$driveMaxSizeGB = $null;
44+
[string]$driveTechnology = $null;
45+
[bool]$eraseData = $null;
46+
[bool]$persistent = $true;
47+
[string]$sasLogicalJBODUri = $null;
48+
49+
sasLogicalJBODs ([object]$ExistingLJBOD, [int]$NextLogicalID, [string]$DeviceSlot, [Bool]$IsPersistent)
50+
{
51+
52+
# This is used to put the driveTechnology property to the correct value later in the script
53+
$TextInfo = (Get-Culture -Name en-US).TextInfo
54+
55+
$this.id = $NextLogicalID;
56+
$this.deviceSlot = $DeviceSlot;
57+
$this.name = $ExistingLJBOD.name;
58+
$this.description = $ExistingLJBOD.description;
59+
$this.numPhysicalDrives = $ExistingLJBOD.NumberOfDrives;
60+
$this.driveMinSizeGB = $ExistingLJBOD.MinSize;
61+
$this.driveMaxSizeGB = $ExistingLJBOD.MaxSize;
62+
$this.driveTechnology = ($TextInfo.ToTitleCase($ExistingLJBOD.Interface.ToLower()) + $TextInfo.ToTitleCase($ExistingLJBOD.Media.ToLower()));
63+
$this.eraseData = $ExistingLJBOD.EraseDataOnDelete;
64+
$this.persistent = $IsPersistent;
65+
$this.sasLogicalJBODUri = $ExistingLJBOD.Uri
66+
67+
}
68+
69+
}
70+
71+
# Get our server profile
72+
$prf1 = Get-HPOVServerProfile -Name prf1
73+
74+
# Get the logical JBOD
75+
$NewLD1 = Get-HPOVLogicalJBOD -name "data1 (3210)"
76+
77+
# Get the current LJBOD drive ID's so we can figure out the next available
78+
$ExistingIDs = $prf1.localStorage.sasLogicalJBODs.id
79+
80+
$NextLogicalID = ($ExistingIDs | Measure-Object -Maximum).Maximum + 1
81+
82+
$MezzDeviceID = "Mezz 1"
83+
$IsPersistent = $True
84+
85+
# Attach a new LJBOD object to the server profile
86+
$prf1.localStorage.sasLogicalJBODs += [sasLogicalJBOD]::new($NewLD1, $NextLogicalID, $MezzDeviceID, $IsPersistent)
87+
88+
# Save the server profile object
89+
Save-HPOVServerProfile -InputObject $prf1
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
##############################################################################
2+
# Add-ExistingLJOBToServerProfile.ps1
3+
#
4+
# Script to create and attach two new HPE Synergy SAS Logical JBOD resources
5+
# to an existing server profile.
6+
#
7+
# Used with HPE OneView 5.00 PowerShell library
8+
#
9+
# VERSION 1.0
10+
#
11+
# (C) Copyright 2013-2020 Hewlett Packard Enterprise Development LP
12+
##############################################################################
13+
<#
14+
Permission is hereby granted, free of charge, to any person obtaining a copy
15+
of this software and associated documentation files (the "Software"), to deal
16+
in the Software without restriction, including without limitation the rights
17+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18+
copies of the Software, and to permit persons to whom the Software is
19+
furnished to do so, subject to the following conditions:
20+
21+
The above copyright notice and this permission notice shall be included in
22+
all copies or substantial portions of the Software.
23+
24+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30+
THE SOFTWARE.
31+
#>
32+
##############################################################################
33+
34+
class sasLogicalJBOD
35+
{
36+
37+
[int]$id = $null;
38+
[string]$deviceSlot = "Mezz 1";
39+
[string]$name = $null;
40+
[string]$description = $null;
41+
[int]$numPhysicalDrives = $null;
42+
[string]$driveMinSizeGB = $null;
43+
[string]$driveMaxSizeGB = $null;
44+
[string]$driveTechnology = $null;
45+
[bool]$eraseData = $null;
46+
[bool]$persistent = $true;
47+
[string]$sasLogicalJBODUri = $null;
48+
49+
sasLogicalJBODs ([object]$ExistingLJBOD, [int]$NextLogicalID, [string]$DeviceSlot, [Bool]$IsPersistent)
50+
{
51+
52+
# This is used to put the driveTechnology property to the correct value later in the script
53+
$TextInfo = (Get-Culture -Name en-US).TextInfo
54+
55+
$this.id = $NextLogicalID;
56+
$this.deviceSlot = $DeviceSlot;
57+
$this.name = $ExistingLJBOD.name;
58+
$this.description = $ExistingLJBOD.description;
59+
$this.numPhysicalDrives = $ExistingLJBOD.NumberOfDrives;
60+
$this.driveMinSizeGB = $ExistingLJBOD.MinSize;
61+
$this.driveMaxSizeGB = $ExistingLJBOD.MaxSize;
62+
$this.driveTechnology = ($TextInfo.ToTitleCase($ExistingLJBOD.Interface.ToLower()) + $TextInfo.ToTitleCase($ExistingLJBOD.Media.ToLower()));
63+
$this.eraseData = $ExistingLJBOD.EraseDataOnDelete;
64+
$this.persistent = $IsPersistent;
65+
$this.sasLogicalJBODUri = $ExistingLJBOD.Uri
66+
67+
}
68+
69+
}
70+
71+
# Some config variables
72+
$ProfileName = "prf1"
73+
$SasLIName = 'SAS LI Name'
74+
$MezzDeviceID = "Mezz 1"
75+
$MinimumDriveCapacity = 2000
76+
$DriveType = "SASSSD"
77+
$IsPersistent = $True
78+
79+
# Get our server profile
80+
$prf1 = Get-HPOVServerProfile -Name $ProfileName -ErrorAction Stop
81+
82+
# Figure out drive types and availability, looking for greater than 2TB SAS drives from drive enclosure attached to a specific SAS Logical Interconnect
83+
$SasLI = Get-HPOVSasLogicalInterconnect -Name $SasLIName -ErrorAction Stop
84+
$AvailableDrives = Get-HPOVAvailableDriveType -InputObject $SasLI | ? { $_.Capacity -gt $MinimumDriveCapacity -and $_.Type -eq $DriveType }
85+
86+
# Create new Logical JBODs
87+
1..2 | ForEach-Object { New-HPOVLogicalJBOD -InputObject $SasLI `
88+
-Name ($prf1.name + " LJBOD$_") `
89+
-DriveType $AvailableDrives.Type `
90+
-MinDriveSize $AvailableDrives.Capacity `
91+
-NumberofDrives 2 `
92+
-EraseDataOnDelete $False }
93+
94+
# Get the unattached, non-error state and available LJBODs
95+
$NewLogicalJBODs = Get-HPOVLogicalJBOD -Name "$($prf1.name)*" | ? { [String]::IsNullOrEmpty($_.UsedBy) -and $_.State -eq 'Configured' }
96+
97+
# Attach a new LJBOD objects to the server profile
98+
ForEach ($JBOD in $NewLogicalJBODs)
99+
{
100+
101+
# Get the current LJBOD drive ID's so we can figure out the next available
102+
$ExistingIDs = $prf1.localStorage.sasLogicalJBODs.id
103+
104+
$NextLogicalID = ($ExistingIDs | Measure-Object -Maximum).Maximum + 1
105+
106+
$prf1.localStorage.sasLogicalJBODs += [sasLogicalJBOD]::new($JBOD, $NextLogicalID, $MezzDeviceID, $IsPersistent)
107+
108+
}
109+
110+
# Save the server profile object
111+
Save-HPOVServerProfile -InputObject $prf1

Server Profiles/CreateServerProfilesFromTemplatesFromServerCollection.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
##############################################################################
22
# CreateServerProfilesFromTemplatesFromServerCollection.ps1
33
#
4-
# Example script to demonstrate finding the number of requested BL or SY servers,
4+
# Example script to demonstrate finding the number of requested BL or SY servers,
55
# ensuring they are uniquely located to spread the cluster nodes across multiple
66
# enclosures/frames. Then, create a server profile for each available server
77
# resource.
88
#
99
# VERSION 1.0
1010
#
11-
# (C) Copyright 2013-2019 Hewlett Packard Enterprise Development LP
11+
# (C) Copyright 2013-2020 Hewlett Packard Enterprise Development LP
1212
##############################################################################
1313
<#
1414
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,7 +32,7 @@ THE SOFTWARE.
3232
##############################################################################
3333

3434
$ApplianceHostname = "appliance.lab.local"
35-
if (-not (get-module HPOneview.420))
35+
if (-not (get-module HPOneview.420))
3636
{
3737

3838
Import-Module HPOneView.420
@@ -125,7 +125,7 @@ Do
125125

126126
# Final list of servers to deploy
127127
# C:\> $ServersToDeploy
128-
#
128+
#
129129
# Name ServerName Status Power Serial Number Model ROM iLO Server Profile
130130
# ---- ---------- ------ ----- ------------- ----- --- --- --------------
131131
# Encl1, bay 5 Server-5.domain.com Warning Off SGH100X8RN BL460c Gen8 I31 v1.30 09/30/2011 iLO4 2.55 No Profile
@@ -137,7 +137,7 @@ Do
137137

138138
# Updated list of available servers
139139
# C:\> $AvailableServers
140-
#
140+
#
141141
# Name ServerName Status Power Serial Number Model ROM iLO Server Profile
142142
# ---- ---------- ------ ----- ------------- ----- --- --- --------------
143143
# Encl1, bay 8 Server-8.domain.com Warning Off SGH103X8RN BL460c Gen8 I31 v1.30 09/30/2011 iLO4 2.55 No Profile
@@ -149,7 +149,7 @@ Do
149149
$ServersToDeploy | Stop-HPOVServer -Confirm:$false | Wait-HPOVTaskComplete | out-Host
150150

151151
# Create the number of Servers from the $svr collection
152-
For ($s = 1; $s -le $ServersToDeploy.count; $s++)
152+
For ($s = 1; $s -le $ServersToDeploy.count; $s++)
153153
{
154154

155155
New-HPOVServerProfile -Name "Prod-HypClusNode-0$s" -Assignment Server -Server $ServersToDeploy[($s - 1)] -ServerProfileTemplate $ServerProfileTemplate -Async

Server Profiles/ProvisionImageStreamerProfileFromTemplate.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Hewlett Packard Enterprise Development LP
1+
# Copyright 2020 Hewlett Packard Enterprise Development LP
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"); you may
44
# not use this file except in compliance with the License. You may obtain
@@ -81,13 +81,13 @@ $OSDeploymentAttributes = Get-HPOVOSDeploymentPlanAttribute -InputObject $OSDepl
8181
($OSDeploymentAttributes | Where-Object name -eq "Password").value = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($Password))
8282

8383
$ParamHash = @{
84-
84+
8585
Name = $ServerProfileName;
8686
AssignmentType = "Server";
8787
Server = $Server;
8888
ServerProfileTemplate = $ServerProfileTemplate;
8989
OSDeploymentPlanAttributes = $OSDeploymentAttributes
90-
91-
}
90+
91+
}
9292

9393
$Results = New-HPOVServerProfile @ParamHash

Server Profiles/UEFI-http-Boot.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Hewlett Packard Enterprise Development LP
1+
# Copyright 2020 Hewlett Packard Enterprise Development LP
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"); you may
44
# not use this file except in compliance with the License. You may obtain
@@ -11,11 +11,12 @@
1111
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
14-
14+
1515
# Specify the firmware update mode. Allowed values:
16-
# FirmwareAndOSDrivers - Updates the firmware and OS drivers without powering down the server hardware using Smart Update Tool.
17-
# FirmwareOnly - Updates the firmware without powering down the server hardware using Smart Update Tool.
18-
# FirmwareOnlyOfflineMode - Manages the firmware through HPE OneView. Selecting this option requires the server hardware to be powered down.
16+
# FirmwareAndOSDrivers - Updates the firmware and OS drivers without powering down the server hardware using Smart Update Tool.
17+
# FirmwareOnly - Updates the firmware without powering down the server hardware using Smart Update Tool.
18+
# FirmwareOnlyOfflineMode - Manages the firmware through HPE OneView. Selecting this option requires the server hardware to be powered down.
19+
1920
# -------------- Attributes for ServerProfileTemplate "UEFI Boot Template"
2021
$name = "UEFI Boot Template"
2122
$shtName = "SY 480 Gen10 1"

Server Profiles/Update-ProfileTemplateFirmware.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Hewlett Packard Enterprise Development LP
1+
# Copyright 2020 Hewlett Packard Enterprise Development LP
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"); you may
44
# not use this file except in compliance with the License. You may obtain
@@ -11,7 +11,7 @@
1111
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
14-
14+
1515
# Use Case:
1616
# To update firmware on Synergy compute modules, you usually update profile template with a new SPP baseline.
1717
# Then apply modified template to profiles
@@ -33,12 +33,12 @@ if ($NULL -ne $thisTemplate)
3333
$thisTemplate.firmware.firmwareBaselineUri = $baselineUri
3434
Send-HPOVRequest -uri $thisTemplate.uri -body $thisTemplate -method PUT
3535
}
36-
else
36+
else
3737
{
38-
-ForegroundColor YELLOW "New baseline --> $newBaseline does not exist. Skip modifying template..."
38+
-ForegroundColor YELLOW "New baseline --> $newBaseline does not exist. Skip modifying template..."
3939
}
4040
}
41-
else
41+
else
4242
{
43-
write-host -ForegroundColor YELLOW "Template --> $template does not exist. Skip modifying it..."
43+
write-host -ForegroundColor YELLOW "Template --> $template does not exist. Skip modifying it..."
4444
}

0 commit comments

Comments
 (0)