Unlike Nova, Cinder does not support calling the 'os-migrate_volume'[1] action without a host or a cluster. For volume migrations of type 'migrate' in watcher the dst_pool is required, but for other migrations that migrate the volumes to different types is not needed. This change checks if the dst_pool is defined and prevents some migrations when it's misssing information. Adds testing for creating audits with the Zone Migration status, validating the schema changes. [1] https://docs.openstack.org/api-ref/block-storage/v3/index.html#migrate-a-volume Closes-Bug: 2108988 Change-Id: I305c58e47093c4a884e86f1d91fdc15ef2a1cfba Signed-off-by: jgilaber <jgilaber@redhat.com>
8.0 KiB
Zone migration
Synopsis
display name: Zone migration
goal: hardware_maintenance
watcher.decision_engine.strategy.strategies.zone_migration.ZoneMigration
Note
The term Zone in the strategy name is not a reference to
Openstack
availability zones but rather a user-defined set of Compute nodes
and storage pools. Currently, migrations across actual availability
zones is not fully tested and might not work in all cluster
configurations.
Requirements
Metrics
None
Cluster data model
Default Watcher's Compute cluster data model:
watcher.decision_engine.model.collector.nova.NovaClusterDataModelCollector
Storage cluster data model is also required:
watcher.decision_engine.model.collector.cinder.CinderClusterDataModelCollector
Actions
Default Watcher's actions:
action description migratewatcher.applier.actions.migration.Migrate
volume_migratewatcher.applier.actions.volume_migration.VolumeMigrate
Planner
Default Watcher's planner:
watcher.decision_engine.planner.weight.WeightPlanner
Configuration
Strategy parameters are:
| parameter | type | default | required | description |
|---|---|---|---|---|
compute_nodes |
array | None | Optional | Compute nodes to migrate. |
storage_pools |
array | None | Optional | Storage pools to migrate. |
|
integer |
6 |
Optional |
The number of actions to be run in parallel in total. |
|
integer |
2 |
Optional |
The number of actions to be run in parallel per compute node in one action plan. |
|
integer |
2 |
Optional |
The number of actions to be run in parallel per storage pool. |
|
object |
None |
Optional |
List prioritizes instances and volumes. |
|
boolean |
False |
Optional |
False: Instances will migrate after all volumes migrate. True: An instance will migrate after the attached volumes migrate. |
Note
* All parameters in the table above have defaults and therefore the
user can create an audit without specifying a value. However, if
only defaults parameters are used, there will be
nothing actionable for the audit. * parallel_* parameters
are not in reference to concurrency, but rather on limiting the amount
of actions to be added to the action plan * compute_nodes,
storage_pools, and priority are optional
parameters, however, if they are passed they require
the parameters in the tables below:
The elements of compute_nodes array are:
| parameter | type | default | required | description |
|---|---|---|---|---|
|
string |
None |
Required |
Compute node from which instances migrate. |
|
string |
None |
Optional |
Compute node to which instances migrate. If omitted, nova will choose the destination node automatically. |
The elements of storage_pools array are:
| parameter | type | default | required | description |
|---|---|---|---|---|
|
string |
None |
Required |
Storage pool from which volumes migrate. |
|
string |
None |
Optional |
Storage pool to which volumes migrate. |
src_type |
string | None | Required | Source volume type. |
dst_type |
string | None | Required | Destination volume type |
The elements of priority object are:
| parameter | type | default | Required | description |
|---|---|---|---|---|
project |
array | None | Optional | Project names. |
compute_node |
array | None | Optional | Compute node names. |
storage_pool |
array | None | Optional | Storage pool names. |
|
enum |
None |
Optional |
Instance attributes. ["vcpu_num", "mem_size", "disk_size", "created_at"] |
|
enum |
None |
Optional |
Volume attributes. ["size", "created_at"] |
Efficacy Indicator
The efficacy indicators for action plans built from the command line are:
watcher.decision_engine.goal.efficacy.specs.HardwareMaintenance.get_global_efficacy_indicator
In Horizon, these indictors are shown with alternative text.
live_migrate_instance_countis shown asThe number of instances actually live migratedin Horizonplanned_live_migrate_instance_countis shown asThe number of instances planned to live migratein Horizonplanned_live_migration_instance_countrefers to the instances planned to live migrate in the action plan.live_migrate_instance_counttracks all the instances that could be migrated according to the audit input.
Algorithm
For more information on the zone migration strategy please refer to: http://specs.openstack.org/openstack/watcher-specs/specs/queens/implemented/zone-migration-strategy.html
How to use it ?
$ openstack optimize audittemplate create \
at1 hardware_maintenance --strategy zone_migration
$ openstack optimize audit create -a at1 \
-p compute_nodes='[{"src_node": "s01", "dst_node": "d01"}]'
Note
* Currently, the strategy will not generate both volume migration and instance migrations in the same audit. If both are requested, only volume migrations will be included in the action plan. * The Cinder model collector is not enabled by default. If the Cinder model collector is not enabled while deploying Watcher, the model will become outdated and cause errors eventually. See the Configuration option to enable the storage collector documentation.
Support caveats
This strategy offers the option to perform both Instance migrations and Volume migrations. Currently, Instance migrations are ready for production use while Volume migrations remain experimental.
External Links
None