Migrating from azurerm_virtual_machine to azurerm_linux_virtual_machine

We have existing systems in Azure that are created from a bootable VHDs stored in blob containers as an attached OS disk in azurerm_virtual_machine.

However, while azurerm_linux_virtual_machine supercedes azurerm_virtual_machine, an attached OS disk is not supported.

An attempted import fails with " Error: The “azurerm_linux_virtual_machine” resource doesn’t support attaching OS Disks - please use the azurerm_virtual_machine resource instead."

A conversion to azure_image, using the existing blob, results in a plan to tear down and rebuild the existing machine, not ideal for production systems.

What is the migration path for machines of this type?

2 Likes