Module - import_volumes_src_cleanup

This module provides for the following ansible plugin:

  • import_volumes_src_cleanup

Module Documentation

Remove any temporary snapshots or volumes associated with this volume migration.

Options

auth:

Required if 'cloud' param not used

auth_type:

Auth type plugin for destination OpenStack cloud. Can be omitted if using password authentication.

cloud:

Cloud resource from clouds.yml

Required if 'auth' param not used

validate_certs:

Validate HTTPS certificates when logging in to OpenStack.

conversion_host:

Dictionary with information about the source conversion host (address, status, name, id)

data:

Data structure with server parameters as loaded from OS-Migrate volumes YAML file.

log_file:

Path to store a log file for this conversion process.

state_file:

Path to store a transfer progress file for this conversion process.

src_conversion_host_address:

Optional IP address of the source conversion host. Without this, the plugin will use the 'access_ipv4' property of the conversion host instance.

ssh_key_path:

Path to an SSH private key authorized on the source cloud.

ssh_user:

The SSH user to connect to the conversion hosts.

transfer_uuid:

A UUID used to keep track of this tranfer's resources on the conversion hosts.

Provided by the import_volumes_export_volumes module.

volume_map:

Dictionary providing information about the volumes to transfer.

Provided by the import_volumes_export_volumes module.

timeout:

Timeout for long running operations, in seconds.

Authors

:

OpenStack tenant migration tools (@os-migrate)

Example Tasks

- name: expose source volume
  os_migrate.os_migrate.import_volumes_export:
    cloud: '{{ cloud_vars_src }}'
    conversion_host: '{{ os_src_conversion_host_info.openstack_conversion_host }}'
    data: '{{ detached_volumes }}'
    ssh_key_path: '{{ os_migrate_conversion_keypair_private_path }}'
    ssh_user: '{{ os_migrate_conversion_host_ssh_user }}'
    log_dir: '{{ os_migrate_data_dir }}/volume_logs'
    timeout: '{{ os_migrate_timeout }}'
  register: exports
- name: transfer volumes to destination
  os_migrate.os_migrate.import_volumes_transfer:
    cloud: dst
    validate_certs: '{{ os_migrate_dst_validate_certs|default(omit) }}'
    ca_cert: '{{ os_migrate_dst_ca_cert|default(omit) }}'
    client_cert: '{{ os_migrate_dst_client_cert|default(omit) }}'
    client_key: '{{ os_migrate_dst_client_key|default(omit) }}'
    conversion_host: '{{ os_dst_conversion_host_info.openstack_conversion_host }}'
    ssh_key_path: '{{ os_migrate_conversion_keypair_private_path }}'
    ssh_user: '{{ os_migrate_conversion_host_ssh_user }}'
    transfer_uuid: '{{ exports.transfer_uuid }}'
    src_conversion_host_address: '{{ os_src_conversion_host_info.openstack_conversion_host.address
      }}'
    volume_map: '{{ exports.volume_map }}'
    log_file: '{{ exports.log_file }}'
    state_file: '{{ exports.state_file }}'
    timeout: '{{ os_migrate_timeout }}'
  register: transfer
- name: clean up in the source cloud after migration
  os_migrate.os_migrate.import_volumes_src_cleanup:
    cloud: src
    validate_certs: '{{ os_migrate_src_validate_certs|default(omit) }}'
    ca_cert: '{{ os_migrate_src_ca_cert|default(omit) }}'
    client_cert: '{{ os_migrate_src_client_cert|default(omit) }}'
    client_key: '{{ os_migrate_src_client_key|default(omit) }}'
    conversion_host: '{{ os_src_conversion_host_info.openstack_conversion_host }}'
    ssh_key_path: '{{ os_migrate_conversion_keypair_private_path }}'
    ssh_user: '{{ os_migrate_conversion_host_ssh_user }}'
    transfer_uuid: '{{ exports.transfer_uuid }}'
    volume_map: '{{ exports.volume_map }}'
    log_file: '{{ exports.log_file }}'
    state_file: '{{ exports.state_file }}'
    timeout: '{{ os_migrate_timeout }}'