managing your MBrace.Azure clusters using F# interactive
This tutorial is from the MBrace Starter Kit. If using a locally simulated cluster you can ignore this tutorial.
In this tutorial you learn how you can use the MBrace.Azure.Management library to provision, monitor and scale an MBrace cluster using Visual Studio and F# Interactive. In order to proceed, you will need to sign up for an Azure subscription. Once signed up, download your publication settings file , which contains all authentication information necessary to manage your Azure subscription(s).
1: 2: |
|
Next, read your publish settings file by calling
1:
|
|
Yielding
1: 2: |
|
Now we can select our subscription of preference
1:
|
|
Select your prefered Azure region. This specifies the default Azure data center to be used for your deployments. Choosing a data center close to your location is recommended.
1:
|
|
Let's now instantiate our subscription manager instance
1:
|
|
You now provision an MBrace cluster as follows:
1:
|
|
This will provision a 4-worker MBrace cluster of Large (A3) instances Provisioning can take some time (approximately 5 minutes).
If you have already provisioned a cluster, reconnect to it using the following:
1: 2: 3: |
|
To reconnect to a cluster when you don't have access to a pubsettings file, use:
1: 2: 3: 4: |
|
You can track the status of the cluster as follows:
1:
|
|
Which yields
1: 2: 3: 4: 5: |
|
Finally, when deployment has completed we can easily obtain a cluster instance by typing
1:
|
|
and submit our first computation to the cluster
1:
|
|
Resizing the cluster is as simple as calling
1:
|
|
When done, it's always a good idea to dispose of our deployment
1:
|
|
Managing storage accounts
The subscription object can be used to manage Azure storage accounts
1:
|
|
or it can be used to retrieve already existing accounts
1:
|
|
which can be used in subsequent cluster deployments
1:
|
|
A list of all accounts can be viewed by writing
1:
|
|
Yielding
1: 2: 3: 4: 5: 6: |
|
Summary
In this tutorial, you've learned about MBrace.Azure.Management and how it can be used to deploy and manage MBrace clusters running on Azure.
Full name: 200-managing-azure-clusters.pubSettingsFile
module Config
--------------------
type Config =
private new : unit -> Config
static member DefaultLogger : ISystemLogger
static member DefaultLogger : ISystemLogger with set
Full name: MBrace.Azure.Management.Config
Full name: Config.pubSettingsFile
Full name: 200-managing-azure-clusters.pubSettings
{Subscriptions: Subscription [];}
member GetSubscriptionById : subscriptionId:string -> Subscription
member Item : index:int -> Subscription
member SubscriptionNames : string []
static member Parse : xml:string -> PublishSettings
static member ParseFile : publishSettingsFile:string -> PublishSettings
Full name: MBrace.Azure.Management.PublishSettings
Full name: 200-managing-azure-clusters.subscription
Full name: 200-managing-azure-clusters.myRegion
private new : regionId:string -> Region
override Equals : other:obj -> bool
override GetHashCode : unit -> int
override ToString : unit -> string
member Id : string
static member Define : regionId:string -> Region
static member Central_US : Region
static member East_Asia : Region
static member East_US : Region
static member East_US_2 : Region
...
Full name: MBrace.Azure.Management.Region
Full name: 200-managing-azure-clusters.manager
private new : client:SubscriptionClient * defaultRegion:Region * _logger:ISystemLogger * logLevel:LogLevel -> SubscriptionManager
member AttachLogger : l:ISystemLogger -> IDisposable
member DeleteDeployment : serviceName:string * ?deleteStorageAccount:bool * ?deleteServiceBusAccount:bool -> unit
member DeleteDeploymentAsync : serviceName:string * ?deleteStorageAccount:bool * ?deleteServiceBusAccount:bool -> Async<unit>
member GetDeployment : serviceName:string -> Deployment
member GetDeploymentAsync : serviceName:string -> Async<Deployment>
member GetDeployments : unit -> Deployment []
member GetDeploymentsAsync : unit -> Async<Deployment []>
member Provision : vmCount:int * ?serviceName:string * ?region:Region * ?vmSize:VMSize * ?mbraceVersion:string * ?storageAccount:string * ?serviceBusAccount:string * ?cloudServicePackage:string * ?clusterLabel:string * ?enableDiagnostics:bool * ?reuseAccounts:bool -> Deployment
member ProvisionAsync : vmCount:int * ?serviceName:string * ?region:Region * ?vmSize:VMSize * ?mbraceVersion:string * ?storageAccount:string * ?serviceBusAccount:string * ?cloudServicePackage:string * ?clusterLabel:string * ?enableDiagnostics:bool * ?reuseAccounts:bool -> Async<Deployment>
...
Full name: MBrace.Azure.Management.SubscriptionManager
Full name: 200-managing-azure-clusters.deployment
private new : vmId:string -> VMSize
override Equals : other:obj -> bool
override GetHashCode : unit -> int
override ToString : unit -> string
member Id : string
static member Define : vmId:string -> VMSize
static member A1 : VMSize
static member A10 : VMSize
static member A11 : VMSize
static member A2 : VMSize
...
Full name: MBrace.Azure.Management.VMSize
Full name: 200-managing-azure-clusters.cluster
inherit MBraceClient
private new : manager:ClusterManager * faultPolicy:FaultPolicy option -> AzureCluster
member AttachLocalWorker : ?workerId:string * ?workingDirectory:string * ?maxWorkItems:int * ?logFile:string * ?logLevel:LogLevel * ?quiet:bool * ?heartbeatInterval:TimeSpan * ?heartbeatThreshold:TimeSpan * ?background:bool -> unit
member AttachLocalWorkers : workerCount:int * ?maxWorkItems:int * ?logLevel:LogLevel * ?quiet:bool * ?heartbeatInterval:TimeSpan * ?heartbeatThreshold:TimeSpan * ?background:bool -> unit
member CullNonResponsiveWorkers : heartbeatThreshold:TimeSpan -> unit
member CullNonResponsiveWorkersAsync : heartbeatThreshold:TimeSpan -> Async<unit>
member KillAllLocalWorkers : unit -> unit
member KillLocalWorker : worker:IWorkerRef -> bool
member Reset : ?deleteQueues:bool * ?deleteRuntimeState:bool * ?deleteLogs:bool * ?deleteUserData:bool * ?deleteAssemblyData:bool * ?force:bool * ?reactivate:bool -> unit
member ResetAsync : ?deleteQueues:bool * ?deleteRuntimeState:bool * ?deleteLogs:bool * ?deleteUserData:bool * ?deleteAssemblyData:bool * ?force:bool * ?reactivate:bool -> Async<unit>
...
Full name: MBrace.Azure.AzureCluster
static member AzureCluster.Connect : config:Configuration * ?clientId:string * ?faultPolicy:MBrace.Core.FaultPolicy * ?logger:MBrace.Runtime.ISystemLogger * ?logLevel:LogLevel -> AzureCluster
static member AzureCluster.Connect : storageConnectionString:string * serviceBusConnectionString:string * ?clientId:string * ?faultPolicy:MBrace.Core.FaultPolicy * ?logger:MBrace.Runtime.ISystemLogger * ?logLevel:LogLevel -> AzureCluster
Full name: 200-managing-azure-clusters.newAccount
Full name: 200-managing-azure-clusters.existingAccount
Full name: 200-managing-azure-clusters.deployment'