Role - import_from_hypervisor

Role Documentation

Import From Hypervisor Role

This role spawns nbdkit on OpenStack hypervisors (compute nodes) for workloads that have use_nbdkit_direct: true in their migration parameters.

Purpose

This role is part of the nbdkit direct mode migration workflow. It:

  1. Reads workloads from workloads.yml
  2. Filters workloads with use_nbdkit_direct: true
  3. For each workload:
  4. Connects to the hypervisor (from hypervisor_hostname in workload data)
  5. Finds the instance disk
  6. Inspects disk format (qcow2 vs raw) and detects backing files
  7. Spawns nbdkit with the correct plugin
  8. Updates the workload file with the nbdkit URI

Workflow Order

1. export_workloads.yml # Exports workloads with hypervisor_hostname 2. import_from_hypervisor.yml # Spawns nbdkit (this role) 3. import_workloads.yml # Migrates using nbdkit URIs

Usage

```bash

1. Export workloads

ansible-playbook export_workloads.yml -e os_migrate_data_dir=/data

2. Spawn nbdkit on hypervisors

ansible-playbook import_from_hypervisor.yml -e os_migrate_data_dir=/data

3. Import workloads

ansible-playbook import_workloads.yml -e os_migrate_data_dir=/data ```

See full README in the file for more details.

Role Defaults

This section highlights all of the defaults and variables set within the “import_from_hypervisor” role.

# Defaults for import_from_hypervisor role

# NBDkit configuration
os_migrate_nbdkit_port: 10809
os_migrate_nbdkit_protocol: tcp  # 'tcp' or 'ssh'
os_migrate_nbdkit_ssh_user: stack
os_migrate_nbdkit_readonly: true
os_migrate_nbdkit_timeout: 300

# IP restriction (optional) - set to destination conversion host IP
os_migrate_nbdkit_ip_allow:

# Nova directories on hypervisor
os_migrate_nbdkit_nova_instances_dir: /var/lib/nova/instances