Поделиться через


Using Notifications and Manual Scaling

Retired Content

This content and the technology described is outdated and is no longer being maintained. For more information, see Transient Fault Handling.

patterns & practices Developer Center

Using notifications enables you to preview any scaling operations before they take place. The Autoscaling Application Block can send an email message to a designated operator (or operators) that details the suggested scaling operations. It is then the responsibility of the operator to perform the scaling operation manually.

To configure notifications, you must add configuration data to the configuration file of the blocks host process and change the service information configuration.

You must configure details of your SMTP service in the configuration file of the block's host process, as shown in the following snippet.

<configuration>
  ...
  <system.net>
    <mailSettings>
      <smtp from="sender@contoso.com" deliveryMethod="Network">
        <network host="localhost" port="6010"/>
      </smtp>
    </mailSettings>
  </system.net>
  ...
</configuration> 

To enable notifications for a hosted service, you must change your service information, as shown in the following snippet. Setting the scalingMode attribute to Notify enables notifications for the hosted service. Use the notificationRecipients attribute to specify the email address of the operator to receive the scaling notifications.

<serviceModel xmlns="https://schemas.microsoft.com/practices/2011/entlib/autoscaling/serviceModel">
  <subscriptions>
    <subscription ...>
      <services>
        <service dnsPrefix="myautoscalingservice" slot="Staging" 
          scalingMode="Notify" notificationRecipients="operator@contoso.com" >
          <roles>
            <role ...
          </roles>
        </service>
      </services>
      <storageAccounts>
        ...
      </storageAccounts>
    </subscription>
  </subscriptions>
</serviceModel>

The following table shows the contents of a sample notification message.

Title

"Scaling requested for hosted service 'myservice' (Production) in subscription 'mysubscription'"

Body

"The following scaling actions are required for hosted service 'myservice' (Production) in subscription 'mysubscription':

Role: role1 - Min: 1 - Max: 3 - Scale (abs): 3 - Scale (rel): 0 - Current: 2 - New: 3

Role: role2 - Min: 3 - Max: 5 - Scale (abs): 0 - Scale (rel): -0.75 - Current: 2 - New: 3


Evaluation id: 00dd4e00-cbf8-4799-b532-04bc13bbd3b7."


For more information about the service information XML configuration file, see the topic "Storing Your Service Information Data."

Note

You can also use a scaling mode of ScaleAndNotify in your service information if you want the block to perform the scaling operation automatically and notify the operator.

Next Topic | Previous Topic | Home

Last built: June 7, 2012