The watcher.decision_engine.strategy.strategies.storage_capacity_balance Module

The watcher.decision_engine.strategy.strategies.storage_capacity_balance Module

class watcher.decision_engine.strategy.strategies.storage_capacity_balance.StorageCapacityBalance(config, osc=None)[source]

Bases: watcher.decision_engine.strategy.strategies.base.WorkloadStabilizationBaseStrategy

Storage capacity balance using cinder volume migration

Description

This strategy migrates volumes based on the workload of the cinder pools. It makes decision to migrate a volume whenever a pool’s used utilization % is higher than the specified threshold. The volume to be moved should make the pool close to average workload of all cinder pools.

Requirements

  • You must have at least 2 cinder volume pools to run this strategy.

Limitations

  • Volume migration depends on the storage device. It may take a long time.

Spec URL

http://specs.openstack.org/openstack/watcher-specs/specs/queens/implemented/storage-capacity-balance.html

check_pool_type(volume, dest_pool)[source]
do_execute(audit=None)[source]

Strategy execution phase

This phase is where you should put the main logic of your strategy.

get_actions(pool, volumes, threshold)[source]

get volume, pool key-value action

return: retype, migrate dict

classmethod get_config_opts()[source]

Defines the configuration options to be associated to this loadable

Returns:A list of configuration options relative to this Loadable
Return type:list of oslo_config.cfg.Opt instances
classmethod get_display_name()[source]

The goal display name for the strategy

classmethod get_name()[source]

The name of the strategy

get_pools(cinder)[source]

Get all volume pools excepting ex_pools.

Parameters:cinder – cinder client
Returns:volume pools
classmethod get_schema()[source]

Defines a Schema that the input parameters shall comply to

Returns:A jsonschema format (mandatory default setting)
Return type:dict
classmethod get_translatable_display_name()[source]

The translatable msgid of the strategy

get_volume_type_by_name(cinder, backendname)[source]
get_volumes(cinder)[source]

Get all volumes with status in available or in-use and no snapshot.

Parameters:cinder – cinder client
Returns:all volumes
group_pools(pools, threshold)[source]

group volume pools by threshold.

Parameters:
  • pools – all volume pools
  • threshold – volume threshold
Returns:

under and over threshold pools

migrate_fit(volume, threshold)[source]
post_execute()[source]

Post-execution phase

pre_execute()[source]

Pre-execution phase

This can be used to fetch some pre-requisites or data.

retype_fit(volume, threshold)[source]
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.