AutomatedLab / AutomatedLab/AutomatedLab
[Bug]: Windows Server 2025 Datacenter has no image mapping in AzureOSImage (Azure engine)
- 主要语言
- PowerShell
- 星标
- 2.2k
- 派生
- 384
- PR 合并指标
- 30 天内没有已合并 PR
描述
### 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
```
贡献指南
调研方向
从 AzureOSImage mapper 入口点开始,将其对 2025-datacenter 和 2025-datacenter-g2 SKU 记录的处理与 2022-datacenter-core-g2 进行比较。重现直接的 Create($sku) 调用和 Install-Lab 预检验证。当两个 Windows Server 2025 Datacenter SKU 都映射到预期的操作系统名称和代次时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- azure, powershell
- 领域
- cloud
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100