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

vmss: support for passing a health probe to update #7355

Merged
merged 1 commit into from
Oct 10, 2019

Conversation

tombuildsstuff
Copy link
Contributor

The Update struct for a Virtual Machine Scale Set doesn't currently expose the 'HealthProbe' block required when updating a VMSS with an Automatic/Rolling Upgrade Policy using the Update method:

{
	"properties": {
		"upgradePolicy": {
			"mode": "Rolling",
			"rollingUpgradePolicy": {
				"maxBatchInstancePercent": 21,
				"maxUnhealthyInstancePercent": 22,
				"maxUnhealthyUpgradedInstancePercent": 23,
				"pauseTimeBetweenBatches": "PT30S"
			}
		},
		"virtualMachineProfile": {
			"storageProfile": {
				"imageReference": {
					"publisher": "Canonical",
					"offer": "UbuntuServer",
					"sku": "18.04-LTS",
					"version": "latest"
				}
			},
			"networkProfile": {
				"networkInterfaceConfigurations": [{
					"name": "example",
					"properties": {
						"primary": true,
						"enableAcceleratedNetworking": false,
						"dnsSettings": {
							"dnsServers": []
						},
						"ipConfigurations": [{
							"name": "internal",
							"properties": {
								"subnet": {
									"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/virtualNetworks/acctestnw-190928080303507041/subnets/internal"
								},
								"primary": true,
								"privateIPAddressVersion": "IPv4",
								"applicationGatewayBackendAddressPools": [],
								"applicationSecurityGroups": [],
								"loadBalancerBackendAddressPools": [{
									"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/loadBalancers/acctestlb-190928080303507041/backendAddressPools/test"
								}],
								"loadBalancerInboundNatPools": [{
									"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/loadBalancers/acctestlb-190928080303507041/inboundNatPools/test"
								}]
							}
						}],
						"enableIPForwarding": false
					}
				}]
			}
		}
	}
}

which currently returns:

{
	"error": {
		"code": "BadRequest",
		"message": "Rolling Upgrade mode is not supported for this Virtual Machine Scale Set because a health probe or health extension was not provided."
	}
}

This PR adds the HealthProbe block to the Update object, which when specified allows the Update to complete successfully:

{
	"properties": {
		"upgradePolicy": {
			"mode": "Rolling",
			"rollingUpgradePolicy": {
				"maxBatchInstancePercent": 21,
				"maxUnhealthyInstancePercent": 22,
				"maxUnhealthyUpgradedInstancePercent": 23,
				"pauseTimeBetweenBatches": "PT30S"
			}
		},
		"virtualMachineProfile": {
			"storageProfile": {
				"imageReference": {
					"publisher": "Canonical",
					"offer": "UbuntuServer",
					"sku": "18.04-LTS",
					"version": "latest"
				}
			},
			"networkProfile": {
				"healthProbe": {
					"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/loadBalancers/acctestlb-190928080303507041/probes/acctest-lb-probe"
				},
				"networkInterfaceConfigurations": [{
					"name": "example",
					"properties": {
						"primary": true,
						"enableAcceleratedNetworking": false,
						"dnsSettings": {
							"dnsServers": []
						},
						"ipConfigurations": [{
							"name": "internal",
							"properties": {
								"subnet": {
									"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/virtualNetworks/acctestnw-190928080303507041/subnets/internal"
								},
								"primary": true,
								"privateIPAddressVersion": "IPv4",
								"applicationGatewayBackendAddressPools": [],
								"applicationSecurityGroups": [],
								"loadBalancerBackendAddressPools": [{
									"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/loadBalancers/acctestlb-190928080303507041/backendAddressPools/test"
								}],
								"loadBalancerInboundNatPools": [{
									"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/loadBalancers/acctestlb-190928080303507041/inboundNatPools/test"
								}]
							}
						}],
						"enableIPForwarding": false
					}
				}]
			}
		}
	}
}

which then returns:

{
	"name": "acctestvmss-190928080303507041",
	"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Compute/virtualMachineScaleSets/acctestvmss-190928080303507041",
	"type": "Microsoft.Compute/virtualMachineScaleSets",
	"location": "westeurope",
	"tags": {},
	"sku": {
		"name": "Standard_F2",
		"tier": "Standard",
		"capacity": 0
	},
	"properties": {
		"singlePlacementGroup": true,
		"upgradePolicy": {
			"mode": "Rolling",
			"rollingUpgradePolicy": {
				"maxBatchInstancePercent": 21,
				"maxUnhealthyInstancePercent": 22,
				"maxUnhealthyUpgradedInstancePercent": 23,
				"pauseTimeBetweenBatches": "PT30S"
			}
		},
		"virtualMachineProfile": {
			"osProfile": {
				"computerNamePrefix": "acctestvmss-190928080303507041",
				"adminUsername": "adminuser",
				"linuxConfiguration": {
					"disablePasswordAuthentication": false,
					"ssh": {
						"publicKeys": []
					},
					"provisionVMAgent": true
				},
				"secrets": [],
				"allowExtensionOperations": true,
				"requireGuestProvisionSignal": true
			},
			"storageProfile": {
				"osDisk": {
					"createOption": "FromImage",
					"caching": "ReadWrite",
					"writeAcceleratorEnabled": false,
					"managedDisk": {
						"storageAccountType": "Standard_LRS"
					}
				},
				"imageReference": {
					"publisher": "Canonical",
					"offer": "UbuntuServer",
					"sku": "18.04-LTS",
					"version": "latest"
				}
			},
			"networkProfile": {
				"healthProbe": {
					"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/loadBalancers/acctestlb-190928080303507041/probes/acctest-lb-probe"
				},
				"networkInterfaceConfigurations": [{
					"name": "example",
					"properties": {
						"primary": true,
						"enableAcceleratedNetworking": false,
						"dnsSettings": {
							"dnsServers": []
						},
						"enableIPForwarding": false,
						"ipConfigurations": [{
							"name": "internal",
							"properties": {
								"primary": true,
								"subnet": {
									"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/virtualNetworks/acctestnw-190928080303507041/subnets/internal"
								},
								"privateIPAddressVersion": "IPv4",
								"loadBalancerBackendAddressPools": [{
									"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/loadBalancers/acctestlb-190928080303507041/backendAddressPools/test"
								}],
								"loadBalancerInboundNatPools": [{
									"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestrg-190928080303507041/providers/Microsoft.Network/loadBalancers/acctestlb-190928080303507041/inboundNatPools/test"
								}]
							}
						}]
					}
				}]
			},
			"diagnosticsProfile": {
				"bootDiagnostics": {
					"enabled": false
				}
			},
			"priority": "Regular"
		},
		"provisioningState": "Updating",
		"overprovision": false,
		"doNotRunExtensionsOnOverprovisionedVMs": false,
		"uniqueId": "9e2399ba-dc3a-4307-bef5-d2a423a50ecd"
	}
}

@openapi-sdkautomation
Copy link

openapi-sdkautomation bot commented Sep 28, 2019

In Testing, Please Ignore

[Logs] (Generated from 5b6736a, Iteration 1)

Succeeded .NET: test-repo-billy/azure-sdk-for-net [Logs] [Diff]
Succeeded Python: test-repo-billy/azure-sdk-for-python [Logs] [Diff]
Failed Java: test-repo-billy/azure-sdk-for-java [Logs] [Diff]
  • Failed compute/resource-manager/v2017_03_30 [Logs] [Generation PR]
  • Failed compute/resource-manager/v2017_09_01 [Logs]
  • Failed compute/resource-manager/v2017_12_01 [Logs]
  • Failed compute/resource-manager/v2018_04_01 [Logs]
Succeeded JavaScript: test-repo-billy/azure-sdk-for-js [Logs] [Diff]
In-Progress Go: test-repo-billy/azure-sdk-for-go [Logs] [Diff]
  • In-Progress compute/mgmt/2015-06-15 [Logs]
  • In-Progress compute/mgmt/2016-03-30 [Logs]
  • In-Progress compute/mgmt/2017-03-30 [Logs]
  • In-Progress compute/mgmt/2017-09-01 [Logs]
  • In-Progress compute/mgmt/2017-12-01 [Logs]
  • In-Progress compute/mgmt/2018-04-01 [Logs]
  • In-Progress compute/mgmt/2018-06-01 [Logs]
  • In-Progress compute/mgmt/2018-10-01 [Logs]
  • In-Progress compute/mgmt/2019-03-01 [Logs]
  • In-Progress compute/mgmt/2019-07-01 [Logs]
  • In-Progress containerservice/mgmt/2016-03-30 [Logs]
  • In-Progress containerservice/mgmt/2016-09-30 [Logs]
  • In-Progress containerservice/mgmt/2017-01-31 [Logs]
  • In-Progress preview/compute/mgmt/2016-04-30-preview [Logs]
  • In-Progress preview/containerservice/mgmt/2015-11-01-preview [Logs]
Succeeded Ruby: test-repo-billy/azure-sdk-for-ruby [Logs] [Diff]

@AutorestCI
Copy link

AutorestCI commented Sep 28, 2019

Automation for azure-sdk-for-python

A PR has been created for you based on this PR content.

Once this PR will be merged, content will be added to your service PR:
Azure/azure-sdk-for-python#7759

@AutorestCI
Copy link

AutorestCI commented Sep 28, 2019

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#5922

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@ArcturusZhang ArcturusZhang added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Sep 29, 2019
@@ -8435,6 +8435,10 @@
},
"VirtualMachineScaleSetUpdateNetworkProfile": {
"properties": {
"healthProbe": {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking change, please include this in a new api version

See 'New property added to response':
https://microsoft.sharepoint.com/:w:/t/azureresourcemanagerteam/EWXsAQ1yx25KkyYCeeWGUgwBSBxEdUDEbHi6FZ__U8EOQw?e=xEcppo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ryansbenson this is in the existing API version - it's just missing from the Swagger - please see the examples in the PR description

In addition it appears that link isn't publicaly available:

Screenshot 2019-10-01 at 10 31 10

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ryansbenson since this is already in the API (but is just missing from the Swagger) I'm assuming adding this optional property to an update (to match the API definition) should be fine?

Copy link
Member

Choose a reason for hiding this comment

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

Hi @tombuildsstuff for your information, the doc above lists various types of breaking changes, which contains on entry of

New property added to response 

If a new property/field is added to the response an API, the GET-PUT pipeline will be broken. Consider the case where from portal a customer updates the value of a new property "A". Another customer does a GET of this resource using the SDK. The SDK will ignore the property since it does not understand it. From the SDK, the customer does a PUT using the model that was returned from the GET. This will overwrite the change made by the first customer from the portal.  

Per this entry, the addition of this property is a breaking change to the existing swagger.

Copy link
Member

Choose a reason for hiding this comment

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

Hi @ryansbenson per what @tombuildsstuff claims, this property has already existed in the API but just missing in swagger, will this condition needs a new api version?
More to ask, would proposing a new api version be done by customer?

Copy link
Contributor

Choose a reason for hiding this comment

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

If the live api version accepts and supports this property, it doesn't constitute a breaking api version change (as it already exists in the api version). This is essentially a documentation issue. If these properties came after the api version was released and we're trying to document it now, your customers have already gone through the side affects of the breaking change (this isn't a good experience but not something we can solve in swagger PRs).

Approving from ARMs side

@ryansbenson ryansbenson added the ARMChangesRequested <valid label in PR review process>add this label when require changes after ARM review label Sep 30, 2019
@tombuildsstuff
Copy link
Contributor Author

@ArcturusZhang sorry to ping you - would you mind tagging this "Service Team" so the Compute team could take a look? This is unfortunately blocking a couple of new resources we're trying to ship

@ryansbenson ryansbenson added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed ARMChangesRequested <valid label in PR review process>add this label when require changes after ARM review WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants