Hello @Anil Kumar
I'd be happy to help answer your questions:
- If Max instance count is set to 10, how observed instance count is reaching 40? It's possible that there is an issue with the configuration of your VMSS or with the metrics that you are using to monitor the instance count. Without more information, it's difficult to say exactly what is causing the observed instance count to reach 40. I would recommend reviewing your VMSS configuration and the metrics that you are using to monitor the instance count to ensure that they are set up correctly.*
- How can I see the accurate instance count for my VMSS? Checked metrics but couldn't find what I was looking for. You can use the Azure portal or Azure CLI to view the current instance count for your VMSS. In the Azure portal, navigate to your VMSS and select the "Instances" tab. This will show you the current instance count and the status of each instance. You can also use the Azure CLI to view the instance count by running the command "az vmss list-instances". This will show you the current instance count and the status of each instance.
- When Min and Max instance count are set to the same value i.e. 10, how is the instance count changing? If the Min and Max instance count are set to the same value, the instance count will not change automatically. You will need to manually add or remove instances to change the instance count.
- There is no condition defined for scale in and scale out, on what basis are these scale operations happening? How does Azure know it needs to scale out by 20 and scale in by 10? Doesn't Azure look at the Max instance count parameter before scaling out? Azure uses the autoscale rules that you have defined to determine when to scale out or scale in the VMSS. The autoscale rules are based on metrics that you have selected, such as CPU usage or memory usage. When the metric values exceed the threshold that you have defined in the autoscale rule, Azure will scale out the VMSS. When the metric values fall below the threshold, Azure will scale in the VMSS. The Max instance count parameter is used to limit the maximum number of instances that can be created in the VMSS, but it does not affect the autoscale rules.
- Doesn't Azure validate JSON file for auto scaling? When I cannot create VMSS with the same Min and Max count, I should ot be allowed to do that by JSON as well.
Azure does validate the JSON file for auto scaling, but it may not catch all configuration errors. In some cases, it may be possible to create a JSON file with the same Min and Max count for a VMSS, but this configuration will not work correctly when the VMSS is deployed. To avoid this issue, you should always follow the best practices for configuring a VMSS, including setting the Min and Max count to different values. If you encounter an error when deploying a VMSS with a JSON file, you should review the error message to determine the cause of the error and make the necessary changes to the JSON file to correct the error.
If I have answered your query, please click "Accept as answer" as a token of appreciation