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 auto os upgrades for service fabric #11723

Merged
merged 5 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,6 @@ 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 {
if *automaticOSUpgradePolicy.EnableAutomaticOSUpgrade && (healthProbeId == "" && !hasHealthExtension) {
return fmt.Errorf("`health_probe_id` must be set or a health extension must be specified when `upgrade_mode` is set to %q and `automatic_os_upgrade_policy` block exists", string(upgradeMode))
}
}

// otherwise the service return the error:
// Rolling Upgrade mode is not supported for this Virtual Machine Scale Set because a health probe or health extension was not provided.
if upgradeMode == compute.Rolling && (healthProbeId == "" && !hasHealthExtension) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1236,20 +1236,17 @@ func VirtualMachineScaleSetAutomatedOSUpgradePolicySchema() *schema.Schema {
return &schema.Schema{
Type: schema.TypeList,
Optional: true,
ForceNew: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This probably requires docs update as well, normally docs state that "Changing this forces a new resource to be created"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, both windows and linux scaleset docs need an update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Docs updated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@favoretti - is this OK now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@hbuckle LGTM, thank you, but a maintainer has to approve still.

MaxItems: 1,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
// TODO: should these be optional + defaulted?
"disable_automatic_rollback": {
Type: schema.TypeBool,
Required: true,
ForceNew: true,
},
"enable_automatic_os_upgrade": {
Type: schema.TypeBool,
Required: true,
ForceNew: true,
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,14 +446,6 @@ 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 {
if *automaticOSUpgradePolicy.EnableAutomaticOSUpgrade && (healthProbeId == "" && !hasHealthExtension) {
return fmt.Errorf("`health_probe_id` must be set or a health extension must be specified when `upgrade_mode` is set to %q and `automatic_os_upgrade_policy` block exists", string(upgradeMode))
}
}

// otherwise the service return the error:
// Rolling Upgrade mode is not supported for this Virtual Machine Scale Set because a health probe or health extension was not provided.
if upgradeMode == compute.Rolling && (healthProbeId == "" && !hasHealthExtension) {
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/linux_virtual_machine_scale_set.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ A `admin_ssh_key` block supports the following:

A `automatic_os_upgrade_policy` block supports the following:

* `disable_automatic_rollback` - (Required) Should automatic rollbacks be disabled? Changing this forces a new resource to be created.
* `disable_automatic_rollback` - (Required) Should automatic rollbacks be disabled?

* `enable_automatic_os_upgrade` - (Required) Should OS Upgrades automatically be applied to Scale Set instances in a rolling fashion when a newer version of the OS Image becomes available? Changing this forces a new resource to be created.
* `enable_automatic_os_upgrade` - (Required) Should OS Upgrades automatically be applied to Scale Set instances in a rolling fashion when a newer version of the OS Image becomes available?

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ A `additional_unattend_content` block supports the following:

A `automatic_os_upgrade_policy` block supports the following:

* `disable_automatic_rollback` - (Required) Should automatic rollbacks be disabled? Changing this forces a new resource to be created.
* `disable_automatic_rollback` - (Required) Should automatic rollbacks be disabled?

* `enable_automatic_os_upgrade` - (Required) Should OS Upgrades automatically be applied to Scale Set instances in a rolling fashion when a newer version of the OS Image becomes available? Changing this forces a new resource to be created.
* `enable_automatic_os_upgrade` - (Required) Should OS Upgrades automatically be applied to Scale Set instances in a rolling fashion when a newer version of the OS Image becomes available?

---

Expand Down