Terraform v0.9.11
There are several things that aren't available for azurerm_virtual_machine_scale_set but are available for individual VMs. I have done all of them using ARM templates so I know it's possible in Azure, but terraform doesn't allow them (I tried :)
Please let me know if I should split this out into separate requests for each.
~Would it be possible to support a boot_diagnostics block in the VMSS configuration, just like the one in azurerm_virtual_machine? See the "How do I turn on boot diagnostics" section here: https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-faq~ (@tombuildsstuff: this is now available)
~Could you please add support for network security groups in a VMSS? This is already there for azurerm_network_interface but not for the scale set. It seems like it would just be a network_security_group_id field inside the VMSS network_profile.~ (@tombuildsstuff: this is now available)
Could you please add the ability to specify a size for OS Disks? In azurerm_virtual_machine there is a storage_os_disk block where you can specify disk_size_gb, but with the VMSS the storage_profile_os_disk block does not support the disk_size_gb field (the VMSS storage_profile_data_disk does support disk_size_gb but I need the OS disk).
Thank you!
looks like we have to wait for them to cut a newer sdk before a lot of these features are even available for us to consume:
In theory we can start working on this when they cut v12 of the SDK.
https://github.com/Azure/azure-sdk-for-go/issues/631
https://github.com/Azure/azure-sdk-for-go/milestone/10
Ok, thanks for the update.
@bpoland, I was able to address all but the third issue. Unfortunately, the azure sdk doesn't support changing the size of the os disk yet. I would suggest opening an issue on their repo if there isn't one already. Feel free to reopen this if you have anymore issues!
@mbfrahry thanks so much for this! Could you tell me a bit more about what I need to request from the Azure SDK for the third one? I looked on https://github.com/Azure/azure-sdk-for-go/issues and don't see any open issues that seem related to this request.
I have been able to expand the disk size upon creation with the below block in an ARM template with API version 2017-03-30 (but obviously would like to use native terraform instead). So do I just need to request that they add support for API version 2017-03-30 or something more specific to the VMSS?
                    "storageProfile": {
                        "osDisk": {
                            "caching": "ReadWrite",
                            "createOption": "FromImage",
                            "diskSizeGB": "10",
                            "name": "[concat(variables('vmssName'), '-osp')]",
                            "osType": "Linux",
                            "image": {
                                "uri": "[variables('vmssImageUri')]"
                            }
                        }
                    },
Hey @bpoland! No problem on adding the vmss features! For the last feature, I'd just make an issue that they add the field you need. It looks like they may have forgotten it and it looks pretty painless to add. I may be wrong but it looks like they need to add that field here https://github.com/Azure/azure-sdk-for-go/blob/master/arm/compute/models.go#L1994.
I'll reopen this issue and feel free to add the issue link from the sdk here. Let me know how things go/if you need anything else
Thanks for the link. I have opened this issue for them to add it: https://github.com/Azure/azure-sdk-for-go/issues/818
Hopefully that made sense for them :)
Thanks again for your help.
It has been bumped upstream to https://github.com/Azure/azure-rest-api-specs/issues/1906
Still waiting on the field to make its way into the SDK.
Is there an update regarding this feature to specify disk_size for os_disk_profile.
@sushilkm in the upcoming version 2.0 of the Azure Provider we're working to add replacements for the azurerm_virtual_machine and azurerm_virtual_machine_scale_set resources. As such whilst this change won't be added to the azurerm_virtual_machine_scale_set resource, it'll be added to it's replacement which we're starting to look into at the moment :)
hi @bpoland @flyinprogrammer @sushilkm
We're currently working on version 2.0 of the Azure Provider which we previously announced in #2807.
As a part of this we're introducing five new resources which will supersede the existing azurerm_virtual_machine and azurerm_virtual_machine_scale_set resources:
azurerm_linux_virtual_machineazurerm_linux_virtual_machine_scale_setazurerm_virtual_machine_scale_set_extensionazurerm_windows_virtual_machineazurerm_windows_virtual_machine_scale_setWe've recently opened the PR for the first of these new resources #4518 - and I'm able to confirm that this new functionality is supported in the new Virtual Machine Scale Set resource - however unfortunately we have no plans to backport this to the existing azurerm_virtual_machine_scale_set resource.
We've posted an update in #2807 with more information on this (we plan to release the new Virtual Machine / Virtual Machine Scale Set resources in a Beta form in a future 1.x version of the Azure Provider and subsequently release them as "GA" in 2.0) - but as we plan to post additional status updates for 2.0 in #2807 I'd suggest subscribing to that issue for updates.
This issue's been assigned to the milestone "2.0" since this is where this will ship - however (due to the way that closing Github Issues from PR's works, to be able to track this back for future users) this issue will be closed once the first of the new resources have been merged.
Thanks!
This has been released in version 2.0.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.0.0"
}
# ... other configuration ...
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 👉 [email protected]. Thanks!