Red5 Pro Auto Scaling Checklist

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

cloud.vsphere_user -- (vSphere user name)
cloud.vsphere_password -- (vSphere user password)
cloud.vsphere_server -- (vSphere (vCenter) server IP address or domain name)
cloud.vsphere_datacenter -- (vSphere datacenter name)
cloud.vsphere_datastore -- (vSphere datastore name)
cloud.vsphere_resource_pool- (vSphere resource pool)
cloud.vsphere_network -- (vSphere network name)
cloud.vsphere_domain -- (Domain name)

Database User Account (config.dbUser): 	
Database User Password (config.dbPass): 
Database private IP Address (config.dbHost): for single SM, Terraform, DB instance this will be localhost

TERRAFORM SERVICE:

Server IP address (terra.host): for single SM, Terraform, DB instance this will be127.0.0.1
server.port=8083
api.accessToken (value used for terra.token in Stream Manager red5-web.properties)=	

STREAM MANAGER:
rest.administratorToken:
red5-web-properties file values:	

*	*	*	*	*
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: Terraform-Cloud-Platform

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 launch configuration with four node types",
      "image": "<image name>",
      "version": “0.0.2”,

      "targets": {
          "target": [
        {
          "role": "origin",
          "instanceType": “2cpu_4mem",
          "connectionCapacity": "30"
        },
        {
          "role": "edge",
          "instanceType": "2cpu_4mem",
          "connectionCapacity": "300"
        },
        {
          "role": "relay",
          "instanceType": "2cpu_4mem",
          "connectionCapacity": "300"
        },
        {
          "role": "transcoder",
          "instanceType": “4cpu_8mem”,
          "connectionCapacity": “30”
        }
         ]
        },

        "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": [
   "private"
 ],
 "launchConfig": "vsphere-launch-01",
 "scalePolicy": "vsphere-scale-01"
}
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>