Use OpenStack Senlin, Heat templates to enable autoscaling

0
26

The OpenStack platform constantly evolves, and as a result, some processes that worked in the past are no longer…

“;
}
});

/**
* remove unnecessary class from ul
*/
$(“#inlineregform”).find( “ul” ).removeClass(“default-list”);

/**
* Replace “errorMessageInput” class with “sign-up-error-msg” class
*/
function renameErrorMsgClass() {
$(“.errorMessageInput”).each(function() {
if ($(this).hasClass(“hidden”)) {
$(this).removeClass(“errorMessageInput hidden”).addClass(“sign-up-error-msg hidden”);
} else {
$(this).removeClass(“errorMessageInput”).addClass(“sign-up-error-msg”);
}
});
}

/**
* when validation function is called, replace “errorMessageInput” with “sign-up-error-msg”
* before return
*/
function validateThis(v, form) {
var validateReturn = urValidation.validate(v, form);
renameErrorMsgClass();
return validateReturn;
}

/**
* DoC pop-up window js – included in moScripts.js which is not included in responsive page
*/
$(“#inlineRegistration”).on(“click”,”a.consentWindow”, function(e) {
window.open(this.href, “Consent”, “width=500,height=600,scrollbars=1”);
e.preventDefault();
});

valid — which is now the case for autoscaling. Before, users set up OpenStack autoscaling with the Ceilometer service and Heat templates. Now, users need a new tool.

OpenStack Senlin is a service that lets admins create and manage clusters of related cloud resources to simplify orchestration. It integrates with Heat and Ceilometer to perform autoscaling tasks, and these tools work together to ensure that a cluster scales in and out based on workload demands.

When you use OpenStack Senlin with Heat, you use specific Heat cluster resources. Use YAML code to define the cluster, as well your scale-in and scale-out policies. The core code of such a configuration might look as follows, where Listing 1 defines the cluster and Listing 2 defines the scale-in and scale-out policies. Both sample configurations are from OpenStack documentation.

Listing 1: Define the Senlin cluster in Heat

cluster:

  type: OS::Senlin::Cluster

  properties:

    desired_capacity: 2

    min_size: 2

    profile: {get_resource: profile}

Listing 2: Define the scale-in and scale-out policies

scale_in_policy:

  type: OS::Senlin::Policy

  properties:

    type: senlin.policy.scaling-1.0

    bindings:

      – cluster: {get_resource: cluster}

    properties:

      event: CLUSTER_SCALE_IN

      adjustment:

        type: CHANGE_IN_CAPACITY

        number: 1

 

scale_out_policy:

  type: OS::Senlin::Policy

  properties:

    type: senlin.policy.scaling-1.0

    bindings:

      – cluster: {get_resource: cluster}

    properties:

      event: CLUSTER_SCALE_OUT

      adjustment:

        type: CHANGE_IN_CAPACITY

        number: 1

While the resources in Listing 1 and 2 define the basis of the OpenStack Senlin cluster, you need to do more to make it fully operational. A load-balancer policy is a mandatory part of the configuration, and the OpenStack Neutron service will create one automatically. Based on the load-balancer policy, you need to define resources to manage the scale-in and scale-out process, which completes the basic framework you define in Heat.

The last required element is the alarm trigger. You must include Ceilometer alarms in the Heat template so that the alarm action defines which Heat trigger to pull — either the receiver_scale_in or the receiver_scale_out, based on what needs to be done.

Next Steps

Why would an enterprise choose OpenStack?

Simplify OpenStack management with these five tips

Review OpenStack Kolla for container deployments




Source link

LEAVE A REPLY