Configure Rackspace Auto Scale Web Hooks with Rackspace Monitoring
Auto Scale uses webhooks to initiate scaling events. A webhook is an industry-standard protocol to send events between systems, and for Auto Scale, they are used to execute policies. A webhook consists of an HTTP callback triggered by some user-defined event, such as an alarm set through Rackspace Monitoring or another monitoring service. When that event occurs, the source site makes an HTTP request to the URI configured for the webhook.
Before you begin
Before you can configure the webhooks, you must create an Auto Scale group.
Create Auto Scale policies
- Log in the Cloud Control Panel.
- Click Servers > Auto Scale.
- Select an Auto Scale group from the list.
- Click Policies > Create Policy.
- Create two policies, one for scaling up and one for scaling down, by
specifying the following values:- Name: Specify a name to identify each policy.
- Scale Trigger: Select Webhook URL for both policies.
- Amount: Specify the number of servers you are removing or adding.
- Cooldown Period: Specify the cooldown period, which prevents scaling
up or down too fast. The policy waits for the policy cooldown period
to elapse or the group's minimum cooldown to elapse, whichever is
longer.
- Click Create Policy.
Create a webhook
Create a corresponding webhook to activate each of the Auto Scale policies created.
-
On the Scaling Group details page, click the gear icon next to the
policy name and select View Webhooks. -
Click Create Webhook..
-
Enter a name for the webhook.
-
Click Save Webhook.
-
Save the webhook address for later use.
Note: You can execute a POST request on the URL to use your webhook manually via cURL. For more information, see the Auto Scale Developer Guide.
Set up Rackspace Monitoring
- On the Scaling group details page, select the cloud server.
- Log in to the server and install the Rackspace Monitoring Agent.
- Open Rackspace Intelligence > Notify.
- Create a new Notification Plan called AutoScale.
- Select a notification plan from the list and select Add Notifications > Create a new notification.
- In the pop-up dialog box, specify the following values:
- Name: Should match the webhook name used in the previous section, such as ScaleUp.
- Type: Select Webhook.
- URL: Enter the Auto Scale Policy webhook URL. If you did not copy this URL in an earlier step, you can find it by selecting the gear icon next to the policy name and selecting View Webhooks.
- Click Create and Select Notification.
- Specify the monitoring alarm type to trigger the notification. For example, you could specify that a critical or warning monitoring alarm trigger the ScaleUp notification and specify that when the monitoring alarm clears, the system triggers the ScaleDown notification.
- Click Save Notification Plan.
- At the top of the Rackspace Intelligence window, select Monitor.
- Click the cloud server name > Monitoring Checks > Create Check.
- Enter the following information:
- Check Type: You can select from the list a wide range of monitoring checks such as CPU or Memory. Select the monitoring check appropriate for your environment.
- Check Name: Enter a name to identify the check.
- Click Create Check. The details page for the check displays.
- Click Create Alarm.
Updated about 1 year ago