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_virtual_machine_scale_set os_profile_windows_config winrm settings gets terraform into unworkable state #219

Closed
sofam opened this issue Aug 8, 2017 · 1 comment · Fixed by #266
Labels

Comments

@sofam
Copy link

sofam commented Aug 8, 2017

Hi there,

Terraform Version

Terraform v0.10.0

Affected Resource(s)

  • azurerm_virtual_machine_scale_set

Terraform Configuration Files

resource "azurerm_virtual_machine_scale_set" "stag-app" {
  name                = "stag-app"
  location            = "${var.region}"
  resource_group_name = "${azurerm_resource_group.resource_group.name}"
  upgrade_policy_mode = "Manual"

  sku {
    name     = "Standard_DS1_v2"
    tier     = "Standard"
    capacity = 2
  }

  storage_profile_image_reference {
    publisher = "microsoftwindowsserver"
    offer     = "WindowsServer"
    sku       = "2016-Datacenter"
    version   = "latest"
  }

  storage_profile_os_disk {
    name              = ""
    caching           = "ReadWrite"
    create_option     = "FromImage"
    managed_disk_type = "Standard_LRS"
  }

  storage_profile_data_disk {
    lun            = 0
    caching        = "ReadWrite"
    create_option  = "Empty"
    disk_size_gb   = 50
  }

  os_profile {
    computer_name_prefix = "${var.vm_name_prefix}"
    admin_username = "${var.admin_username}"
    admin_password = "${var.admin_password}"
    custom_data = "${file("Deploy.PS1")}"
  }

  os_profile_secrets {
        source_vault_id = "/subscriptions/2a65484f-e5aa-4f91-8ace-18421d584029/resourceGroups/econ-keyvaults-test/providers/Microsoft.KeyVault/vaults/xxxxxx"
        vault_certificates {
          certificate_url = "https://xxxxxx/secrets/xxxxxx/ed0b413c72884e8684a7f5920e77565f"
          certificate_store = "My"
        }
  }

  os_profile_windows_config {
    enable_automatic_upgrades = false
    provision_vm_agent = true
    winrm = {
      protocol = "https"
      certificate_url = "https://econ-test-infrastructure.vault.azure.net/secrets/azure-nightly-test/ed0b413c72884e8684a7f5920e77565f"
    }
    
    /* additional_unattend_config {
      pass = "oobeSystem"
      component = "Microsoft-Windows-Shell-Setup"
      setting_name = "AutoLogon"
      content = "<AutoLogon><Password><Value>${var.admin_password}</Value></Password><Enabled>true</Enabled><LogonCount>1</LogonCount><Username>${var.admin_username}</Username></AutoLogon>"
    }
    
    additional_unattend_config {
      pass = "oobeSystem"
      component = "Microsoft-Windows-Shell-Setup"
      setting_name = "FirstLogonCommands"
      content = "${file("FirstLogonCommands.xml")}"
    }*/
  }

  network_profile {
    name    = "stag-app"
    primary = true
    
    ip_configuration {
        name = "${var.vm_name_prefix}-ipConfig"
        subnet_id = "${azurerm_subnet.app_zone_1.id}"
        load_balancer_backend_address_pool_ids = ["${azurerm_lb_backend_address_pool.app-1-lb-be-ip.id}"]
        load_balancer_inbound_nat_rules_ids = ["${azurerm_lb_nat_pool.app-1-lb-nat.id}"]
    }
  }
}

Debug Output

https://gist.github.com/sofam/9665a973ece75b129b3347e6f3e1138c

Expected Behavior

When running terraform apply or terraform destroy the virtual machine scale set should be created or destroyed.

Actual Behavior

The virtual machine scale set is created, then terraform exits with the following error:

Error refreshing state: 1 error(s) occurred:

* azurerm_virtual_machine_scale_set.stag-app: 1 error(s) occurred:

* azurerm_virtual_machine_scale_set.stag-app: azurerm_virtual_machine_scale_set.stag-app: [DEBUG] Error setting Virtual Machine Scale Set OS Profile Windows config error: &errors.errorString{s:"Invalid address to set: []string{\"os_profile_windows_config\", \"0\", \"winrm\"}"}

Only thing I can do from here is manually deleting the resource from the Azure portal.

Steps to Reproduce

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

  1. terraform apply on a scale set with a windows os profile, specifying winrm settings

Important Factoids

Running Azure Resource Manager.

@ghost
Copy link

ghost commented Apr 1, 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 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 and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants