Red5 Pro Auto Scaling Checklist

Red5 Pro LICENSE.KEY:  _ _ _ _ - _ _ _ _ -_ _ _ _ -_ _ _ _ 

Stream Manager Application Registration:
Application ID (az.clientId)	
Application Key Secret	(az.clientKey)
Active Directory ID (az.tenantId)
Subscription ID	(az.subscriptionId)
Region

SSH Key Name
SSH Password (az.vmPassword)

Resource Naming Convention Suggestions:
resource name prefix 	az.resourceNamePrefix (e.g. autoscaling)
Master Resource Group Name	 az.resourceGroupName (e.g. red5proautoscaling)
Resource Group Region	az.resourceGroupRegion
Stream Manager Static IP <name>-<region>-pip (e.g. streammanager-eastus-pip)	
Stream Manager Static IP address	
Virtual Network <prefix>-<region>-vnet (e.g. autoscaling-eastus-vnet)
Network Security Group <prefix>-<region>-nsg (e.g. autoscaling-eastus-nsg)
Stream Manager Network Security Group <prefix>-<streammanager>-<region>-nsg (e.g. autoscaling-streammanager-eastus-nsg)

Database:
MySQL DB Server Name	(config.dbHost) <prefix>-<region>-db (e.g. autoscaling-eastus-db)
MySQL Admin Login Name	(config.dbUser)
DB Password	(config.dbPass)	

NODE configuration:
cluster password: 

Image <imagename>-<serverversion><region>-img (e.g. autoscaling-4.4.0-eastus-img)
NOTE: for the launchconfig file, use the image name MINUS the region and img extensions

az.vmUsername=(example: ubuntu)
az.vmPassword=
The az.vmPassword is the Dynamic virtual machine password to be created for ssh access. Password must be between 6-72 characters long and must satisfy at least 3 of password complexity requirements from the following:
  1. Contains an uppercase character
  2. Contains a lowercase character
  3. Contains a numeric digit
  4. Contains a special character
  5. Control characters are not allowed

red5-web-properties file values:
instancecontroller.replaceDeadClusters= (true or false): 
instancecontroller.deleteDeadGroupNodesOnCleanUp= (true or false): 
rest.administratorToken (IMPORTANT: replace default of xyz123): 

Launch Configuration files’ values (for each policy):
- image:
- instance type:
- connectionCapacity: 

Scaling Policy files’ values (for each policy):
- Minimum Number of Edges per cluster (minLimit): 
- Maximum Number of Edges per cluster (maxLimit):

*	*	*	*	*
API BASICS TO GET YOU STARTED:

1. Verify Stream Manager is Using the Correct Controller

GET call:  

https://<streammanagerurl>/streammanager/api/4.0/admin/debug/cloudcontroller?accessToken=<rest.administratorToken>
should return: Microsoft Azure

2. Create a New Scale Policy
POST  call:

https://<streammanagerurl>/streammanager/api/4.0/admin/configurations/scalepolicy?accessToken=<rest.administratorToken>

json data (example):

{
      "policy": {
          "name": "allnodetypes-v3",
          "description": "This is a sample 3rd generation scale policy file with all four node types",
          "type": "com.red5pro.services.autoscaling.model.ScalePolicyMaster",
          "version": "0.0.3",
          "targets": {
              "region": [
                  {
                      "name": "default",
                      "target": [
                          {
                              "role": "edge",
                              "estimatedWarmUpTime": 150000,
                              "maxLimit": 20,
                              "scaleAdjustment": 1,
                              "coolDownPeriod": 180000,
                              "minLimit": 1
                          },
                          {
                              "role": "origin",
                              "estimatedWarmUpTime": 150000,
                              "maxLimit": 10,
                              "scaleAdjustment": 1,
                              "coolDownPeriod": 180000,
                              "minLimit": 1
                          },
                                                    {
                              "role": "relay",
                              "estimatedWarmUpTime": 150000,
                              "maxLimit": 10,
                              "scaleAdjustment": 1,
                              "coolDownPeriod": 180000,
                              "minLimit": 1
                          },
                                                    {
                              "role": "transcoder",
                              "estimatedWarmUpTime": 150000,
                              "maxLimit": 10,
                              "scaleAdjustment": 1,
                              "coolDownPeriod": 180000,
                              "minLimit": 1
                          }
                      ]
                  }
                  
                      ]
                  }
      }
  }

3. Create a New Launch Policy - note: node connection capacity should be based on server performance metrics
POST  call:

https://<streammanagerurl>/streammanager/api/4.0/admin/configurations/launchconfig?accessToken=<rest.administratorToken>

json data (example):

    {
    "launchconfig": {
      "name": "allnodetypes",
      "description": "This is a sample azure launch configuration with all four node types",
      "image": "<imagename>",
      "version": “0.0.2”,

      "targets": {
          "target": [
        {
          "role": "origin",
          "instanceType": "Standard_DS2”,
          "connectionCapacity": "30"
        },
        {
          "role": "edge",
          "instanceType": "Standard_DS2”,
          "connectionCapacity": "300"
        },
        {
          "role": "relay",
          "instanceType": "Standard_DS2”,
          "connectionCapacity": "300"
        },
        {
          "role": "transcoder",
          "instanceType": "Standard_DS2”,
          "connectionCapacity": “15"
        }
         ]
        },

        "properties": {
          "property": [
            {
              "name": "property-name",
              "value": "property-value"
            }
          ]
        },
        "metadata": {
          "meta": [
            {
              "key": "meta-name",
              "value": "meta-value"
            }
          ]
        }
      }}

4. Create a New Node Group POST call:
https://<streammanagerurl>/streammanager/api/4.0/admin/nodegroup?accessToken=<rest.administratorToken>
json data (example):

{
"regions": [
 “eastus”
 ],
 "launchConfig": "<launch-policy>",
 "scalePolicy": "<scale-policy>"
}

Note the cluster “name” that is returned by the above call. It will be used to create a new Origin server.

5. Launch New Origin
POST call:

https://<streammanagerurl>/streammanager/api/4.0/admin/nodegroup/<cluster-name>/node/origin?accessToken=<rest.administratorToken>

6. List nodes in your new nodegroup
GET call:

https://<streammanagerurl>/streammanager/api/4.0/admin/nodegroup/<cluster-name>/node?accessToken=<rest.administratorToken>