watcher.decision_engine.strategy.strategies.basic_consolidation
Modulewatcher.decision_engine.strategy.strategies.basic_consolidation
Module¶Good server consolidation strategy
Consolidation of VMs is essential to achieve energy optimization in cloud environments such as OpenStack. As VMs are spinned up and/or moved over time, it becomes necessary to migrate VMs among servers to lower the costs. However, migration of VMs introduces runtime overheads and consumes extra energy, thus a good server consolidation strategy should carefully plan for migration in order to both minimize energy consumption and comply to the various SLAs.
This algorithm not only minimizes the overall number of used servers, but also minimizes the number of migrations.
It has been developed only for tests. You must have at least 2 physical compute nodes to run it, so you can easily run it on DevStack. It assumes that live migration is possible on your OpenStack cluster.
watcher.decision_engine.strategy.strategies.basic_consolidation.
BasicConsolidation
(config, osc=None)[source]¶Bases: watcher.decision_engine.strategy.strategies.base.ServerConsolidationBaseStrategy
Basic offline consolidation using live migration
calculate_score_instance
(instance)[source]¶Calculate Score of virtual machine
Parameters: | instance – the virtual machine |
---|---|
Returns: | score |
calculate_score_node
(node)[source]¶Calculate the score that represent the utilization level
Parameters: | node – ComputeNode instance |
---|---|
Returns: | Score for the given compute node |
Return type: | float |
calculate_weight
(compute_resource, total_cores_used, total_disk_used, total_memory_used)[source]¶Calculate weight of every resource
Parameters: |
|
---|---|
Returns: |
check_migration
(source_node, destination_node, instance_to_migrate)[source]¶Check if the migration is possible
Parameters: |
|
---|---|
Returns: | True if the there is enough place otherwise false |
check_threshold
(destination_node, total_cores, total_disk, total_mem)[source]¶Check threshold
Check the threshold value defined by the ratio of aggregated CPU capacity of VMs on one node to CPU capacity of this node must not exceed the threshold value.
Parameters: |
|
---|---|
Returns: | True if the threshold is not exceed |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.