Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scale Windows Azure roles programmatically

Tags:

azure

I am looking for some code that will scale a role to a given amount of instances given the roleID I want to scale. I am looking for someone to implement this method.

Private Shared Sub DoScaleOperation(RoleID As String, InstanceCount As Integer)
    'TODO:
    'Check if the current number of instances in the role RoleID matches InstanctCount
    'and if the numbers don't match then scale down or scale up as appropriate.
End Sub

This method should work for both the dev environment and the cloud environment. Does anyone know how to do this?

Also out curiorsity I an wondering what the names of the Role Instances will be on a scale up and what will be the names of the instances removed during a scale down. I am hoping the names of the instances will be something like RoleID_(0 to InstanceCount - 1).

like image 891
RyanFishman Avatar asked Jan 17 '23 23:01

RyanFishman


2 Answers

There is an API that you want to call in order to programmatically change instance count in Azure: http://msdn.microsoft.com/en-us/library/windowsazure/ee460809.aspx This API does not work in local dev environment. You will need to provide a management certificate with your call. You can also use Azure cmdlets to change instance counts.

like image 179
Igorek Avatar answered Jan 21 '23 13:01

Igorek


I assume you have looked at WASABi, the Autoscaling Application Block?

What were your conclusions for the P&P product in your scenario?

like image 33
noopman Avatar answered Jan 21 '23 14:01

noopman