Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, October 3, 2019 4:26 PM
I have set up a virtual machine scale set with more than one vm instance inside, and I have configured a http "health probe" (application health extension), as well as a rolling upgrade policy (if that is relevant in any way). But when I perform a restart all instances are restarted at the same time. It doesn't matter if I click "Restart" of the scale set itself in the "Overview" tab, or selecting all instances in the "Instances" tag and then clicking "Restart", the behavior is the same.
What I expected to happen was that the scale set restarted one instance, then waited until it became available with a positive health check (using the http health probe defined), and only after that it should have started with the second instance (and so on, until all instances are restarted). The way I see it, this should be the default, automatic, behavior of a scale set. Maybe an alternative solution could be that it always kept at least X percent of the instances running (meaning it can restart some of them in parallel, if there are several instances in total).
Is there any way to configure the scale set to handle restarts like this? I don't want to have to handle it manually, by checking the health status of one instance before restarting the next one. And preferably I would want a solution that only uses Azure Portal configuration and no script (I would like to be able to do this kind of restart using the Azure App, for example).
All replies (5)
Thursday, October 3, 2019 5:28 PM
Can you elaborate on why you are manually restarting your cluster?
Having the rolling upgrade policy in place will ensure that when you update your instances the update will roll out one instance at a time. However that does not apply to a manual restart. If you are manually restarting the VMSS cluster it will just restart every node all together.
Can you tell me a bit more about your use case and the reason for the manual restarts? Or were you just doing some testing?
Friday, October 4, 2019 12:29 AM
Sometimes a server needs to be restarted even outside of an upgrade/update process. Maybe because of a memory leak in a 3rd party system makes it necessary to restart the servers after a while, or maybe the database has been updated in a way that requires a restart. Sure, maybe it would be enough to restart the services on the server, but sometimes a full server restart is better.
Friday, October 4, 2019 7:51 PM
If that is what you are looking to do, I might suggest restarting the individual instance instead of the entire scale set
/en-us/powershell/module/azurerm.compute/restart-azurermvmss?view=azurermps-6.13.0
You can do the same thing via the portal as well by going to the ScaleSet -> Instances -> Select the instance you want to adjust -> Restart
This will restart the individual instance instead of the entire scaleset.
Besides that, the rolling updates/ restarts will only apply when applying updates to the VM. If you select restart on the entire scaleset it will restart all at once.
Saturday, October 5, 2019 12:27 AM
Well, in the case of a database update, it is really all instances that needs to be restarted, not just a single one.
Why do I get the feeling that you don't want to admit that sometimes there can be a legitimate need for a manual restart of all instances? :)
Sunday, October 6, 2019 7:52 PM
Not saying there are not valid reasons for a restart. Just tying to understand your scenario so I can suggest better.
As I mentioned in the above comment, if you want to restart the instances one at a time you would want to do that manually. Restarting from the VMSS blade itself will reset all the instances at once. The rolling updates you can enable don't apply to manual restarts.
Using the powershell commands, you could create a simple script you can run that will cycle through each of the instances restarting them one at a time. Besides that, there is not a platform feature we offer that will allow you to select the restart from the VMSS blade and it will cycle through the restarts one at a time.