Bug 2035808

Summary: [OSP17.0][OVN migration] generate-inventory fails on check_stack function
Product: Red Hat OpenStack Reporter: Roman Safronov <rsafrono>
Component: openstack-neutronAssignee: Jakub Libosvar <jlibosva>
Status: CLOSED ERRATA QA Contact: Roman Safronov <rsafrono>
Severity: high Docs Contact:
Priority: urgent    
Version: 17.0 (Wallaby)CC: apevec, chrisw, jschluet, lhh, majopela, mtomaska, scohen, skaplons
Target Milestone: AlphaKeywords: Regression, Triaged
Target Release: 17.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-neutron-18.2.1-0.20220330172248.ca458d9.el9ost Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-21 12:18:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2019745    

Description Roman Safronov 2021-12-27 18:43:40 UTC
Description of problem:
When trying to run ovs2ovn migration on OSP17 the ovn_migration script fails on check_stack function because heat is not available and 'openstack stack show <STACK_NAME>' command does not work on OSP17 as it used to work on previous OSP versions.

(undercloud) [stack@undercloud-0 ovn_migration]$ openstack stack show overcloud
/usr/lib64/python3.6/site-packages/_yaml/__init__.py:23: DeprecationWarning: The _yaml extension module is now located at yaml._yaml and its location is subject to change.  To use the LibYAML-based parser and emitter, import from `yaml`: `from yaml import CLoader as Loader, CDumper as Dumper`.
  DeprecationWarning
public endpoint for orchestration service in regionOne region not found
(undercloud) [stack@undercloud-0 ovn_migration]$ echo $?
1



# Check if the stack exists
function check_stack {
    source $STACKRC_FILE
    openstack stack show $STACK_NAME 1> /dev/null || {
        echo "ERROR: STACK_NAME=${STACK_NAME} does not exist. Please provide the stack name or its ID "
        echo "       via STACK_NAME environment variable."
        exit 1
    }
}



Version-Release number of selected component (if applicable):
RHOS-17.0-RHEL-8-20211208.n.1

How reproducible:
100%

Steps to Reproduce:
1. Deploy OSP17.0 with ML2/OVS backend
2. Due to BZ2035354 do the following workaround:
  a)Clone upstream neutron repo stable/wallaby branch (OSP17.0 is based on it) and copy ovn_migration.sh script to /usr/bin and ovn migration ansible playbooks to  ~/ovn_migration (according to the official documentation for the latest OSP version, https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.2/html-single/networking_with_open_virtual_network/index#ml2-ovs-to-ovn-migration-prepare_migrating-ml2ovs-to-ovn), 
i.e.
git clone -b stable/wallaby https://github.com/openstack/neutron.git
sudo cp neutron/tools/ovn_migration/tripleo_environment/ovn_migration.sh /usr/bin/
sudo chmod +x /usr/bin/ovn_migration.sh
cp -r neutron/tools/ovn_migration/tripleo_environment/playbooks/ ~/ovn_migration

3. Follow the official documentation until step 9 - try to generate inventory 
/home/stack/ovn_migration/start-ovn-migration.sh generate-inventory > /home/stack/ovn_migration/generate-inventory.log 


Actual results:
ovn_migration script fails on check_stack function

Expected results:
ovn_migration script does not fail 

Additional info:

Comment 5 Roman Safronov 2022-06-20 09:13:05 UTC
Verified that the issue does not occur on RHOS-17.0-RHEL-9-20220615.n.2

Comment 10 errata-xmlrpc 2022-09-21 12:18:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:6543