AutomatedLab / AutomatedLab/AutomatedLab
[Bug]: Windows Server 2025 Datacenter has no image mapping in AzureOSImage (Azure engine)
- Langage dominant
- PowerShell
- Étoiles
- 2.2k
- Forks
- 384
- Métriques de merge des PR
- Aucune PR mergée en 30 j
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
```
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par le point d’entrée du mapper AzureOSImage et comparez son traitement des enregistrements de SKU 2025-datacenter et 2025-datacenter-g2 avec 2022-datacenter-core-g2. Reproduisez les appels directs à Create($sku) et la validation préalable de Install-Lab. La tâche est terminée lorsque les deux SKU Windows Server 2025 Datacenter sont associés au nom de système d’exploitation et à la génération attendus.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- azure, powershell
- Domaine
- cloud
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 55/100