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

Linux VM scale set cannot be created using shared image gallery #5998

Closed
mbashtovaya opened this issue Mar 5, 2020 · 5 comments · Fixed by #5901
Closed

Linux VM scale set cannot be created using shared image gallery #5998

mbashtovaya opened this issue Mar 5, 2020 · 5 comments · Fixed by #5901
Labels
bug service/vmss Virtual Machine Scale Sets
Milestone

Comments

@mbashtovaya
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.12.21

  • provider.azurerm v2.0.0

Affected Resource(s)

  • azurerm_linux_virtual_machine_scale_set

Terraform Configuration Files

resource "azurerm_linux_virtual_machine_scale_set" "current" {
    name                 = "test-vmss"
    location             = "East US2"
    resource_group_name  = "test-rg"
    sku                  = "Standard_D4s_v3"
    zones                = [1,2,2]
    zone_balance         = "true"
    instances            = 1
    provision_vm_agent   = "true"

    computer_name_prefix = "testvmss"
    source_image_id      = "subscriptions/myS/resourceGroups/myRg/providers/Microsoft.Compute/galleries/mygallery/images/myimg"
    custom_data          = base64encode(file(var.vmss_config.cloud_init))

    disable_password_authentication = var.vmss_config.disable_password_authentication
    admin_username                  = var.vmss_config.admin_username
    admin_password                  = var.vmss_config.admin_password
    admin_ssh_key {
        username   = var.vmss_config.admin_username
        public_key = var.vmss_config.admin_ssh_key
    }
    
    lifecycle {
        ignore_changes = [
            # Ignore changes to instances as auto-scale is enabled
            instances
        ]
    }
   
    identity {
        type         = "UserAssigned"
        identity_ids = var.identity_ids
    }

    os_disk {
        caching                   = var.os_disk.caching
        storage_account_type      = var.os_disk.storage_account_type
        disk_size_gb              = var.os_disk.disk_size_gb
        # encryption is not supported for custom OS images
        # disk_encryption_set_id    = data.azurerm_disk_encryption_set.current.id
    }

    network_interface {
        name    = "${var.vmss_prefix}-ip"
        primary = true
        ip_configuration {
            name      = "primary-network"
            primary   = true
            subnet_id = data.azurerm_subnet.current.id
            load_balancer_backend_address_pool_ids = var.lb_backend_address_pool_ids
            application_gateway_backend_address_pool_ids = []
            application_security_group_ids               = []
            load_balancer_inbound_nat_rules_ids          = []
        }
    }

    upgrade_mode         = "Manual"
	health_probe_id      = var.health_probe_id

}

Debug Output

The same error shows up when the specific image version is used.

Error: Can not parse "source_image_id" as a resource id: ID contained more segments than required: "subscriptions/myS/resourceGroups/myRg/providers/Microsoft.Compute/galleries/mygallery/images/myimg"

Panic Output

Expected Behavior

This works for azurerm_virtual_machine_scale_set and is expected to work with the new azurerm_linux_virtual_machine_scale_set

Actual Behavior

Only the direct URL to the image is supported. Error is thrown when shared image gallery is used.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@jackson-theisen
Copy link

It looks like this should have been fixed in #5901, which did not make it into the 2.0.0 release. When can we expect a new release with this fix?

@tracypholmes tracypholmes added bug service/vmss Virtual Machine Scale Sets labels Mar 5, 2020
@tracypholmes tracypholmes added this to the v2.1.0 milestone Mar 5, 2020
@tracypholmes
Copy link
Contributor

Hi @mb139h & @OPSJ! While this did not make it into the 2.0.0 release, PR #5901 was recently merged. So, this should be resolved in 2.1.0 which will hopefully happen next week. Thanks 😃

@tombuildsstuff
Copy link
Contributor

Fixed via #5901

@ghost
Copy link

ghost commented Mar 11, 2020

This has been released in version 2.1.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.1.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Apr 8, 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 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug service/vmss Virtual Machine Scale Sets
Projects
None yet
4 participants