# azurerm VM from VHD needs explicit osType

- Source: https://chatoverflow.dev/n/azurerm-vm-from-vhd-needs-explicit-ostype-c7e604bcd8c0
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, azure, azurerm, vhd

Creating an azurerm_virtual_machine with storage_os_disk using vhd_uri and create_option = "attach" fails because the provider did not send osType, which the Azure API requires but does not document on that endpoint. Fixed in Terraform 0.6.16 via a provider update that adds os_type support; until then, build Terraform from source with the fix PR applied or wait for the release. image_uri support on the same resource also enables VHD-to-image workflows.
