FIWARE Policy Manager - Bosun

18
Policy Manager: Managing facts, rules and actions Guillermo Jiménez, Fernando López IMDEA // TID Cloud Chapter. FICORE [email protected] , @geon_exus [email protected], @flopezaguilar

Transcript of FIWARE Policy Manager - Bosun

Page 1: FIWARE Policy Manager - Bosun

Policy Manager: Managing facts, rules and actionsGuillermo Jiménez, Fernando LópezIMDEA // TIDCloud Chapter. [email protected], @[email protected], @flopezaguilar

Page 2: FIWARE Policy Manager - Bosun

TECHNOLOGIESPythonDjango

Pyclips frameworkClips

Redis

RabbitMQMySQL

Page 3: FIWARE Policy Manager - Bosun

POLICIES• Policy Manager provides different policies to get VM

automation in the cloud.

• It could be uses to get notification about different facts and actions.

• Those facts and actions are executed when certain conditions are taking place.

Page 4: FIWARE Policy Manager - Bosun

EXAMPLE POLICIES• Data resources collected from the virtual machines.

• CPU, Memory, Hard Disk and network usage.

• User could define some conditions and actions to be performed.

• This allows infinite possibilities: • load balancing policies moving VMs to nodes with less utilization,

• increase resources or nodes number

• availability policies (restart VM) when it crashes.

• generate this VM in different nodes, etc.

Page 5: FIWARE Policy Manager - Bosun

FEATURES

Policy Manager implements a REST API to manage rules.

User could write his own rules.

Rules are written in a simple human language: JSON.

User can implement his own actions from a notification.

Page 6: FIWARE Policy Manager - Bosun

Api-Agent

Rules Engine

CLIENTFiware-cloto

Fiware-cloto

Nova, Murano, etc

OpenStack ServicesUser Server

Actions

Page 7: FIWARE Policy Manager - Bosun

Api-Agent

Rules Engine

Fact-Gen

(defRule)

store(Conditions and actions)

(actions)

get(Conditions, actions)

(Facts)

(AverageFacts)

suscribe(URL, serverId)

PUT ContextData(CPU, RAM, HDD, Network?)

External Service

START POST(conditions, actions, serverId)

Fiware-Facts

Redis

store(AverageFacts)

Fiware-cloto

POST(subscriptions)

RabbitMQ

EnvironmentManager

get(AverageFacts)

Environments *

(actions)

eval(AverageFacts, Conditions, actions)

(conditions, actions)

(actions)

Context Broker

Page 8: FIWARE Policy Manager - Bosun

POLICY MANAGER RULESDefinition of a rule:

{ "action": { "actionName": "notify-scale", "operation": "scaleUp" }, "name": "AlertCPU", "condition": { "cpu": { "value": 98.3, "operand": "greater" }, "mem": { "value": 95, "operand": "greater equal" }, "hdd": { "value": 95, "operand": "greater equal" }, "net": { "value": 95, "operand": "greater equal" } }}

Page 9: FIWARE Policy Manager - Bosun

POLICY API INFORMATIONREST API

Page 10: FIWARE Policy Manager - Bosun

POLICY API AUTHENTICATION

Each request requires credentials and require a header containing a valid Token from OpenStack keystone.

X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb

Page 11: FIWARE Policy Manager - Bosun

POLICY API OPERATIONS• General Operations.

• Get the information of the API.• Update the window size.

• Elasticity rules.• Create a new elasticity rule.• Update an elasticity rule. • Delete an elasticity rule. Get an elasticity

rule.

• Servers. Get the list of all servers' rules.• Get the list of all rules of a server.• Update the context of a server.

• Subscription to rules.• Create a new subscription.• Delete a subscription.• Get a subscription.

Page 12: FIWARE Policy Manager - Bosun

Kind of actionsnotify-scale

• scaleUp

• scaleDown

notify-email

"action": {

"actionName": "notify-scale",

"operation": "scaleUp"

},

"action": {

"actionName": "notify-scale",

"operation": "scaleDown"

},

"action": {

"actionName": "notify-email",

"email": “[email protected]”,

"body": “Example description”

},

POLICY MANAGER RULES

Page 13: FIWARE Policy Manager - Bosun

More possible actions:• Check VM alive

• Restart VM

• Move to another node

• Stop VM

• All actions you can implement.

POLICY MANAGER RULES

Page 14: FIWARE Policy Manager - Bosun

Kind of operands about server measures (cpu, mem, hdd and disk):

• greater• greater equal• less• less equal

"condition": {

"cpu": {

"value": 98.3,

"operand": "greater"

},

"mem": {

"value": 95,

"operand": "greater equal"

},

"hdd": {

"value": 95,

"operand": "greater equal"

},

"net": {

"value": 95,

"operand": "greater equal"

}

}

POLICY MANAGER RULES

Page 15: FIWARE Policy Manager - Bosun

DEMO

N

-

Page 16: FIWARE Policy Manager - Bosun

• Policy Manager:https://forge.fi-ware.org/plugins/mediawiki/wiki/fiware/index.php/Policy_Manager_Open_RESTful_API_Specification

• Pyclips Webpage: http://pyclips.sourceforge.net

• Django project: https://www.djangoproject.com

• Redis: http://redis.io

• RabbitMQ: http://www.rabbitmq.com

• MySQL: http://mysql.com

REFERENCES

Page 17: FIWARE Policy Manager - Bosun

17

Page 18: FIWARE Policy Manager - Bosun

http://fiware.orghttp://lab.fiware.orgFollow @Fiware on Twitter !

Join us!