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

Allow Virtual Machine Scale Sets to have both Rolling upgrade mode and Automatic OS Upgrade #18605

Merged

Conversation

MarcDenman
Copy link
Contributor

Currently when creating/updating VMSS through the AzureRM provider, you are unable to use the Rolling upgrade mode and have Automatic OS Policy enabled. You receive the following error:

an automatic_os_upgrade_policy block cannot be specified when upgrade_mode is not set to Automatic"

After looking through the VMSS documentation, I can't see any technical reason for this and I have managed to create/update a VMSS through the Azure Portal with both the Rolling upgrade mode and Automatic OS Upgrade enabled with the resulting ARM template below.

Looking at the VMSS resources, I think it is changing a couple checks to allow Rolling to be specified and with no further changes needed. I have tested by building locally and running locally and it has worked as expected

"properties": {
                "singlePlacementGroup": true,
                "upgradePolicy": {
                    "mode": "Rolling",
                    "rollingUpgradePolicy": {
                        "maxBatchInstancePercent": 20,
                        "maxUnhealthyInstancePercent": 100,
                        "maxUnhealthyUpgradedInstancePercent": 20,
                        "pauseTimeBetweenBatches": "PT60S",
                        "enableCrossZoneUpgrade": false,
                        "prioritizeUnhealthyInstances": false
                    },
                    "automaticOSUpgradePolicy": {
                        "enableAutomaticOSUpgrade": true,
                        "useRollingUpgradePolicy": false,
                        "disableAutomaticRollback": false
                    }
                },
                .....

image

#13745

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 for this @MarcDenman - could you add some tests to verify/ensure this continues to work? thanks!

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 @MarcDenman - LGTM 👾

@katbyte katbyte merged commit 89439d1 into hashicorp:main Nov 2, 2022
@github-actions github-actions bot added this to the v3.30.0 milestone Nov 2, 2022
katbyte added a commit that referenced this pull request Nov 2, 2022
@github-actions
Copy link

github-actions bot commented Nov 4, 2022

This functionality has been released in v3.30.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

github-actions bot commented Dec 5, 2022

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 5, 2022
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.

2 participants