Difficulties setting up autoscaling

Topics: Windows Azure Integration Pack
Apr 19, 2012 at 2:13 AM

After the autoscaler runs for a few minutes, I get this error:
Autoscaling General Error: 2002 : Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling.DataPointsCollection.DataPointsStoreException: Could not save data point to Windows Azure Storage. ---> System.Data.Services.Client.DataServiceRequestException: An error occurred while processing this request. ---> System.Data.Services.Client.DataServiceClientException: <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
  <code>ResourceNotFound</code>
  <message xml:lang="en-US">0:The specified resource does not exist.</message>
</error>

I tested that the autoscaler can see and write to my developer storage by changing the name of the AutoscaleDataPoints table.  The new table name was created correctly.  I can write to the table with Azure Storage Explorer.

Here are the relevant lines from the app.config:

    <autoscalingConfiguration dataPointsStoreAccount="UseDevelopmentStorage=true"
        dataPointsTableName="AutoscalerDatapts" ruleEvaluationRate="00:01:00"
        loggerName="System Diagnostics Logger" rulesStoreName="Blob Rules Store"
        serviceInformationStoreName="Blob Service Information Store">
        <loggers>
            <add name="System Diagnostics Logger" type="Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling.Logging.SystemDiagnosticsLogger, Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling, Version=5.0.1118.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </loggers>
        <rulesStores>
            <add name="Blob Rules Store" type="Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling.Rules.Configuration.BlobXmlFileRulesStore, Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling, Version=5.0.1118.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                blobContainerName="autoscaling" blobName="rules-store.xml"
                storageAccount="UseDevelopmentStorage=true" monitoringRate="00:00:30" />
        </rulesStores>
        <serviceInformationStores>
            <add name="Blob Service Information Store" type="Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling.ServiceModel.Configuration.BlobXmlFileServiceInformationStore, Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling, Version=5.0.1118.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                blobContainerName="autoscaling" blobName="service-information-store.xml"
                storageAccount="UseDevelopmentStorage=true" monitoringRate="00:00:30" />
        </serviceInformationStores>
        <advancedOptions>
            <serviceManagementRequestTracker trackServiceManagementRequests="true"
                storageAccount="UseDevelopmentStorage=true" />
            <executionLease useBlobExecutionLease="false" blobExecutionLeaseStorageAccount="UseDevelopmentStorage=true" />
        </advancedOptions>
    </autoscalingConfiguration>

Rules-Information:

<?xml version="1.0" encoding="utf-8" ?>
<rules xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/rules">
  <constraintRules>
    <rule name="default" enabled="true" rank="1" description="base line rule">
      <actions>
        <range target="GuestBook_WorkerRole" min="1" max="2"/>
      </actions>
    </rule>
  </constraintRules>
  
  <reactiveRules>
    <rule name="scaleupq" enabled="true" rank="2">
      <when>
        <greaterOrEqual operand="q" than="5"/>
      </when>
    </rule>
    <rule name="scaledownq" enabled="true" rank="2">
      <when>
        <lessOrEqual operand="q" than="2"/>
      </when>
    </rule>
  </reactiveRules>

  <operands>
    <queueLength alias="q" aggregate="Max" timespan="00:05:00"  queue="q1"/>
  </operands>
</rules>

And Service-Information:

<?xml version="1.0" encoding="utf-8" ?>
<serviceModel xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/serviceModel">
  <subscriptions>
    <subscription name="<my subscription name>"
                  certificateStoreLocation="CurrentUser"
                  certificateStoreName="My"
                  certificateThumbprint="00C49DF47FA4028C1FEEEF51C21F3C2EC7EB9765"
                  subscriptionId="<my subscription id>" >
      <services>
        <service dnsPrefix="GOScaleTest" slot="Production">
          <roles>
            <role alias="GuestBook_WorkerRole" roleName="GuestBook_WorkerRole" wadStorageAccountName="Storage"/>
          </roles>
        </service>
      </services>
      <storageAccounts>
        <storageAccount alias="Storage" connectionString="DefaultEndpointsProtocol=https;AccountName=<my account name>;AccountKey=<my account key>">
          <queues>
            <queue alias="q1" queueName="guestthumbs"/>
          </queues>
        </storageAccount>
      </storageAccounts>
    </subscription>
  </subscriptions>
  <scaleGroups>
  </scaleGroups>
</serviceModel>
Apr 19, 2012 at 4:54 AM

I changed from using developer storage to a real azure storage account for the autoscaler's needs (service-information, rules-information, data points) and the error 2002 went away.

After I fixed my rules (missing actions on reactive rules) all's well.  It works now.

Apr 19, 2012 at 4:34 PM

Correct, the Autoscaler does not work with storing the DataPoints in the dev fabric. The reason is that it uses the "Upsert" feature which is not yet supported in the emulator.

More info on what Upsert is here: http://blogs.msdn.com/b/windowsazurestorage/archive/2011/09/15/windows-azure-tables-introducing-upsert-and-query-projection.aspx

Cheers,
Julian
http://blogs.msdn.com/b/jdom