Skip to content

[EMS-22255] Add disk_controller_type support to virtual_machine_default - #126

Open
lyudmililchev92 wants to merge 1 commit into
mainfrom
EMS-22255
Open

lyudmililchev92 wants to merge 1 commit into
mainfrom
EMS-22255

Conversation

@lyudmililchev92

Copy link
Copy Markdown
Collaborator

Summary

Allows switching the disk controller (SCSI ↔ NVMe) of VMs managed by the default type (azurerm_virtual_machine). This is required to resize existing VMs to NVMe-only sizes such as Easv6.

azurerm_virtual_machine is feature-frozen in the AzureRM provider and has no disk_controller_type argument. Azure only allows changing the controller in the same request as a size change.

Changes

  • New optional setting disk_controller_type ("NVMe" / "SCSI") for type = "default" VMs.
  • When set, azapi_update_resource sends vmSize + diskControllerType in one request.
  • azurerm_virtual_machine.main now depends_on that resource, so the azapi update runs first. The azurerm update that follows only applies the size that is already set.
  • No change for existing configurations: without disk_controller_type the azapi resource has count = 0.

Usage

vm_example = {
  type                 = "default"
  size                 = "Standard_E4as_v6"
  disk_controller_type = "NVMe"
  ...
}

Notes

  • Existing VMs only. The resource ID is built from the name because of the depends_on, so on create the azapi update would run before the VM exists. For new VMs Azure picks the controller from the size, so the setting is not needed.
  • Guest OS prerequisite for SCSI → NVMe: the NVMe driver (stornvme) must be set to boot start in Windows before applying. Otherwise the VM will not boot.
  • Not yet tested against a real VM. The first use will be the pilot on the ASV test Colibri VMs (dca-test-col-app, dca-test-col-db), with a terraform plan review before apply.

🤖 Generated with Claude Code

azurerm_virtual_machine is feature-frozen and cannot set the disk
controller type, which blocks resizing to NVMe-only sizes (e.g. Easv6).
Set the controller together with the size through azapi_update_resource,
applied before azurerm_virtual_machine.main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lyudmililchev92
lyudmililchev92 requested a review from a team as a code owner October 7, 2026 13:54
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

Successfully merging this pull request may close these issues.

1 participant