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

Support health extension for rolling ugrade mode #9136

Merged
merged 13 commits into from
Apr 14, 2021

Conversation

ArcturusZhang
Copy link
Contributor

Fixes #8120

@ghost ghost added the size/L label Nov 3, 2020
Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Hi @ArcturusZhang
Thanks for this PR.
I've left a few comments below based on our conversations offline.

This will need to wait for us to promote the in-line extensions out of beta before being merged as until then the behaviours won't be consistent/predictable with externally defined extensions. We're expecting to review that soon, I'll update here and re-review at that point, but will mark this as blocked for now.

@jackofallops jackofallops added this to the Blocked milestone Nov 4, 2020
@jackofallops jackofallops added enhancement service/vmss Virtual Machine Scale Sets labels Nov 4, 2020
@ArcturusZhang
Copy link
Contributor Author

ArcturusZhang commented Nov 5, 2020

Hi @jackofallops I think this might be a part of the extension beta shipping out. When the beta flag is not set, the flag I added will always be false and therefore the check

(healthProbeId == "" && !hasHealthExtension)

will be exactly the same as healthProbeId == "" since !hasHealthExtension is always true, which makes the logic exactly the same as before I changed it.
What do you think?

@ghost ghost added size/XL and removed size/L labels Nov 5, 2020
@marcelkmfst

This comment has been minimized.

@marcelkmfst

This comment has been minimized.

@sammetb

This comment has been minimized.

Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Hi @ArcturusZhang - Apologies for the long delay in returning to this review. I've left some comments below regarding changes required, if you can address those I'll jump back on it asap.

Thanks!

@@ -433,6 +434,18 @@ func resourceLinuxVirtualMachineScaleSetCreate(d *schema.ResourceData, meta inte
virtualMachineProfile.ExtensionProfile.ExtensionsTimeBudget = utils.String(v.(string))
}

// otherwise the service return the error:
// Automatic OS Upgrade is not supported for this Virtual Machine Scale Set because a health probe or health extension was not specified.
if upgradeMode == compute.Automatic && len(automaticOSUpgradePolicyRaw) > 0 && (healthProbeId == "" && !hasHealthExtension) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we'll get here, line 352 above will kick us out first if health_probe_id is unset, so that will need investigating for refactoring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah... something is messed up during the merging from master. I need to check these carefully again.

@@ -449,6 +450,18 @@ func resourceWindowsVirtualMachineScaleSetCreate(d *schema.ResourceData, meta in
virtualMachineProfile.ExtensionProfile.ExtensionsTimeBudget = utils.String(v.(string))
}

// otherwise the service return the error:
// Automatic OS Upgrade is not supported for this Virtual Machine Scale Set because a health probe or health extension was not specified.
if upgradeMode == compute.Automatic && len(automaticOSUpgradePolicyRaw) > 0 && (healthProbeId == "" && !hasHealthExtension) {
Copy link
Member

Choose a reason for hiding this comment

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

As with the Linux resource, we'll not get here if health_probe_id is not set, Line 368.

@jackofallops jackofallops removed this from the Blocked milestone Mar 12, 2021
@ArcturusZhang
Copy link
Contributor Author

Hi @jackofallops I have resolved the comments. please take a look again

Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Hi @ArcturusZhang - Thanks for the updates, this LGTM now 👍 I'll get the tests run asap.

@jackofallops jackofallops added this to the v2.56.0 milestone Apr 12, 2021
@jackofallops
Copy link
Member

Tests looking fine (Failures unrelated)

image

@jackofallops jackofallops merged commit bd84b37 into hashicorp:master Apr 14, 2021
jackofallops added a commit that referenced this pull request Apr 14, 2021
@ghost
Copy link

ghost commented Apr 16, 2021

This has been released in version 2.56.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.56.0"
}
# ... other configuration ...

@ArcturusZhang ArcturusZhang deleted the vmss-health-extension branch April 16, 2021 02:30
@ghost
Copy link

ghost commented May 14, 2021

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!

@ghost ghost locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement service/vmss Virtual Machine Scale Sets size/XL
Projects
None yet
4 participants