Autoscaling Azure with WASABi – Part 3

I gave an Autoscaling Azure talk at the Brisbane Azure User Group (BAUG) on the 18th April 2012. This series of posts will walk through the demo I put together for the talk using the Autoscaling Application Block (WASABi).

What are we configuring?

We have built the autoscaler as a console application but without configuration it cannot do much. This post will see us configuring the autoscaler so that it knows where to find its data points store, where to find its autoscaling rules and where to find the service information for the services it will be autoscaling.

Visual Studio Extensions

The Enterprise Library Configuration Console will make the configuration of the Autoscaling Application Block a little easier. Click on Tools > Extension Manager … in Visual Studio and search for enterprise library config in the Online Gallery. Install the EnterpriseLibrary.Config extension.Enterprise Library Configuration Console - Extension Manager

Configuration

Right click on the app.config file in the solution and select the Enterprise Library Configuration Console’s edit configuration file option.

Solution Explorer

Select the Add Autoscaling Settings from the Blocks menu item.Add Autoscaling Settings

Go to the Windows Azure preview portal and select the primary access key from your Data Points Store Storage Account. Mine is baugautoscalingdata . We will need this key for the data points store storage account configuration.

Storage account - manage access keys

Expand the Autoscaling Settings section in the Enterprise Library Configuration Console and configure the following elements:

  • Data Points Store Storage Account
  • Rule Evaluation Rate

Place your storage account connection string into the Data Points Store Storage Account element. It will be in the following format:

 DefaultEndpointsProtocol=https;AccountName=[YOUR STORAGE ACCOUNT NAME];AccountKey=[YOUR STORAGE ACCOUNT KEY]

Modify the Rule Evaluation Rate down to 1 min (00:01:00) from the default. This is a demo afterall and we want to see results quickly.Autoscaling Settings

The Rules Store and Service Information Store default to storage account storage. Since we will be hosting these stores locally change both of the stores to use local file stores. Click on the + next to each store and set the store to use local file storage.Use Local File Rules Store

Configure the stores with the file names of the files that will host the stores:

  • Rules Store – local-rules-store.xml
  • Service Information Store – local-serviceinformation-store.xml

Ensure that the Logger is set to System Diagnostics Logger. Save and close.Configure Rules Store

Open the app.config file and paste the following system.diagnostics xml as a child node under the <configuration> node. This will log all output to the console in addition to a file at C:\Logs\ConsoleAutoscaler.log. Ensure that your C:\Logs folder is created.

 
<system.diagnostics>
  <trace autoflush="true"/>
  <sources>
    <source name="Autoscaling General"
            switchName="SourceSwitch"
            switchType="System.Diagnostics.SourceSwitch" >
      <listeners>
        <add name="console" />
        <add name="file" />
        <remove name ="Default" />
      </listeners>
    </source>
    <source name="Autoscaling Updates"
            switchName="SourceSwitch"
            switchType="System.Diagnostics.SourceSwitch" >
      <listeners>
        <add name="console" />
        <add name="file" />
        <remove name="Default" />
      </listeners>
    </source>
  </sources>
  <sharedListeners>
    <add name="console" type="System.Diagnostics.ConsoleTraceListener">
      <filter type="System.Diagnostics.EventTypeFilter" initializeData="Verbose"/>
    </add>
    <add name="file" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\Logs\ConsoleAutoscaler.log">
      <filter type="System.Diagnostics.EventTypeFilter" initializeData="Verbose"/>
    </add>
  </sharedListeners>
  <switches>
    <add name="SourceSwitch"
        value="Verbose, Information, Warning, Error, Critical" />
  </switches>
</system.diagnostics>

The autoscaler is now configured. Next up will be configuring the Service Information Store.

Advertisements

2 thoughts on “Autoscaling Azure with WASABi – Part 3

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s