Skip to content

NKCODE TECH GEEK ZONE

  • RSS - Posts
Menu
  • Home
  • Cloud
    • Azure
    • Alibaba
    • AWS
  • Hardware
  • Linux
  • Network
  • Security
  • Windows Client / Servers
    • SQL
    • Windows Client OS
      • Windows 10
    • Windows Servers
      • Windows 2008R2
      • Windows Server 2012R2
      • Windows Server 2016
      • Windows Server 2019
  • VMWARE
  • Free Tools
  • About Me
    • Disclaimer
Menu

Steps to Deploy Gen2 VMs in Azure

Posted on June 24, 2019

Microsoft announced the public preview of support to deploy gen2 VMs in Azure. Gen2 VMs have been around since Windows Server 2012 R2 for on-premises Hyper-V deployments. However, there are some serious limitations during the Azure preview. First view at the benefits.

Why Do I Need to Deploy Gen2 VMs in Azure?

For security purposes. Gen2 VMs will offer the following features in Azure during the preview:

  • Operating System (OS) disks that exceed 2 TB
  • Future support for SecureBoot to block rootkits
  • UEFI-based boot architecture vs. legacy BIOS architecture
  • Future support for Virtual Trusted Platform Module (vTPM)
  • SCSI Disk Controllers (instead of IDE) but only for Premium Storage
  • Support for Accelerated Networking (This isn’t new, it’s just not broken.)

If you’re considering deploying Windows Virtual Desktop in Azure, then SecureBoot in generation 2 VMs should allow you to enable Device Guard and Credential Guard to block credential-theft attacks. I’ll update this post after I deploy credential guard in WVD. (WVD is currently not supported in the gen2 preview. Neither is VBS.)

Why Do Not Deploy Gen2 VMs in Azure?

Also for security purposes. And budgetary reasons. Let’s start with the primary reason why I’m not converting all of my Azure VMs to generation 2 right now.

  • Not compatible with Azure Site Recovery or Azure Backup. I avoid using Veeam, Zerto, or third-party backups for Azure VMs because the seamless integration of ASR and Azure Backup make automation and orchestration significantly easier.
  • No support for Azure Disk Encryption. That means no BitLocker.
  • Virtualization-Based Security is not supported. (Yet.)
  • Shielded VMs are missing.
  • No VHDX support.
  • Currently only Windows Server 2012 through 2019 is supported.

As far as your budget goes, the preview does not support A or B series VMs. Which means you’ll have to deploy using a more expensive Dsv2/3, Esv3, Fsv2, GS, Ls/v2, or Mv2 series VM.

Deploying Windows Server 2019 Generation 2 in Azure

Deploy Gen2 VMs Using the Azure Portal

To deploy a generation 2 VM in Azure, just navigate to the Azure Marketplace and search for:

windowsserver-gen2preview

Select Windows Server 2019 Datacenter (Gen2) and then proceed to create your VM as normal.

Deploy Gen2 VMs Using PowerShell and the Az Module

If you prefer to use PowerShell to deploy your VMs, our DevSecOps team suggests running something similar to the following using the Az module.

Install-Module Az
Import-Module Az
$VMLocalAdminUser = "nkAdmin"
$VMLocalAdminSecurePassword = ConvertTo-SecureString 'Long!Passwords?Are#More*Secure%2019' -AsPlainText -Force
$LocationName = "eastus2"
$ResourceGroupName = "RG-NKG-UAT"
$ComputerName = "NKCODE-01"
$VMName = "NKCODE-01"
$VMSize = "Standard_D4s_v3"

$NetworkName = "NKG-VNET-01"
$NICName = "NKCODE-Nic-01"
$SubnetName = "NKG-SN-01"
$SubnetAddressPrefix = "10.0.0.0/24"
$VnetAddressPrefix = "10.0.0.0/16"

$SingleSubnet = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $SubnetAddressPrefix
$Vnet = New-AzVirtualNetwork -Name $NetworkName -ResourceGroupName $ResourceGroupName -Location $LocationName -AddressPrefix $VnetAddressPrefix -Subnet $SingleSubnet
$NIC = New-AzNetworkInterface -Name $NICName -ResourceGroupName $ResourceGroupName -Location $LocationName -SubnetId $Vnet.Subnets[0].Id

$Credential = New-Object System.Management.Automation.PSCredential ($VMLocalAdminUser, $VMLocalAdminSecurePassword);

$VirtualMachine = New-AzVMConfig -VMName $VMName -VMSize $VMSize
$VirtualMachine = Set-AzVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName $ComputerName -Credential $Credential -ProvisionVMAgent -EnableAutoUpdate
$VirtualMachine = Add-AzVMNetworkInterface -VM $VirtualMachine -Id $NIC.Id
$VirtualMachine = Set-AzVMSourceImage -VM $VirtualMachine -PublisherName 'MicrosoftWindowsServer' -Offer 'WindowsServer' -Skus 'windowsserver-gen2preview' -Version latest

New-AzVM -ResourceGroupName $ResourceGroupName -Location $LocationName -VM $VirtualMachine -Verbose

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...

Related

Welcome to Teck Geek Zone

Alibaba & Azure Cloud with a free trial worth $200-1200 USD Click below Cloud Providers

  • Securing Your Cloud Environment with Alibaba Cloud Firewall
  • 🚢 Sailing into the Data Age: How Cloud and IoT are Revolutionizing the Marine Industry
  • What is Azure Grafana? A Comprehensive Guide to Monitoring and Visualization
  • 🔐 How to Enable Virtualization-Based Security (VBS) for Windows Workloads in VMware Cloud Foundation and vSphere
  • Microsoft’s Azure SRE Agent: AI-Powered Reliability Engineering

Categories

  • Cloud (186)
    • Alibaba (39)
    • AWS (39)
    • Azure (114)
  • Free Tools (5)
  • Hardware (17)
  • Linux (13)
  • Network (28)
  • Security (21)
  • VMWARE (54)
  • Windows OS (44)
    • Windows 10 (7)
  • Windows Servers (69)
    • SQL (3)
    • Windows 2008R2 (7)
    • Windows Server 2012R2 (15)
    • Windows Server 2016 (20)
    • Windows Server 2019 (10)

Subscribe to our newsletter

©2025 NKCODE TECH GEEK ZONE | Design: Newspaperly WordPress Theme
 

Loading Comments...
 

    %d