Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaromirk committed Jul 29, 2023
1 parent c1c011a commit e2c432b
Show file tree
Hide file tree
Showing 6 changed files with 1,103 additions and 1,066 deletions.
2 changes: 1 addition & 1 deletion Scenarios/AzSHCI Deployment 22H2 Edition/LabConfig.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$LabConfig=@{AllowedVLANs="1-10,711-719" ; DomainAdminName='LabAdmin'; AdminPassword='LS1setup!' ; DCEdition='4'; Internet=$true ; TelemetryLevel='Full' ; TelemetryNickname='' ; AdditionalNetworksConfig=@(); VMs=@()}

#Azure Stack HCI 21H2
#Azure Stack HCI 22H2
1..4 | ForEach-Object {$LABConfig.VMs += @{ VMName = "AzSHCI$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI22H2_G2.vhdx' ; HDDNumber = 4 ; HDDSize= 2TB ; MemoryStartupBytes= 1GB; VMProcessorCount=4 ; vTPM=$true}}
#Or with nested virtualization enabled
#1..4 | ForEach-Object {$LABConfig.VMs += @{ VMName = "AzSHCI$_" ; Configuration = 'S2D' ; ParentVHD = 'AzSHCI22H2_G2.vhdx' ; HDDNumber = 4 ; HDDSize= 2TB ; MemoryStartupBytes= 4GB; VMProcessorCount=4 ; vTPM=$true ; NestedVirt=$true}}
Expand Down
10 changes: 7 additions & 3 deletions Scenarios/AzSHCI Deployment 22H2 Edition/Scenario.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@
}
}
#define and install other features
$features="Failover-Clustering","RSAT-Clustering-PowerShell","Hyper-V-PowerShell","NetworkATC","NetworkHUD","Data-Center-Bridging","RSAT-DataCenterBridging-LLDP-Tools","FS-SMBBW"
#optional - affects perf even if not enabled on volumes as filter driver is attached (Bitlocker,SR,Dedup)
#$features+="RSAT-Feature-Tools-BitLocker","Storage-Replica","RSAT-Storage-Replica","FS-Data-Deduplication","System-Insights","RSAT-System-Insights"
$features="Failover-Clustering","RSAT-Clustering-PowerShell","Hyper-V-PowerShell","NetworkATC","NetworkHUD","Data-Center-Bridging","RSAT-DataCenterBridging-LLDP-Tools","FS-SMBBW","System-Insights","RSAT-System-Insights"
#optional - affects perf even if not enabled on volumes as filter driver is attached (SR,Dedup) and also Bitlocker, that affects a little bit
#$features+="Storage-Replica","RSAT-Storage-Replica","FS-Data-Deduplication","BitLocker","RSAT-Feature-Tools-BitLocker"
Invoke-Command -ComputerName $servers -ScriptBlock {Install-WindowsFeature -Name $using:features}
#endregion

Expand Down Expand Up @@ -823,6 +823,10 @@ if ($NetATC){

#check number of live migrations
get-vmhost -CimSession $Servers | Select-Object Name,MaximumVirtualMachineMigrations

#check it in cluster (is only 1 - expected)
get-cluster -Name $ClusterName | Select-Object Name,MaximumParallelMigrations

#endregion

#remove net intent global overrides if necessary
Expand Down
2 changes: 1 addition & 1 deletion Scenarios/AzSHCI and AVD/Scenario.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
#Copy agent and bootloader to VMs
#create sessions
$sessions=New-PSSession -ComputerName $VMs.VMName
#copy ARC agent
#copy AVD agent
foreach ($session in $sessions){
Copy-Item -Path "$env:USERPROFILE\Downloads\AVDAgent.msi" -Destination "$env:USERPROFILE\Downloads\" -tosession $session -force
Copy-Item -Path "$env:USERPROFILE\Downloads\AVDAgentBootloader.msi" -Destination "$env:USERPROFILE\Downloads\" -tosession $session -force
Expand Down
19 changes: 11 additions & 8 deletions Scenarios/AzSHCI and Kubernetes/Scenario.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,17 @@ Foreach ($PSSession in $PSSessions){
$VolumeName="AKS"
$Servers=(Get-ClusterNode -Cluster $ClusterName).Name
$DHCPServer="DC"
$DHCPScopeID="10.0.0.0"
$VIPPoolStart="10.0.1.2"
$VIPPoolEnd="10.0.1.100"
$VLANID=11
$resourcegroupname="$ClusterName-rg"

#if dhcp is disabled:
$k8sNodeIpPoolStart="10.0.1.101"
$k8sNodeIpPoolEnd="10.0.1.254"
$IPAddressPrefix="10.0.1.0/24"
$DNSServers="10.0.1.1"
$Gateway="10.0.1.1"
$VLANID=11
$resourcegroupname="$ClusterName-rg"

#JaromirK note: it would be great if I could simply run "Initialize-AksHciNode -ComputerName $ClusterName". I could simply skip credssp. Same applies for AksHciConfig and AksHciRegistration

Expand Down Expand Up @@ -323,11 +324,13 @@ Foreach ($PSSession in $PSSessions){
#configure aks
#note: I'm assigning larger control plane VM than default as I saw IP disapperaring IP address if it was smaller in virtual environment (I tested manually incresed size to 8cores and 8GB RAM)
Invoke-Command -ComputerName $servers[0] -Credential $Credentials -Authentication Credssp -ScriptBlock {
#install nuget first
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
#DHCP
#$vnet = New-AksHciNetworkSetting -Name $using:vNetName -vSwitchName $using:vSwitchName -vippoolstart $using:vippoolstart -vippoolend $using:vippoolend
$vnet = New-AksHciNetworkSetting -Name $using:vNetName -vSwitchName $using:vSwitchName -vippoolstart $using:vippoolstart -vippoolend $using:vippoolend -vlanID $using:VLANID
#Static
$vnet = New-AksHciNetworkSetting -Name $using:vNetName -ipAddressPrefix $using:IPAddressPrefix -vSwitchName $using:vSwitchName -vippoolstart $using:vippoolstart -vippoolend $using:vippoolend -k8sNodeIpPoolStart $using:k8sNodeIpPoolStart -k8sNodeIpPoolEnd $using:k8sNodeIpPoolEnd -vlanID $using:VLANID -DNSServers $using:DNSServers -gateway $Using:Gateway
Set-AksHciConfig -vnet $vnet -workingDir c:\clusterstorage\$using:VolumeName\ImagesStore -imageDir c:\clusterstorage\$using:VolumeName\Images -cloudConfigLocation c:\clusterstorage\$using:VolumeName\Config -ClusterRoleName "$($using:ClusterName)_AKS" -controlPlaneVmSize 'Standard_A4_v2' # Get-AksHciVmSize
#$vnet = New-AksHciNetworkSetting -Name $using:vNetName -ipAddressPrefix $using:IPAddressPrefix -vSwitchName $using:vSwitchName -vippoolstart $using:vippoolstart -vippoolend $using:vippoolend -k8sNodeIpPoolStart $using:k8sNodeIpPoolStart -k8sNodeIpPoolEnd $using:k8sNodeIpPoolEnd -vlanID $using:VLANID -DNSServers $using:DNSServers -gateway $Using:Gateway
Set-AksHciConfig -vnet $vnet -workingDir c:\clusterstorage\$using:VolumeName\WorkDir -imageDir c:\clusterstorage\$using:VolumeName\Images -cloudConfigLocation c:\clusterstorage\$using:VolumeName\Config -ClusterRoleName "$($using:ClusterName)_AKS" -controlPlaneVmSize 'Standard_A4_v2' # Get-AksHciVmSize
}

#validate config
Expand Down Expand Up @@ -518,7 +521,7 @@ $password="" #if blank, password will be created
#create credentials
$ClientID=$sp.AppId
$SecureSecret= ConvertTo-SecureString $password -AsPlainText -Force
$Credentials = New-Object System.Management.Automation.PSCredential ($ClientID , $SecureSecret)
$SPCredentials = New-Object System.Management.Automation.PSCredential ($ClientID , $SecureSecret)

#register namespace Microsoft.KubernetesConfiguration and Microsoft.Kubernetes
Register-AzResourceProvider -ProviderNamespace Microsoft.Kubernetes
Expand All @@ -529,7 +532,7 @@ Invoke-Command -ComputerName $ClusterName -ScriptBlock {
#Generate kubeconfig
Get-AksHciCredential -Name $using:KubernetesClusterName -confirm:0
#onboard
Enable-AksHciArcConnection -Name $using:KubernetesClusterName -tenantId $using:tenantID -subscriptionId $using:subscriptionID -resourcegroup $using:resourcegroup -Location $using:location -credential $using:Credentials
Enable-AksHciArcConnection -Name $using:KubernetesClusterName -tenantId $using:tenantID -subscriptionId $using:subscriptionID -resourcegroup $using:resourcegroup -Location $using:location -credential $using:SPCredentials
}


Expand Down
Loading

0 comments on commit e2c432b

Please sign in to comment.