Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The image option in storage_profile_os_disk under azurerm_virtual_machine_scale_set not working #11400

Closed
retheshnair opened this issue Jan 25, 2017 · 5 comments

Comments

@retheshnair
Copy link

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

terraform -v
Terraform v0.8.4

Affected Resource(s)

Please list the resources as a list, for example:

  • azurerm_virtual_machine_scale_set

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

VIRTUAL MACHINE SCALE SET
=====================

  os_profile {
    computer_name_prefix = "${var.AZURE_WEBSERVER}"
    admin_username = "${var.AZURE_OS_ADMIN_USER}"
    admin_password = "${var.AZURE_OS_ADMIN_PASSWORD}"
  }

  os_profile_linux_config {
    disable_password_authentication = true
    ssh_keys {
      path                        = "/home/${var.AZURE_OS_ADMIN_USER}/.ssh/authorized_keys"
      key_data                    = "${file(var.AZURE_LINUX_SSH_KEY_PUB)}"
    }
  }

  network_profile {
      name = "webserverscale01-networkprofile"
      primary = true
      ip_configuration {
        name = "ipconfig1-webserverscaleset01"
        subnet_id = "${azurerm_subnet.vnet01_subnet0.id}"
      }
  }

  storage_profile_os_disk {
    os_type = "linux"
    name             = "webserverscalset01_osdisk01"
    vhd_containers = ["${azurerm_storage_account.storageaccount01.primary_blob_endpoint}${azurerm_storage_container.storagecontainer01.name}"]
    caching          = "ReadWrite"
    create_option    = "FromImage"
   # image            = "${var.AZURE_CUSTOM_SERVER_IMAGE}"
    image             = "https://retheshstorage02.blob.core.windows.net/system/Microsoft.Compute/Images/images/packer-osDisk.a79a2ebb-1a9e-4d2b-9704-1f5e370d6b4e.vhd"
  }

}

Debug Output

Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

Panic Output

No panic output

Expected Behavior

We should be able to spin up VM in VM scale set using the saved image .This same image can be used for spinning up VM using azurerm_virtual_machine and it is working

Actual Behavior

It is not working as expected

terraform : �[31mError applying plan:
At line:1 char:1

  • terraform apply
  •   + CategoryInfo          : NotSpecified: (�[31mError applying plan::String) 
      [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    
    

1 error(s) occurred:

  • azurerm_virtual_machine_scale_set.webserverscalset01:
    compute.VirtualMachineScaleSetsClient#CreateOrUpdate: Failure responding to
    request: StatusCode=400 -- Original Error: autorest/azure: Service returned an
    error. Status=400 Code="InvalidParameter" Message="Parameter
    'OSDisk.vhdContainers' is not allowed."
    Terraform does not automatically rollback in the face of errors.
    Instead, your Terraform state file has been partially updated with
    any resources that successfully completed. Please address the error
    above and apply again to incrementally change your infrastructure.�[0m�[0m

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
@moritzheiber
Copy link

moritzheiber commented Jan 30, 2017

We are seeing the same issue with our deployments.

According to the documentation (scroll to the Q&A section; middle of the page) vhd_containers is not a required parameter, but rather, can be left out if image is specified.

This is clearly a bug in the resource provider.

Using Azure Scale Sets with Terraform and custom images is currently broken because of this.

@moritzheiber
Copy link

FYI, there is a PR trying to fix this (and some other issues): #11516

@shtratos
Copy link

shtratos commented Jan 30, 2017

In my experience, if you are trying to create a VMSS from a custom image - you must omit or leave vhd_containers in your ARM template. As I understand, that's because VMSS requires custom image to be in the same storage account where it keeps VHDs.

Compare:

@stack72
Copy link
Contributor

stack72 commented Jan 31, 2017

Closed via #11516

@ghost
Copy link

ghost commented Apr 17, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants