From b4cd8ad1adb72c5ac93afeaddbf8e2479445cebf Mon Sep 17 00:00:00 2001 From: Alberto Florez Date: Mon, 15 Jun 2026 00:00:45 +0200 Subject: [PATCH 1/4] Fix storage map accumulation and optimize datastore filtering --- .../mtv_management/tasks/_mtv_storage_map.yml | 50 +++++++++++++++++-- .../_mtv_storage_map_process_datastore.yml | 6 +-- 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/roles/mtv_management/tasks/_mtv_storage_map.yml b/roles/mtv_management/tasks/_mtv_storage_map.yml index ab05c6c..ade482b 100644 --- a/roles/mtv_management/tasks/_mtv_storage_map.yml +++ b/roles/mtv_management/tasks/_mtv_storage_map.yml @@ -2,7 +2,7 @@ - name: _mtv_storage_map | Initialize data structures ansible.builtin.set_fact: - mtv_management_mtv_storagemaps: {} + mtv_management_mtv_storagemap_maps: {} - name: _mtv_storage_map | Verify Storage Map Overrides do not contain both includes and excludes ansible.builtin.fail: @@ -41,9 +41,46 @@ mtv_management_inventory_query_result_var: mtv_destination_datastores when: "'vsphere' in provider" +- name: _mtv_storage_map | Extract included datastore IDs from overrides + ansible.builtin.set_fact: + mtv_management_mtv_allowed_datastore_ids: >- + {{ + mtv_management_storage_map_overrides + | selectattr('include', 'defined') + | selectattr('include', 'equalto', true) + | map(attribute='id') + | list + }} + when: + - mtv_management_storage_map_overrides is defined + - mtv_management_storage_map_overrides | length > 0 + - mtv_management_storage_map_overrides | selectattr('include', 'defined') | list | length > 0 + +- name: _mtv_storage_map | Extract excluded datastore IDs from overrides + ansible.builtin.set_fact: + mtv_management_mtv_excluded_datastore_ids: >- + {{ + mtv_management_storage_map_overrides + | selectattr('exclude', 'defined') + | selectattr('exclude', 'equalto', true) + | map(attribute='id') + | list + }} + when: + - mtv_management_storage_map_overrides is defined + - mtv_management_storage_map_overrides | length > 0 + - mtv_management_storage_map_overrides | selectattr('exclude', 'defined') | list | length > 0 + - name: _mtv_storage_map | Process VMware Datastores ansible.builtin.include_tasks: _mtv_storage_map_process_datastore.yml - loop: "{{ mtv_destination_datastores }}" + loop: >- + {{ + (mtv_destination_datastores | selectattr('id', 'in', mtv_management_mtv_allowed_datastore_ids) | list) + if (mtv_management_mtv_allowed_datastore_ids | default([]) | length > 0) + else (mtv_destination_datastores | rejectattr('id', 'in', mtv_management_mtv_excluded_datastore_ids | default([])) | list) + if (mtv_management_mtv_excluded_datastore_ids | default([]) | length > 0) + else mtv_destination_datastores + }} loop_control: loop_var: mtv_vmware_datastore when: @@ -53,7 +90,14 @@ - name: _mtv_storage_map | Process Ovirt Datastores ansible.builtin.include_tasks: _mtv_storage_map_process_datastore.yml - loop: "{{ mtv_destination_datastores }}" + loop: >- + {{ + (mtv_destination_datastores | selectattr('id', 'in', mtv_management_mtv_allowed_datastore_ids) | list) + if (mtv_management_mtv_allowed_datastore_ids | default([]) | length > 0) + else (mtv_destination_datastores | rejectattr('id', 'in', mtv_management_mtv_excluded_datastore_ids | default([])) | list) + if (mtv_management_mtv_excluded_datastore_ids | default([]) | length > 0) + else mtv_destination_datastores + }} loop_control: loop_var: mtv_ovirt_datastore when: diff --git a/roles/mtv_management/tasks/_mtv_storage_map_process_datastore.yml b/roles/mtv_management/tasks/_mtv_storage_map_process_datastore.yml index 453da6d..a74f877 100644 --- a/roles/mtv_management/tasks/_mtv_storage_map_process_datastore.yml +++ b/roles/mtv_management/tasks/_mtv_storage_map_process_datastore.yml @@ -54,15 +54,13 @@ - name: _mtv_storage_map_process_datastore | Add VMware StorageMap Map to Dict ansible.builtin.set_fact: - mtv_management_mtv_storagemap_maps: "{{ mtv_management_mtv_storagemap_maps | default({}) | ansible.builtin.combine({mtv_vmware_datastore.selfLink: mtv_management_storage_map_map}, recursive=true) }}" # noqa: yaml[line-length] + mtv_management_mtv_storagemap_maps: "{{ mtv_management_mtv_storagemap_maps | default({}) | ansible.builtin.combine({(mtv_vmware_datastore.selfLink + '-' + _mtv_management_storage_map_storage_class): mtv_management_storage_map_map}, recursive=true) }}" # noqa: yaml[line-length] when: - mtv_vmware_datastore is defined - - "(('include' in mtv_management_mtv_vmware_datastore_overrides and mtv_management_storage_map_overrides | selectattr('include', 'defined') | list | length > 0) or (mtv_management_storage_map_overrides | selectattr('include', 'defined') | list | length == 0 and mtv_management_storage_map_overrides | selectattr('exclude', 'defined') | list | length == 0)) or ('exclude' not in mtv_management_mtv_vmware_datastore_overrides and mtv_management_storage_map_overrides | selectattr('exclude', 'defined') | list | length > 0)" # noqa: yaml[line-length] - name: _mtv_storage_map_process_datastore | Add Ovirt StorageMap Map to Dict ansible.builtin.set_fact: - mtv_management_mtv_storagemap_maps: "{{ mtv_management_mtv_storagemap_maps | default({}) | ansible.builtin.combine({mtv_ovirt_datastore.selfLink: mtv_management_storage_map_map}, recursive=true) }}" # noqa: yaml[line-length] + mtv_management_mtv_storagemap_maps: "{{ mtv_management_mtv_storagemap_maps | default({}) | ansible.builtin.combine({(mtv_ovirt_datastore.selfLink + '-' + _mtv_management_storage_map_storage_class): mtv_management_storage_map_map}, recursive=true) }}" # noqa: yaml[line-length] when: - mtv_ovirt_datastore is defined - - "(('include' in mtv_management_mtv_ovirt_datastore_overrides and mtv_management_storage_map_overrides | selectattr('include', 'defined') | list | length > 0) or (mtv_management_storage_map_overrides | selectattr('include', 'defined') | list | length == 0 and mtv_management_storage_map_overrides | selectattr('exclude', 'defined') | list | length == 0)) or ('exclude' not in mtv_management_mtv_ovirt_datastore_overrides and mtv_management_storage_map_overrides | selectattr('exclude', 'defined') | list | length > 0)" # noqa: yaml[line-length] ... From a9a16096fe3abbddcfacba7306b624f93f739a7d Mon Sep 17 00:00:00 2001 From: Alberto Florez Date: Wed, 24 Jun 2026 23:57:39 +0200 Subject: [PATCH 2/4] docs: update generated documentation --- README.md | 137 ------------------------------------------------------ 1 file changed, 137 deletions(-) diff --git a/README.md b/README.md index fafc433..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,137 +0,0 @@ -# Ansible for OpenShift Virtualization Migration - -![GitHub Release](https://img.shields.io/github/v/release/redhat-cop/openshift_virtualization_migration?include_prereleases&style=flat-square) -[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/redhat-cop/openshift_virtualization_migration/ci.yml?style=flat-square&label=release)](https://github.com/redhat-cop/openshift_virtualization_migration/actions) -[![Semantic Versioning](https://img.shields.io/badge/semver-2.0.0-blue?style=flat-square)](https://semver.org/) -[![License](https://img.shields.io/github/license/redhat-cop/openshift_virtualization_migration?style=flat-square)](LICENSE) - - - -- [Ansible for OpenShift Virtualization Migration](#ansible-for-openshift-virtualization-migration) - - [Description](#description) - - [Documentation](#documentation) - - [Release Notes](#release-notes) - - [Roles](#roles) - - [Requirements](#requirements) - - [Installation](#installation) - - [Use Cases](#use-cases) - - [Testing](#testing) - - [Support](#support) - - [License](#license) - - - -## Description - -This collection enables the migration journey of Virtual Machine (VM) workloads from existing hypervisors to Red Hat OpenShift Virtualization using Ansible Automation Platform. Additionally it provides content for the management and maintenance of VM workloads within Red Hat OpenShift Virtualization. - -## Documentation - -* [Contributing Guide](CONTRIBUTING.md) -* [Disconnected Environment Setup](docs/disconnected_environment_guide.md) -* [Secure Credential Management](docs/secure_credential_management.md) -* [Secure Credential Practices](docs/secure_credential_practices.md) - -## Release Notes - -See [CHANGELOG.md](CHANGELOG.md) for release history and changes. - -## Roles - -This collection includes the following roles for managing OpenShift Virtualization migrations: - - - - - -## Requirements - -The following Ansible Collections are required: - -```yaml ---- -collections: - - name: redhat.openshift_virtualization - - name: redhat.openshift - - name: vmware.vmware_rest - - name: ansible.posix - - name: infra.aap_utilities - - name: kubernetes.core - - name: community.crypto - - name: community.general - - name: community.vmware - - # AAP <=2.4 - - name: infra.controller_configuration - - name: ansible.controller - version: "<=4.5.12" - - # AAP 2.5+ - - name: ansible.platform - - name: ansible.controller - - name: infra.aap_configuration -... -``` - -## Installation - -You can install the `infra.openshift_virtualization_migration` collection with the Ansible Galaxy CLI: - -```shell -ansible-galaxy collection install infra.openshift_virtualization_migration -``` - -Note that if you install any collections from Ansible Galaxy, they will not be upgraded automatically when you upgrade the Ansible package. - -To upgrade the collection to the latest available version, run the following command: - -``` -ansible-galaxy collection install infra.openshift_virtualization_migration --upgrade -``` - -You can also include it in a `requirements.yml` file and install it with `ansible-galaxy collection install -r requirements.yml`, using the format: - -```yaml ---- -collections: - - name: infra.openshift_virtualization_migration - # If you need a specific version of the collection, you can specify like this: - # version: ... -``` - -See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details. - -## Use Cases - -This collection is ideal for accomplishing the following using Ansible automation: - -* Analyzing existing Virtual Machine hypervisor environments. -* Installing and configuring Ansible Automation Platform. -* Preparing OpenShift environments to support Virtual Machines and migrating Virtual Machines from existing hypervisors using the Migration Toolkit for Virtualization (MTV). -* Migrating Virtual Machines using the Migration Toolkit for Virtualization (MTV). - -## Testing - -[tox](https://tox.wiki) is used to perform tests and verification of this collection. - -The following commands can be used to execute the various types of tests implemented: - -```shell -tox -av # lists all tests - -tox # run them all - -tox -e # run specific one - -tox -f sanity --ansible -c tox-ansible.ini # run tox-ansible that does our ansible-test sanity suite -``` - -## Support - -The [Ansible Forum](https://forum.ansible.com/tag/openshift_migrate) can be used for additional questions and issues related to this collection. - -## License - -GNU General Public License v3.0 or later. - -See the [LICENSE](https://www.gnu.org/licenses/gpl-3.0.en.html) to see the full text. From 575d23c67b4867c69c26cb60da5186426c66b218 Mon Sep 17 00:00:00 2001 From: Alberto Florez Date: Wed, 24 Jun 2026 23:57:39 +0200 Subject: [PATCH 3/4] docs: update generated documentation --- README.md | 137 --------------------------------- roles/mtv_management/README.md | 18 +++-- 2 files changed, 11 insertions(+), 144 deletions(-) diff --git a/README.md b/README.md index fafc433..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,137 +0,0 @@ -# Ansible for OpenShift Virtualization Migration - -![GitHub Release](https://img.shields.io/github/v/release/redhat-cop/openshift_virtualization_migration?include_prereleases&style=flat-square) -[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/redhat-cop/openshift_virtualization_migration/ci.yml?style=flat-square&label=release)](https://github.com/redhat-cop/openshift_virtualization_migration/actions) -[![Semantic Versioning](https://img.shields.io/badge/semver-2.0.0-blue?style=flat-square)](https://semver.org/) -[![License](https://img.shields.io/github/license/redhat-cop/openshift_virtualization_migration?style=flat-square)](LICENSE) - - - -- [Ansible for OpenShift Virtualization Migration](#ansible-for-openshift-virtualization-migration) - - [Description](#description) - - [Documentation](#documentation) - - [Release Notes](#release-notes) - - [Roles](#roles) - - [Requirements](#requirements) - - [Installation](#installation) - - [Use Cases](#use-cases) - - [Testing](#testing) - - [Support](#support) - - [License](#license) - - - -## Description - -This collection enables the migration journey of Virtual Machine (VM) workloads from existing hypervisors to Red Hat OpenShift Virtualization using Ansible Automation Platform. Additionally it provides content for the management and maintenance of VM workloads within Red Hat OpenShift Virtualization. - -## Documentation - -* [Contributing Guide](CONTRIBUTING.md) -* [Disconnected Environment Setup](docs/disconnected_environment_guide.md) -* [Secure Credential Management](docs/secure_credential_management.md) -* [Secure Credential Practices](docs/secure_credential_practices.md) - -## Release Notes - -See [CHANGELOG.md](CHANGELOG.md) for release history and changes. - -## Roles - -This collection includes the following roles for managing OpenShift Virtualization migrations: - - - - - -## Requirements - -The following Ansible Collections are required: - -```yaml ---- -collections: - - name: redhat.openshift_virtualization - - name: redhat.openshift - - name: vmware.vmware_rest - - name: ansible.posix - - name: infra.aap_utilities - - name: kubernetes.core - - name: community.crypto - - name: community.general - - name: community.vmware - - # AAP <=2.4 - - name: infra.controller_configuration - - name: ansible.controller - version: "<=4.5.12" - - # AAP 2.5+ - - name: ansible.platform - - name: ansible.controller - - name: infra.aap_configuration -... -``` - -## Installation - -You can install the `infra.openshift_virtualization_migration` collection with the Ansible Galaxy CLI: - -```shell -ansible-galaxy collection install infra.openshift_virtualization_migration -``` - -Note that if you install any collections from Ansible Galaxy, they will not be upgraded automatically when you upgrade the Ansible package. - -To upgrade the collection to the latest available version, run the following command: - -``` -ansible-galaxy collection install infra.openshift_virtualization_migration --upgrade -``` - -You can also include it in a `requirements.yml` file and install it with `ansible-galaxy collection install -r requirements.yml`, using the format: - -```yaml ---- -collections: - - name: infra.openshift_virtualization_migration - # If you need a specific version of the collection, you can specify like this: - # version: ... -``` - -See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details. - -## Use Cases - -This collection is ideal for accomplishing the following using Ansible automation: - -* Analyzing existing Virtual Machine hypervisor environments. -* Installing and configuring Ansible Automation Platform. -* Preparing OpenShift environments to support Virtual Machines and migrating Virtual Machines from existing hypervisors using the Migration Toolkit for Virtualization (MTV). -* Migrating Virtual Machines using the Migration Toolkit for Virtualization (MTV). - -## Testing - -[tox](https://tox.wiki) is used to perform tests and verification of this collection. - -The following commands can be used to execute the various types of tests implemented: - -```shell -tox -av # lists all tests - -tox # run them all - -tox -e # run specific one - -tox -f sanity --ansible -c tox-ansible.ini # run tox-ansible that does our ansible-test sanity suite -``` - -## Support - -The [Ansible Forum](https://forum.ansible.com/tag/openshift_migrate) can be used for additional questions and issues related to this collection. - -## License - -GNU General Public License v3.0 or later. - -See the [LICENSE](https://www.gnu.org/licenses/gpl-3.0.en.html) to see the full text. diff --git a/roles/mtv_management/README.md b/roles/mtv_management/README.md index c8b91f7..8e4ee15 100644 --- a/roles/mtv_management/README.md +++ b/roles/mtv_management/README.md @@ -197,6 +197,8 @@ Description: Management of the Migration Toolkit for Virtualization (MTV). | _mtv_storage_map ¦ Determine Destination Storage Class | `ansible.builtin.set_fact` | True | | _mtv_storage_map ¦ Query for Datastores from Destination Provider | `ansible.builtin.include_tasks` | True | | _mtv_storage_map ¦ Query for Datastores from Destination Provider | `ansible.builtin.include_tasks` | True | +| _mtv_storage_map ¦ Extract included datastore IDs from overrides | `ansible.builtin.set_fact` | True | +| _mtv_storage_map ¦ Extract excluded datastore IDs from overrides | `ansible.builtin.set_fact` | True | | _mtv_storage_map ¦ Process VMware Datastores | `ansible.builtin.include_tasks` | True | | _mtv_storage_map ¦ Process Ovirt Datastores | `ansible.builtin.include_tasks` | True | | _mtv_storage_map ¦ Template StorageMap Map | `ansible.builtin.set_fact` | False | @@ -406,11 +408,13 @@ classDef rescue stroke:#665352,stroke-width:2px; _mtv_storage_map___Query_for_Storage_Classes_from_Destination_Provider_mtv_query_inventory_yml_2-->|Task| _mtv_storage_map___Determine_Destination_Storage_Class3[ mtv storage map determine destination storage
class
When: **mtv management default storage class is not
defined or mtv management default storage class
default true trim length 0 and item
object metadata annotations is defined and item
object metadata annotations storageclass
kubernetes io is default class default false
string lower true**]:::task _mtv_storage_map___Determine_Destination_Storage_Class3-->|Include task| _mtv_storage_map___Query_for_Datastores_from_Destination_Provider_mtv_query_inventory_yml_4[ mtv storage map query for datastores from
destination provider
When: **ovirt in provider**
include_task: mtv query inventory yml]:::includeTasks _mtv_storage_map___Query_for_Datastores_from_Destination_Provider_mtv_query_inventory_yml_4-->|Include task| _mtv_storage_map___Query_for_Datastores_from_Destination_Provider_mtv_query_inventory_yml_5[ mtv storage map query for datastores from
destination provider
When: **vsphere in provider**
include_task: mtv query inventory yml]:::includeTasks - _mtv_storage_map___Query_for_Datastores_from_Destination_Provider_mtv_query_inventory_yml_5-->|Include task| _mtv_storage_map___Process_VMware_Datastores__mtv_storage_map_process_datastore_yml_6[ mtv storage map process vmware datastores
When: **vsphere in provider and mtv destination
datastores is defined and mtv destination
datastores length 0**
include_task: mtv storage map process datastore yml]:::includeTasks - _mtv_storage_map___Process_VMware_Datastores__mtv_storage_map_process_datastore_yml_6-->|Include task| _mtv_storage_map___Process_Ovirt_Datastores__mtv_storage_map_process_datastore_yml_7[ mtv storage map process ovirt datastores
When: **ovirt in provider and mtv destination datastores
is defined and mtv destination datastores length
0**
include_task: mtv storage map process datastore yml]:::includeTasks - _mtv_storage_map___Process_Ovirt_Datastores__mtv_storage_map_process_datastore_yml_7-->|Task| _mtv_storage_map___Template_StorageMap_Map8[ mtv storage map template storagemap map]:::task - _mtv_storage_map___Template_StorageMap_Map8-->|Task| _mtv_storage_map___Create_Storage_Map9[ mtv storage map create storage map]:::task - _mtv_storage_map___Create_Storage_Map9-->End + _mtv_storage_map___Query_for_Datastores_from_Destination_Provider_mtv_query_inventory_yml_5-->|Task| _mtv_storage_map___Extract_included_datastore_IDs_from_overrides6[ mtv storage map extract included datastore ids
from overrides
When: **mtv management storage map overrides is defined
and mtv management storage map overrides length
0 and mtv management storage map overrides
selectattr include defined list length
0**]:::task + _mtv_storage_map___Extract_included_datastore_IDs_from_overrides6-->|Task| _mtv_storage_map___Extract_excluded_datastore_IDs_from_overrides7[ mtv storage map extract excluded datastore ids
from overrides
When: **mtv management storage map overrides is defined
and mtv management storage map overrides length
0 and mtv management storage map overrides
selectattr exclude defined list length
0**]:::task + _mtv_storage_map___Extract_excluded_datastore_IDs_from_overrides7-->|Include task| _mtv_storage_map___Process_VMware_Datastores__mtv_storage_map_process_datastore_yml_8[ mtv storage map process vmware datastores
When: **vsphere in provider and mtv destination
datastores is defined and mtv destination
datastores length 0**
include_task: mtv storage map process datastore yml]:::includeTasks + _mtv_storage_map___Process_VMware_Datastores__mtv_storage_map_process_datastore_yml_8-->|Include task| _mtv_storage_map___Process_Ovirt_Datastores__mtv_storage_map_process_datastore_yml_9[ mtv storage map process ovirt datastores
When: **ovirt in provider and mtv destination datastores
is defined and mtv destination datastores length
0**
include_task: mtv storage map process datastore yml]:::includeTasks + _mtv_storage_map___Process_Ovirt_Datastores__mtv_storage_map_process_datastore_yml_9-->|Task| _mtv_storage_map___Template_StorageMap_Map10[ mtv storage map template storagemap map]:::task + _mtv_storage_map___Template_StorageMap_Map10-->|Task| _mtv_storage_map___Create_Storage_Map11[ mtv storage map create storage map]:::task + _mtv_storage_map___Create_Storage_Map11-->End ``` ### Graph for _mtv_storage_map_process_datastore.yml @@ -434,8 +438,8 @@ classDef rescue stroke:#665352,stroke-width:2px; _mtv_storage_map_process_datastore___Set_Ovirt_StorageMap_StorageClass_from_Overrides3-->|Task| _mtv_storage_map_process_datastore___Verify_VMWare_Destination_Storage_Class4[ mtv storage map process datastore verify vmware
destination storage class
When: **mtv vmware datastore is defined**]:::task _mtv_storage_map_process_datastore___Verify_VMWare_Destination_Storage_Class4-->|Task| _mtv_storage_map_process_datastore___Verify_Ovirt_Destination_Storage_Class5[ mtv storage map process datastore verify ovirt
destination storage class
When: **mtv ovirt datastore is defined**]:::task _mtv_storage_map_process_datastore___Verify_Ovirt_Destination_Storage_Class5-->|Task| _mtv_storage_map_process_datastore___Template_StorageMap_Map6[ mtv storage map process datastore template
storagemap map]:::task - _mtv_storage_map_process_datastore___Template_StorageMap_Map6-->|Task| _mtv_storage_map_process_datastore___Add_VMware_StorageMap_Map_to_Dict7[ mtv storage map process datastore add vmware
storagemap map to dict
When: **mtv vmware datastore is defined and include in
mtv management mtv vmware datastore overrides and
mtv management storage map overrides selectattr
include defined list length 0 or mtv
management storage map overrides selectattr
include defined list length 0 and mtv
management storage map overrides selectattr
exclude defined list length 0 or
exclude not in mtv management mtv vmware
datastore overrides and mtv management storage map
overrides selectattr exclude defined
list length 0**]:::task - _mtv_storage_map_process_datastore___Add_VMware_StorageMap_Map_to_Dict7-->|Task| _mtv_storage_map_process_datastore___Add_Ovirt_StorageMap_Map_to_Dict8[ mtv storage map process datastore add ovirt
storagemap map to dict
When: **mtv ovirt datastore is defined and include in
mtv management mtv ovirt datastore overrides and
mtv management storage map overrides selectattr
include defined list length 0 or mtv
management storage map overrides selectattr
include defined list length 0 and mtv
management storage map overrides selectattr
exclude defined list length 0 or
exclude not in mtv management mtv ovirt datastore
overrides and mtv management storage map overrides
selectattr exclude defined list length
0**]:::task + _mtv_storage_map_process_datastore___Template_StorageMap_Map6-->|Task| _mtv_storage_map_process_datastore___Add_VMware_StorageMap_Map_to_Dict7[ mtv storage map process datastore add vmware
storagemap map to dict
When: **mtv vmware datastore is defined**]:::task + _mtv_storage_map_process_datastore___Add_VMware_StorageMap_Map_to_Dict7-->|Task| _mtv_storage_map_process_datastore___Add_Ovirt_StorageMap_Map_to_Dict8[ mtv storage map process datastore add ovirt
storagemap map to dict
When: **mtv ovirt datastore is defined**]:::task _mtv_storage_map_process_datastore___Add_Ovirt_StorageMap_Map_to_Dict8-->End ``` From 64cb0a665ed0bcb122021973ffc2efc920f458a2 Mon Sep 17 00:00:00 2001 From: Alberto Florez Date: Thu, 25 Jun 2026 12:06:27 +0200 Subject: [PATCH 4/4] update README --- README.md | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) diff --git a/README.md b/README.md index e69de29..4c468e7 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,154 @@ +# Ansible for OpenShift Virtualization Migration + +![GitHub Release](https://img.shields.io/github/v/release/redhat-cop/openshift_virtualization_migration?include_prereleases&style=flat-square) +[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/redhat-cop/openshift_virtualization_migration/ci.yml?style=flat-square&label=release)](https://github.com/redhat-cop/openshift_virtualization_migration/actions) +[![Semantic Versioning](https://img.shields.io/badge/semver-2.0.0-blue?style=flat-square)](https://semver.org/) +[![License](https://img.shields.io/github/license/redhat-cop/openshift_virtualization_migration?style=flat-square)](LICENSE) + + + +- [Ansible for OpenShift Virtualization Migration](#ansible-for-openshift-virtualization-migration) + - [Description](#description) + - [Documentation](#documentation) + - [Release Notes](#release-notes) + - [Roles](#roles) + - [Requirements](#requirements) + - [Installation](#installation) + - [Use Cases](#use-cases) + - [Testing](#testing) + - [Support](#support) + - [License](#license) + + + +## Description + +This collection enables the migration journey of Virtual Machine (VM) workloads from existing hypervisors to Red Hat OpenShift Virtualization using Ansible Automation Platform. Additionally it provides content for the management and maintenance of VM workloads within Red Hat OpenShift Virtualization. + +## Documentation + +* [Contributing Guide](CONTRIBUTING.md) +* [Disconnected Environment Setup](docs/disconnected_environment_guide.md) +* [Secure Credential Management](docs/secure_credential_management.md) +* [Secure Credential Practices](docs/secure_credential_practices.md) + +## Release Notes + +See [CHANGELOG.md](CHANGELOG.md) for release history and changes. + +## Roles + +This collection includes the following roles for managing OpenShift Virtualization migrations: + + +* [aap_deploy](roles/aap_deploy/README.md) - Deploys an instance of Ansible Automation Platform. +* [aap_machine_credentials](roles/aap_machine_credentials/README.md) - Management of Machine Credentials. +* [aap_seed](roles/aap_seed/README.md) - Populates an Ansible Automation Platform instance. +* [bootstrap](roles/bootstrap/README.md) - Initialization of the Ansible for OpenShift Virtualization Migration environment. +* [create_mf_aap_token](roles/create_mf_aap_token/README.md) - create_mf_aap_token +* [mtv_management](roles/mtv_management/README.md) - Management of the Migration Toolkit for Virtualization (MTV). +* [mtv_migrate](roles/mtv_migrate/README.md) - Migration of Virtual Machines from Source to Destination. +* [network_mgmt](roles/network_mgmt/README.md) - Management of network related components. +* [operator_management](roles/operator_management/README.md) - Management of OpenShift Operators. +* [validate_migration](roles/validate_migration/README.md) - Verification of an Ansible for OpenShift Virtualization Migration environment. +* [vm_backup_restore](roles/vm_backup_restore/README.md) - Virtual Machine backup and restore capabilities. +* [vm_collect](roles/vm_collect/README.md) - Collection of Migration Toolkit for Virtualization inventory information. +* [vm_hot_plug](roles/vm_hot_plug/README.md) - Hot Plug Virtual Machine resources. +* [vm_lifecycle](roles/vm_lifecycle/README.md) - Management of the lifecycle activities of Virtual Machines. +* [vm_mac_address](roles/vm_mac_address/README.md) - Management of Virtual Machine MAC Addresses. +* [vm_networking](roles/vm_networking/README.md) - Management of Virtual Machine networking. +* [vm_patching](roles/vm_patching/README.md) - Patching related activities for Virtual Machines. +* [vm_ssh](roles/vm_ssh/README.md) - Management of SSH keys for Virtual Machines in OpenShift. + + +## Requirements + +The following Ansible Collections are required: + +```yaml +--- +collections: + - name: redhat.openshift_virtualization + - name: redhat.openshift + - name: vmware.vmware_rest + - name: ansible.posix + - name: infra.aap_utilities + - name: kubernetes.core + - name: community.crypto + - name: community.general + - name: community.vmware + + # AAP <=2.4 + - name: infra.controller_configuration + - name: ansible.controller + version: "<=4.5.12" + + # AAP 2.5+ + - name: ansible.platform + - name: ansible.controller + - name: infra.aap_configuration +... +``` + +## Installation + +You can install the `infra.openshift_virtualization_migration` collection with the Ansible Galaxy CLI: + +```shell +ansible-galaxy collection install infra.openshift_virtualization_migration +``` + +Note that if you install any collections from Ansible Galaxy, they will not be upgraded automatically when you upgrade the Ansible package. + +To upgrade the collection to the latest available version, run the following command: + +``` +ansible-galaxy collection install infra.openshift_virtualization_migration --upgrade +``` + +You can also include it in a `requirements.yml` file and install it with `ansible-galaxy collection install -r requirements.yml`, using the format: + +```yaml +--- +collections: + - name: infra.openshift_virtualization_migration + # If you need a specific version of the collection, you can specify like this: + # version: ... +``` + +See [using Ansible collections](https://docs.ansible.com/ansible/devel/user_guide/collections_using.html) for more details. + +## Use Cases + +This collection is ideal for accomplishing the following using Ansible automation: + +* Analyzing existing Virtual Machine hypervisor environments. +* Installing and configuring Ansible Automation Platform. +* Preparing OpenShift environments to support Virtual Machines and migrating Virtual Machines from existing hypervisors using the Migration Toolkit for Virtualization (MTV). +* Migrating Virtual Machines using the Migration Toolkit for Virtualization (MTV). + +## Testing + +[tox](https://tox.wiki) is used to perform tests and verification of this collection. + +The following commands can be used to execute the various types of tests implemented: + +```shell +tox -av # lists all tests + +tox # run them all + +tox -e # run specific one + +tox -f sanity --ansible -c tox-ansible.ini # run tox-ansible that does our ansible-test sanity suite +``` + +## Support + +The [Ansible Forum](https://forum.ansible.com/tag/openshift_migrate) can be used for additional questions and issues related to this collection. + +## License + +GNU General Public License v3.0 or later. + +See the [LICENSE](https://www.gnu.org/licenses/gpl-3.0.en.html) to see the full text.