Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Azure Windows 11 Deployment Gen2 VM #1638

Open
wanjabachmann opened this issue May 1, 2024 · 0 comments
Open

[Bug]: Azure Windows 11 Deployment Gen2 VM #1638

wanjabachmann opened this issue May 1, 2024 · 0 comments

Comments

@wanjabachmann
Copy link

Description

I am getting the following error when trying to deploy a Windows 11 Enterprise VM on Azure:

Write-LogFunctionExitWithError: New-LabVM...leaving: Deployment of resource group 'AutomatedLab.Lab' failed with '14:40:55 - The deployment '86c11f35-76d9-47a2-ad20-2b9eab71dd94' failed with error(s). Showing 1 out of 1 error(s). Status Message: The selected VM size
'Standard_D2_v2' cannot boot Hypervisor Generation '2'. If this was a Create operation please check that the Hypervisor Generation of the Image matches the Hypervisor Generation of the selected VM Size. If this was an Update operation
please select a Hypervisor Generation '2' VM Size. For more information, see https://aka.ms/azuregen2vm (Code:BadRequest)  CorrelationId: 19c37007-ad76-48b2-ab2b-6574ec35768d 14:40:55 - The deployment '86c11f35-76d9-47a2-ad20-2b9eab71dd94'  
failed with error(s). Showing 1 out of 1 error(s). Status Message: The selected VM size 'Standard_D2_v2' cannot boot Hypervisor Generation '2'. If this was a Create operation please check that the Hypervisor Generation of the Image matches  
the Hypervisor Generation of the selected VM Size. If this was an Update operation please select a Hypervisor Generation '2' VM Size. For more information, see https://aka.ms/azuregen2vm (Code:BadRequest)  CorrelationId:
19c37007-ad76-48b2-ab2b-6574ec35768d'

When I try to add a '-AzureRoleSize "Standard_DS2_v2"' to override the RoleSize with a type which is supported for both versions Gen1 and Gen2 i get the following error:

Exception: Selected VM size Standard_DS2_v2 for WindowsClient only suppports G2 VMs, however no matching Generation 2 image was found for your selection: Publisher MicrosoftWindowsDesktop, offer windows-11, sku win11-21h2-ent!

https://learn.microsoft.com/en-us/azure/virtual-machines/dv2-dsv2-series#dsv2-series

Thanks for checking 🙂

Steps to reproduce the issue

# Initial try
$labName = "AZGettingStarted"
$clientName = "WindowsClient"


New-LabDefinition -Name $labName -DefaultVirtualizationEngine Azure
Add-LabAzureSubscription -DefaultLocation 'West Europe'
Sync-LabAzureLabSources -SkipIsos

Add-LabMachineDefinition -Name $clientName -OperatingSystem 'Windows 11 Enterprise' `
                            -Memory 4GB  `
                            -VmGeneration 2 -Verbose

Set-LabInstallationCredential -Username "Install" -Password "Somepass1"

Install-Lab

Show-LabDeploymentSummary -Detailed

#########################################################################################

# First try with the -VMGeneration 2 Parameter

$labName = "AZGettingStarted"
$clientName = "WindowsClient"


New-LabDefinition -Name $labName -DefaultVirtualizationEngine Azure
Add-LabAzureSubscription -DefaultLocation 'West Europe'
Sync-LabAzureLabSources -SkipIsos

Add-LabMachineDefinition -Name $clientName -OperatingSystem 'Windows 11 Enterprise' `
                            -Memory 4GB  `
                            -VmGeneration 2 -Verbose

Set-LabInstallationCredential -Username "Install" -Password "Somepass1"

Install-Lab

Show-LabDeploymentSummary -Detailed

#########################################################################################


# Second try with AzureRoleSize Parameter
$labName = "AZGettingStarted"
$clientName = "WindowsClient"

New-LabDefinition -Name $labName -DefaultVirtualizationEngine Azure
Add-LabAzureSubscription -DefaultLocation 'West Europe'
Sync-LabAzureLabSources -SkipIsos

Add-LabMachineDefinition -Name $clientName -OperatingSystem 'Windows 11 Enterprise' `
                            -Memory 4GB `
                            -AzureRoleSize "Standard_DS2_v2" -Verbose

Set-LabInstallationCredential -Username "Install" -Password "Somepass1"

Install-Lab

Show-LabDeploymentSummary -Detailed

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.20348
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

AutomatedLab Version

Name                      Version
----                      -------
AutomatedLab              5.51.0
AutomatedLab.Common       2.3.17
AutomatedLab.Recipe       5.50.0
AutomatedLab.Ships        5.50.0
AutomatedLabCore          5.51.0
AutomatedLabCore          5.50.0
AutomatedLabDefinition    5.50.0
AutomatedLabNotifications 5.50.0
AutomatedLabTest          5.50.0
AutomatedLabUnattended    5.50.0
AutomatedLabWorker        5.50.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant