Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ChrisLynchHPE/410a54e435cadb924604d2e57c34a8d9 to your computer and use it in GitHub Desktop.
Save ChrisLynchHPE/410a54e435cadb924604d2e57c34a8d9 to your computer and use it in GitHub Desktop.
# Get the SHT of the server hardware
$BL460cGen9SHT = Get-OVServerHardwareType -Name 'BL460c Gen9 1'
# Get the EG
$EnclosureGroup = Get-OVEnclosureGroup -Name $DCSDefaultEGName
# Create our profile Ethernet connections
$ServerProfileConnection1NetObject = Get-OVNetwork -Name $ServerProfileConnection1NetName -ErrorAction Stop
$ProfileConnection1 = New-OVServerProfileConnection -ConnectionID 1 -Name "$ServerProfileConnection1NetName Connection" -Network $ServerProfileConnection1NetObject
$ServerProfileConnection2NetObject = Get-OVNetwork -Name $ServerProfileConnection2NetName -ErrorAction Stop
$ProfileConnection2 = New-OVServerProfileConnection -ConnectionID 2 -Name "$ServerProfileConnection2NetName Connection" -Network $ServerProfileConnection2NetObject
# Create our profile bootable fibre channel connections
$ServerProfileConnection3NetObject = Get-OVNetwork -Name $ServerProfileConnection3NetName -Type $ServerProfileConnection3Type -ErrorAction Stop
$ProfileConnection3 = New-OVServerProfileConnection -ConnectionID 3 -ConnectionType FC -Name "$ServerProfileConnection3NetName Connection" -Network $ServerProfileConnection3NetObject -Bootable -Priority Primary -BootVolumeSource ManagedVolume
$ServerProfileConnection4NetObject = Get-OVNetwork -Name $ServerProfileConnection4NetName -Type $ServerProfileConnection4Type -ErrorAction Stop
$ProfileConnection4 = New-OVServerProfileConnection -ConnectionID 4 -Name "$ServerProfileConnection4NetName Connection" -Network $ServerProfileConnection4NetObject -Bootable -Priority Secondary -BootVolumeSource ManagedVolume
$ServerProfileConnections = $ProfileConnection1,$ProfileConnection2,$ProfileConnection3,$ProfileConnection4
# Configure the local Smart Array drives for scratch space
$ServerProfileLogicalDiskObject = New-OVServerProfileLogicalDisk -Name 'Scratch Disk' -RAID RAID1 -NumberofDrives 2 -DriveType Auto
$ServerProfileController = New-OVServerProfileLogicalDiskController -ControllerID Embedded -Mode RAID -Initialize -LogicalDisk $ServerProfileLogicalDiskObject
# Create our private, bootable volume policy. This volume will be created on demand when the profile is created from the template
$FSTCPG1 = Get-OVStoragePool -Name FST_CPG1
$EphemeralStorageVolumeObject = New-OVServerProfileAttachVolume -Name "$BfSAdvancedServerProfileName Private Vol 1" -StoragePool $FSTCPG1 -Capacity 60 -LunIdType Auto -BootVolume
$ParamHash = @{
Name = $BfSAdvancedServerProfileName
AssignmentType = 'Unassigned';
ServerHardwareType = $BL460cGen9SHT;
EnclosureGroup = $EnclosureGroup;
Connections = $ServerProfileConnections;
LocalStorage = $true;
StorageController = $ServerProfileController;
SanStorage = $true;
HostOStype = 'Win2k12';
StorageVolume = $EphemeralStorageVolumeObject;
Bios = $true;
BiosSettings = $Gen9BiosSettings;
ManageBoot = $true;
BootMode = "UEFI";
}
# Create the profile
$CreateBfSAdvancedServerProfileResults = New-OVServerProfile -Confirm:$False @ParamHash | Wait-OVTaskComplete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment