Date post: | 16-Jul-2015 |
Category: |
Technology |
Upload: | geonexus |
View: | 44 times |
Download: | 1 times |
Policy Manager: Managing facts, rules and actions
Guillermo Jiménez, Fernando López
IMDEA // TIDCloud Chapter. [email protected], @geon_exus
[email protected], @flopezaguilar
TECHNOLOGIES
PythonDjango
Pyclips frameworkClips
Redis
RabbitMQMySQL
POLICIES
• Policy Manager provides different policies to get VMautomation in the cloud.
• It could be uses to get notification about different factsand actions.
• Those facts and actions are executed when certainconditions are taking place.
EXAMPLE POLICIES
• Data resources collected from the virtual machines.
• CPU, Memory, Hard Disk and network usage.
• User could define some conditions and actions to beperformed.
• 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.
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.
Api-Agent
Rules Engine
CLIENTFiware-cloto
Fiware-cloto
Nova, Murano, etc
OpenStack ServicesUser Server
Actions
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
STARTPOST(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
POLICY MANAGER RULES
Definition 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"
}}
}
POLICY API INFORMATION
REST API
POLICY API AUTHENTICATION
Each request requires credentials and require a headercontaining a valid Token from OpenStack keystone.
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
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.
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
More possible actions:
• Check VM alive
• Restart VM
• Move to another node
• Stop VM
• All actions you can implement.
POLICY MANAGER RULES
Kind of operands about servermeasures (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
DEMO
N
-
• 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
17
http://fiware.org
http://lab.fiware.org
Follow @Fiware on Twitter !
Join us!