From 7c9040d3574117cf8035c826d84ec656675696b3 Mon Sep 17 00:00:00 2001 From: Jan Egil Ring Date: Thu, 15 Aug 2024 22:43:17 +0200 Subject: [PATCH 1/7] Moved DSC configuration for Hyper-V and VM Switch from Common to DataOps and ITPro Signed-off-by: Jan Egil Ring --- .../artifacts/dsc/common.dsc.yml | 31 ------------------ .../artifacts/dsc/dataops.dsc.yml | 32 ++++++++++++++++++- .../artifacts/dsc/devops.dsc.yml | 32 ++++++++++++++++++- 3 files changed, 62 insertions(+), 33 deletions(-) diff --git a/azure_jumpstart_arcbox/artifacts/dsc/common.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/common.dsc.yml index c644df8520..cbae2a56bb 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/common.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/common.dsc.yml @@ -86,35 +86,4 @@ properties: settings: FontName: Cascadia Mono FontFile: C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.18.3181.0_x64__8wekyb3d8bbwe\CascadiaMono.ttf - - resource: PSDscResources/WindowsFeature - id: Hyper-V - directives: - description: Install Hyper-V - settings: - Name: Hyper-V - Ensure: Present - - resource: HyperVDsc/VMHost - id: VMHost - directives: - description: Configure VM Host settings - settings: - IsSingleInstance: Yes - EnableEnhancedSessionMode: True - - resource: HyperVDsc/VMSwitch - id: VMSwitch - directives: - description: Configure VM Switch - settings: - Name: InternalNATSwitch - Ensure: Present - Type: Internal - - resource: NetworkingDsc/IPAddress - id: IPAddress.VMSwitch - directives: - description: Configure VM Switch vNIC IP Address - settings: - InterfaceAlias: 'vEthernet (InternalNATSwitch)' - IPAddress: '10.10.1.1/24' - AddressFamily: IPv4 - KeepExistingAddress: false configurationVersion: 0.2.0 \ No newline at end of file diff --git a/azure_jumpstart_arcbox/artifacts/dsc/dataops.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/dataops.dsc.yml index 722865abe4..b7f8a8f193 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/dataops.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/dataops.dsc.yml @@ -58,5 +58,35 @@ properties: settings: id: Istio.Istio source: winget - + - resource: PSDscResources/WindowsFeature + id: Hyper-V + directives: + description: Install Hyper-V + settings: + Name: Hyper-V + Ensure: Present + - resource: HyperVDsc/VMHost + id: VMHost + directives: + description: Configure VM Host settings + settings: + IsSingleInstance: Yes + EnableEnhancedSessionMode: True + - resource: HyperVDsc/VMSwitch + id: VMSwitch + directives: + description: Configure VM Switch + settings: + Name: InternalNATSwitch + Ensure: Present + Type: Internal + - resource: NetworkingDsc/IPAddress + id: IPAddress.VMSwitch + directives: + description: Configure VM Switch vNIC IP Address + settings: + InterfaceAlias: 'vEthernet (InternalNATSwitch)' + IPAddress: '10.10.1.1/24' + AddressFamily: IPv4 + KeepExistingAddress: false configurationVersion: 0.2.0 \ No newline at end of file diff --git a/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml index d77cb4f582..f790a61891 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml @@ -37,5 +37,35 @@ properties: settings: id: Istio.Istio source: winget - + - resource: PSDscResources/WindowsFeature + id: Hyper-V + directives: + description: Install Hyper-V + settings: + Name: Hyper-V + Ensure: Present + - resource: HyperVDsc/VMHost + id: VMHost + directives: + description: Configure VM Host settings + settings: + IsSingleInstance: Yes + EnableEnhancedSessionMode: True + - resource: HyperVDsc/VMSwitch + id: VMSwitch + directives: + description: Configure VM Switch + settings: + Name: InternalNATSwitch + Ensure: Present + Type: Internal + - resource: NetworkingDsc/IPAddress + id: IPAddress.VMSwitch + directives: + description: Configure VM Switch vNIC IP Address + settings: + InterfaceAlias: 'vEthernet (InternalNATSwitch)' + IPAddress: '10.10.1.1/24' + AddressFamily: IPv4 + KeepExistingAddress: false configurationVersion: 0.2.0 \ No newline at end of file From 49eda667643160e988ddf44fde96c144b927f9ca Mon Sep 17 00:00:00 2001 From: Jan Egil Ring Date: Thu, 15 Aug 2024 22:46:09 +0200 Subject: [PATCH 2/7] Updated Hyper-V DSC for ITPro and DevOps Signed-off-by: Jan Egil Ring --- .../artifacts/dsc/devops.dsc.yml | 31 ------------------- .../artifacts/dsc/itpro.dsc.yml | 31 +++++++++++++++++++ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml index f790a61891..9a79565f0d 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/devops.dsc.yml @@ -37,35 +37,4 @@ properties: settings: id: Istio.Istio source: winget - - resource: PSDscResources/WindowsFeature - id: Hyper-V - directives: - description: Install Hyper-V - settings: - Name: Hyper-V - Ensure: Present - - resource: HyperVDsc/VMHost - id: VMHost - directives: - description: Configure VM Host settings - settings: - IsSingleInstance: Yes - EnableEnhancedSessionMode: True - - resource: HyperVDsc/VMSwitch - id: VMSwitch - directives: - description: Configure VM Switch - settings: - Name: InternalNATSwitch - Ensure: Present - Type: Internal - - resource: NetworkingDsc/IPAddress - id: IPAddress.VMSwitch - directives: - description: Configure VM Switch vNIC IP Address - settings: - InterfaceAlias: 'vEthernet (InternalNATSwitch)' - IPAddress: '10.10.1.1/24' - AddressFamily: IPv4 - KeepExistingAddress: false configurationVersion: 0.2.0 \ No newline at end of file diff --git a/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml index 2e7b256e31..616c6d817e 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml @@ -9,4 +9,35 @@ properties: settings: id: 7zip.7zip source: winget + - resource: PSDscResources/WindowsFeature + id: Hyper-V + directives: + description: Install Hyper-V + settings: + Name: Hyper-V + Ensure: Present + - resource: HyperVDsc/VMHost + id: VMHost + directives: + description: Configure VM Host settings + settings: + IsSingleInstance: Yes + EnableEnhancedSessionMode: True + - resource: HyperVDsc/VMSwitch + id: VMSwitch + directives: + description: Configure VM Switch + settings: + Name: InternalNATSwitch + Ensure: Present + Type: Internal + - resource: NetworkingDsc/IPAddress + id: IPAddress.VMSwitch + directives: + description: Configure VM Switch vNIC IP Address + settings: + InterfaceAlias: 'vEthernet (InternalNATSwitch)' + IPAddress: '10.10.1.1/24' + AddressFamily: IPv4 + KeepExistingAddress: false configurationVersion: 0.2.0 \ No newline at end of file From ebee48f2366a8f5a03032eedf640bafd4b06f1d6 Mon Sep 17 00:00:00 2001 From: Jan Egil Ring Date: Thu, 15 Aug 2024 23:43:32 +0200 Subject: [PATCH 3/7] Do not install Hyper-V if flavor is DevOps Signed-off-by: Jan Egil Ring --- azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 b/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 index 3cb2ce8721..02a44c593f 100644 --- a/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 +++ b/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 @@ -429,6 +429,8 @@ else { # Disabling Windows Server Manager Scheduled Task Get-ScheduledTask -TaskName ServerManager | Disable-ScheduledTask + if ($flavor -eq "ITPro") { + Write-Header "Installing Hyper-V" # Install Hyper-V and reboot @@ -437,6 +439,8 @@ else { Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart Install-WindowsFeature -Name Hyper-V -IncludeAllSubFeature -IncludeManagementTools -Restart + } + # Clean up Bootstrap.log Write-Host "Clean up Bootstrap.log" Stop-Transcript From 7a64e0ded1373a2b731d17813bebf18f08c81b55 Mon Sep 17 00:00:00 2001 From: Jan Egil Ring Date: Mon, 2 Sep 2024 08:39:03 +0200 Subject: [PATCH 4/7] Update AKS Edge deployment version and schema version in LogonScript.ps1 Signed-off-by: Jan Egil Ring --- .../arm_template/artifacts/LogonScript.ps1 | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/artifacts/LogonScript.ps1 b/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/artifacts/LogonScript.ps1 index da3866f1e5..b13c894019 100644 --- a/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/artifacts/LogonScript.ps1 +++ b/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/artifacts/LogonScript.ps1 @@ -3,8 +3,8 @@ Start-Transcript -Path C:\Temp\LogonScript.log ## Deploy AKS EE # Parameters -$AksEdgeRemoteDeployVersion = "1.0.230221.1200" -$schemaVersion = "1.1" +$AksEdgeRemoteDeployVersion = "1.7.639.0" +$schemaVersion = "1.9" $versionAksEdgeConfig = "1.0" $aksEdgeDeployModules = "main" $aksEEReleasesUrl = "https://api.github.com/repos/Azure/AKS-Edge/releases" @@ -37,7 +37,7 @@ if ($AKSEEPinnedSchemaVersion -ne "useLatest") { Expand-Archive $output -DestinationPath "C:\temp" -Force $AKSEEReleaseConfigFilePath = "C:\temp\AKS-Edge-$latestReleaseTag\tools\aksedge-config.json" $jsonContent = Get-Content -Raw -Path $AKSEEReleaseConfigFilePath | ConvertFrom-Json - $schemaVersion = $jsonContent.SchemaVersion + $schemaVersionAksEdgeConfig = $jsonContent.SchemaVersion # Clean up the downloaded release files Remove-Item -Path $output -Force Remove-Item -Path "C:\temp\AKS-Edge-$latestReleaseTag" -Force -Recurse @@ -163,7 +163,7 @@ Set-Content -Path $aksedgejson -Value $aksedgeConfig -Force $aksedgeShell = (Get-ChildItem -Path "$workDir" -Filter AksEdgeShell.ps1 -Recurse).FullName . $aksedgeShell -# Download, install and deploy AKS EE +# Download, install and deploy AKS EE Write-Host "Step 2: Download, install and deploy AKS Edge Essentials" # invoke the workflow, the json file already stored above. $retval = Start-AideWorkflow -jsonFile $aidejson @@ -204,8 +204,8 @@ az -v az login --service-principal --username $Env:appId --password=$Env:password --tenant $Env:tenantId # Set default subscription to run commands against -# "subscriptionId" value comes from clientVM.json ARM template, based on which -# subscription user deployed ARM template to. This is needed in case Service +# "subscriptionId" value comes from clientVM.json ARM template, based on which +# subscription user deployed ARM template to. This is needed in case Service # Principal has access to multiple subscriptions, which can break the automation logic az account set --subscription $Env:subscriptionId @@ -347,22 +347,22 @@ $clusterName = "$env:computername-$env:kubernetesDistribution" # Changing to Client VM wallpaper $imgPath = "C:\Temp\wallpaper.png" -$code = @' -using System.Runtime.InteropServices; -namespace Win32{ - - public class Wallpaper{ - [DllImport("user32.dll", CharSet=CharSet.Auto)] - static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni) ; - - public static void SetWallpaper(string thePath){ - SystemParametersInfo(20,0,thePath,3); +$code = @' +using System.Runtime.InteropServices; +namespace Win32{ + + public class Wallpaper{ + [DllImport("user32.dll", CharSet=CharSet.Auto)] + static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni) ; + + public static void SetWallpaper(string thePath){ + SystemParametersInfo(20,0,thePath,3); } } - } + } '@ -add-type $code +add-type $code [Win32.Wallpaper]::SetWallpaper($imgPath) # Kill the open PowerShell monitoring kubectl get pods From 596aa227002b1d0799616761023be379dea37a85 Mon Sep 17 00:00:00 2001 From: Jan Egil Ring Date: Mon, 2 Sep 2024 09:01:43 +0200 Subject: [PATCH 5/7] Update AKS Edge deployment version to 1.9 in azuredeploy.json Signed-off-by: Jan Egil Ring --- .../aks_edge_essentials_single/arm_template/azuredeploy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/azuredeploy.json b/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/azuredeploy.json index 6cf8d1f8dd..2756e96bad 100644 --- a/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/azuredeploy.json +++ b/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/azuredeploy.json @@ -142,7 +142,7 @@ }, "AKSEEPinnedSchemaVersion": { "type": "string", - "defaultValue": "1.13", + "defaultValue": "1.9", "metadata": { "description": "The AKS Edge Essentials schema version to be used. This is only used to pin the AKS Edge Essentials schema version for testing.To pin a specific version, use the format '1.13'. To use the latest schema version, use 'useLatest'" } From 9c54b57c2be42e6fbb0568e47385910f7e67d2ea Mon Sep 17 00:00:00 2001 From: Jan Egil Ring Date: Mon, 2 Sep 2024 09:11:34 +0200 Subject: [PATCH 6/7] Update AKS Edge deployment version and schema version in LogonScript.ps1 Signed-off-by: Jan Egil Ring --- .../arm_template/artifacts/LogonScript.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/artifacts/LogonScript.ps1 b/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/artifacts/LogonScript.ps1 index b13c894019..50fd943e3f 100644 --- a/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/artifacts/LogonScript.ps1 +++ b/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/artifacts/LogonScript.ps1 @@ -4,7 +4,6 @@ Start-Transcript -Path C:\Temp\LogonScript.log # Parameters $AksEdgeRemoteDeployVersion = "1.7.639.0" -$schemaVersion = "1.9" $versionAksEdgeConfig = "1.0" $aksEdgeDeployModules = "main" $aksEEReleasesUrl = "https://api.github.com/repos/Azure/AKS-Edge/releases" @@ -28,7 +27,7 @@ if ($env:kubernetesDistribution -eq "k8s") { Write-Host "Fetching the latest AKS Edge Essentials release." if ($AKSEEPinnedSchemaVersion -ne "useLatest") { - $SchemaVersion = $AKSEEPinnedSchemaVersion + $schemaVersionAksEdgeConfig = $AKSEEPinnedSchemaVersion }else{ $latestReleaseTag = (Invoke-WebRequest $aksEEReleasesUrl | ConvertFrom-Json)[0].tag_name $AKSEEReleaseDownloadUrl = "https://github.com/Azure/AKS-Edge/archive/refs/tags/$latestReleaseTag.zip" @@ -47,7 +46,7 @@ if ($AKSEEPinnedSchemaVersion -ne "useLatest") { $aideuserConfig = @" { "SchemaVersion": "$AksEdgeRemoteDeployVersion", - "Version": "$schemaVersion", + "Version": "$schemaVersionAksEdgeConfig", "AksEdgeProduct": "$productName", "AksEdgeProductUrl": "", "Azure": { From ca9d67fe19f3efada52ef1fab49e1dc08cf9690f Mon Sep 17 00:00:00 2001 From: Jan Egil Ring Date: Mon, 2 Sep 2024 21:42:10 +0200 Subject: [PATCH 7/7] Update AKS Edge deployment version to 1.13 in azuredeploy.json Signed-off-by: Jan Egil Ring --- .../aks_edge_essentials_single/arm_template/azuredeploy.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/azuredeploy.json b/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/azuredeploy.json index 2756e96bad..6cf8d1f8dd 100644 --- a/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/azuredeploy.json +++ b/azure_arc_k8s_jumpstart/aks_hybrid/aks_edge_essentials_single/arm_template/azuredeploy.json @@ -142,7 +142,7 @@ }, "AKSEEPinnedSchemaVersion": { "type": "string", - "defaultValue": "1.9", + "defaultValue": "1.13", "metadata": { "description": "The AKS Edge Essentials schema version to be used. This is only used to pin the AKS Edge Essentials schema version for testing.To pin a specific version, use the format '1.13'. To use the latest schema version, use 'useLatest'" }