ConfigManager.psm1
Import-Module $PSScriptRoot\Utils.psm1 Import-Module $PSScriptRoot\ClusUtils.psm1 $script:CMap = @{} $script:CMap["turnKeySdnPath"] = "" $script:CMap["storePath"] = "" $script:CMap["state"] = "state.json" $script:CMap["credential"] = "cred.json" $script:CMap["workloadcredential"] = "workloadcred.json" $script:CMap["userConfigPath"] = "$PSScriptRoot\config\deployment" $script:CMap["deploymentConfigPath"] = "$PSScriptRoot\config\deployment" $script:CMap["deploymentFile"] = "deployment.json" $script:CMap["hnvpaNetworkFile"] = "networkconfig\logicalnetworks\hnvpa.json" $script:CMap["mgmtNetworkFile"] = "networkconfig\logicalnetworks\management.json" $script:CMap["greNetworkFile"] = "networkconfig\logicalnetworks\grevip.json" $script:CMap["publicVIPNetworkFile"] = "networkconfig\logicalnetworks\publicvip.json" $script:CMap["privateVIPNetworkFile"] = "networkconfig\logicalnetworks\privatevip.json" $script:CMap["macpoolFile"] = "networkconfig\macpools\defaultMacPool.json" $script:CMap["sdnConfigFile"] = "sdnconfig.json" $script:CMap["sdnExpressConfigPath"] = "$PSScriptRoot\config\sdnexpress" $script:CMap["sdnExpressTemplateFile"] = "template.psd1" $script:CMap["userWorkloadConfigPath"] = "$PSScriptRoot\config\workload" $script:CMap["workloadConfigPath"] = "$PSScriptRoot\config\workload" $script:CMap["workload"] = "workloadconfig.json" $script:CMap["vhdStore"] = "" $script:MgmtHostNicName = "TurnKeySdn-Mgmt" $script:DefaultTestVhdShare = "\\skyshare.redmond.corp.microsoft.com\Beanstalk\SDN_ADOArtifacts\TestArtifacts\mariner_workload_vhd" $script:DefaultTestVhdFile = "full-2.0.20231004.vhdx" $script:InstallStateInstalled = "installed" $script:InstallStateInstallFailed = "installFailed" $script:InstallStateInstalling = "installing" $script:InstallStateNone = "none" $script:InternetSwitchDefaultName = "turnkeysdn-internet" $script:SdnSwitchDefaultName = "turnkeysdn-sdnswitch" # Corp network routes, used on the management nic of gateway VMs to allow access to corp network $script:MSFTCorpRoutes = @("10.0.0.0/8") function Initialize-StorePath { if (-not [String]::IsNullOrEmpty($script:CMap["turnKeySdnPath"]) -and ` -not ([String]::IsNullOrEmpty($script:CMap["storePath"]))) { return } $csv = Get-CSV if ($null -ne $csv) { $script:CMap["turnKeySdnPath"] = Join-Path $csv "TurnKeySdn" $script:CMap["vhdStore"] = Join-Path $csv "TurnKeySdnVhdStore" } else { $script:CMap["turnKeySdnPath"] = Join-Path $Env:SystemDrive "TurnKeySdn" $script:CMap["vhdStore"] = Join-Path $Env:SystemDrive "TurnKeySdnVhdStore" } $script:CMap["storePath"] = Join-Path $script:CMap["turnKeySdnPath"] ".store" if (Test-IsInitialized) { $script:CMap["deploymentConfigPath"] = Join-Path $script:CMap["turnKeySdnPath"] "DeploymentConfig" $script:CMap["workloadConfigPath"] = Join-Path $script:CMap["turnKeySdnPath"] "WorkloadConfig" } if (-not $(Test-Path (Get-TurnKeySdnPath))) { New-Item (Get-TurnKeySdnPath) -ItemType Directory -ErrorAction Stop | Out-Null } if (-not $(Test-Path (Get-StorePath))) { New-Item (Get-StorePath) -ItemType Directory -ErrorAction Stop | Out-Null } } function Undo-StorePathInitialization { $script:CMap["turnKeySdnPath"] = "" $script:CMap["storePath"] = "" $script:CMap["deploymentConfigPath"] = $script:CMap["userConfigPath"] $script:CMap["workloadConfigPath"] = $script:CMap["userWorkloadConfigPath"] $script:CMap["vhdStore"] = "" } function Get-StorePath { Initialize-StorePath return $script:CMap["storePath"] } function Get-TurnKeySdnPath { Initialize-StorePath return $script:CMap["turnKeySdnPath"] } function Get-InternalDeploymentConfigPath { Initialize-StorePath return $script:CMap["deploymentConfigPath"] } function Get-InternalWorkloadConfigPath { Initialize-StorePath return $script:CMap["workloadConfigPath"] } function Get-VhdStore { Initialize-StorePath return $script:CMap["vhdStore"] } function Get-SdnExpressPath { param ( [parameter(Mandatory = $false)][switch] $SkipConfigPath ) if (-not $($SkipConfigPath.IsPresent)) { $infraconfig = Get-DeploymentConfig $sdnExpPath = $infraconfig.sdnexpressPath if (-not [String]::IsNullOrEmpty($sdnExpPath)) { $sdnExpPSM1 = Join-Path $sdnExpPath "SDNExpress.psm1" if ($(Test-Path $sdnExpPSM1)) { return $sdnExpPath } } } $sdnExpPath = Join-Path $PSScriptRoot "..\..\SDNExpress" $sdnExpPSM1 = Join-Path $sdnExpPath "SDNExpress.psm1" if ($(Test-Path $sdnExpPSM1)) { return $sdnExpPath } Import-Module -Name SdnExpress -ErrorAction SilentlyContinue $module = Get-Module SdnExpress if ($null -ne $module) { return $module.ModuleBase } return $null } function Set-SdnExpressPathInternal { param( [parameter(Mandatory = $true)][string] $sdnExpressPath ) $infraconfig = Get-DeploymentConfig $infraconfig.sdnexpressPath = $sdnExpressPath Set-DeploymentConfig -deploymentConfig $infraconfig Write-TraceLog "Set-SdnExpressPath: Updated path to $sdnExpressPath" } function Get-SdnExpressModule { $sdnExpPath = Get-SdnExpressPath $sdnexpress = Join-Path $sdnExpPath SDNExpress.psm1 return $sdnexpress } function Get-SdnExpressScript { $sdnExpPath = Get-SdnExpressPath $sdnexpress = Join-Path $sdnExpPath SDNExpress.ps1 return $sdnexpress } function Get-RestoreReplayScriptPath { param ( [parameter(Mandatory = $false)][switch] $SkipConfigPath ) if (-not $($SkipConfigPath.IsPresent)) { $infraconfig = Get-DeploymentConfig $restoreReplayScriptPath = $infraconfig.restoreReplayScriptPath if (-not [String]::IsNullOrEmpty($restoreReplayScriptPath)) { $restoreReplayScript = Join-Path $restoreReplayScriptPath RestoreReplay.ps1 if ($(Test-Path $restoreReplayScript)) { return $restoreReplayScriptPath } } } $restoreReplayScriptPath = Join-Path $PSScriptRoot "..\BCDR" $restoreReplayScript = Join-Path $restoreReplayScriptPath RestoreReplay.ps1 if ($(Test-Path $restoreReplayScript)) { return $restoreReplayScriptPath } $script = Get-InstalledScript RestoreReplay -ErrorAction SilentlyContinue if ($null -ne $script) { return $script.InstalledLocation } return $null } function Get-RestoreReplayScript { $restoreReplayScriptPath = Get-RestoreReplayScriptPath $restoreReplay = Join-Path $restoreReplayScriptPath RestoreReplay.ps1 return $restoreReplay } function Get-DefaultNetworkControllerPsModulePath { return Join-Path $env:SystemRoot "system32\WindowsPowerShell\v1.0\Modules\NetworkControllerFc" } function Get-DefaultNetworkControllerPackageLocation { return (Join-Path $env:SystemRoot "NetworkController") } function Get-DefaultNetworkControllerDBLocation { $csv = Get-CSV if ($csv -ne $null) { return (Join-Path $csv "FCNCDB") } return (Join-Path $env:SystemDrive "FCNCDB") } function Set-AddressRandmoizerSeed { param( [parameter(Mandatory = $true)][int] $seed ) $internalConfig = Get-TurnKeySdnInternalConfig -configType state $internalConfig.randomizerSeed = $seed Set-TurnKeySdnInternalConfig -configType state -config $internalConfig } function Get-AddressRandmoizerSeed { $internalConfig = Get-TurnKeySdnInternalConfig -configType state if (-not [String]::IsNullOrEmpty($internalConfig.randomizerSeed)) { return [int]$internalConfig.randomizerSeed } $curhost = (hostname) $hostIndex = $curhost.Substring($($curhost.Length - 2)) $result = 0 if (-not [int]::TryParse($hostIndex, [ref]$result)) { $result = Get-Random -Minimum 1 -Maximum 60 } return $result } function Get-RandomizedIPv4Address { param( $address, $randomizer ) $addresses = $address.Split(".") $addresses[1] = ([int]$addresses[1] + $randomizer) % 255 return $addresses -join '.' } function Update-IPv4Address { param( $Address ) $depConfig = Get-DeploymentConfig if (-not $depConfig.randomizeAddresses) { return $Address } $randomizer = Get-AddressRandmoizerSeed $addr = Get-RandomizedIPv4Address -address $Address -randomizer $randomizer return $addr } function Update-LogicalNetworkAddresses { param( $network ) $depConfig = Get-DeploymentConfig if (-not $depConfig.randomizeAddresses) { return $network } $isOneNode = $depConfig.hyperVHosts.Count -eq 1 $randomizer = Get-AddressRandmoizerSeed $network.properties.subnets | ForEach-Object { $subnetProp = $_.properties $subnetProp.addressPrefix = Get-RandomizedIPv4Address -address $subnetProp.addressPrefix -randomizer $randomizer $newGateways = @() $subnetProp.defaultGateways | ForEach-Object { $newGateways += Get-RandomizedIPv4Address -address $_ -randomizer $randomizer } $subnetProp.defaultGateways = $newGateways $subnetProp.ipPools | Foreach-Object { $poolProp = $_.Properties $poolProp.startIpAddress = Get-RandomizedIPv4Address -address $poolProp.startIpAddress -randomizer $randomizer $poolProp.endIpAddress = Get-RandomizedIPv4Address -address $poolProp.endIpAddress -randomizer $randomizer } if ($isOneNode) { $subnetProp.vlanID = $([int]$subnetProp.vlanID) + $randomizer } } return $network } function Set-TurnKeySdnInternalConfig { param( [ValidateSet("workloadcredential","credential", "state")] [parameter(Mandatory = $true)][string] $configType, [parameter(Mandatory = $true)] $config ) $configFile = Join-Path (Get-StorePath) $script:CMap[$configType] $value = $(ConvertTo-Json $config -Depth 10) Set-Content -Path $configFile -Value $value -Encoding UTF8 } function Get-TurnKeySdnInternalConfig { param( [ValidateSet("workloadcredential","credential", "state")] [parameter(Mandatory = $true)][string] $configType ) $configFile = Join-Path (Get-StorePath) $script:CMap[$configType] return $(Get-Config $configFile) } function Test-TurnKeySdnStateConfigExist { $configFile = Get-StateFileWithoutInit return $(Test-Path $configFile) } function Get-TurnKeySdnCred { if ($Global:SdnCredential -ne $null -and $Global:SdnCredential -ne [pscredential]::Empty) { return $Global:SdnCredential } $configFile = Join-Path (Get-StorePath) $script:CMap["credential"] try { $c = Get-Config $configFile } catch { } if ([String]::IsNullOrEmpty($c.username) -or [String]::IsNullOREmpty($c.password)) { Write-TraceLog "Get-TurnKeySdnCred: Failed to get credentials, defaulting to empty cred" return [pscredential]::Empty } $cred = [pscredential]::new($c.username, $($c.password | ConvertTo-SecureString -ErrorAction Stop)) return $cred } function Get-TurnKeySdnWorkloadVmCred { # todo: find a better way to store workload credentials # $configFile = Join-Path (Get-StorePath) $script:CMap["workloadcredential"] # $c = Get-Config $configFile # if([string]::IsNullOrEmpty($c.username) -or [string]::IsNullOrEmpty($c.password)) { # throw "Workload VMcredentials is not initialized. Please make sure $Env:TURNKEY_WORKLOAD_PASSWORD is set on the machine. Then run initialize again for TurnKey SDN" # } else { # $vmUserName = $c.username # $vmUserPassword = $c.password # } $vmUserName = $Env:TURNKEY_WORKLOAD_USERNAME $vmUserPassword = $Env:TURNKEY_WORKLOAD_PASSWORD return [pscredential]::new($vmUserName, $($vmUserPassword | ConvertTo-SecureString -AsPlainText -Force)) } function Get-Config { param( [parameter(Mandatory = $true)][string] $file ) Test-FileExist -path $file $config = Get-Content $file -ErrorAction Stop | ConvertFrom-Json return $config } function Get-GreVipLogicalNetworkConfig { param( [Parameter(Mandatory = $false)][bool] $RandomizeAddress = $true ) $greNetworkFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["greNetworkFile"] $network = Get-Config $greNetworkFile if ($RandomizeAddress) { $network = Update-LogicalNetworkAddresses $network } return $network } function Set-GreVipNetworkConfig { param( [parameter(Mandatory = $true)][PSCustomObject]$Network ) $greNetworkFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["greNetworkFile"] $Network | ConvertTo-Json -Depth 100 | Out-File $greNetworkFile -Force } function Get-HnvPaNetworkConfig { param( [Parameter(Mandatory = $false)][bool] $RandomizeAddress = $true ) $hnvpaNetworkFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["hnvpaNetworkFile"] $hnvPaNetwork = Get-Config $hnvpaNetworkFile if ($RandomizeAddress) { $hnvPaNetwork = Update-LogicalNetworkAddresses $hnvPaNetwork } return $hnvPaNetwork } function Set-HnvPaNetworkConfig { param( [parameter(Mandatory = $true)][PSCustomObject]$Network ) $hnvpaNetworkFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["hnvpaNetworkFile"] $Network | ConvertTo-Json -Depth 100 | Out-File $hnvpaNetworkFile -Force } function Get-MgmtNetworkConfig { param( [Parameter(Mandatory = $false)][bool] $RandomizeAddress = $true ) $mgmtNetworkFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["mgmtNetworkFile"] $mgmtNetwork = Get-Config $mgmtNetworkFile if ($RandomizeAddress) { $mgmtNetwork = Update-LogicalNetworkAddresses $mgmtNetwork } return $mgmtNetwork } function Set-MgmtNetworkConfig { param( [parameter(Mandatory = $true)][PSCustomObject]$Network ) $mgmtNetworkFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["mgmtNetworkFile"] $Network | ConvertTo-Json -Depth 100 | Out-File $mgmtNetworkFile -Force } function Get-PublicVipNetworkConfig { $publicVipNetworkFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["publicVipNetworkFile"] $publicVipNetwork = Get-Config $publicVipNetworkFile return $publicVipNetwork } function Set-PublicVipNetworkConfig { param( [parameter(Mandatory = $true)][PSCustomObject]$Network ) $publicVipNetworkFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["publicVipNetworkFile"] $Network | ConvertTo-Json -Depth 100 | Out-File $publicVipNetworkFile -Force } function Get-PrivateVipNetworkConfig { $privateVipNetworkFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["privateVipNetworkFile"] $privateVipNetwork = Get-Config $privateVipNetworkFile return $privateVipNetwork } function Set-PrivateVipNetworkConfig { param( [parameter(Mandatory = $true)][PSCustomObject]$Network ) $privateVipNetworkFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["privateVipNetworkFile"] $Network | ConvertTo-Json -Depth 100 | Out-File $privateVipNetworkFile -Force } function Get-DeploymentConfig { $config = Get-Config $(Get-DeploymentFile) # config upgrade for productkey $p = $config | Get-Member -Name productKey -ErrorAction SilentlyContinue if ($null -eq $p) { $config | add-member -NotePropertyName productKey -NotePropertyValue "" } return $config } function Get-TorVmConfig { $config = Get-DeploymentConfig return $config.torVmConfig } function Set-TorVmConfig { param( [parameter(Mandatory = $true)][PSCustomObject]$Config ) $depConfig = Get-DeploymentConfig $depConfig.torVmConfig = $Config Set-DeploymentConfig -deploymentConfig $depConfig } function Update-MacAddress { param($mac) $net = Get-MgmtNetworkConfig # Generate a mac address based on the managment network. $prefixElements = $net.properties.subnets[0].properties.addressPrefix.Split("/") $prefixLen = [int]$prefixElements[1] $ip = $prefixElements[0] if ($prefixLen -gt 24) { $secLast_hex = "{0:X2}" -f [int]($ip.Split('.')[-2]) $last_hex = "{0:X2}" -f [int]($ip.Split('.')[-1]) } elseif ($prefixLen -gt 8 -and $prefixLen -le 24) { $secLast_hex = "{0:X2}" -f [int]($ip.Split('.')[-3]) $last_hex = "{0:X2}" -f [int]($ip.Split('.')[-2]) } else { $secLast_hex = "{0:X2}" -f [int]($ip.Split('.')[-4]) $last_hex = "{0:X2}" -f [int]($ip.Split('.')[-3]) } $macEle = $mac.Split("-") $macEle[3] = $secLast_hex $macEle[4] = $last_hex $result = $macEle -join '-' return $result } function Get-DefaultMacPoolConfig { $configFileName = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["macpoolFile"] $config = Get-Config $configFileName # Always randomize mac addresses, if needed expose a separate flag to disable. $config.properties.startMacAddress = Update-MacAddress -mac $config.properties.startMacAddress $config.properties.endMacAddress = Update-MacAddress -mac $config.properties.endMacAddress return $config } function Set-MacPoolConfig { param( [parameter(Mandatory = $true)][PSCustomObject]$Config ) $configFileName = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["macpoolFile"] $Config | ConvertTo-Json -Depth 100 | Out-File $configFileName -Force } function Get-SdnConfig { $configFileName = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["sdnConfigFile"] $config = Get-Config $configFileName return $config } function Test-ValidDepId { param( [parameter(Mandatory = $true)][string] $id ) if ($id.Length -gt 9) { Write-TraceLog "Test-ValidDepId failed, id $id must be less than 9 characters" return $false } $names = @("NC-$id", "$id-$(Get-RouterVMSuffix)", "$id-$(Get-NCVMSuffix)0", "$id-$(Get-MUXVMSuffix)0", "$id-$(Get-GWVMSuffix)0") foreach($name in $names) { $result = (Resolve-DnsName $name -ErrorAction SilentlyContinue) if ($result -ne $null) { Write-TraceLog "Test-ValidDepId failed, another deployment with id $id already exists" return $false } } Write-TraceLog "Test-ValidDepId $id passed all validations" return $true } function Get-NewDepId { while($true) { $id = ((New-Guid).guid).split("-")[0] # Skip if the name is already in use if ($(Test-ValidDepId -id $id)) { return $id } } } function Set-DeploymentId { param( [parameter(Mandatory = $false)][string] $id ) $internalConfig = Get-TurnKeySdnInternalConfig -configType state $internalConfig.depId = $id if ([String]::IsNullOrEmpty($internalConfig.torId)) { $internalConfig.torId = $id } Set-TurnKeySdnInternalConfig -configType state -config $internalConfig } function Get-TurnKeySdnDeploymentId { $configFileName = Join-Path (Get-StorePath) $script:CMap["state"] $config = Get-Config $configFileName return $config.depId } function Get-TorId { $configFileName = Join-Path (Get-StorePath) $script:CMap["state"] $config = Get-Config $configFileName return $config.torId } function Get-StateFileWithoutInit { $csv = Get-CSV if ($csv -ne $null) { $installPath = Join-Path $csv "TurnKeySdn" } else { $installPath = Join-Path $Env:SystemDrive "TurnKeySdn" } $storePath = Join-Path $installPath ".store" $configFileName = Join-Path $storePath $script:CMap["state"] return $configFileName } function Remove-TurnKeySdnStore { param ( [parameter(Mandatory = $false)][switch] $SkipStore ) try { $depConfig = Get-DeploymentConfig $deployFolder = $depConfig.vmLocation if (-not [string]::IsNullOrEmpty($deployFolder)) { Write-TraceLog "Remove-TurnKeySdnStore removing deployment folder $deployFolder" Remove-Item $depConfig.vmLocation -Recurse -Force -ErrorAction SilentlyContinue } } catch { Write-TraceLog "Remove-TurnKeySdnStore: Failed to remove vmLocation $deployFolder, error $_" } try { $workloadConfig = Get-TurnKeySdnWorkloadConfig $workloadDeployFolder = $workloadConfig.deploymentpath if (-not [String]::IsNullOrEmpty($workloadDeployFolder)) { Write-TraceLog "Remove-TurnKeySdnStore removing workload folder $workloadDeployFolder" Remove-Item $workloadDeployFolder -Recurse -Force -ErrorAction SilentlyContinue } } catch { Write-TraceLog "Remove-TurnKeySdnStore: Failed to remove deploymentpath $workloadDeployFolder, error $_" } if (Test-IsInitialized) { try { $inernalWorkConfig = Get-InternalWorkloadConfigPath if (-not [String]::IsNullOrEmpty($inernalWorkConfig)) { Write-TraceLog "Remove-TurnKeySdnStore removing workload config folder $inernalWorkConfig" Remove-Item $inernalWorkConfig -Recurse -Force -ErrorAction SilentlyContinue } } catch { Write-TraceLog "Remove-TurnKeySdnStore: Failed to remove deploymentpath $inernalWorkConfig, error $_" } try { $inernalDepConfig = Get-InternalDeploymentConfigPath if (-not [String]::IsNullOrEmpty($inernalDepConfig)) { Write-TraceLog "Remove-TurnKeySdnStore removing deployment config folder $inernalDepConfig" Remove-Item $inernalDepConfig -Recurse -Force -ErrorAction SilentlyContinue } } catch { Write-TraceLog "Remove-TurnKeySdnStore: Failed to remove deploymentpath $inernalDepConfig, error $_" } } $configPresent = Test-TurnKeySdnStateConfigExist if ($($SkipStore.IsPresent) -and $configPresent) { Write-TraceLog "Remove-TurnKeySdnStore: Resetting install states" $state = Get-StateInternal $state.depId = "" $state.initialized = $false $state.installState = $script:InstallStateNone $state.mgmtIPOffset = "0" Set-TurnKeySdnInternalConfig -configType state -config $state Write-TraceLog "Remove-TurnKeySdnStore: Skipping store path removal" return } try { $storePath = Get-TurnKeySdnPath if (-not [String]::IsNullOrEmpty($storePath)) { Write-TraceLog "Remove-TurnKeySdnStore removing storePath $storePath" Remove-Item $storePath -Recurse -Force -ErrorAction SilentlyContinue } } catch { Write-TraceLog "Remove-TurnKeySdnStore: Failed to remove storePath $storePath, error $_" } } function Get-TurnKeySdnRestEndpoint { $sdnConfig = Get-SdnConfig $endpoint = $sdnConfig.networkController.restName if (-not [String]::IsNullOrEmpty($endpoint)) { return $endpoint } if ([String]::IsNullOrEmpty($sdnConfig.networkController.restIpAddress)) { throw "Invalid sdn configuration, both restname and IP are empty" } return $sdnConfig.networkController.restIpAddress.split("/")[0] } function Get-TurnKeySdnNCRuntime() { $sdnConfig = Get-SdnConfig return $sdnConfig.networkController.runtime } function Set-TurnKeySdnConfig { param( [parameter(Mandatory = $true)][PSCustomObject]$sdnConfig ) $configString = $sdnConfig | ConvertTo-Json -Depth 10 $configFile = Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["sdnConfigFile"] Set-Content -Path $configFile -Value $configString -Encoding UTF8 } function Set-DeploymentConfig { param( [parameter(Mandatory = $true)][PSCustomObject]$deploymentConfig ) $configString = $deploymentConfig | ConvertTo-Json -Depth 10 Set-Content -Path $(Get-DeploymentFile) -Value $configString -Encoding UTF8 } function LoadSdnExpressConfig { $sdnexpress = Import-LocalizedData ` -BaseDirectory $script:CMap["sdnExpressConfigPath"] ` -FileName $script:CMap["sdnExpressTemplateFile"] return $sdnexpress } function Get-WorkloadConfigPath { param( [ValidateSet("LoadBalancer", "VNET", "LogicalNetwork", "Gateway", "None", "HLK")] [Parameter(Mandatory = $false)] $WorkloadType, [Parameter(Mandatory = $false)] $WorkloadFolder ) if ($WorkloadType -eq "None" -or [String]::IsNullOrEmpty($WorkloadType)) { $WorkloadType = "LoadBalancer" } if ([String]::IsNullOrEmpty($WorkloadFolder)) { $WorkloadFolder = $WorkloadType } $path = Join-Path(Get-InternalWorkloadConfigPath) $WorkloadFolder if (-not (Test-Path $path)) { throw "Workload $WorkloadType not found at $path" } return $path } function Get-TurnKeySdnWorkloadConfig { $workloadConfigFile = Join-Path (Get-InternalWorkloadConfigPath) $script:CMap["workload"] $workloadConfig = Get-Config $workloadConfigFile return $workloadConfig } function Get-SdnWorkloadDeploymentPath { $workloadConfig = Get-TurnKeySdnWorkloadConfig if (-not [String]::isnullorempty($workloadConfig.deploymentpath)) { return $workloadConfig.deploymentpath } } function Set-TurnKeySdnWorkloadConfig { param( [parameter(Mandatory = $true)][PSCustomObject]$config ) $configString = $config | ConvertTo-Json -Depth 10 $configFile = Join-Path (Get-InternalWorkloadConfigPath) $script:CMap["workload"] Set-Content -Path $configFile -Value $configString -Encoding UTF8 } function Get-SdnWorkloadVirtualGateways { param( [Parameter(Mandatory = $true)] $WorkloadConfigPath ) $jsonPath = Join-Path $workloadConfigPath "jsons\virtualgateways" if (-not $(Test-Path $jsonPath)) { return $null } Get-ChildItem $jsonPath } function Get-SdnWorkloadLogicalNetworks { param( [Parameter(Mandatory = $true)] $WorkloadConfigPath ) $jsonPath = Join-Path $workloadConfigPath "jsons\logicalnetworks" if (-not $(Test-Path $jsonPath)) { return $null } Get-ChildItem $jsonPath } function Get-SdnWorkloadNetworkInterfaces { param( [Parameter(Mandatory = $true)] $WorkloadConfigPath ) $nicJsonPath = Join-Path $workloadConfigPath "jsons\networkinterfaces" if (-not $(Test-Path $nicJsonPath)) { return $null } Get-ChildItem $nicJsonPath } function Get-SdnWorkloadLoadbalancers { param( [Parameter(Mandatory=$true)] $WorkloadConfigPath ) $lbJsonPath = Join-Path $workloadConfigPath "jsons\loadbalancers" if (-not $(Test-Path $lbJsonPath)) { return $null } Get-ChildItem $lbJsonPath } function Get-TurnKeySdnHyperVHosts { $depConfig = Get-DeploymentConfig if ($depConfig.hyperVHosts.Count -gt 0) { return $depConfig.hyperVHosts } if (Test-IsCluster) { Write-TraceLog "Get-TurnKeySdnHyperVHosts: No hosts found, defaulting to clusternodes" $hypervHosts = (get-cluster | get-clusternode).Name } else { Write-TraceLog "Get-TurnKeySdnHyperVHosts: No hosts found, defaulting to local host" $hypervHosts = @($(hostname)) } return $hypervHosts } function Get-SdnSwitchName { $depConfig = Get-DeploymentConfig return $depConfig.sdnSwitchName } function Initialize-TurnKeySdnDeploymentId { $config = Get-TurnKeySdnInternalConfig -configType state $updated = $false if ([String]::IsNullOrEmpty($config.depId)) { $config.depId = Get-NewDepId $updated = $true } if ([String]::IsNullOrEmpty($config.torId)) { $config.torId = $config.depId $updated = $true } if ([String]::IsNullOrEmpty($config.randomizerSeed)) { $config.randomizerSeed = Get-AddressRandmoizerSeed $updated = $true } if ($updated) { Set-TurnKeySdnInternalConfig -configType state -config $config } } function Initialize-Store { Initialize-StorePath $script:CMap["deploymentConfigPath"] = Join-Path $script:CMap["turnKeySdnPath"] "DeploymentConfig" $script:CMap["workloadConfigPath"] = Join-Path $script:CMap["turnKeySdnPath"] "WorkloadConfig" $internalConfigPath = $script:CMap["deploymentConfigPath"] $internalWorkloadConfigPath = $script:CMap["workloadConfigPath"] if (-not (Test-Path $internalConfigPath)) { New-Item $internalConfigPath -ItemType Directory -ErrorAction Stop | Out-Null } if (-not (Test-Path $internalWorkloadConfigPath)) { New-Item $internalWorkloadConfigPath -ItemType Directory -ErrorAction Stop | Out-Null } $userConfigPath = $script:CMap["userConfigPath"] Write-TraceLog "Copying user config from $userConfigPath to $internalConfigPath" robocopy $userConfigPath $script:CMap["deploymentConfigPath"] /E /XO /NC /NS /NP /NFL /NDL /NJH /NJS $userWorkloadConfigPath = $script:CMap["userWorkloadConfigPath"] Write-TraceLog "Copying user workload config from $userWorkloadConfigPath to $internalWorkloadConfigPath" robocopy $userWorkloadConfigPath $internalWorkloadConfigPath /E /XO /NC /NS /NP /NFL /NDL /NJH /NJS $vhdStore = Get-VhdStore if (-not (Test-Path $vhdStore)) { New-Item $vhdStore -ItemType Directory -ErrorAction Stop | Out-Null } $credFile = Join-Path (Get-StorePath) $script:CMap["credential"] if (-not $(Test-Path $credFile)) { $cred = @{} $cred["username"] = "" $cred["password"] = "" Set-TurnKeySdnInternalConfig -configType credential -config $cred } $stateFile = Join-Path (Get-StorePath) $script:CMap["state"] if (-not $(Test-Path $stateFile)) { $state = @{} $state["depId"] = "" $state["torId"] = "" $state["randomizerSeed"] = "" $state["initialized"] = $false $state["installState"] = $script:InstallStateNone $state["mgmtIPOffset"] = "0" Set-TurnKeySdnInternalConfig -configType state -config $state } Initialize-TurnKeySdnDeploymentId } function Get-DeploymentFile { return Join-Path (Get-InternalDeploymentConfigPath) $script:CMap["deploymentFile"] } function Get-MgmtNicName { return $script:MgmtHostNicName } function Get-DefaultWorkloadVhdShare { return $script:DefaultTestVhdShare } function Get-DefaultWorkloadVhdFile { return $script:DefaultTestVhdFile } function Get-StateInternal { $stateFile = Get-StateFileWithoutInit $config = Get-Config $stateFile return $config } function Set-InstallState { param( [ValidateSet("installed", "installFailed", "installing", "none")] [parameter(Mandatory = $true)][string] $state ) $config = Get-StateInternal $config.installState = $state Set-TurnKeySdnInternalConfig -configType state -config $config } function Test-IsInstalled { try { $config = Get-StateInternal } catch { return $false } return $config.installState -ieq "installed" } function Test-IsInitialized { try { $config = Get-StateInternal } catch { return $false } return $config.initialized } function Set-Initialized { $config = Get-TurnKeySdnInternalConfig -configType state $config.initialized = $true Set-TurnKeySdnInternalConfig -configType state -config $config } function Get-NextManagementIPOffset { $config = Get-StateInternal [int]$offset = $config.mgmtIPOffset $config.mgmtIPOffset = $offset + 1 Set-TurnKeySdnInternalConfig -configType state -config $config return $offset } function Initialize-ManagementIPOffset { $config = Get-StateInternal $config.mgmtIPOffset = 0 Set-TurnKeySdnInternalConfig -configType state -config $config } function Get-MsftCorpRoutes { return $script:MSFTCorpRoutes } function Test-RRASRouterEnabled { $depConfig = Get-DeploymentConfig return $depConfig.useRRASRouter } function Get-DefaultInternetSwitchName { return $script:InternetSwitchDefaultName } function Get-DefaultSdnSwitchName { return $script:SdnSwitchDefaultName } function Get-RouterVMSuffix { "-TOR" } function Get-NCVMSuffix { "-NC" } function Get-MUXVMSuffix { "-MUX" } function Get-GWVMSuffix { "-GW" } function Get-DefaultCtsTrafficFolder { if (-not (Test-IsCluster)) { return "$env:SystemDrive\Tools" } $csvPath = Get-CSV return $(Join-Path -Path $csvPath -ChildPath "WorkloadTools") } function Get-DefaultCtsTrafficFile { return $(Join-Path -Path (Get-DefaultCtsTrafficFolder) -ChildPath "CtsTraffic.exe") } function Get-CtsTrafficGitHubUri { return "https://github.com/microsoft/ctsTraffic/raw/master/Releases/2.0.3.2/x64/ctsTraffic.exe" } function Copy-OrGetCtsTraffficExe { param( [parameter(Mandatory = $false)][string] $SourceFolder ) $defaultCtsTrafficFolder = Get-DefaultCtsTrafficFolder if (-not (Test-Path $defaultCtsTrafficFolder)) { New-item -Path $defaultCtsTrafficFolder -ItemType Directory -Force -ErrorAction Stop | Out-Null } $ctsTraffic = Get-DefaultCtsTrafficFile $source = Join-Path $SourceFolder "CtsTraffic.exe" if (-not $(Test-Path $source) -and -not $(Test-Path $ctsTraffic)) { Write-TraceLog "Copy-OrGetCtsTraffficExe: Ctstraffic not found at $source, downloading from github and copying to $ctsTraffic" Start-BitsTransfer $(Get-CtsTrafficGitHubUri) $ctsTraffic return } if ($(Test-Path $source)) { Write-TraceLog "Copy-OrGetCtsTraffficExe: Ctstraffic found locally at $source, copying to $ctsTraffic" Copy-Item -Path $source -Destination $ctsTraffic -Force return } Write-TraceLog "Copy-OrGetCtsTraffficExe: Using existing ctstraffic from $ctsTraffic" } # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCW3JVOnEuvazGM # zuXikmqpeKrmNdzDh4nlxPq1SClPgKCCDXYwggX0MIID3KADAgECAhMzAAADrzBA # DkyjTQVBAAAAAAOvMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p # bmcgUENBIDIwMTEwHhcNMjMxMTE2MTkwOTAwWhcNMjQxMTE0MTkwOTAwWjB0MQsw # CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u # ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy # b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB # AQDOS8s1ra6f0YGtg0OhEaQa/t3Q+q1MEHhWJhqQVuO5amYXQpy8MDPNoJYk+FWA # hePP5LxwcSge5aen+f5Q6WNPd6EDxGzotvVpNi5ve0H97S3F7C/axDf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