https://github.com/mohammadmrd/heat-vertical-scaling
Auto-scaling service using OpenStack heat and aodh
https://github.com/mohammadmrd/heat-vertical-scaling
aodh heat openstack openstack-aodh openstack-heat vertical-scaling
Last synced: 7 months ago
JSON representation
Auto-scaling service using OpenStack heat and aodh
- Host: GitHub
- URL: https://github.com/mohammadmrd/heat-vertical-scaling
- Owner: MohammadMRD
- License: mit
- Created: 2021-02-12T15:03:43.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-22T08:06:59.000Z (over 4 years ago)
- Last Synced: 2025-01-22T07:37:10.928Z (9 months ago)
- Topics: aodh, heat, openstack, openstack-aodh, openstack-heat, vertical-scaling
- Language: JavaScript
- Homepage:
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Heat - Vertical Scaling
## Getting started
1. Clone project
2. Go to the project directory
3. Create `.env` file
> * PORT
> * OPENSTACK_USERNAME
> * OPENSTACK_PASSWORD
> * OPENSTACK_USER_DOMAIN_ID
> * OPENSTACK_PROJECT_NAME
> * OPENSTACK_PROJECT_DOMAIN_ID5. Run `npm start`
6. Create a heat template
7. Define a scaling resource using `OS::Heat::AutoScalingGroup`
8. Define an alarm and set the URL of this service to alarm's actions(alarm_action, ok_action, ...)## Request parameters
- **action**: `up` or `down`
- **flavors**: List of flavors id or name
- **group**: Scaling resource's name
- **cooldown**: Cooldown period, in seconds (default: 0)## HOT example
```yaml
heat_template_version: 2018-08-31
description: A simple stackparameters:
flavor_type:
type: string
image_id:
type: string
network_id:
type: stringresources:
scale_group:
type: OS::Heat::AutoScalingGroup
properties:
min_size: 1
max_size: 3
resource:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor_type }
image: { get_param: image_id }
metadata: {"metering.server_group": {get_param: "OS::stack_id"}}
networks:
- network: { get_param: network_id }cpu_alarm_high:
type: OS::Aodh::GnocchiAggregationByResourcesAlarm
properties:
description: Scale up if CPU > 80% for 5 minutes
metric: cpu_util
aggregation_method: mean
granularity: 300
evaluation_periods: 1
threshold: 80
resource_type: instance
comparison_operator: gt
alarm_actions:
- http://SERVICE_URL?action=up&flavors=c1&flavors=c2&flavors=c3&group=scale_group
query:
list_join:
- ''
- - {'=': {server_group: {get_param: "OS::stack_id"}}}
cpu_alarm_low:
type: OS::Aodh::GnocchiAggregationByResourcesAlarm
properties:
description: Scale down if CPU < 5% for 5 minutes
metric: cpu_util
aggregation_method: mean
granularity: 300
evaluation_periods: 1
threshold: 5
resource_type: instance
comparison_operator: lt
alarm_actions:
- http://SERVICE_URL?action=down&flavors=c1&flavors=c2&flavors=c3&group=scale_group
query:
list_join:
- ''
- - {'=': {server_group: {get_param: "OS::stack_id"}}}
outputs:
# refs or scale_group_refs
scale_group_refs:
value: { get_attr: [scale_group, refs] }
```