-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #459 from microsoft/dev
Dev
- Loading branch information
Showing
19 changed files
with
543 additions
and
465 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
$LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!' ; <#Prefix = 'WSLab-'#> ; DCEdition='4'; Internet=$true ; TelemetryLevel='Full' ; TelemetryNickname='' ; AdditionalNetworksConfig=@(); VMs=@()} | ||
$LabConfig=@{<#SwitchNics="NIC1","NIC2";#> DomainAdminName='LabAdmin'; AdminPassword='LS1setup!' <#;Prefix = 'WSLab-'#> ; DCEdition='4'; Internet=$true ; TelemetryLevel='Full' ; TelemetryNickname='' ; AdditionalNetworksConfig=@(); VMs=@()} | ||
|
||
#MDT machine (GUI is needed as Core does not have WDSUtil) | ||
$LabConfig.VMs += @{ VMName = 'MDT' ; Configuration = 'S2D' ; ParentVHD = 'Win2022_G2.vhdx' ; SSDNumber = 1; SSDSize=1TB ; MGMTNICs=1 } | ||
|
||
#Management machine | ||
$LabConfig.VMs += @{ VMName = 'Management' ; ParentVHD = 'Win2022_G2.vhdx' ; MGMTNICs=1 } | ||
|
||
#optional Windows 11 machine for management | ||
$LabConfig.VMs += @{ VMName = 'Win11' ; ParentVHD = 'Win1121H2_G2.vhdx' ; MGMTNICs=1} | ||
#$LabConfig.VMs += @{ VMName = 'Win11' ; ParentVHD = 'Win1121H2_G2.vhdx' ; MGMTNICs=1} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#Run from DC or Management machine | ||
|
||
#region Variables and prerequisites | ||
$ClusterName="AzSHCI-Cluster" | ||
$Nodes=(Get-ClusterNode -Cluster $ClusterName).Name | ||
$VolumeSize=1TB | ||
|
||
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | ||
Install-Module -Name VMFleet -Force | ||
Install-Module -Name PrivateCloud.DiagnosticInfo -Force | ||
|
||
#Make sure Hyper-V is installed (to be able to work with VHD) | ||
$Result=Install-WindowsFeature -Name "Hyper-V" -ErrorAction SilentlyContinue | ||
if ($result.ExitCode -eq "failed"){ | ||
Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Online -NoRestart | ||
} | ||
#endregion | ||
|
||
#region Configure VMFleet prereqs | ||
#Create Volumes | ||
Foreach ($Node in $Nodes){ | ||
if (-not (Get-Virtualdisk -CimSession $ClusterName -FriendlyName $Node)){ | ||
New-Volume -CimSession $Node -StoragePoolFriendlyName "S2D on $ClusterName" -FileSystem CSVFS_ReFS -FriendlyName $Node -Size $VolumeSize | ||
} | ||
} | ||
|
||
if (-not (Get-Virtualdisk -CimSession $ClusterName -FriendlyName Collect)){ | ||
New-Volume -CimSession $CLusterName -StoragePoolFriendlyName "S2D on $ClusterName" -FileSystem CSVFS_ReFS -FriendlyName Collect -Size 100GB | ||
} | ||
|
||
#Ask for VHD | ||
Write-Output "Please select VHD created using CreateVMFleetImage" | ||
[reflection.assembly]::loadwithpartialname("System.Windows.Forms") | ||
$openFile = New-Object System.Windows.Forms.OpenFileDialog -Property @{ | ||
Title="Please select VHD created by convert-windowsimage. Click cancel if you want to create it" | ||
} | ||
$openFile.Filter = "vhdx files (*.vhdx)|*.vhdx|All files (*.*)|*.*" | ||
If($openFile.ShowDialog() -eq "OK"){ | ||
Write-Output "File $($openfile.FileName) selected" | ||
} | ||
$VHDPath=$openfile.FileName | ||
|
||
#Copy VHD to collect folder | ||
Copy-Item -Path $VHDPath -Destination \\$ClusterName\ClusterStorage$\Collect\ | ||
#Copy VMFleet to cluster nodes | ||
$Sessions=New-PSSession -ComputerName $Nodes | ||
Foreach ($Session in $Sessions){ | ||
Copy-Item -Recurse -Path "C:\Program Files\WindowsPowerShell\Modules\VMFleet" -Destination "C:\Program Files\WindowsPowerShell\Modules\" -ToSession $Session -Force | ||
} | ||
#endregion | ||
|
||
#region install and create VMFleet | ||
$VHDName=$VHDPath | Split-Path -Leaf | ||
#Grab nubmer of Logical Processors per node divided by 2 | ||
$NumberOfVMs=(Get-CimInstance -CimSession $ClusterName -ClassName Win32_ComputerSystem).NumberOfLogicalProcessors/2 | ||
|
||
#Enable CredSSP | ||
# Temporarily enable CredSSP delegation to avoid double-hop issue | ||
foreach ($Node in $Nodes){ | ||
Enable-WSManCredSSP -Role "Client" -DelegateComputer $Node -Force | ||
} | ||
Invoke-Command -ComputerName $Nodes -ScriptBlock { Enable-WSManCredSSP Server -Force } | ||
|
||
$password = ConvertTo-SecureString "LS1setup!" -AsPlainText -Force | ||
$Credentials = New-Object System.Management.Automation.PSCredential ("CORP\LabAdmin", $password) | ||
|
||
Invoke-Command -ComputerName $Nodes[0] -Credential $Credentials -Authentication Credssp -ScriptBlock { | ||
Install-Fleet #as vmfleet has issues with Install-Fleet -ClusterName https://github.com/microsoft/diskspd/issues/157 | ||
#It's probably more convenient to run this command on cluster as all VHD copying will happen on cluster itself. | ||
New-Fleet -BaseVHD "c:\ClusterStorage\Collect\$using:VHDName" -VMs $using:NumberOfVMs -AdminPass P@ssw0rd -Admin Administrator -ConnectUser corp\LabAdmin -ConnectPass LS1setup! | ||
} | ||
|
||
# Disable CredSSP | ||
Disable-WSManCredSSP -Role Client | ||
Invoke-Command -ComputerName $nodes -ScriptBlock { Disable-WSManCredSSP Server } | ||
#endregion | ||
|
||
#region Measure Performance | ||
#make sure PrivateCloud.DiagnosticInfo is present | ||
$Nodes=(Get-ClusterNode -Cluster $ClusterName).Name | ||
$Sessions=New-PSSession $Nodes | ||
foreach ($Session in $Sessions){ | ||
Copy-Item -Path 'C:\Program Files\WindowsPowerShell\Modules\PrivateCloud.DiagnosticInfo' -Destination 'C:\Program Files\WindowsPowerShell\Modules\' -ToSession $Session -Recurse -Force | ||
} | ||
|
||
# Temporarily enable CredSSP delegation to avoid double-hop issue | ||
foreach ($Node in $Nodes){ | ||
Enable-WSManCredSSP -Role "Client" -DelegateComputer $Node -Force | ||
} | ||
Invoke-Command -ComputerName $Nodes -ScriptBlock { Enable-WSManCredSSP Server -Force } | ||
|
||
$password = ConvertTo-SecureString "LS1setup!" -AsPlainText -Force | ||
$Credentials = New-Object System.Management.Automation.PSCredential ("CORP\LabAdmin", $password) | ||
|
||
Invoke-Command -ComputerName $Nodes[0] -Credential $Credentials -Authentication Credssp -ScriptBlock { | ||
Measure-FleetCoreWorkload | ||
} | ||
|
||
# Disable CredSSP | ||
Disable-WSManCredSSP -Role Client | ||
Invoke-Command -ComputerName $nodes -ScriptBlock { Disable-WSManCredSSP Server } | ||
#endregion |
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.