Understanding Azure Resource Management for Red5 Pro Autoscaling

NOTE:: This section assumes that you have a basic understanding of Azure resource management. Here we will be extending on it to describe how Red5 Pro autoscaling uses the Azure resource management for its operations.

  • Resources are managed inside an autoscaling-specific resource group. You should always create separate resource groups for separate autoscaling resources. Each group will contains resources specific to a Stream Manager setup.
  • While individual resources are region specific, Azure resource groups are not, so we can manage cross-region resources in one group which may have been created in any region.
  • To manage cross-region resources we use special naming schemes for resources as given in the table below.
  • Select a short resource name prefix (3-4 characters recommended). A resource name prefix is a short string that is used to resolve resources. Any resource manually created or generated by Stream Manager will have this prefix in its name to help identify the resource. The resource name prefix works as a namespacing parameter, thereby improving the unique representation of a resource for a Stream Manager setup.

Note:

You can use the same resource group for multiple autoscaling setups using a different resource name prefix for each.

Sample Red5 Pro Autoscaling Resource Group

Resource Naming Convention

Resource Type Naming Pattern Example Comment
Resource Name Prefix Simple and short alphabetic string used for namespacing resources within the same group. autoscaling Referenced as <prefix> in this document
Resource Group Name Simple and short alphabetic string red5proautoscaling
Virtual Network <prefix>-<region>-vnet autoscaling-eastus-vnet
Network Security Group <prefix>-<region>-nsg autoscaling-eastus-nsg
Image <imagename>-<serverversion>-<region>-img autoscaling-4.4.0-eastus-img Image name does not need to have resource name prefix. The image name should be specified in the launch configuration file without the region and img suffix. This will automatically be attached by controller when resolving resource.
Storage Account sm<region>stg Storage is not managed by Stream Manager. But the specified naming convention is recommended as a good practice.
VM Name <RandomString>-<region>-vm xbcgdtsf-eastus-vm Autogenerated by controller. Note that each VM is placed in a VM resource group.
VM Resource Group Name <prefix>-<VMName> autoscaling-xbcgdtsf-eastus-vm Autogenerated by controller.
Network Interface <VMName>-<region>-nic Autogenerated by controller.
Public IP <VMName>-<region>-nic Autogenerated by controller.
Stream Manager Static IP <name>-<region>-pip streammanager-eastus-pip
Stream Manager VM Name <name>-<region>-vm streammanager-eastus-vm It is recommended to create a new resource group and then create the VM inside that. This helps with resource clean up if you delete the project.
Stream Manager Resource Group <prefix>-<name>-<region>-vm autoscaling-streammanager-eastus-vm Optional but recommended as a good practice.
MySQL DB Server Name <prefix>-<region>-db autoscaling-eastus-db This will be the name of the database server.
  • The controller generates unique resource group names for each VM created using the resource prefix and then launches the VM inside it. That way when we need to delete the VM we can delete the group and all subsidiary resources will be deleted properly.
  • Each region may or may not support a VM size type. It is the responsibility of the admin to ensure that a region with supported size type is used. (vm size type is the instanceType in the launch configuration file). Alternate allowed VM size types can be specified as fallback via the launch configuration file. (See Azure launch configuration sample).
  • If a Launch operation or a delete operation fails, a garbage cleaning mechanism will automatically remove the VM resource group.
  • VM resource groups are tagged with the nodename prefix(from red5-web.properties) to help identify which Stream Manager they belong to for internal usage. This is known as the identity tag. This, along with other tags, is also stored on the VM itself.

Instance Tags

Regional Resources

The Azure Stream Manager controller is designed to work on multiple regions across the platform. To achieve this the controller must be able to resolve resources across regions.

Each resource on the Azure platform, other than the ResourceGroup is strictly bound to a region. A Resource Group can be associated with resources across regions, thereby making it like a big bucket to hold all our autoscaling resources. Following the recommended naming convention mentioned in this document, resources should be duplicated in each region to be targeted.

Create the following resources in each region that you wish to target with autoscaling:

  • Virtual Network
  • Network Security Group
  • Image

Availability zones

In terms of autoscaling on Azure, Red5 Pro Stream Manager does not currently support Azure's native zones.

Zones

At this time, the default subnet of the virtual network is assumed by the Stream Manager to be the only availability zone for that region. The Azure controller will dynamically generate the zone name as: <region>-a for the default subnet. Thus when setting up an autoscaling virtual network in any region, you must ensure that the network has only one default subnet.

Authentication components

Every Azure account comes with a default Azure directory (AD). An AD represents an organization which houses users, manages authentication and other access-related services. The AD is called the Tenant in Azure authentication components terminology. This section of the document is about working on the default AD of your Azure account. You can always create a new Azure directory if you need to. You can get more information on Active Directory here.

A subscription is the account usage & billing component. It will keep track of your service usage and bill for them accordingly.

An application must be registered in the AD to be able to access services using Azure API. The application is regarded as a Client and the client ID is a required part of the Azure authentication components. When we register an application, we also get a client secret. Both the client ID and secret are used for AD authentication.

Thus these are the components of authentication that we need to gather for Stream Manager:

Client-Id : The application ID of your app after it is registered in the AD Key : A secret access key for your application, generated from the AD after app registration Tenant-ID : The active directory ID which can be obtained from the active directory info. Subscription-ID : The ID of the subscription account that the application uses for accessing resources.