AutomatedLab / AutomatedLab/AutomatedLab

[Bug]: Windows Server 2025 Datacenter has no image mapping in AzureOSImage (Azure engine)

Open
#1,856 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
2.2k
Forks
384
PR merge metrics
No merged PRs in 30d

Description

### Description

When defining an Azure lab machine with `-OperatingSystem 'Windows Server 2025 Datacenter'`
(via Add-LabMachineDefinition), Install-Lab's own pre-flight validation fails before any
resource is provisioned, with:

no OS was found that matches Windows Server 2025 Datacenter and generation 2

I confirmed this is a gap in AutomatedLab's own SKU-to-name mapper, not an Azure- or
region-side problem: calling AutomatedLab's compiled mapper directly against a live-queried
Azure SKU record for both `2025-datacenter` and `2025-datacenter-g2` returns an EMPTY
AutomatedLabOperatingSystemName for both Gen1 and Gen2:

$sku = Get-LabAzureAvailableSku | Where-Object Skus -eq '2025-datacenter-g2'
[AutomatedLab.Azure.AzureOSImage]::Create($sku) # AutomatedLabOperatingSystemName is empty

The identical call against a `2022-datacenter-core-g2` SKU record maps correctly to
`AutomatedLabOperatingSystemName = 'Windows Server 2022 Datacenter'` with `Gen = V2`.

The underlying Azure images do exist and are queryable via `az vm image list` and
Get-LabAzureAvailableSku, so this looks like the pinned 5.61.0 release simply predates
Windows Server 2025's GA and the catalogue was never updated for it.

Workaround: use Windows Server 2022 Datacenter instead (no cost or capability difference for
our use case, since Azure's Windows compute meter is flat per VM size regardless of the
Windows Server version).

### Steps to reproduce the issue

```PowerShell
# In an Azure lab definition:
New-LabDefinition -Name 'ReproLab' -DefaultVirtualizationEngine Azure
Add-LabAzureSubscription -SubscriptionId -DefaultLocationName 'swedencentral' `
-DefaultResourceGroupName 'rg-repro'
Add-LabVirtualNetworkDefinition -Name 'ReproNet' -AddressSpace '10.60.0.0/24'
Set-LabInstallationCredential -Username 'Install' -Password 'SomeP@ssw0rd!'
Add-LabDomainDefinition -Name 'repro.local' -AdminUser 'Install' -AdminPassword 'SomeP@ssw0rd!'

Add-LabMachineDefinition -Name 'DC01' -Roles RootDC `
-OperatingSystem 'Windows Server 2025 Datacenter' `
-DomainName 'repro.local' -Network 'ReproNet' -AzureRoleSize 'Standard_D2as_v5'

Install-Lab
# --> fails pre-flight validation: "no OS was found that matches Windows Server 2025
# Datacenter and generation 2"

# Direct repro of the underlying mapper gap, without a full lab:
Import-Module Az.Compute
$sku = Get-LabAzureAvailableSku | Where-Object Skus -eq '2025-datacenter-g2'
[AutomatedLab.Azure.AzureOSImage]::Create($sku)
# --> AutomatedLabOperatingSystemName is empty, for both 2025-datacenter and
# 2025-datacenter-g2, Gen1 and Gen2

# Compare with a working SKU:
$sku2022 = Get-LabAzureAvailableSku | Where-Object Skus -eq '2022-datacenter-core-g2'
[AutomatedLab.Azure.AzureOSImage]::Create($sku2022)
# --> AutomatedLabOperatingSystemName = 'Windows Server 2022 Datacenter', Gen = V2
```

### PowerShell Version

```Shell
PowerShell Version:
Name Value
---- -----
PSVersion 5.1.26100.8972
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.8972
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

### AutomatedLab Version

```Shell
AutomatedLab Version:
Name Version
---- -------
AutomatedLab 5.61.0
AutomatedLab.Common 2.3.37
AutomatedLab.Recipe 5.61.0
AutomatedLab.Ships 5.61.0
AutomatedLabCore 5.61.0
AutomatedLabDefinition 5.61.0
AutomatedLabNotifications 5.61.0
AutomatedLabTest 5.61.0
AutomatedLabUnattended 5.61.0
AutomatedLabWorker 5.61.0
```

Contributor guide

Open the contributing guide

Research direction

Start with the AzureOSImage mapper entry point and compare its handling of the 2025-datacenter and 2025-datacenter-g2 SKU records with 2022-datacenter-core-g2. Reproduce the direct Create($sku) calls and the Install-Lab pre-flight validation. Done means both Windows Server 2025 Datacenter SKUs map to the expected operating-system name and generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.