From b677d65b2d9cf9e3ff58677300712fe3fe40da04 Mon Sep 17 00:00:00 2001 From: Miro Tomaska Date: Mon, 9 Jan 2023 16:21:59 -0600 Subject: [PATCH] [OVN][Migration] Enable settings backup subnet for NFS clients MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the BACKUP_MIGRATION_IP is set to a different IP outside of the default nets[1] set in the “openstack overcloud backup” playbook setup_nfs role[2]. Then the NFS will fail to mount directories during the backup, because they will not be reachable | permitted. This change simply adds a new variable BACKUP_MIGRATION_CTL_PLANE_CIDRS into the ovn_migration script to allow the user to overwrite the extra-var used for Openstack overcloud backup --setup-nfs command. [1] https://opendev.org/openstack/tripleo-ansible/src/commit/e281ae7624774d71f22fbb993af967ed1ec08780/tripleo_ansible/roles/backup_and_restore/defaults/main.yml#L47 [2] https://opendev.org/openstack/tripleo-ansible/src/commit/e281ae7624774d71f22fbb993af967ed1ec08780/tripleo_ansible/roles/backup_and_restore/tasks/setup_nfs.yml#L127 Change-Id: I160dfc4e893b93ac7a40e19b3dd6b89750dac57d --- doc/source/ovn/migration.rst | 6 ++++++ tools/ovn_migration/tripleo_environment/ovn_migration.sh | 4 +++- .../playbooks/roles/recovery-backup/tasks/main.yml | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/source/ovn/migration.rst b/doc/source/ovn/migration.rst index 7fa733ce4ff..38d9bb65a52 100644 --- a/doc/source/ovn/migration.rst +++ b/doc/source/ovn/migration.rst @@ -155,6 +155,12 @@ Perform the following steps in the undercloud server that will be used as a NFS server to store the backup. Default: 192.168.24.1 + * BACKUP_MIGRATION_CTL_PLANE_CIDRS - Only used if CREATE_BACKUP is enabled. + A comma separated string of control plane subnets in CIDR notation for the + controllers being backed up. The specified subnets will be used to enable + NFS remote clients connections. + Default: 192.168.24.0/24 + .. warning:: Please note that VALIDATE_MIGRATION requires enough quota (2 diff --git a/tools/ovn_migration/tripleo_environment/ovn_migration.sh b/tools/ovn_migration/tripleo_environment/ovn_migration.sh index 271783e74a5..14c6ce7d0c2 100644 --- a/tools/ovn_migration/tripleo_environment/ovn_migration.sh +++ b/tools/ovn_migration/tripleo_environment/ovn_migration.sh @@ -42,7 +42,8 @@ LANG=C : ${VALIDATE_MIGRATION:=False} : ${DHCP_RENEWAL_TIME:=30} : ${CREATE_BACKUP:=True} -: ${BACKUP_MIGRATION_IP:=192.168.24.1} # TODO: Document this new var +: ${BACKUP_MIGRATION_IP:=192.168.24.1} +: ${BACKUP_MIGRATION_CTL_PLANE_CIDRS:=192.168.24.0/24} check_for_necessary_files() { @@ -328,6 +329,7 @@ start_migration() { -e overcloudrc=$OVERCLOUDRC_FILE \ -e stackrc=$STACKRC_FILE \ -e backup_migration_ip=$BACKUP_MIGRATION_IP \ + -e backup_migration_ctl_plane_cidrs=$BACKUP_MIGRATION_CTL_PLANE_CIDRS \ -e create_backup=$CREATE_BACKUP \ -e ansible_inventory=$inventory_file \ -e validate_migration=$VALIDATE_MIGRATION $* diff --git a/tools/ovn_migration/tripleo_environment/playbooks/roles/recovery-backup/tasks/main.yml b/tools/ovn_migration/tripleo_environment/playbooks/roles/recovery-backup/tasks/main.yml index 6ed510316ae..d018183fb5c 100644 --- a/tools/ovn_migration/tripleo_environment/playbooks/roles/recovery-backup/tasks/main.yml +++ b/tools/ovn_migration/tripleo_environment/playbooks/roles/recovery-backup/tasks/main.yml @@ -36,6 +36,7 @@ --setup-nfs \ --extra-vars '{ "tripleo_backup_and_restore_server": {{ backup_migration_ip }}, + "tripleo_backup_and_restore_clients_nets": {{ backup_migration_ctl_plane_cidrs.split(',') }}, "nfs_server_group_name": {{ revert_preparation_server_name }} }'