Possible to tell a scale set or application gateway which vm instance to use?

Jimi 1 Reputation point
2020-03-20T18:43:27.253+00:00

Hi,

When testing new big features I sometimes have the need to quickly switch between two different "versions" of a virtual machine in a scale set. But since our current (test env) setup uses bare bone Ubuntu images and configures everything using a custom script, it takes quite a long time to create a new instance. So, if possible, I would like to be able to tell the scale set (or application gateway) which specific instance it should use for all incoming traffic. That way I can have both instances alive at the same time, and quickly switch back end forth when testing things.

I'm not interested in setting up multiple scalesets or application gateways, since I want all other components in the environment to use the same configuration, pointing to the same application gateway, and I don't want to have to do any configuration changes in all these components in order to achieve this switch.

So, does the scaleset or the application gateway offer any opportunity like this?
Is it perhaps possible to achive using the health check? If I can make sure that only one of the two instances returns a 200 OK for the health checks, can I then make it direct all traffic to the other one without the scale set automatically tearing down the "unhealthy" instance? Maybe there is a setting to disable this "kill any unhealthy instance" feature? Or is it possible to configure it in such a way that it takes maybe 1 or two "unhealthy" health check responses for it to remove the instance from the load, but let say 1000 "unhealthy" health check responses before it actually kills the instance?

Regards

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
346 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. jakaruna-MSFT 596 Reputation points Microsoft Employee
    2020-03-24T14:57:43.833+00:00

    VMSS is meant to run the same image multiple times. Your requirement is not possible and not recommended as well.

    Easisest solution would be to deploy your new software on a new VM or a new VMSS and add that on the app gateway.

    for example in app gateway,

    test.app.com can go to the single Vm or the test VMSS which you created for testing

    prod.app.com can go to the regular VMSS.