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

azurerm_windows_virtual_machine_scale_set fails when using a specialized image #9637

Closed
clippermadness opened this issue Dec 3, 2020 · 3 comments

Comments

@clippermadness
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.13.5

  • provider registry.terraform.io/hashicorp/aws v3.19.0
  • provider registry.terraform.io/hashicorp/azuread v1.1.1
  • provider registry.terraform.io/hashicorp/azurerm v2.38.0

Affected Resource(s)

  • azurerm_windows_virtual_machine_scale_set
  • azurerm_shared_image_version

Terraform Configuration Files

data "azurerm_shared_image" "pipeline_autoscale_image_ocr_dev2" {
  name                = "autoscaling-image-ocr-dev"
  gallery_name        = data.azurerm_shared_image_gallery.autoscaling_images.name
  resource_group_name = data.azurerm_shared_image_gallery.autoscaling_images.resource_group_name
}

data "azurerm_shared_image_version" "pipeline_autoscale_image_ocr_dev2_v1" {
  name                = "1.0.0"
  image_name          = data.azurerm_shared_image.pipeline_autoscale_image_ocr_dev2.name
  gallery_name        = data.azurerm_shared_image_gallery.autoscaling_images.name
  resource_group_name = data.azurerm_shared_image_gallery.autoscaling_images.resource_group_name
}

resource "azurerm_windows_virtual_machine_scale_set" "pipeline_dev2_text_win_autoscale_schedule" {

  name                = "pipetextwindev2schedule"
  location            = data.azurerm_resource_group.dev2.location
  resource_group_name = data.azurerm_resource_group.dev2.name

  sku = "Standard_F4s_v2"
  upgrade_mode = "Manual"
  instances = 0
  overprovision = false
  source_image_id = data.azurerm_shared_image_version.pipeline_autoscale_image_ocr_dev2_v1.id

  os_disk {
    caching = "ReadWrite"
    storage_account_type = "StandardSSD_LRS"
  }

  # since the underlying image we're using is a specialized image, I would expect these to be ignored
  computer_name_prefix = "textsched"
  admin_username = "somethingadminlike"
  admin_password = "completelyignoredandunused"

  network_interface {
    name    = "pipetextdev2-networkprofile"
    primary = true
    network_security_group_id = azurerm_network_security_group.pipeline_pipelinetier_dev2.id
    ip_configuration {
      name         = "pipetextdev2-ipconfig"
      subnet_id    = "${data.azurerm_virtual_network.dev2_vnet.id}/subnets/${data.azurerm_subnet.dev2_subnet_default.name}"
      primary      = true
      public_ip_address {
        name                    = "pipetextdev2-publicipconfig"
        domain_name_label       = "textwinsched"
        idle_timeout_in_minutes = 15
      }
    }
  }

  identity {
    type = "SystemAssigned"
  }

  lifecycle {
    ignore_changes = [ instances, automatic_os_upgrade_policy ]
  }
}

Expected Behaviour

I expected terraform to create the VMSS

Actual Behaviour

azurerm_windows_virtual_machine_scale_set.pipeline_dev2_text_win_autoscale_schedule: Creating...

Error: Error creating Windows Virtual Machine Scale Set "pipetextwindev2schedule" (Resource Group "dev2"): compute.VirtualMachineScaleSetsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidParameter" Message="Parameter 'osProfile' is not allowed." Target="osProfile"

on autoscaling_vidprocessor_text.tf line 105, in resource "azurerm_windows_virtual_machine_scale_set" "pipeline_dev2_text_win_autoscale_schedule":
105: resource "azurerm_windows_virtual_machine_scale_set" "pipeline_dev2_text_win_autoscale_schedule" {

@AliAllomani
Copy link
Contributor

looks same as #7772

@tombuildsstuff
Copy link
Contributor

Duplicate of #7772, thanks for the cross-link @AliAllomani

@ghost
Copy link

ghost commented Apr 15, 2021

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 15, 2021
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

4 participants