Skip to content

Commit 54bfd2f

Browse files
committed
R2026a release!
1 parent 6abe9c9 commit 54bfd2f

28 files changed

Lines changed: 585 additions & 260 deletions

packer/v1/build-azure-parallel-server.pkr.hcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ variable "STARTUP_SCRIPTS" {
8383
type = list(string)
8484
default = [
8585
"env.ps1",
86+
"00_Set-CustomDNSSuffix.ps1",
8687
"10_Setup-Disk.ps1",
8788
"20_Setup-MATLAB.ps1",
8889
"30_Setup-Polyspace.ps1",
@@ -91,7 +92,8 @@ variable "STARTUP_SCRIPTS" {
9192
"60_Setup-MJS.ps1",
9293
"70_Start-MJS.ps1",
9394
"80_Initialize-ClusterManagementProgram.ps1",
94-
"90_Add-SpotInstanceMonitoring.ps1"
95+
"90_Add-SpotInstanceMonitoring.ps1",
96+
"Setup-MJSHostname.ps1"
9597
]
9698
description = "The list of startup scripts Packer will copy to the remote machine image builder, which can be used during resource group creation."
9799
}

packer/v1/build/Invoke-Sysprep.ps1

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,74 +10,78 @@
1010
Invoke-Sysprep
1111
1212
.NOTES
13-
Copyright 2024-2025 The MathWorks, Inc.
13+
Copyright 2024-2026 The MathWorks, Inc.
1414
The $ErrorActionPreference variable is set to 'Stop' to ensure that any errors encountered during the function execution will cause the script to stop and throw an error.
1515
#>
1616
function Invoke-Sysprep {
17-
Write-Output 'Starting Invoke-Sysprep...'
17+
try {
18+
Write-Output 'Starting Invoke-Sysprep...'
1819

19-
Write-Output 'Waiting for essential services to start...'
20+
Write-Output 'Waiting for essential services to start...'
2021

21-
# Boolean flag to check if required services are running
22-
$ServicesRunning = $false
22+
# Boolean flag to check if required services are running
23+
$ServicesRunning = $false
2324

24-
# Start a stopwatch for timing
25-
$ServicesTimeoutDuration = 300
26-
$Stopwatch = New-Object System.Diagnostics.Stopwatch
27-
$Stopwatch.Start()
25+
# Start a stopwatch for timing
26+
$ServicesTimeoutDuration = 300
27+
$Stopwatch = New-Object System.Diagnostics.Stopwatch
28+
$Stopwatch.Start()
2829

29-
while ($Stopwatch.Elapsed.TotalSeconds -le $ServicesTimeoutDuration) {
30-
$RdAgent = Get-Service RdAgent -ErrorAction SilentlyContinue
31-
$GuestAgent = Get-Service WindowsAzureGuestAgent -ErrorAction SilentlyContinue
30+
while ($Stopwatch.Elapsed.TotalSeconds -le $ServicesTimeoutDuration) {
31+
$RdAgent = Get-Service RdAgent -ErrorAction SilentlyContinue
32+
$GuestAgent = Get-Service WindowsAzureGuestAgent -ErrorAction SilentlyContinue
3233

33-
if (($RdAgent.Status -eq 'Running') -and ($GuestAgent.Status -eq 'Running')) {
34-
Write-Output 'SUCCESS: Both RdAgent and WindowsAzureGuestAgent services are running.'
35-
$ServicesRunning = $true
36-
break
34+
if (($RdAgent.Status -eq 'Running') -and ($GuestAgent.Status -eq 'Running')) {
35+
Write-Output 'SUCCESS: Both RdAgent and WindowsAzureGuestAgent services are running.'
36+
$ServicesRunning = $true
37+
break
38+
}
3739
}
38-
}
3940

40-
$Stopwatch.Stop()
41+
$Stopwatch.Stop()
4142

42-
if (-not $ServicesRunning) {
43-
Write-Output "Services RdAgent and WindowsAzureGuestAgent did not start within the specified timeout of $ServicesTimeoutDuration seconds."
44-
throw
45-
}
43+
if (-not $ServicesRunning) {
44+
Write-Output "Services RdAgent and WindowsAzureGuestAgent did not start within the specified timeout of $ServicesTimeoutDuration seconds."
45+
throw
46+
}
4647

47-
# Start a stopwatch for timing sysprep
48-
$SysprepTimeoutDuration = 300
49-
$Stopwatch = New-Object System.Diagnostics.Stopwatch
50-
$Stopwatch.Start()
48+
# Start a stopwatch for timing sysprep
49+
$SysprepTimeoutDuration = 300
50+
$Stopwatch = New-Object System.Diagnostics.Stopwatch
51+
$Stopwatch.Start()
52+
53+
# Start sysprep
54+
& "$Env:SystemRoot\System32\Sysprep\Sysprep.exe" /oobe /generalize /quiet /quit
55+
56+
$ExpectedImageState = 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE'
57+
58+
while ($Stopwatch.Elapsed.TotalSeconds -le $SysprepTimeoutDuration) {
59+
$ImageState = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State'
60+
if ($ImageState.ImageState -ne $ExpectedImageState) {
61+
Write-Output $ImageState.ImageState
62+
Start-Sleep -Seconds 10
63+
}
64+
else {
65+
Write-Output "Final image state: $($ImageState.ImageState)"
66+
break
67+
}
68+
}
69+
$Stopwatch.Stop()
70+
if ($ImageState.ImageState -ne $ExpectedImageState) {
71+
$FinalImageState = $ImageState.ImageState
72+
throw "Image stage is $FinalImageState after $SysprepTimeoutDuration but was expected to be $ExpectedImageState"
73+
}
5174

52-
# Start sysprep
53-
& "$Env:SystemRoot\System32\Sysprep\Sysprep.exe" /oobe /generalize /quiet /quit
54-
55-
$ExpectedImageState = 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE'
75+
Write-Output 'Done with Invoke-Sysprep.'
5676

57-
while ($Stopwatch.Elapsed.TotalSeconds -le $SysprepTimeoutDuration) {
58-
$ImageState = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State'
59-
if ($ImageState.ImageState -ne $ExpectedImageState) {
60-
Write-Output $ImageState.ImageState
61-
Start-Sleep -Seconds 10
62-
}
63-
else {
64-
Write-Output "Final image state: $ImageState.ImageState"
65-
break
66-
}
77+
Write-Output 'Wait for 5 mins to let sysprep complete...'
78+
Start-Sleep -Seconds 300
79+
Write-Output '5 mins wait is over.'
6780
}
68-
$Stopwatch.Stop()
69-
if ($ImageState.ImageState -ne $ExpectedImageState) {
70-
$FinalImageState = $ImageState.ImageState
71-
throw "Image stage is $FinalImageState after $SysprepTimeoutDuration but was expected to be $ExpectedImageState"
81+
finally {
82+
Write-Output 'Printing last 10 lines of sysprep log for verification...'
83+
Get-FileContent -FilePath '%WINDIR%\System32\Sysprep\Panther\Setupact.log' -NLines 10
7284
}
73-
74-
Write-Output 'Done with Invoke-Sysprep.'
75-
76-
Write-Output 'Wait for 5 mins to let sysprep complete...'
77-
Start-Sleep -Seconds 300
78-
Write-Output '5 mins wait is over.'
79-
Write-Output 'Printing last 10 lines of sysprep log for verification...'
80-
Get-FileContent -FilePath '%WINDIR%\System32\Sysprep\Panther\Setupact.log' -NLines 10
8185
}
8286

8387
function Get-FileContent {

packer/v1/release-config/R2022b.pkrvars.hcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
RELEASE = "R2022b"
66
STARTUP_SCRIPTS = [
77
"env.ps1",
8+
"00_Set-CustomDNSSuffix.ps1",
89
"10_Setup-Disk.ps1",
910
"20_Setup-MATLAB.ps1",
1011
"30_Setup-Polyspace.ps1",
@@ -13,7 +14,8 @@ STARTUP_SCRIPTS = [
1314
"60_Setup-MJS.ps1",
1415
"70_Start-MJS.ps1",
1516
"80_Initialize-ClusterManagementProgram.ps1",
16-
"90_Add-SpotInstanceMonitoring.ps1"
17+
"90_Add-SpotInstanceMonitoring.ps1",
18+
"Setup-MJSHostname.ps1"
1719
]
1820
RUNTIME_SCRIPTS = [
1921
"cluster_management",

packer/v1/release-config/R2023a.pkrvars.hcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
RELEASE = "R2023a"
66
STARTUP_SCRIPTS = [
77
"env.ps1",
8+
"00_Set-CustomDNSSuffix.ps1",
89
"10_Setup-Disk.ps1",
910
"20_Setup-MATLAB.ps1",
1011
"30_Setup-Polyspace.ps1",
@@ -13,7 +14,8 @@ STARTUP_SCRIPTS = [
1314
"60_Setup-MJS.ps1",
1415
"70_Start-MJS.ps1",
1516
"80_Initialize-ClusterManagementProgram.ps1",
16-
"90_Add-SpotInstanceMonitoring.ps1"
17+
"90_Add-SpotInstanceMonitoring.ps1",
18+
"Setup-MJSHostname.ps1"
1719
]
1820
RUNTIME_SCRIPTS = [
1921
"cluster_management",

packer/v1/release-config/R2023b.pkrvars.hcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
RELEASE = "R2023b"
66
STARTUP_SCRIPTS = [
77
"env.ps1",
8+
"00_Set-CustomDNSSuffix.ps1",
89
"10_Setup-Disk.ps1",
910
"20_Setup-MATLAB.ps1",
1011
"30_Setup-Polyspace.ps1",
@@ -13,7 +14,8 @@ STARTUP_SCRIPTS = [
1314
"60_Setup-MJS.ps1",
1415
"70_Start-MJS.ps1",
1516
"80_Initialize-ClusterManagementProgram.ps1",
16-
"90_Add-SpotInstanceMonitoring.ps1"
17+
"90_Add-SpotInstanceMonitoring.ps1",
18+
"Setup-MJSHostname.ps1"
1719
]
1820
RUNTIME_SCRIPTS = [
1921
"cluster_management",

packer/v1/release-config/R2024a.pkrvars.hcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
RELEASE = "R2024a"
66
STARTUP_SCRIPTS = [
77
"env.ps1",
8+
"00_Set-CustomDNSSuffix.ps1",
89
"10_Setup-Disk.ps1",
910
"20_Setup-MATLAB.ps1",
1011
"30_Setup-Polyspace.ps1",
@@ -13,7 +14,8 @@ STARTUP_SCRIPTS = [
1314
"60_Setup-MJS.ps1",
1415
"70_Start-MJS.ps1",
1516
"80_Initialize-ClusterManagementProgram.ps1",
16-
"90_Add-SpotInstanceMonitoring.ps1"
17+
"90_Add-SpotInstanceMonitoring.ps1",
18+
"Setup-MJSHostname.ps1"
1719
]
1820
RUNTIME_SCRIPTS = [
1921
"cluster_management",

packer/v1/release-config/R2024b.pkrvars.hcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
RELEASE = "R2024b"
66
STARTUP_SCRIPTS = [
77
"env.ps1",
8+
"00_Set-CustomDNSSuffix.ps1",
89
"10_Setup-Disk.ps1",
910
"20_Setup-MATLAB.ps1",
1011
"30_Setup-Polyspace.ps1",
@@ -13,7 +14,8 @@ STARTUP_SCRIPTS = [
1314
"60_Setup-MJS.ps1",
1415
"70_Start-MJS.ps1",
1516
"80_Initialize-ClusterManagementProgram.ps1",
16-
"90_Add-SpotInstanceMonitoring.ps1"
17+
"90_Add-SpotInstanceMonitoring.ps1",
18+
"Setup-MJSHostname.ps1"
1719
]
1820
RUNTIME_SCRIPTS = [
1921
"cluster_management",

packer/v1/release-config/R2025a.pkrvars.hcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
RELEASE = "R2025a"
66
STARTUP_SCRIPTS = [
77
"env.ps1",
8+
"00_Set-CustomDNSSuffix.ps1",
89
"10_Setup-Disk.ps1",
910
"20_Setup-MATLAB.ps1",
1011
"30_Setup-Polyspace.ps1",
@@ -13,7 +14,8 @@ STARTUP_SCRIPTS = [
1314
"60_Setup-MJS.ps1",
1415
"70_Start-MJS.ps1",
1516
"80_Initialize-ClusterManagementProgram.ps1",
16-
"90_Add-SpotInstanceMonitoring.ps1"
17+
"90_Add-SpotInstanceMonitoring.ps1",
18+
"Setup-MJSHostname.ps1"
1719
]
1820
RUNTIME_SCRIPTS = [
1921
"cluster_management",

packer/v1/release-config/R2025b.pkrvars.hcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
RELEASE = "R2025b"
66
STARTUP_SCRIPTS = [
77
"env.ps1",
8+
"00_Set-CustomDNSSuffix.ps1",
89
"10_Setup-Disk.ps1",
910
"20_Setup-MATLAB.ps1",
1011
"30_Setup-Polyspace.ps1",
@@ -13,7 +14,8 @@ STARTUP_SCRIPTS = [
1314
"60_Setup-MJS.ps1",
1415
"70_Start-MJS.ps1",
1516
"80_Initialize-ClusterManagementProgram.ps1",
16-
"90_Add-SpotInstanceMonitoring.ps1"
17+
"90_Add-SpotInstanceMonitoring.ps1",
18+
"Setup-MJSHostname.ps1"
1719
]
1820
RUNTIME_SCRIPTS = [
1921
"cluster_management",

packer/v1/release-config/R2026a.pkrvars.hcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
RELEASE = "R2026a"
66
STARTUP_SCRIPTS = [
77
"env.ps1",
8+
"00_Set-CustomDNSSuffix.ps1",
89
"10_Setup-Disk.ps1",
910
"20_Setup-MATLAB.ps1",
1011
"30_Setup-Polyspace.ps1",
@@ -13,7 +14,8 @@ STARTUP_SCRIPTS = [
1314
"60_Setup-MJS.ps1",
1415
"70_Start-MJS.ps1",
1516
"80_Initialize-ClusterManagementProgram.ps1",
16-
"90_Add-SpotInstanceMonitoring.ps1"
17+
"90_Add-SpotInstanceMonitoring.ps1",
18+
"Setup-MJSHostname.ps1"
1719
]
1820
RUNTIME_SCRIPTS = [
1921
"cluster_management",

0 commit comments

Comments
 (0)