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
│ Error: creating Linux Virtual Machine: (Name "linux-vm" / Resource Group "LinuxTest"): compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="StorageProfile.dataDisks.lun does not have required value(s) for image specified in storage profile." Target="storageProfile"
│
│ on main.tf line 103, in resource "azurerm_linux_virtual_machine""this":
│ 103: resource "azurerm_linux_virtual_machine""this" {
Expected Behaviour
azurerm_linux_virtual_machine doesn't have an option to specify the data disk when deploying a virtual machine from a managed image. Since the image has two data disks, there is no way to refer to the data disk ID.
In the ARM reference there is an option for setting the data disk create_option to be fromImage, but the validation values on the data disk attachment in Terraform don't allow fromImage as a possible option.
Actual Behaviour
Error as shown under debug output.
Steps to Reproduce
Create a Linux virtual machine in Azure with an OS disk and with a Data disk.
Capture the VM and create a managed image that includes both disks.
Try to create a new VM from the managed image with both disks.
Hi @pimvandenderen, as stated by @myc2h6o#6117 is the one to watch for movement on this issue. I am going to close this issue as a duplicate so that we can consolidate feedback on to #6117, please upvote over there if you have not already.
The "closed" will say as not planned, but that also covers duplicates.
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.
Is there an existing issue for this?
Community Note
Terraform Version
1.36
AzureRM Provider Version
3.26.0
Affected Resource(s)/Data Source(s)
azurerm_linux_virtual_machine
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
azurerm_linux_virtual_machine doesn't have an option to specify the data disk when deploying a virtual machine from a managed image. Since the image has two data disks, there is no way to refer to the data disk ID.
In the ARM reference there is an option for setting the data disk create_option to be fromImage, but the validation values on the data disk attachment in Terraform don't allow fromImage as a possible option.
Actual Behaviour
Error as shown under debug output.
Steps to Reproduce
Important Factoids
No response
References
One reference is here without solution: https://discuss.hashicorp.com/t/can-create-virtual-linux-machine-from-custom-image-which-has-data-disk/10457/3
The text was updated successfully, but these errors were encountered: