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

provider/azurerm: VMSS Managed Disk - storage_profile_os_disk.name should be optional #14932

Closed
tombuildsstuff opened this issue May 30, 2017 · 1 comment

Comments

@tombuildsstuff
Copy link
Contributor

Currently when creating a Managed Disk in an azurerm_virtual_machine_scale_set - the name field under storage_profile_os_disk is a Required field. However this can't be set at the same time as managed_disk_type, as such it needs to be set to an empty string - instead this would make more sense as an Optional field.

Terraform Version

0.9.6

Affected Resource(s)

  • azurerm_vm_scale_set

Terraform Configuration Files

resource "azurerm_resource_group" "test" {
  name     = "vmss-bug"
  location = "West US 2"
}

resource "azurerm_virtual_network" "test" {
  name                = "vmss-vn"
  address_space       = ["10.0.0.0/16"]
  location            = "West US 2"
  resource_group_name = "${azurerm_resource_group.test.name}"
}

resource "azurerm_subnet" "test" {
  name                 = "vmss-bugsn"
  resource_group_name  = "${azurerm_resource_group.test.name}"
  virtual_network_name = "${azurerm_virtual_network.test.name}"
  address_prefix       = "10.0.2.0/24"
}

resource "azurerm_network_interface" "test" {
  name                = "vmss-bugni"
  location            = "West US 2"
  resource_group_name = "${azurerm_resource_group.test.name}"

  ip_configuration {
    name                          = "testconfiguration1"
    subnet_id                     = "${azurerm_subnet.test.id}"
    private_ip_address_allocation = "dynamic"
  }
}

resource "azurerm_storage_account" "test" {
  name                = "vmssbugsa"
  resource_group_name = "${azurerm_resource_group.test.name}"
  location            = "West US 2"
  account_type        = "Standard_LRS"

  tags {
    environment = "staging"
  }
}

resource "azurerm_storage_container" "test" {
  name                  = "vhds"
  resource_group_name   = "${azurerm_resource_group.test.name}"
  storage_account_name  = "${azurerm_storage_account.test.name}"
  container_access_type = "private"
}

resource "azurerm_virtual_machine_scale_set" "test" {
  name                   = "vmss-bug-vmss"
  location               = "West US 2"
  resource_group_name    = "${azurerm_resource_group.test.name}"
  upgrade_policy_mode    = "Manual"
  single_placement_group = false

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

  os_profile {
    computer_name_prefix = "testvm-vmss"
    admin_username       = "myadmin"
    admin_password       = "Passwword1234"
  }

  network_profile {
    name    = "TestNetworkProfile"
    primary = true

    ip_configuration {
      name      = "TestIPConfiguration"
      subnet_id = "${azurerm_subnet.test.id}"
    }
  }

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

  storage_profile_image_reference {
    publisher = "Canonical"
    offer     = "UbuntuServer"
    sku       = "16.04-LTS"
    version   = "latest"
  }
}

Debug Output

n/a

Panic Output

n/a

Expected Behavior

The name field in the storage_profile_os_disk object should be Optional, rather than Required - given it's only mandatory for non-managed disks.

Actual Behavior

The name field needs to be set to an empty string currently (see the HCL above)

References

justaugustus pushed a commit to justaugustus/tectonic-installer that referenced this issue Aug 8, 2017
`storage_profile_os_disk.name` must be set to "" when using managed disks.
See:
* hashicorp/terraform#14906
* hashicorp/terraform#14932
justaugustus pushed a commit to justaugustus/tectonic-installer that referenced this issue Aug 10, 2017
`storage_profile_os_disk.name` must be set to "" when using managed disks.
See:
* hashicorp/terraform#14906
* hashicorp/terraform#14932
@ghost
Copy link

ghost commented Apr 9, 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 9, 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

2 participants