You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resource"azurerm_managed_disk""data_disk" {
name="data_disk"location="West US 2"resource_group_name=azurerm_resource_group.resource_group.namestorage_account_type="Standard_LRS"create_option="Empty"disk_size_gb="9000"### Going up from 4000tags={
environment ="dev"
}
}
TF should perform the following actions when resizing the disk over 4095 GiB:
Stop the VM
Detach the disk
Resize disk
Attach disk back
Start the VM
Actual Behaviour
TF stops the VM
TF attempts to resize disk
Azure returns the Disks cannot be resized beyond 4095 GiB when attached to a VM error:
Error: Error updating Managed Disk "some_disk_name" (Resource Group "name-of-resource-group"): compute.DisksClient#Update: Failure sending request: StatusCode=0 -- Original Error: Code="BadRequest" Message="Disks cannot be resized beyond 4095 GiB when attached to a VM. Detach disk some_disk_name from VM /subscriptions/some_uuid/resourceGroups/name-of-resource-group/providers/Microsoft.Compute/virtualMachines/some-hostname and try again. If caching is enabled for this disk, it will not be supported for disks greater than 4095 GiB."
Steps to Reproduce
Create a VM, attach a disk of any size below 4095GiB, attempt to resize the attached disk to anything over 4095GiB
The text was updated successfully, but these errors were encountered:
I am also having a simliar issue with running terraform 1.3.7 - although the hot extend function is supposed to kick in, I get an error after the machine is deallocated
Terraform behaviour
is as below when resizing data disks on running VMs:
Action
Result
Notes
4GiB -> 4095GiB Hot extend with no issue
no outage is required
Below 4095GiB to 4096GiB or above
Error with outage
To successfully resize, I had to manually detach the disk and reapply the plan. The plan would create a new attachment object and make a data disk change to the size This use case causes an unexpected outage to the virtual machine, but also then fails.
4096GiB to 8192GiB +
Error with no outage
To successfully resize from here with Terraform, the VM needed to be manually shut down before applying the plan. This would require an outage to the machine successfully apply
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_managed_disk
Terraform Configuration Files
Debug Output
https://gist.github.com/kazikfriedrich/fc455894d5561463016a30ad106ad977
Expected Behaviour
TF should perform the following actions when resizing the disk over 4095 GiB:
Actual Behaviour
Disks cannot be resized beyond 4095 GiB when attached to a VM
error:Steps to Reproduce
Create a VM, attach a disk of any size below 4095GiB, attempt to resize the attached disk to anything over 4095GiB
The text was updated successfully, but these errors were encountered: