Terraform: azurerm_storage_blobs can't be attached to vms since v.0.9.3

Created on 14 Apr 2017  ยท  3Comments  ยท  Source: hashicorp/terraform

Hi there,

since this commit, a existing _azurerm_storage_blob_ can't be attached to a _azurerm_virtual_machine_ anymore. It fails because this test only allows attaching a managed disk.

Terraform Version

Terraform v0.9.3

Affected Resource(s)

  • azurerm_virtual_machine
  • azurerm_storage_blob

Terraform Configuration Files

Based on the azurerm_virtual_machine example:

resource "azurerm_storage_blob" "test" {
  name                    = "datadisk0.vhd"
  resource_group_name     = "${azurerm_resource_group.test.name}"
  storage_account_name    = "${azurerm_storage_account.test.name}"
  storage_container_name  = "${azurerm_storage_container.test.name}"
  source_uri              = "https://accsa.blob.core.cloudapi.de/images/empty-1024gb.vhd"
  type                    = "page"
  size                    = "1099511627776"
}

resource "azurerm_virtual_machine" "test" {
[...]
  storage_data_disk {
    name          = "datadisk0"
    vhd_uri       = "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}/datadisk0.vhd"
    disk_size_gb  = "1023"
    create_option = "Attach"
    lun           = 0
  }
[...]

Expected Behavior

An existing image should be attached. This worked fine until Terraform v0.9.2.

Actual Behavior

Since this was added, it fails with
* azurerm_virtual_machine.test: [ERROR] Must specify which disk to attach

Steps to Reproduce

  1. Take the example from the documentation
  2. Add the above mentioned _azurerm_storage_blob_. _source_uri_ can be any existing image.
  3. Change the _create_option_ to _Attach_, as shown above to attach that existing image.
  4. run terraform apply
  5. After a while, see the above mentioned error message.
bug provideazurerm

Most helpful comment

Ick, my bad. I'll get a PR open for the fix as soon as I can.

All 3 comments

Ick, my bad. I'll get a PR open for the fix as soon as I can.

Opened PR #13686 for the fix.

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.

Was this page helpful?
0 / 5 - 0 ratings