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

New Resource: azurerm_linux_virtual_machine_scale_set #4518

Merged
merged 14 commits into from
Oct 7, 2019

Conversation

tombuildsstuff
Copy link
Contributor

This PR adds support for one of the 2.0 resources: azurerm_linux_virtual_machine_scale_set which supersedes the existing azurerm_virtual_machine_scale_set resource as outlined in #2807.

The original azurerm_virtual_machine_scale_set resource was introduced in March 2016, when Azure Resource Manager was still in Beta.

Whilst we've been adding features since then, unfortunately the way the Virtual Machine Scale Set API behaves today is very different from how it did previously - as such the azurerm_virtual_machine_scale_set resource didn't fully cover all use-cases.

After spending a considerable amount of time on this - we ultimately came to the conclusion it'd be better to start afresh rather than trying to fix the existing azurerm_virtual_machine_scale_set resource. The Azure API behaves differently depending on which Operating System is used on the Virtual Machine / Virtual Machine Scale Set - for example for a Windows Virtual Machine (& Scale Set) a name field can be up to 15 Characters long, whereas for a Linux Virtual Machine (& Scale Set) the name field can be up to 63 characters long.


There's some intentional design decisions as a part of this resource:

  • Unmanaged Disks are not supported by this new resource since Azure no longer recommends Unmanaged Disks for new deployments (and there's considerable scaling limitations when using them). Operators wishing to use Unmanaged Disks can continue to use the existing azurerm_virtual_machine_scale_set resource.
  • Terraform will now update and reimage the instances by default when the sku (or select other fields, like the source_image_reference etc) is updated. This can be disabled by setting the terraform_should_roll_instances_when_required field to false.
  • As outlined in Announcement: Upcoming Changes in Version 2.0 of the Azure Provider #2807, Extensions for a Virtual Machine Scale Set will form part of a separate resource, rather than being part of the main resource. This allows operators to more easily control the lifecycle of these dependencies.

.. and a few things to note here:

  • This resource is feature-toggled and disabled by default until the remaining Virtual Machine and Virtual Machine Scale Set resources become available, at which time we'll document how to enable this feature-toggle.
  • This resource is in a Beta state - meaning that the Schema can change at any point prior to 2.0 - when it'll go GA.
  • There's one upstream issue blocking some functionality of this resource, but this is limited to Virtual Machine Scale Sets with Automatic/Rolling Upgrades configured - if this isn't resolved by the time we go GA we'll have to work around this/raise an error. In addition one test in here is also blocked on azurerm_image: add option to set the hyper_v_generation for the image #4453.
  • The examples referenced in the documentation (tracked separately in this branch) will be completed and PR'd once the remaining Virtual Machine/Virtual Machine Scale Set resources have been merged

As mentioned above - this is feature-toggled off by default - once the remaining Virtual Machine/Virtual Machine Scale Set resources become available we'll publicise this, but for the moment I've intentionally held off documenting how to opt into this functionality.

Upcoming PR's will add support for the other new Virtual Machine and Virtual Machine Scale Set resources documented in the 2.0 announcement.

Fixes #160
Fixes #292
Fixes #536
Fixes #809
Fixes #1616
Fixes #1620
Fixes #1669
Fixes #1739
Fixes #3020
Fixes #3773
Supersedes #2750

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from a couple minor comments LGTM 👍

azurerm/internal/services/compute/ssh_keys.go Outdated Show resolved Hide resolved
azurerm/internal/services/compute/ssh_keys.go Outdated Show resolved Hide resolved
azurerm/resource_arm_linux_virtual_machine_scale_set.go Outdated Show resolved Hide resolved
azurerm/resource_arm_linux_virtual_machine_scale_set.go Outdated Show resolved Hide resolved
This resource supersedes the existing `azurerm_virtual_machine_scale_set` resource
which will form part of the 2.0 release - as outlined in #2807.

Since this won't be shipping immediately this is intentionally feature toggled and
missing from the sidebar - but will be added in when this goes live.
@tombuildsstuff
Copy link
Contributor Author

Ignoring 5 test failures (which are Preview related, where we're still trying to get access, will be fixed by this PR - or are blocked on this issue) - the tests otherwise look good:

Screenshot 2019-10-07 at 12 32 20

Since this is feature-toggled off we're good to merge this for the moment, and can publish the information for how to enable this once all the VM/VMSS resources are available and the upstream API issue is fixed

@ghost
Copy link

ghost commented Oct 29, 2019

This has been released in version 1.36.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 = "~> 1.36.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Nov 6, 2019

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 Nov 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.