Skip to content

Unable to use packer on 6th generation Azure VMs #521

Closed

Description

@akingscote

Overview of the Issue

I'm trying to build a new image from a 6th generation SKU Standard_E2ds_v6.

When the image (windows) is built, i'm unable to launch a VM from the image with the following error:
Image
It seems that the disk controller is set to scsi by default, instead of honoring the parent image configuration, which I think should be nvme.

When i manually create the VM of the same spec, I can see that the disk controller is NVMe.
Image

https://learn.microsoft.com/en-us/azure/virtual-machines/nvme-linux#212-check-controller-type-using-azure-cli

Someone else has reported an similar issue.

Reproduction Steps

I have just tried to build the packer script below, and then launch an image from the image.

I can provide the deprovision script (sysprep) script if needed, but I think its pretty standard.

Plugin and Packer version

Packer v1.13.1

/home/ashley/.config/packer/plugins/github.com/hashicorp/azure/packer-plugin-azure_v2.3.3_x5.0_linux_amd64

Simplified Packer Buildfile

packer {
  required_plugins {
    azure = {
      source  = "github.com/hashicorp/azure"
      version = "~> 2"
    }
  }
}

source "azure-arm" "windows" {
  location = "UK South"
  vm_size  = "Standard_E2ds_v6"
  subscription_id = var.subscription_id
  tenant_id       = var.tenant_id

  use_azure_cli_auth                = true
  managed_image_resource_group_name = var.resource_group
  managed_image_name                = var.image_name

  async_resourcegroup_delete         = true
  managed_image_storage_account_type = "Premium_LRS"

  os_type         = "Windows"
  image_publisher = "MicrosoftWindowsServer"
  image_offer     = "WindowsServer"
  image_version   = "26100.4652.250713"
  image_sku       = "2025-datacenter-azure-edition"

  communicator   = "winrm"
  winrm_username = "packer"
  winrm_insecure = true
  winrm_use_ssl  = true
  winrm_timeout  = "1h"

}

# sysprep
build {
  sources = ["source.azure-arm.windows"]
  provisioner "powershell" {
    scripts = [
      "./files/scripts/deprovision-image.ps1"
    ]
  }
}

Operating system and Environment details

OS, Architecture, and any other information you can provide about the environment.

Log Fragments and crash.log files

Include appropriate log fragments. If the log is longer than a few dozen lines,
please include the URL to the gist of the log or
use the Github detailed format instead of posting it directly in the issue.

Set the env var PACKER_LOG=1 for maximum log detail.

Activity

  1. ivalua-mly commented on Aug 11, 2025

    @ivalua-mly

    My team is also affected by this issue. We're locked to using v4 instances in the meantime.

  2. hneiva commented on Sep 10, 2025

    @hneiva

    +1

  3. natitomattis-im commented on Sep 19, 2025

    @natitomattis-im

    +1

  4. tanmay-hc commented on Sep 25, 2025

    @tanmay-hc
    Contributor

    Hi,

    Thanks for the detailed issue report.
    After investigation, we've confirmed that this is due to a platform limitation within Microsoft Azure itself, not a bug in the Packer plugin.

    The older Managed Image format does not support the stateful security features (like vTPM) required by Trusted Launch VMs. The official and required method for creating and distributing these advanced images is to use an Azure Compute Gallery (formerly Shared Image Gallery).
    The Managed Images generalizes the image to be as widely compatible as possible. This means it defaults to supporting the SCSI controller, ensuring it can run on the vast majority of Azure VMs, including older generations.

    In order to use the Azure v6 VMs, you'd need to migrate to Shared Image Gallery (Compute Gallery) Images.
    I have tested the same using the following commands.

    # Create the gallery
    az sig create --resource-group packer-test --gallery-name packer_gallery
    
    # Create an image definition with DiskControllerTypes
    az sig image-definition create \
      --resource-group packer-test \
      --gallery-name packer_gallery \
      --gallery-image-definition Windows2025-NVMe-new \
      --publisher MicrosoftWindowsServer \
      --offer WindowsServer \
      --sku 2025-datacenter-g2 \
      --os-type Windows \
      --hyper-v-generation V2 \
      --features "DiskControllerTypes=SCSI,NVMe"
    

    Please let us know if this helps unblock you @akingscote @ivalua-mly @hneiva @natitomattis-im

  5. sfc-gh-delmore commented on Oct 21, 2025

    @sfc-gh-delmore

    Following, we are also having this issue creating Alma 9 x86 v6 VMs. To be clear, it is not enough to only use a shared image gallery, we had to specifically add the --features "DiskControllerTypes=SCSI,NVMe" option.

  6. natitomattis-im commented on Oct 29, 2025

    @natitomattis-im

    Thanks @tanmay-hc !
    --features "DiskControllerTypes=SCSI,NVMe" unblocked us as well

  7. tanmay-hc commented on Nov 6, 2025

    @tanmay-hc
    Contributor

    Closing this issue as its not a Packer issue and a workaround has been provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions