From 955080dfcd3189e564470d15c16611951bd005b3 Mon Sep 17 00:00:00 2001 From: Seif Bassem <38246040+sebassem@users.noreply.github.com> Date: Sun, 30 Jun 2024 16:00:02 +0300 Subject: [PATCH 1/4] added F drive --- .../artifacts/ArcServersLogonScript.ps1 | 4 +-- .../artifacts/Bootstrap.ps1 | 10 ++++++- .../artifacts/DataOpsLogonScript.ps1 | 2 +- .../bicep/clientVm/clientVm.bicep | 26 +++++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/azure_jumpstart_arcbox/artifacts/ArcServersLogonScript.ps1 b/azure_jumpstart_arcbox/artifacts/ArcServersLogonScript.ps1 index 3fc044fb2f..3d6c9f0be9 100644 --- a/azure_jumpstart_arcbox/artifacts/ArcServersLogonScript.ps1 +++ b/azure_jumpstart_arcbox/artifacts/ArcServersLogonScript.ps1 @@ -1,6 +1,6 @@ $Env:ArcBoxDir = "C:\ArcBox" $Env:ArcBoxLogsDir = "$Env:ArcBoxDir\Logs" -$Env:ArcBoxVMDir = "$Env:ArcBoxDir\Virtual Machines" +$Env:ArcBoxVMDir = "F:\Virtual Machines" $Env:ArcBoxIconDir = "$Env:ArcBoxDir\Icons" $Env:ArcBoxTestsDir = "$Env:ArcBoxDir\Tests" $agentScript = "$Env:ArcBoxDir\agentScript" @@ -156,7 +156,7 @@ if ($Env:flavor -ne "DevOps") { $Env:AZCOPY_BUFFER_GB = 4 # Other ArcBox flavors does not have an azcopy network throughput capping Write-Output "Downloading nested VMs VHDX file for SQL. This can take some time, hold tight..." - azcopy cp $vhdSourceFolder --include-pattern "${SQLvmName}.vhdx" $Env:ArcBoxVMDir --check-length=false --cap-mbps 1200 --log-level=ERROR + azcopy cp $vhdSourceFolder --include-pattern "${SQLvmName}.vhdx" $Env:ArcBoxVMDir --check-length=false --log-level=ERROR } # Create the nested VMs if not already created diff --git a/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 b/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 index e83360f168..44e7c7bbe4 100644 --- a/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 +++ b/azure_jumpstart_arcbox/artifacts/Bootstrap.ps1 @@ -65,12 +65,20 @@ param ( [System.Environment]::SetEnvironmentVariable('ArcBoxDir', "C:\ArcBox", [System.EnvironmentVariableTarget]::Machine) +# Formatting VMs disk +$disk = (Get-Disk | Where-Object partitionstyle -eq 'raw')[0] +$driveLetter = "F" +$label = "VMsDisk" +$disk | Initialize-Disk -PartitionStyle MBR -PassThru | ` + New-Partition -UseMaximumSize -DriveLetter $driveLetter | ` + Format-Volume -FileSystem NTFS -NewFileSystemLabel $label -Confirm:$false -Force + # Creating ArcBox path Write-Output "Creating ArcBox path" $Env:ArcBoxDir = "C:\ArcBox" $Env:ArcBoxDscDir = "$Env:ArcBoxDir\DSC" $Env:ArcBoxLogsDir = "$Env:ArcBoxDir\Logs" -$Env:ArcBoxVMDir = "$Env:ArcBoxDir\Virtual Machines" +$Env:ArcBoxVMDir = "F:\Virtual Machines" $Env:ArcBoxKVDir = "$Env:ArcBoxDir\KeyVault" $Env:ArcBoxGitOpsDir = "$Env:ArcBoxDir\GitOps" $Env:ArcBoxIconDir = "$Env:ArcBoxDir\Icons" diff --git a/azure_jumpstart_arcbox/artifacts/DataOpsLogonScript.ps1 b/azure_jumpstart_arcbox/artifacts/DataOpsLogonScript.ps1 index 7084717a84..a3940b538d 100644 --- a/azure_jumpstart_arcbox/artifacts/DataOpsLogonScript.ps1 +++ b/azure_jumpstart_arcbox/artifacts/DataOpsLogonScript.ps1 @@ -1,6 +1,6 @@ $Env:ArcBoxDir = "C:\ArcBox" $Env:ArcBoxLogsDir = "C:\ArcBox\Logs" -$Env:ArcBoxVMDir = "$Env:ArcBoxDir\Virtual Machines" +$Env:ArcBoxVMDir = "F:\Virtual Machines" $Env:ArcBoxIconDir = "C:\ArcBox\Icons" $Env:ArcBoxTestsDir = "$Env:ArcBoxDir\Tests" diff --git a/azure_jumpstart_arcbox/bicep/clientVm/clientVm.bicep b/azure_jumpstart_arcbox/bicep/clientVm/clientVm.bicep index c199296e18..20820b26f4 100644 --- a/azure_jumpstart_arcbox/bicep/clientVm/clientVm.bicep +++ b/azure_jumpstart_arcbox/bicep/clientVm/clientVm.bicep @@ -105,6 +105,8 @@ param addsDomainName string = 'jumpstart.local' @description('The custom location RPO ID') param customLocationRPOID string +@description('The SKU of the VMs disk') +param vmsDiskSku string = 'Premium_LRS' var bastionName = 'ArcBox-Bastion' var publicIpAddressName = deployBastion == false ? '${vmName}-PIP' : '${bastionName}-PIP' @@ -146,6 +148,21 @@ resource publicIpAddress 'Microsoft.Network/publicIpAddresses@2022-01-01' = if ( } } +resource vmDisk 'Microsoft.Compute/disks@2023-04-02' = { + location: location + name: '${vmName}-VMsDisk' + sku: { + name: vmsDiskSku + } + properties: { + creationData: { + createOption: 'Empty' + } + diskSizeGB: 1024 + burstingEnabled: true + } +} + resource vm 'Microsoft.Compute/virtualMachines@2022-03-01' = { name: vmName location: location @@ -173,6 +190,15 @@ resource vm 'Microsoft.Compute/virtualMachines@2022-03-01' = { sku: windowsOSVersion version: 'latest' } + dataDisks: [ + { + createOption: 'Attach' + lun: 0 + managedDisk: { + id: vmDisk.id + } + } + ] } networkProfile: { networkInterfaces: [ From a8c5c123799d57347dc8f25ff3cce79cb18811d8 Mon Sep 17 00:00:00 2001 From: Seif Bassem <38246040+sebassem@users.noreply.github.com> Date: Sun, 30 Jun 2024 16:20:59 +0300 Subject: [PATCH 2/4] chore: Update virtual machine paths to use F drive instead of C drive --- .../artifacts/dsc/virtual_machines_itpro.dsc.yml | 16 ++++++++-------- .../artifacts/dsc/virtual_machines_sql.dsc.yml | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/azure_jumpstart_arcbox/artifacts/dsc/virtual_machines_itpro.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/virtual_machines_itpro.dsc.yml index cc44512408..8191c15aba 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/virtual_machines_itpro.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/virtual_machines_itpro.dsc.yml @@ -9,13 +9,13 @@ properties: settings: Name: ArcBox-Win2K19 SwitchName: 'InternalNATSwitch' - VhdPath: C:\ArcBox\Virtual Machines\ArcBox-Win2K19.vhdx + VhdPath: F:\Virtual Machines\ArcBox-Win2K19.vhdx ProcessorCount: 2 StartupMemory: '12GB' RestartIfNeeded: true State: Running Generation: 2 - Path: C:\ArcBox\Virtual Machines + Path: F:\Virtual Machines EnableGuestService: true SecureBoot: true - resource: HyperVDsc/VMHyperV @@ -25,13 +25,13 @@ properties: settings: Name: ArcBox-Win2K22 SwitchName: 'InternalNATSwitch' - VhdPath: C:\ArcBox\Virtual Machines\ArcBox-Win2K22.vhdx + VhdPath: F:\Virtual Machines\ArcBox-Win2K22.vhdx ProcessorCount: 2 StartupMemory: '12GB' RestartIfNeeded: true State: Running Generation: 2 - Path: C:\ArcBox\Virtual Machines + Path: F:\Virtual Machines EnableGuestService: true SecureBoot: true - resource: HyperVDsc/VMHyperV @@ -41,13 +41,13 @@ properties: settings: Name: ArcBox-Ubuntu-01 SwitchName: 'InternalNATSwitch' - VhdPath: C:\ArcBox\Virtual Machines\ArcBox-Ubuntu-01.vhdx + VhdPath: F:\Virtual Machines\ArcBox-Ubuntu-01.vhdx ProcessorCount: 2 StartupMemory: '4GB' RestartIfNeeded: true State: Running Generation: 2 - Path: C:\ArcBox\Virtual Machines + Path: F:\Virtual Machines EnableGuestService: true SecureBoot: false - resource: HyperVDsc/VMHyperV @@ -57,13 +57,13 @@ properties: settings: Name: ArcBox-Ubuntu-02 SwitchName: 'InternalNATSwitch' - VhdPath: C:\ArcBox\Virtual Machines\ArcBox-Ubuntu-02.vhdx + VhdPath: F:\Virtual Machines\ArcBox-Ubuntu-02.vhdx ProcessorCount: 2 StartupMemory: '4GB' RestartIfNeeded: true State: Running Generation: 2 - Path: C:\ArcBox\Virtual Machines + Path: F:\Virtual Machines EnableGuestService: true SecureBoot: false configurationVersion: 0.2.0 \ No newline at end of file diff --git a/azure_jumpstart_arcbox/artifacts/dsc/virtual_machines_sql.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/virtual_machines_sql.dsc.yml index f261cf00f7..3e0aed6851 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/virtual_machines_sql.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/virtual_machines_sql.dsc.yml @@ -8,13 +8,13 @@ properties: settings: Name: ArcBox-SQL SwitchName: 'InternalNATSwitch' - VhdPath: C:\ArcBox\Virtual Machines\ArcBox-SQL.vhdx + VhdPath: F:\Virtual Machines\ArcBox-SQL.vhdx ProcessorCount: 2 StartupMemory: '12GB' RestartIfNeeded: true State: Running Generation: 2 - Path: C:\ArcBox\Virtual Machines + Path: F:\Virtual Machines EnableGuestService: true SecureBoot: true configurationVersion: 0.2.0 \ No newline at end of file From dabe6abb7ae65df37c22d5872801f42b6613bb45 Mon Sep 17 00:00:00 2001 From: Seif Bassem <38246040+sebassem@users.noreply.github.com> Date: Sun, 30 Jun 2024 16:29:59 +0300 Subject: [PATCH 3/4] chore: Update DSC configuration to install 7zip instead of Terraform --- azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml b/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml index 33d7c7853b..2e7b256e31 100644 --- a/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml +++ b/azure_jumpstart_arcbox/artifacts/dsc/itpro.dsc.yml @@ -3,10 +3,10 @@ properties: resources: - resource: Microsoft.WinGet.DSC/WinGetPackage - id: terraform + id: 7zip directives: - description: Install Terraform + description: Install 7zip settings: - id: Hashicorp.Terraform + id: 7zip.7zip source: winget configurationVersion: 0.2.0 \ No newline at end of file From d1450e85ec5ac0c3cd85fb66b7c6bf305e47f730 Mon Sep 17 00:00:00 2001 From: Seif Bassem <38246040+sebassem@users.noreply.github.com> Date: Sun, 30 Jun 2024 17:07:06 +0300 Subject: [PATCH 4/4] chore: Update VM name format in main.bicep file --- azure_jumpstart_arcbox/bicep/main.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_jumpstart_arcbox/bicep/main.bicep b/azure_jumpstart_arcbox/bicep/main.bicep index abee87be15..780dfc1a2f 100644 --- a/azure_jumpstart_arcbox/bicep/main.bicep +++ b/azure_jumpstart_arcbox/bicep/main.bicep @@ -102,7 +102,7 @@ module ubuntuRancherK3sDataSvcNodesDeployment 'kubernetes/ubuntuRancherNodes.bic subnetId: mgmtArtifactsAndPolicyDeployment.outputs.subnetId azureLocation: location flavor: flavor - vmName : '${k3sArcDataClusterName}-Node-0${i}' + vmName : '${k3sArcDataClusterName}-Node-0${i}' storageContainerName: toLower(k3sArcDataClusterName) } dependsOn: [