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_orchestrated_virtual_machine_scale_set - Support new VMSS Flex functionality #14003

Merged
merged 24 commits into from
Nov 13, 2021

Conversation

WodansSon
Copy link
Collaborator

@WodansSon WodansSon commented Nov 3, 2021

Orchestrated Virtual Machine Scale Sets is an update to the existing Virtual Machine Scale Sets that combines the fault domain availability constructs of Availability Sets with the autoscaling and zonal redundancy of Virtual Machine Scale Sets. This PR will expose the new fields that have been made available in the Orchestrated Virtual Machine Scale Sets public preview.

extensions will not be supported in the initial release of the resource.1.

Dependencies:

  • Upgrade compute API to latest 2021-07-01

Footnotes

  1. Due to a bug in the service code extensions are not currently supported in the azurerm_orchestrated_virtual_machine_scale_set resource. The ETA for extensions support is tentatively set for January 27, 2022.

@WodansSon
Copy link
Collaborator Author

image

@WodansSon WodansSon changed the title [WIP]azurerm_orchestrated_virtual_machine_scale_set - Support new VMSS Flex functionality azurerm_orchestrated_virtual_machine_scale_set - Support new VMSS Flex functionality Nov 10, 2021
@WodansSon WodansSon modified the milestones: Future, v2.85.0 Nov 10, 2021

* `instances`- (Optional) The number of Virtual Machines in the Orcestrated Virtual Machine Scale Set.

-> **Note:** If you're using AutoScaling, you may wish to use [Terraform's `ignore_changes` functionality](https://www.terraform.io/docs/configuration/resources.html#ignore_changes) to ignore changes to this field.
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we not just make it optional+computed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately for backwards compatibility with the original resource I had to make it Optional... if it is not a legacy OVMSS resource this is actually a required field... 😬

@WodansSon
Copy link
Collaborator Author

image

@WodansSon
Copy link
Collaborator Author

image

@katbyte katbyte modified the milestones: v2.85.0, v2.86.0 Nov 12, 2021
@WodansSon
Copy link
Collaborator Author

image

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.

Thanks @WodansSon! LGTM 👍


* `source_image_reference` - (Optional) A `source_image_reference` block as defined below.

* `terminate_notification` - (Optional) A `terminate_notification` block as defined below.
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be

Suggested change
* `terminate_notification` - (Optional) A `terminate_notification` block as defined below.
* `termination_notification` - (Optional) A `terminate_notification` block as defined below.

@WodansSon WodansSon merged commit 8bc0344 into main Nov 13, 2021
@WodansSon WodansSon deleted the f-ovmss branch November 13, 2021 04:19
WodansSon added a commit that referenced this pull request Nov 13, 2021
amccullough84 pushed a commit to amccullough84/terraform-provider-azurerm that referenced this pull request Nov 15, 2021
commit 33d0c8b
Author: Andy.McCullough <[email protected]>
Date:   Mon Nov 15 14:32:05 2021 +0000

    Updated host_pool docs to add guidance on usage of new resource

commit ebe31dc
Author: Andy.McCullough <[email protected]>
Date:   Mon Nov 15 14:30:02 2021 +0000

    docs for new resource

commit acc17e6
Author: Andy.McCullough <[email protected]>
Date:   Mon Nov 15 14:06:37 2021 +0000

    Remove old docs

commit b3f8a7b
Author: Andy.McCullough <[email protected]>
Date:   Mon Nov 15 13:51:45 2021 +0000

    Fixed Acc Test issue

    Because the expiration_date value is set to be relative to execution time this is expected to generate a continual diff. This is beneficial as it ensures that a valid token is always available for registration activities downstream.

commit defb851
Author: Andy.McCullough <[email protected]>
Date:   Mon Nov 15 13:24:37 2021 +0000

    fix panic in acceptance test

commit f7f4db3
Author: Andy.McCullough <[email protected]>
Date:   Mon Nov 15 13:00:53 2021 +0000

    Fix naming issue

commit ed06e99
Author: Andy.McCullough <[email protected]>
Date:   Mon Nov 15 12:57:46 2021 +0000

    Fix static check error

commit e3d2bb5
Author: Andy.McCullough <[email protected]>
Date:   Mon Nov 15 12:53:47 2021 +0000

    Removed testing comments

commit 214dda2
Author: Andy.McCullough <[email protected]>
Date:   Mon Nov 15 12:51:37 2021 +0000

    New Provider - azurerm_virtual_desktop_host_pool_registration_info

commit baa8d11
Merge: f59d172 f5f4260
Author: amccullough84 <[email protected]>
Date:   Mon Nov 15 10:19:44 2021 +0000

    Merge branch 'hashicorp:main' into fix-dv-hp-regtoken

commit f5f4260
Merge: 470d180 020905f
Author: Tom Harvey <[email protected]>
Date:   Mon Nov 15 10:43:51 2021 +0100

    Merge pull request hashicorp#14182 from hashicorp/f/go-1.17

    build: updating to use Go 1.17.3

commit 020905f
Author: tombuildsstuff <[email protected]>
Date:   Mon Nov 15 09:38:46 2021 +0100

    build: updating to use Go 1.17.3

commit 470d180
Author: Tom Harvey <[email protected]>
Date:   Mon Nov 15 09:25:41 2021 +0100

    updating to include hashicorp#14083

commit dc05e90
Merge: 8b67f3b 61ed4e7
Author: Tom Harvey <[email protected]>
Date:   Mon Nov 15 09:24:30 2021 +0100

    Merge pull request hashicorp#14083 from magodo/upgrade_storage_account_sdk_to_2021_04_01

    Upgrade storage sdk to 2021-04-01

commit 8b67f3b
Author: kt <[email protected]>
Date:   Sun Nov 14 11:13:32 2021 -0800

    CHANGELOG.md for hashicorp#14160

commit 6bba7b9
Author: lonegunmanb <[email protected]>
Date:   Mon Nov 15 03:10:36 2021 +0800

    Fix hashicorp#14152 by adding lock to avoid parallel race error on service side (hashicorp#14160)

    As hashicorp#14152 described, when create multiple azurerm_network_watcher_flow_log with same network_security_group_id, the service side would complain a "AnotherOperationInProgress".

    This patch add an internal lock on nsg id to avoid this issue.

    AccTest (The failed test also failed on main branch so I guess it's ok for this patch):

commit 1c3cbbf
Author: kt <[email protected]>
Date:   Sun Nov 14 10:56:36 2021 -0800

    CHANGELOG.md for hashicorp#14120

commit 42e8c2a
Author: xuzhang3 <[email protected]>
Date:   Mon Nov 15 02:55:03 2021 +0800

    azurerm_machine_learning_workspace - encryption block (hashicorp#14120)

    Support Customer-managed key data encryption

commit a1fa302
Author: WS <[email protected]>
Date:   Fri Nov 12 21:31:17 2021 -0700

    Updating to include hashicorp#14003

commit 8bc0344
Author: WS <[email protected]>
Date:   Fri Nov 12 21:19:14 2021 -0700

    merge hashicorp#14003

    * Initial check-in

    * Add ovmss sku spilt func

    * update recoveryservices and add documentation

    * update vendor

    * go mod vendor

    * update test case to remove depricated field

    * Remove support for extensions

    * Add note to documentation about extension support

    * Split Capacity out of sku_name

    * Update sku parsing due to spliting out capacity

    * Fix comment format

    * Add retry logic

    * Update error message for create retry

    * Added case for unretryable in retry else case

    * Update website/docs/r/orchestrated_virtual_machine_scale_set.html.markdown

    Co-authored-by: kt <[email protected]>

    * Update website/docs/r/orchestrated_virtual_machine_scale_set.html.markdown

    Co-authored-by: kt <[email protected]>

    * Make instances optional and computed

    * Update err msg to match main

    * Change field name to termination_notification

    * Add TODO note for 3.0

    Co-authored-by: kt <[email protected]>

commit 7266d2d
Author: WS <[email protected]>
Date:   Fri Nov 12 21:15:31 2021 -0700

    Corrected version of compute API

commit d8452c2
Author: kt <[email protected]>
Date:   Fri Nov 12 14:07:51 2021 -0800

    CHANGELOG.md for 314174

commit 82a4cf8
Author: WS <[email protected]>
Date:   Fri Nov 12 15:06:11 2021 -0700

    Splitting SDK upgrade and OVMSS work into two PR's (hashicorp#14174)

    Co-authored-by: kt <[email protected]>

commit bf14645
Author: Matthew Frahry <[email protected]>
Date:   Fri Nov 12 13:41:38 2021 -0800

    Update changelog for hashicorp#14165

commit e4805f2
Author: lonegunmanb <[email protected]>
Date:   Sat Nov 13 05:40:28 2021 +0800

    `windows_virtual_machine_scale_set`/`linux_virtual_machine_scale_set` - `source_image_reference.offer` and `source_image_reference.publisher` are now ForceNew hashicorp#14165)

commit 65b6749
Author: Matthew Frahry <[email protected]>
Date:   Fri Nov 12 11:24:21 2021 -0800

    vmware - regen embedded sdk (hashicorp#14133)

commit 6964085
Merge: 6ed425d 431afb5
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 19:30:14 2021 +0100

    Merge pull request hashicorp#14170 from hashicorp/f/linting

    datalakestore: fixing linting issues

commit 431afb5
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 19:06:43 2021 +0100

    internal/acceptance: round 2

commit 6ed425d
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 18:51:59 2021 +0100

    updating to include hashicorp#14150

commit bf7f88e
Merge: 3072fa8 853d95e
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 18:51:27 2021 +0100

    Merge pull request hashicorp#14150 from hashicorp/pandora-signalr-regen

    signalr - regenerate embedded sdk

commit 3072fa8
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 18:47:56 2021 +0100

    updating to include hashicorp#14135

commit de31e75
Merge: e43775d ef67b84
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 18:47:27 2021 +0100

    Merge pull request hashicorp#14135 from hashicorp/pandora-va-regen

    video_analyzer - embedded sdk regen

commit e43775d
Author: catriona-m <[email protected]>
Date:   Fri Nov 12 15:18:43 2021 +0000

    azurerm_api_management - refactoring remaining api_management resources to use parsers (hashicorp#14148)

    * refactoring api_management to use parsers

    * refactoring api_management to use parsers

commit e579802
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 15:40:56 2021 +0100

    d/data_lake_store: fixing linting by ensuring all fields have defaults

commit 98037e5
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 15:37:03 2021 +0100

    r/data_lake_analytics_account: fixing the linting

commit 26c30b7
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 15:36:12 2021 +0100

    internal/acceptance: fixing the linting

commit ef67b84
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 15:25:45 2021 +0100

    videoanalyzer: updating to the latest embedded sdk

commit cfa47b7
Author: Matthew Frahry <[email protected]>
Date:   Wed Nov 10 14:13:19 2021 -0800

    regeegen part 2

commit d87d927
Author: Matthew Frahry <[email protected]>
Date:   Tue Nov 9 17:11:25 2021 -0800

    regen embedded sdk

commit 7833565
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 13:21:16 2021 +0100

    updating to include hashicorp#14153

commit 7822f3d
Merge: 705a277 a92f9d5
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 13:20:50 2021 +0100

    Merge pull request hashicorp#14153 from hashicorp/pandora-relay-regen

    relay - regenerate embedded sdk

commit 705a277
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 13:19:24 2021 +0100

    updating to include hashicorp#14158

commit bf89540
Merge: d042f29 f4f13a2
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 13:18:51 2021 +0100

    Merge pull request hashicorp#14158 from hashicorp/pandora-datalake-swap

    datalake - switching to use an embedded sdk

commit 853d95e
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 13:16:47 2021 +0100

    imports

commit 7f84f4a
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 13:14:36 2021 +0100

    r/private_endpoint: fixing the casing on `private_connection_resource_id` if needed

commit 8f5b3dc
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 12:42:35 2021 +0100

    website: updating the resource id for signalr_service_network_acl to match the new format

commit 61d8125
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 12:41:46 2021 +0100

    r/signalr_service_network_acl: adding a state migration for the old -> new id

commit 4e16e75
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 12:31:33 2021 +0100

    r/signalr_service_network_acl: updating to use the native Resource ID validator function

commit e90b825
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 12:31:21 2021 +0100

    website: updating signalr_service to account for the updated resource id

commit 42d9912
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 12:29:11 2021 +0100

    r/signalr_service: adding a state migration for the old/new ID format

commit 7d4ca72
Author: Matthew Frahry <[email protected]>
Date:   Thu Nov 11 12:49:30 2021 -0800

    regen part two

commit 7612229
Author: Matthew Frahry <[email protected]>
Date:   Tue Nov 9 17:09:09 2021 -0800

    regen embedded sdk

commit d042f29
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 12:15:20 2021 +0100

    updating to include hashicorp#14154

commit 2170cd3
Merge: ae96dd4 6907fe0
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 12:14:55 2021 +0100

    Merge pull request hashicorp#14154 from hashicorp/pandora-powerbi-regen

    powerbi - regenerate embedded sdk

commit ae96dd4
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 11:57:27 2021 +0100

    updating to include hashicorp#14155

commit 1d5fba1
Merge: 63dfaea 7782707
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 11:56:45 2021 +0100

    Merge pull request hashicorp#14155 from hashicorp/pandora-maps-regen

    maps - regenerate embedded sdk

commit a92f9d5
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 11:55:58 2021 +0100

    Update internal/services/relay/relay_namespace_resource.go

commit f930ab1
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 11:55:54 2021 +0100

    Update internal/services/relay/relay_hybrid_connection_resource.go

commit 63dfaea
Merge: c4f6fc9 03c8125
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 11:39:39 2021 +0100

    Merge pull request hashicorp#14161 from aristosvo/sql/removal-deprecated-docs-extended_auditing_policy

    `azurerm_(ms)sql_server` - removal of doc for deprecated `extended_auditing_policy`

commit c4f6fc9
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 11:38:58 2021 +0100

    updating to include hashicorp#14157

commit a2daa68
Merge: 605af2e d638e8d
Author: Tom Harvey <[email protected]>
Date:   Fri Nov 12 11:38:29 2021 +0100

    Merge pull request hashicorp#14157 from hashicorp/pandora-databricks-regen

    databricks - regenerate embedded sdk

commit f4f13a2
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 11:36:58 2021 +0100

    dependencies: removing the old azure sdk

commit 03c8125
Author: Aris van Ommeren <[email protected]>
Date:   Fri Nov 12 10:39:37 2021 +0100

    `azurerm_(ms)sql_server` - removal of doc for deprecated `extended_auditing_policy`

commit 15a5699
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 10:06:09 2021 +0100

    datalake: goimports

commit 79b3dfc
Author: tombuildsstuff <[email protected]>
Date:   Fri Nov 12 09:19:59 2021 +0100

    handling the import change

commit cd59eaf
Author: Matthew Frahry <[email protected]>
Date:   Thu Nov 4 08:35:39 2021 -0700

    Fix struct issue

commit 4709fd3
Author: Matthew Frahry <[email protected]>
Date:   Wed Nov 3 17:06:47 2021 -0700

    moving bulk of datalake to embedded sdk

commit 605af2e
Author: tf-release-bot <[email protected]>
Date:   Fri Nov 12 00:58:39 2021 +0000

    v2.85.0

commit ef524f8
Author: kt <[email protected]>
Date:   Thu Nov 11 16:14:22 2021 -0800

    CHANGELOG.md for hashicorp#14052

commit 5d9df60
Author: aristosvo <[email protected]>
Date:   Fri Nov 12 01:13:41 2021 +0100

    `azurerm_sql_managed_instance`: Support for `identity` (hashicorp#14052)

    Fixes hashicorp#14049

commit f0b3431
Author: Yichun Ma <[email protected]>
Date:   Fri Nov 12 06:31:23 2021 +0800

    `managed_disk_resource`: Add `disk_iops_read_only`, `disk_mbps_read_only` (hashicorp#14025)

    Add support for DiskIOPSReadOnly and DiskMBpsReadOnly
    These two properties are the read-only version of DiskIOPSReadWrite and DiskMBpsReadWrite, which specify the read-only IOps and MBps to the disk
    These two properties are only available for Ultra disk, and only available if it is a shared disk.

commit e999081
Author: Dmitry Tokarev <[email protected]>
Date:   Thu Nov 11 16:13:44 2021 -0500

    Doc Fix: `azurerm_iothub_resource` doc shows correct route source option names (hashicorp#14149)

commit 7782707
Author: Matthew Frahry <[email protected]>
Date:   Thu Nov 11 12:59:40 2021 -0800

    regen part two electric boogaloo

commit 6907fe0
Author: Matthew Frahry <[email protected]>
Date:   Thu Nov 11 12:54:43 2021 -0800

    regen part two electric boogaloo

commit d1b5875
Author: Matthew Frahry <[email protected]>
Date:   Thu Nov 11 12:52:20 2021 -0800

    regen part two electric boogaloo

commit b244895
Author: aristosvo <[email protected]>
Date:   Thu Nov 11 20:32:29 2021 +0100

    `azuread`: upgrade of `azuread` components in AccTest to v2 (hashicorp#14105)

    Co-authored-by: Tom Bamford <[email protected]>

commit 6a200da
Author: kt <[email protected]>
Date:   Thu Nov 11 11:01:01 2021 -0800

    CHANGELOG.md for hashicorp#14136

commit f3cba73
Author: aristosvo <[email protected]>
Date:   Thu Nov 11 20:00:28 2021 +0100

    `azurerm_mysql_flexible_server_firewall_rule`: New resource (hashicorp#14136)

    Fixes hashicorp#14132

commit b930347
Author: kt <[email protected]>
Date:   Thu Nov 11 10:23:45 2021 -0800

    CHANGELOG.md for hashicorp#13600

commit 590f7fa
Author: Lucas Maxwell <[email protected]>
Date:   Fri Nov 12 05:22:20 2021 +1100

    New resource: `azurerm_synapse_workspace_aad_admin` - supports setting AAD admin for synapse workspaces with CMK (hashicorp#13600)

    Fixes hashicorp#13195

commit 57eefd3
Author: kt <[email protected]>
Date:   Thu Nov 11 09:37:20 2021 -0800

    CHANGELOG.md for hashicorp#14025

commit eb8e9e7
Author: kt <[email protected]>
Date:   Thu Nov 11 09:34:57 2021 -0800

    CHANGELOG.md for hashicorp#14085

commit 8f8d660
Author: aristosvo <[email protected]>
Date:   Thu Nov 11 18:34:08 2021 +0100

    `azurerm_storage_encryption_scope`: Allow versionless `key_vault_key_id` (hashicorp#14085)

    Fixes hashicorp#14069

commit 1b7a681
Author: kt <[email protected]>
Date:   Thu Nov 11 09:33:18 2021 -0800

    CHANGELOG.md for hashicorp#14098

commit 060459c
Author: Neil Ye <[email protected]>
Date:   Fri Nov 12 01:32:49 2021 +0800

    New Resource: azurerm_monitor_private_link_scope (hashicorp#14098)

    This PR to support new resource Azure Monitor Private Link Scope.

    Background: docs.microsoft.com/en-us/azure/azure-monitor/logs/private-link-security

    Rest API Spec: Azure/azure-rest-api-specs@ddda805/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-07-01-preview/privateLinkScopes_API.json#L196

commit 3c83e15
Author: kt <[email protected]>
Date:   Thu Nov 11 09:30:43 2021 -0800

    CHANGELOG.md for hashicorp#14097

commit 877e642
Author: Elena Xin <[email protected]>
Date:   Fri Nov 12 01:29:58 2021 +0800

    azurerm_backup_protected_vm: Support exclude_disk_luns and include_disk_luns properties for backup protected VM resource (hashicorp#14097)

    The purpose of this PR:

    Supports exclude_disk_luns and include_disk_luns properties for backup protected VM resource.

    Fixes: #issue 13570

commit f59d172
Author: Andy.McCullough <[email protected]>
Date:   Wed Nov 10 22:26:46 2021 +0000

    Minor Update and docs

commit 96a1ded
Merge: 11fa2ff 70a4cb3
Author: amccullough84 <[email protected]>
Date:   Wed Nov 10 20:41:14 2021 +0000

    Merge branch 'hashicorp:main' into fix-dv-hp-regtoken

commit 11fa2ff
Author: Andy.McCullough <[email protected]>
Date:   Wed Nov 10 20:30:12 2021 +0000

    desktopvirtualization\hostpool

    Added registration_token attribute to top level hostpool so we can setnewcomputed when registration_info changes

commit 518569c
Author: Matthew Frahry <[email protected]>
Date:   Tue Nov 9 17:06:10 2021 -0800

    reregen embedded sdk

commit 4ac4a01
Author: Matthew Frahry <[email protected]>
Date:   Tue Nov 9 17:01:13 2021 -0800

    regen embedded sdk

commit 12a8c2b
Author: Matthew Frahry <[email protected]>
Date:   Tue Nov 9 16:58:22 2021 -0800

    regen embedded sdk

commit d638e8d
Author: Matthew Frahry <[email protected]>
Date:   Tue Nov 9 16:27:57 2021 -0800

    Regenenerate sdk

commit 61ed4e7
Author: magodo <[email protected]>
Date:   Mon Nov 8 19:49:51 2021 +0800

    using storage 2021-01-01 for blob inventory policy

commit 4ac292f
Author: magodo <[email protected]>
Date:   Mon Nov 8 17:56:19 2021 +0800

    pass build for test code

commit 1ef6525
Author: magodo <[email protected]>
Date:   Mon Nov 8 17:50:39 2021 +0800

    upgrade storage sdk to 2021-04-01 (compatible way to mitigate breaking chagne of the inventory, but not working actually)
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

Partial PR review

Required: true,
ValidateFunc: validation.StringInSlice([]string{
string(compute.ResourceIdentityTypeUserAssigned),
string(compute.ResourceIdentityTypeNone),
Copy link
Contributor

Choose a reason for hiding this comment

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

this shouldn't be exposing the value None - that's the default value if this block is omitted

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fair enough, I'll remove that.

Type: pluginsdk.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{
string(compute.ResourceIdentityTypeUserAssigned),
Copy link
Contributor

Choose a reason for hiding this comment

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

does this not also support SystemAssigned and SystemAssigned/UserAssigned?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, VMSS Flex only supports User Assigned Identity. That may change in the future but for now it's only User Assigned.

output["linux_configuration"] = flattenOrchestratedVirtualMachineScaleSetLinuxConfiguration(input, d)
}

return []interface{}{output}
Copy link
Contributor

Choose a reason for hiding this comment

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

each of these nested fields needs to be set into the state

Copy link
Collaborator Author

@WodansSon WodansSon Nov 18, 2021

Choose a reason for hiding this comment

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

They are as far as I can tell, is there something I am missing?

              {
                "custom_data": "Y3VzdG9tIGRhdGEh",
                "linux_configuration": [
                  {
                    "admin_password": "",
                    "admin_ssh_key": [
                      {
                        "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCsTcryUl51Q2VSEHqDRNmceUFo55ZtcIwxl2QITbN1RREti5ml/VTytC0yeBOvnZA4x4CFpdw/lCDPk0yrH9Ei5vVkXmOrExdTlT3qI7YaAzj1tUVlBd4S6LX1F7y6VLActvdHuDDuXZXzCDd/97420jrDfWZqJMlUK/EmCE5ParCeHIRIvmBxcEnGfFIsw8xQZl0HphxWOtJil8qsUWSdMyCiJYYQpMoMliO99X40AUc4/AlsyPyT5ddbKk08YrZ+rKDVHF7o2$                        "username": "ubuntu"
                      }
                    ],
                    "admin_username": "ubuntu",
                    "computer_name_prefix": "prefix",
                    "disable_password_authentication": true,
                    "provision_vm_agent": true,
                    "secret": []
                  }
                ],
                "windows_configuration": []
              }
            ],

Comment on lines -26 to -28
if err := assertOrchestratedVirtualMachineScaleSet(vm); err != nil {
return []*pluginsdk.ResourceData{}, fmt.Errorf("importing Virtual Machine Scale Set Orchestrator VM %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we'll need this to confirm this isn't a non-orchestrated VMSS, albeit we need to update this to check the type/profile?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Still trying to figure out exactly how to work that out at the moment as the flex has added a wrinkle into this check... I am open to ideas if you might have a way to derive what "type" of VM is attempting to be imported.

if err != nil {
if utils.ResponseWasNotFound(resp.Response) {
return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this indicates a bug (since this should have been picked up in the Plan via calling the Read function) - so can we remove this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think so as this is another workaround for a known bug in the API. Before we can delete the VMSS we have to scale down the capacity to 0 before we call delete else we get the pesky subnet in use error again. I am unaware of a better workaround at the moment. 🙁

if err := future.WaitForCompletionRef(ctx, client.Client); err != nil {
return fmt.Errorf("waiting for creation of Orchestrated Virtual Machine Scale Set %q (Resource Group %q): %+v", name, resourceGroup, err)
// If it is a Retryable Error re-issue the PUT for 10 loops until either the error goes away or the limit has been reached
if strings.Contains(err.Error(), "RetryableError") {
Copy link
Contributor

Choose a reason for hiding this comment

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

the Azure SDK for Go (go-autorest) should be doing this automatically - so we can remove this and file a bug in the Azure SDK to get that fixed if it doesn't?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I totally agree with you, they should, but they are not so I added this as a workaround because if I don't you end up with a resource that cannot be deleted because the subnet is in use. I will follow up with the SDK team about this issue.

@github-actions
Copy link

This functionality has been released in v2.86.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants