• No results found

Configuring Load Balancing as a Service

This document describes how to configure Load Balancing as a Service (LBaaS). It includes the following sections:

“Overview of LBaaS” on page 59

“Prerequisites for Using LBaaS” on page 63

“Creating and Starting an LBaaS Service” on page 66 “LBaaS REST API Reference” on page 73

Overview of LBaaS

LBaaS is a service template provided by the Services Controller (SSC) REST API. LBaaS enables you to create and configure generic load-balancing services with multiple front-end IP addresses shared in a high- availability cluster of automatically deployed Traffic Manager service instances and load-balancing across a group of back-end nodes.

A traffic manager instance that is deployed for a service (such as LBaaS) is a service instance. When an LBaaS service is created and activated, a defined number of service instances are created.

The Services Controller performs health monitoring of service instances. It automatically ejects failed instances from the service cluster, and where resources allow, deploys additional instances in their place. The deployment strength of a service is a percentage measure of the number of deployed instances against the required number of instances. When a service instance fails, this failure is reflected by a reduction in the deployment strength of its service. Additionally, an email is sent, and potentially an administrator task is raised.

Configuring Load Balancing as a Service Overview of LBaaS

You can configure the following LBaaS elements.

Figure 5-1. LBaaS Configurable Elements

LBaaS provides Traffic Manager instance co-existence such that multiple services can place instances on the same hosts.

Stingray Services Controller User’s Guide 61

Overview of LBaaS Configuring Load Balancing as a Service

Enterprise Licensing for LBaaS

Enterprise licensing enables you to prepay for blocks of available bandwidth for a Traffic Manager SKU (Stock Keeping Unit) and for a specified time period. The licensed bandwidth for a SKU is calculated as the total bandwidth of all the valid installed Bandwidth Packs for that SKU.

With Enterprise Licensing, the Services Controller rejects REST API requests that result in a Services Controller state where instances and services using a particular SKU consume more bandwidth than has been licensed for that SKU.

For example, the following requests might be rejected due to insufficient bandwidth: Increasing the value of the bandwidth property in an instance or service resource.

Deploying an additional instance or increasing the requested number of instances to be deployed for a service.

Altering the stm_feature_pack property value of an instance or service to a feature pack based on a different SKU.

Deleting, deactivating, or upgrading an existing Bandwidth Pack.

The total bandwidth that a service consumes is calculated as the product of the values:

num_instances x bandwidth

The bandwidth used by this service is reserved from the Bandwidth Pack for the SKU that is linked by the

stm_feature_pack property. As with Services Controller nonservice instances, you cannot make changes to these property values that exceed your licensed bandwidth.

LBaaS Service Life Cycle

Each service has a status property that identifies and modifies the service in terms of where it is in the service life cycle. Some of these statuses are stable states, whereas others are transient states that indicate the service is undergoing changes. The possible values of the status property are listed below.

Status Type Description

Creating Transient The service is being created.

Inactive Stable The service has just been created but has not been activated yet, thus it has no service instances. Alternatively, the service has been stopped. Starting Transient The service is in the process of starting by deploying instances into a

service cluster before they are configured.

Following a successful start, the service transitions to the Active state.

Active Stable The service is operational.

Stopping Transient The service is in the process of stopping, with all the instances in the service cluster being deactivated and deleted.

Following a successful stop, the service transitions to the Inactive state.

Deleting Transient The service is being permanently decommissioned and all instances in the service cluster are being deleted. A successful deletion results in the service transitioning to the Deleted state.

Deleted Stable The service and its service cluster instances have been permanently deleted.

Configuring Load Balancing as a Service Overview of LBaaS

For transitions that are directly under your control (that is, Inactive > Active, Active > Inactive, and Inactive > Deleted), you make a REST API PUT request to the service resource, by setting the status property to the target status. The service does not move directly to the target status, but goes into the transitional state, such as Starting, Stopping, Deleting, and Changing.

Service Failover Mechanism

In the Services Controller, a service is an automatically deployed and configured cluster of Traffic Manager instances (that is, a service cluster).

When an LBaaS service is created and activated, the Services Controller deploys and maintains a configured service cluster with a given number of instances. The Services Controller service manager relies on the monitoring feature of the Services Controller to periodically check the health of each service instance to make sure it is still accessible to the Services Controller. If a service instance remains inaccessible for a period of time longer than the number of seconds specified in the instance_health_fail_trigger service property, then a failover is triggered for the service.

With failover, the Services Controller automatically performs the following actions for each failed instance:

1. Stops the instance.

2. Removes the instance from the service cluster.

3. Deletes the instance.

If any of these actions are unsuccessful, the instance is ejected (that is, disassociated from the rest of the service cluster), an administrator task is automatically generated, and an email notification of the outstanding task is sent.

If there is available capacity on one of the service hosts, a new instance is automatically deployed and added to the service cluster.

If there is no available capacity on any service host, the service continues to run with fewer instances in the service cluster: the service resource property deployment_strength is automatically adjusted downwards to represent this reduction in the size of the service cluster.

As with instance failures detected by Services Controller monitoring for nonservice instances, the Services Controller sends an email notification of the detected failure. If the Services Controller is unsuccessful in stopping, removing, and deleting the instance, an administrator task is automatically generated and an email notification of the outstanding task is sent. In this case, you must manually resolve the problem. The

Changing Transient The service is currently processing a configuration change:

• An amendment to the number of instances required for the service cluster has occurred.

• A change to the configuration of the ELBaaS service itself.

No further configuration changes are accepted until this configuration change has been completely processed.

A successful change results in the service transitioning to the Active state. This state can also arise as the result of a failover following an instance failure.

Config Failed Stable A failure state has been encountered where the configuration objects required to configure the LBaaS service could not be applied to the Traffic Manager cluster.

Stingray Services Controller User’s Guide 63

Prerequisites for Using LBaaS Configuring Load Balancing as a Service

Configuration of a Service Failover Mechanism

The Services Controller automatically monitors the health of service cluster instances, using any Services Controller in a Services Controller cluster that has monitoring enabled. This feature is enabled by default, but is deactivated on a given Services Controller using the monitoring mode settings in the REST API

manager resource.

Monitoring in Services Controller has the following configurable values:

Monitor Interval - The number of seconds between each individual health checks for a given resource.

Failure Period - The number of seconds that must elapse during which no successful health checks are made before the monitored resource is considered failed.

Services have instance_health_monitor_interval and instance_health_failure_trigger properties corresponding to these two configurable values, so that monitoring for instances in a service cluster are configured on a per-service basis. If you do not specify values for these service resource properties, the default values from the /api/tmcm/1.4/settings/monitoring resource are used for all instances in the service cluster.

Prerequisites for Using LBaaS

Before creating an LBaaS service, you must set up the Services Controller with these supporting resources:

Feature Pack - A resource based on one of the standard preconfigured Traffic Manager SKUs,

determining the features available for instances that use that feature pack. Currently, only the STM-400 SKU supports LBaaS.

FLA License - Each service instance must have an appropriate Traffic Manager Flexible Licensing Architecture (FLA) license installed to ensure that it are licensed by Services Controller. The FLA license used by service instances is the same as those used by nonservice instances.

Stingray Traffic Manager (STM) Version - A resource that represents the Services Controller tarball from which service instances are installed. The Services Controller validates any Traffic Manager version that you select for an LBaaS service to ensure it is an acceptable version.

Instance Host - A resource representing a host on which service instances are deployed. In most respects, an instance host used for service instances is the same as the one used for nonservice instances, but there are some differences. Instance hosts can either be used exclusively for nonservice instances or exclusively for service instances, but not for both. Hosts that are intended for use

exclusively for service instances are referred to as service hosts. When allocated, service host resources must be set up with the following additional properties:

– usage_info - Specify servicemanager. Indicates the host is earmarked for service instances only, and fails if the host has normal instances already.

– size - Specify an integer for the number of LBaaS instances that can fit on the source host. The Services Controller will not deploy more instances beyond this value. For LBaaS, each deployed service instance counts as having a volume of 1. A service host with a size of 5 can accommodate up to five LBaaS instances. With LBaaS, size is a required property for a host resource.

– cpu_cores - Specify the set of cores available on the host (in taskset format). The Services Controller uses this property to balance CPU affinity of Traffic Manager instance processes belonging to multiple services. If you do not set this property, the Linux kernel determines process scheduling that results in reduced achievable densities.

Configuring Load Balancing as a Service Prerequisites for Using LBaaS

– retained_info_dir - Specify a directory to store support information about instances that are culled. This directory will contain STM TSRs, if it is possible to generate them, or a copy of the STM logs if it was not possible to create a TSR.

Typically, a Services Controller requires multiple service hosts to manage LBaaS services.

Prerequisite Examples

For these examples, you deploy one or more LBaaS services, using:

a Services Controller installation running on host myssccontroller.mydomain.com, with its REST API running on port 8000.

an STM-400 SKU based feature pack.

instances based on Traffic Manager v9.7 or later.

Riverbed-generated Traffic Manager FLA license fla-ssl.

a group of three service hosts, myhost-01.mydomain.com, myhost-02.mydomain.com, and myhost-

03.mydomain.com, to host your service instances. This example assumes that passwordless SSH between myssccontroller.mydomain.com and these three service hosts has been set up, and that the working location directories and installation root directories have been set up in advance (as would be the case with any other instance host).

Creating Feature Packs

This procedure is the same as any feature_pack resource. Currently, only the STM-400 SKU supports LBaaS.

Creating an FLA License Resource

This procedure is the same as any Traffic Manager FLA license resource. It creates an FLA license resource that is used for normal or service instances.

To create an FLA license Resource 1. Perform a PUT request:

https://myssccontroller.mydomain.com:8000/api/tmcm/1.4/license/fla-ssl

Include the following JSON structure as the body of your request:

{

"info" : "This is the resource for the fla-ssl license" }

Stingray Services Controller User’s Guide 65

Prerequisites for Using LBaaS Configuring Load Balancing as a Service

Creating a Traffic Manager Version

This procedure is the same as any Traffic Manager version resource. It creates a Traffic Manager version resource that is used for normal or service instances.

To create a Traffic Manager version resource 1. Perform a PUT request:

https://myssccontroller.mydomain.com:8000/api/tmcm/1.4/version/ZeusTM_97_Linux-x86_64

Include the following JSON structure as the body of your request:

{

"version_filename":"ZeusTM_97_Linux-x86_64.tgz", "info":"Version 9.7

}

Creating Instance Hosts

This procedure is similar to any instance host resource, but it creates a resource that is dedicated to hosting only service instances.

To create instance hosts

1. To create the first instance host, perform a PUT request:

https://myssccontroller.mydomain.com:8000/api/tmcm/1.4/host/myhost-01.mydomain.com

Include the following JSON structure as the body of your request:

{ "cpu_cores":"0-3", "work_location":"/space/workspace", "install_root":"/space/install", "username":"root", "usage_info":"servicemanager", "retained_info_dir":"/space/retain", "size":5 }

2. To create the second instance host, perform a PUT request:

https://myssccontroller.mydomain.com:8000/api/tmcm/1.4/host/myhost-02.mydomain.com

Include the following JSON structure as the body of your request:

{ "cpu_cores":"0-3", "work_location":"/space/workspace", "install_root":"/space/install", "username":"root", "usage_info":"servicemanager", "retained_info_dir":"/space/retain", "size":5 }

Configuring Load Balancing as a Service Creating and Starting an LBaaS Service

3. To create the third instance host, perform a PUT request:

https://myssccontroller.mydomain.com:8000/api/tmcm/1.4/host/myhost-03.mydomain.com

Include the following JSON structure as the body of your request:

{ cpu_cores":"0-3", "work_location":"/space/workspace", "install_root":"/space/install", "username":"root", "usage_info":"servicemanager", "retained_info_dir":"/space/retain", "size":10 }

The setting of usage_info to servicemanager indicates that these hosts are intended for exclusive use for service deployments. The size property indicates how many LBaaS service instances are

accommodated on each host. In these examples, myhost-03 is twice as large as myhost-01 and myhost-

02.

Creating and Starting an LBaaS Service

To create and modify LBaaS services, you interact only with the Services Controller REST API. The Services Controller deploys and configures a Traffic Manager cluster based on your specifications without you needing to worry about the details of the Traffic Manager configuration.

Configuration Options for an LBaaS Service

To create an LBaaS service, you must define your requirements for the service through the following set of configurable values:

Number of Traffic Manager instances to deploy into a service cluster Allocated maximum bandwidth per Traffic Manager instance Traffic Manager feature pack

Traffic Manager version

Front-end IP addresses and ports Back-end IP addresses and ports

The protocol to be balanced (HTTP, HTTPS, TCP, SSL)

Load-balancing algorithm to use (such as, random, round robin, or perceptive, and so forth)

Secure Socket Layer (SSL) off-load and associated certificate/key pairs (this functionality is optional) Back-end node health monitoring (this functionality is optional)

Session persistence options (this functionality is optional)

Note: If you omit the Traffic Manager version (that is, the stm_version property) from the JSON structure, the version is automatically selected by the Services Controller. The latest version of all the available version resources is selected. If you omit a feature pack, a feature pack that uses a SKU that satisfies all of the licensing requirements of the service (as defined by the service configuration) and with maximum available bandwidth is chosen.

Stingray Services Controller User’s Guide 67

Creating and Starting an LBaaS Service Configuring Load Balancing as a Service

Creating an LBaaS Service

To create an LBaaS service, perform this task.

To create an LBaaS service

To create the service, perform a PUT request:

https://myssccontroller.mydomain.com:8000/api/tmsm/1.0/service/myLBaaS1

Include the following JSON structure as the body of your request:

{ "service_type":"LBaaS", "status":"Inactive", "stm_feature_pack":"STM400FP", "num_instances":1, "license_name":"fla-ssl", "instance_bandwidth":1000, "protocol":"HTTP", "back_end_nodes":["XX.XX.XX.XX:80","XX.XX.XX.XX:80"], "front_end_port":80, "front_end_ips":["YY.YY.YY.YY","YY.YY.YY.YY","YY.YY.YY.YY","YY.YY.YY.YY","YY.YY.YY.YY"] }

The following table summarizes the individual properties in this service resource.

Property Description

"service_type":"LBaaS" Specifies the type of service to create based on a template. The template determines the other properties that must be provided when creating the service resource. You might require different templates that will have different requirements.

For example, an LBaaS service requires you to specify the protocol to be load balanced. A different template for a more specific service type might not require this property.

Currently, only the LBaaS service template is available, which is used for both LBaaS and ELBaaS services.

"status":"Inactive" All services start in the Inactive state. For details, see “LBaaS Service Life Cycle” on page 61.

"stm_feature_pack":"STM400FP" Specifies the name of the feature pack to be applied to all instances in the service cluster. You can provide a value for this property when creating a service or allow the Services Controller to auto-select a suitable resource for the template in use. The Services Controller automatically determines an eligible feature pack if this property is omitted.

Riverbed recommends that you select the feature pack carefully as it can have cost or capacity implications, depending on the licensing model in use.

The Services Controller validates any feature pack that you specify for an LBaaS service to ensure that it provides sufficient features for the LBaaS service configuration.

"num_instances":1 Specifies the number of instances that the Services Controller can deploy and maintain in a healthy state in this service cluster.

When you initially create a service, no instances are deployed until the service is set to the Active state.

"license_name":"fla-ssl" Specifies the FLA license resource used for instances in this service cluster.

Configuring Load Balancing as a Service Creating and Starting an LBaaS Service

This example represents only a partial example of the properties you can set for the LBaaS service. For details, see “LBaaS REST API Reference” on page 73.

Starting and Stopping an LBaaS Service

You can start or stop an LBaaS service in a stable state by setting its status property.

To start the LBaaS service

Perform a PUT request:

https://myssccontroller.mydomain.com:8000/api/tmsm/1.0/service/myLBaaS1

Include the following JSON structure as the body of your request:

{

"status":"Active" }

The service switches to the transitional state Starting while it is deploying, clustering, and activating service instances, before finally switching to the state Active.

To stop the LBaaS service

Perform a PUT request:

https://myssccontroller.mydomain.com:8000/api/tmsm/1.0/service/myLBaaS1

Include the following JSON structure as the body of your request: {

Related documents