Index: branches/OaaS/HeuristicLab.Services.Optimization/HeuristicLab.Services.Optimization.ccproj
===================================================================
--- branches/OaaS/HeuristicLab.Services.Optimization/HeuristicLab.Services.Optimization.ccproj	(revision 9371)
+++ branches/OaaS/HeuristicLab.Services.Optimization/HeuristicLab.Services.Optimization.ccproj	(revision 9508)
@@ -38,4 +38,12 @@
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Services.Hive.Scaler\HeuristicLab.Services.Optimization.Scaler.csproj">
+      <Name>HeuristicLab.Services.Optimization.Scaler</Name>
+      <Project>{d03b1a10-9c88-4c4b-bccf-4f98cde863d3}</Project>
+      <Private>True</Private>
+      <RoleType>Worker</RoleType>
+      <RoleName>HeuristicLab.Services.Optimization.Scaler</RoleName>
+      <UpdateDiagnosticsConnectionStringOnPublish>True</UpdateDiagnosticsConnectionStringOnPublish>
+    </ProjectReference>
     <ProjectReference Include="..\HeuristicLab.Services.Hive.WebRole\HeuristicLab.Services.Hive.WebRole.csproj">
       <Name>HeuristicLab.Services.Hive.WebRole</Name>
Index: branches/OaaS/HeuristicLab.Services.Optimization/ServiceConfiguration.Cloud.cscfg
===================================================================
--- branches/OaaS/HeuristicLab.Services.Optimization/ServiceConfiguration.Cloud.cscfg	(revision 9371)
+++ branches/OaaS/HeuristicLab.Services.Optimization/ServiceConfiguration.Cloud.cscfg	(revision 9508)
@@ -1,28 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <ServiceConfiguration serviceName="HeuristicLab.Services.Optimization" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*" schemaVersion="2012-05.1.7">
-  <Role name="HeuristicLab.Services.Hive.WebRole">
-    <Instances count="1" />
-    <ConfigurationSettings>
-      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="ADJUST_ME" />
-      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
-      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="ADJUST_ME" />
-      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="ADJUST_ME" />
-      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="ADJUST_ME" />
-      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
-    </ConfigurationSettings>
-    <Certificates>
-      <Certificate name="ADJUST_ME" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
-      <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
-    </Certificates>
-  </Role>
   <Role name="HeuristicLab.Services.Optimization.Web">
     <Instances count="1" />
     <ConfigurationSettings>
-      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="ADJUST_ME" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=ADJUST_ME;AccountKey=ADJUST_ME"/>
       <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
       <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="hive" />
       <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="ADJUST_ME" />
       <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="ADJUST_ME" />
-      <Setting name="Cloudia.WindowsAzure.Storage" value="ADUST_ME" />
+      <Setting name="Cloudia.WindowsAzure.Storage" value="DefaultEndpointsProtocol=https;AccountName=ADJUST_ME;AccountKey=ADJUST_ME" />
       <Setting name="HiveEndpointName" value="WSHttpBinding_Remote_IHiveService" />
       <Setting name="ControllerEndpointName" value="WSHttpBinding_Remote_IControllerService" />
@@ -30,5 +15,37 @@
     <Certificates>
       <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
-      <Certificate name="ADJUST_ME" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
+      <Certificate name="localhost" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
+    </Certificates>
+  </Role>
+  <Role name="HeuristicLab.Services.Optimization.Scaler">
+    <Instances count="1" />
+    <ConfigurationSettings>
+      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=ADJUST_ME;AccountKey=ADJUST_ME" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="hive" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="ADJUST_ME" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="ADJUST_ME" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
+      <Setting name="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=ADJUST_ME;AccountKey=ADJUST_ME" />
+      <Setting name="TraceTable" value="ScalerTraceTable" />
+      <Setting name="TraceTableEnabled" value="false" />
+    </ConfigurationSettings>
+    <Certificates>
+      <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
+      <Certificate name="Azure Service Management" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
+    </Certificates>
+  </Role>
+  <Role name="HeuristicLab.Services.Hive.WebRole">
+    <Instances count="1" />
+    <ConfigurationSettings>
+      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=ADJUST_ME;AccountKey=ADJUST_ME" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="hive" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="ADJUST_ME" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="ADJUST_ME" />
+    </ConfigurationSettings>
+    <Certificates>
+      <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
+      <Certificate name="localhost" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
     </Certificates>
   </Role>
Index: branches/OaaS/HeuristicLab.Services.Optimization/ServiceConfiguration.Local.cscfg
===================================================================
--- branches/OaaS/HeuristicLab.Services.Optimization/ServiceConfiguration.Local.cscfg	(revision 9371)
+++ branches/OaaS/HeuristicLab.Services.Optimization/ServiceConfiguration.Local.cscfg	(revision 9508)
@@ -1,4 +1,39 @@
 <?xml version="1.0" encoding="utf-8"?>
 <ServiceConfiguration serviceName="HeuristicLab.Services.Optimization" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="1" osVersion="*" schemaVersion="2012-05.1.7">
+  <Role name="HeuristicLab.Services.Optimization.Web">
+    <Instances count="1" />
+    <ConfigurationSettings>
+      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="hive" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="ADJUST_ME" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="ADJUST_ME" />
+      <Setting name="Cloudia.WindowsAzure.Storage" value="DefaultEndpointsProtocol=https;AccountName=ADJUST_ME;AccountKey=ADJUST_ME" />
+      <Setting name="HiveEndpointName" value="WSHttpBinding_Local_IHiveService" />
+      <Setting name="ControllerEndpointName" value="WSHttpBinding_Local_IControllerService" />
+    </ConfigurationSettings>
+    <Certificates>
+      <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
+      <Certificate name="localhost" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
+    </Certificates>
+  </Role>
+  <Role name="HeuristicLab.Services.Optimization.Scaler">
+    <Instances count="1" />
+    <ConfigurationSettings>
+      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=ADJUST_ME;AccountKey=ADJUST_ME" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="hive" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="ADJUST_ME" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="ADJUST_ME" />
+      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
+      <Setting name="StorageConnectionString" value="DefaultEndpointsProtocol=https;AccountName=ADJUST_ME;AccountKey=ADJUST_ME" />
+      <Setting name="TraceTable" value="ScalerTraceTable" />
+      <Setting name="TraceTableEnabled" value="true" />
+    </ConfigurationSettings>
+    <Certificates>
+      <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
+      <Certificate name="Azure Service Management" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
+    </Certificates>
+  </Role>
   <Role name="HeuristicLab.Services.Hive.WebRole">
     <Instances count="1" />
@@ -9,26 +44,8 @@
       <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="ADJUST_ME" />
       <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="ADJUST_ME" />
-      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
-    </ConfigurationSettings>
-    <Certificates>
-      <Certificate name="ADJUST_ME" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
-      <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
-    </Certificates>
-  </Role>
-  <Role name="HeuristicLab.Services.Optimization.Web">
-    <Instances count="1" />
-    <ConfigurationSettings>
-      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
-      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
-      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="hive" />
-      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="ADJUST_ME" />
-      <Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="ADJUST_ME" />
-      <Setting name="Cloudia.WindowsAzure.Storage" value="ADJUST_ME" />
-      <Setting name="HiveEndpointName" value="WSHttpBinding_Local_IHiveService" />
-      <Setting name="ControllerEndpointName" value="WSHttpBinding_Local_IControllerService" />
     </ConfigurationSettings>
     <Certificates>
       <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
-      <Certificate name="ADJUST_ME" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
+      <Certificate name="localhost" thumbprint="ADJUST_ME" thumbprintAlgorithm="sha1" />
     </Certificates>
   </Role>
Index: branches/OaaS/HeuristicLab.Services.Optimization/ServiceDefinition.build.csdef
===================================================================
--- branches/OaaS/HeuristicLab.Services.Optimization/ServiceDefinition.build.csdef	(revision 9371)
+++ branches/OaaS/HeuristicLab.Services.Optimization/ServiceDefinition.build.csdef	(revision 9508)
@@ -10,32 +10,4 @@
 -->
 <ServiceDefinition name="HeuristicLab.Services.Optimization" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-05.1.7">
-  <WebRole name="HeuristicLab.Services.Hive.WebRole" vmsize="Small">
-    <Sites>
-      <Site name="Web">
-        <Bindings>
-          <Binding name="HttpIn" endpointName="HttpIn" />
-        </Bindings>
-      </Site>
-    </Sites>
-    <Endpoints>
-      <InputEndpoint name="HttpIn" protocol="http" port="80" localPort="80" />
-    </Endpoints>
-    <Imports>
-      <Import moduleName="Diagnostics" />
-      <Import moduleName="RemoteAccess" />
-      <Import moduleName="RemoteForwarder" />
-    </Imports>
-    <LocalResources>
-      <LocalStorage name="HeuristicLab.Services.Hive.WebRole.svclog" sizeInMB="1000" cleanOnRoleRecycle="false" />
-    </LocalResources>
-    <Certificates>
-      <Certificate name="localhost" storeLocation="LocalMachine" storeName="My" />
-    </Certificates>
-    <Contents>
-      <Content destination=".\">
-        <SourceDirectory path="rcf/Debug/HeuristicLab.Services.Hive.WebRoleContent\" />
-      </Content>
-    </Contents>
-  </WebRole>
   <WebRole name="HeuristicLab.Services.Optimization.Web" vmsize="Small">
     <Sites>
@@ -62,3 +34,43 @@
     </ConfigurationSettings>
   </WebRole>
+  <WorkerRole name="HeuristicLab.Services.Optimization.Scaler" vmsize="Small">
+    <Runtime executionContext="elevated" />
+    <Imports>
+      <Import moduleName="Diagnostics" />
+      <Import moduleName="RemoteAccess" />
+      <Import moduleName="RemoteForwarder" />
+    </Imports>
+    <ConfigurationSettings>
+      <Setting name="StorageConnectionString" />
+      <Setting name="TraceTable" />
+      <Setting name="TraceTableEnabled" />
+    </ConfigurationSettings>
+    <Certificates>
+      <Certificate name="Azure Service Management" storeLocation="CurrentUser" storeName="My" />
+    </Certificates>
+  </WorkerRole>
+  <WebRole name="HeuristicLab.Services.Hive.WebRole" vmsize="Small">
+    <Sites>
+      <Site name="Web">
+        <Bindings>
+          <Binding name="Endpoint1" endpointName="Endpoint1" />
+        </Bindings>
+      </Site>
+    </Sites>
+    <Endpoints>
+      <InputEndpoint name="Endpoint1" protocol="http" port="80" />
+    </Endpoints>
+    <Imports>
+      <Import moduleName="Diagnostics" />
+      <Import moduleName="RemoteAccess" />
+    </Imports>
+    <Certificates>
+      <Certificate name="localhost" storeLocation="LocalMachine" storeName="My" />
+    </Certificates>
+    <Contents>
+      <Content destination=".\">
+        <SourceDirectory path="rcf/Debug/HeuristicLab.Services.Hive.WebRoleContent\" />
+      </Content>
+    </Contents>
+  </WebRole>
 </ServiceDefinition>
Index: branches/OaaS/HeuristicLab.Services.Optimization/ServiceDefinition.csdef
===================================================================
--- branches/OaaS/HeuristicLab.Services.Optimization/ServiceDefinition.csdef	(revision 9371)
+++ branches/OaaS/HeuristicLab.Services.Optimization/ServiceDefinition.csdef	(revision 9508)
@@ -1,27 +1,4 @@
 ﻿<?xml version="1.0" encoding="utf-8"?>
 <ServiceDefinition name="HeuristicLab.Services.Optimization" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-05.1.7">
-  <WebRole name="HeuristicLab.Services.Hive.WebRole" vmsize="Small">
-    <Sites>
-      <Site name="Web">
-        <Bindings>
-          <Binding name="HttpIn" endpointName="HttpIn" />
-        </Bindings>
-      </Site>
-    </Sites>
-    <Endpoints>
-      <InputEndpoint name="HttpIn" protocol="http" port="80" localPort="80" />
-    </Endpoints>
-    <Imports>
-      <Import moduleName="Diagnostics" />
-      <Import moduleName="RemoteAccess" />
-      <Import moduleName="RemoteForwarder" />
-    </Imports>
-    <LocalResources>
-      <LocalStorage name="HeuristicLab.Services.Hive.WebRole.svclog" sizeInMB="1000" cleanOnRoleRecycle="false" />
-    </LocalResources>
-    <Certificates>
-      <Certificate name="localhost" storeLocation="LocalMachine" storeName="My" />
-    </Certificates>
-  </WebRole>
   <WebRole name="HeuristicLab.Services.Optimization.Web" vmsize="Small">
     <Sites>
@@ -48,3 +25,38 @@
     </ConfigurationSettings>
   </WebRole>
+  <WorkerRole name="HeuristicLab.Services.Optimization.Scaler" vmsize="Small">
+    <Runtime executionContext="elevated" />
+    <Imports>
+      <Import moduleName="Diagnostics" />
+      <Import moduleName="RemoteAccess" />
+      <Import moduleName="RemoteForwarder" />
+    </Imports>
+    <ConfigurationSettings>
+      <Setting name="StorageConnectionString" />
+      <Setting name="TraceTable" />
+      <Setting name="TraceTableEnabled" />
+    </ConfigurationSettings>
+    <Certificates>
+      <Certificate name="Azure Service Management" storeLocation="CurrentUser" storeName="My" />
+    </Certificates>
+  </WorkerRole>
+  <WebRole name="HeuristicLab.Services.Hive.WebRole" vmsize="Small">
+    <Sites>
+      <Site name="Web">
+        <Bindings>
+          <Binding name="Endpoint1" endpointName="Endpoint1" />
+        </Bindings>
+      </Site>
+    </Sites>
+    <Endpoints>
+      <InputEndpoint name="Endpoint1" protocol="http" port="80" />
+    </Endpoints>
+    <Imports>
+      <Import moduleName="Diagnostics" />
+      <Import moduleName="RemoteAccess" />
+    </Imports>
+    <Certificates>
+      <Certificate name="localhost" storeLocation="LocalMachine" storeName="My" />
+    </Certificates>
+  </WebRole>
 </ServiceDefinition>
