watcher.applier.actions.volume_migration
Module¶watcher.applier.actions.volume_migration.
VolumeMigrate
(config, osc=None)[source]¶Bases: watcher.applier.actions.base.BaseAction
Migrates a volume to destination node or type
By using this action, you will be able to migrate cinder volume. Migration type ‘swap’ can only be used for migrating attached volume. Migration type ‘migrate’ can be used for migrating detached volume to the pool of same volume type. Migration type ‘retype’ can be used for changing volume type of detached volume.
The action schema is:
schema = Schema({
'resource_id': str, # should be a UUID
'migration_type': str, # choices -> "swap", "migrate","retype"
'destination_node': str,
'destination_type': str,
})
The resource_id is the UUID of cinder volume to migrate.
The destination_node is the destination block storage pool name.
(list of available pools are returned by this command: cinder
get-pools
) which is mandatory for migrating detached volume
to the one with same volume type.
The destination_type is the destination block storage type name.
(list of available types are returned by this command: cinder
type-list
) which is mandatory for migrating detached volume or
swapping attached volume to the one with different volume type.
execute
()[source]¶Executes the main logic of the action
This method can be used to perform an action on a given set of input parameters to accomplish some type of operation. This operation may return a boolean value as a result of its execution. If False, this will be considered as an error and will then trigger the reverting of the actions.
Returns: | A flag indicating whether or not the action succeeded |
---|---|
Return type: | bool |
post_condition
()[source]¶Hook: called after the execution of an action
This function is called regardless of whether an action succeeded or not. So you can use it to perform cleanup operations.
pre_condition
()[source]¶Hook: called before the execution of an action
This method can be used to perform some initializations or to make some more advanced validation on its input parameters. So if you wish to block its execution based on this factor, raise the related exception.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.