What is ignoreRoleInstanceStatus setting in Windows Azure?
ignoreRoleInstanceStatus is described in WebRole and WorkerRole Schema as below
https://msdn.microsoft.com/en-us/library/windowsazure/gg557553.aspx
Web Role:
ignoreRoleInstanceStatus |
boolean |
Optional. When the value of this attribute is set to true, the status of a service is ignored and the endpoint will not be removed by the load balancer. The default value is false. Setting this value to true useful for debugging busy instances of a service.
|
Worker Role:
ignoreRoleInstanceStatus |
boolean |
Optional. When the value of this attribute is set to true, the status of a service is ignored and that the endpoint will not be removed by the load balancer. The default value is false. Setting this value true useful for debugging busy instances of a service. |
Usage:
<InputEndpoints >
<InputEndpoint certificate="<certificate-name>" ignoreRoleInstanceStatus="[true|false]" name="<input-endpoint-name>" protocol="[http|https]" localPort="<port-number>" port="<port-number>" />
</InputEndpoints>
<Endpoints>
<InputEndpoint certificate="<certificate-name>" ignoreRoleInstanceStatus="[true|false]" name="<input-endpoint-name>" protocol="[http|https|tcp]" localPort="<port-number>" port="<port-number>" />
<InternalEndpoint name="<internal-endpoint-name>" protocol="[http|tcp]" port="<port-number>">
<FixedPort port="<port-number>"/>
<FixedPortRange min="<minium-port-number>" max="<maximum-port-number>"/>
</InternalEndpoint>
</Endpoints>
When when ignoreRoleInstanceStatus is set to TRUE, the VM instance always stuck with LoadBalancer without consideration of Instance Status. So in some cases when VM Instance generate Busy status, the LoadBalancer to design to remove the VM by detaching the VM internal IP address from its list. Using ignoreRoleInstanceStatus is TRUE, the LoadBalancer will override the VM Status.
To test it, I have used my previous blog info, in which I used Powershell commands to take a specific Azure VM instance out of Load Balancer:
Windows Azure Troubleshooting - Taking specific Windows Azure Instance offline
Here is what I did:
1. Created a sample Web Role and included ignoreRoleInstanceStatus as TRUE in the Service Definition as below and deployed to Windows Azure Cloud:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="TestignoreRoleInstanceStatusProj" xmlns="https://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="WebRole1" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" ignoreRoleInstanceStatus="true" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
</WebRole>
</ServiceDefinition>
2. After the service is deployed to Windows Azure, RDP to the instance and run the Powershell script as below to kick VM instance "Busy" status:
3. Keep an eye on Windows Azure Portal to see if the Role Status changes... even after 10 minutes the role status did not changed as below
Also I tried opening the website in my browser which was keep working so I could confirm that yes, the VM instance was stick to LoadBalancer.
So I was able to prove that this ignoreRoleInstanceStatus property is useful to keep the instance stick to LoadBalancer in any state, however this property needs to set in Service Definition and to update it i would need to re-deploy the application which is trouble.
Comments
Anonymous
February 23, 2012
Thanks, Avkash. One question, are the powershell snapins for windows azure installed in the instance by default, or did you install it there?Anonymous
February 23, 2012
Srikant, All Azure VM already have PowerShell installed in it so all you need is just log into your Azure VM, launch PowerShell command window and start typing commands... Thanks, AvkashAnonymous
August 16, 2012
can i get this service definition file from java API or I have the role name, I want to check whether its a WEB, WORKER or VM role from API, is it possible?