diff options
author | Eduardo Olivares <eolivare@redhat.com> | 2022-02-14 14:40:32 +0100 |
---|---|---|
committer | Eduardo Olivares <eolivare@redhat.com> | 2022-03-04 08:58:05 +0000 |
commit | 480c643dd94512606baab02bf26a90c9ab855c55 (patch) | |
tree | 57726a701f7b08cadcb0302ab86f1b6b6e8a054a /tools | |
parent | b072cbf05f079519e379b2bfebe27846ae612275 (diff) | |
download | neutron-480c643dd94512606baab02bf26a90c9ab855c55.tar.gz |
[ovn-migration] Add debug information to create-resources.sh.j2 scripts
Port status, server status and server console log output are printed
when the create-resources.sh script fails during the OVN migration
Example: OVN migration fails because SSH connection is not possible,
after ping successfully replied - probably a metadata issue and having
the console logs could help to identify it
Change-Id: I83e55203907526caf44ba34cd38241eccf70adb3
Diffstat (limited to 'tools')
2 files changed, 24 insertions, 1 deletions
diff --git a/tools/ovn_migration/infrared/tripleo-ovn-migration/roles/create-resources/templates/create-resources.sh.j2 b/tools/ovn_migration/infrared/tripleo-ovn-migration/roles/create-resources/templates/create-resources.sh.j2 index 752b6f1406..3b51f2e207 100644 --- a/tools/ovn_migration/infrared/tripleo-ovn-migration/roles/create-resources/templates/create-resources.sh.j2 +++ b/tools/ovn_migration/infrared/tripleo-ovn-migration/roles/create-resources/templates/create-resources.sh.j2 @@ -65,6 +65,8 @@ do if [ $num_attempts -gt 24 ] then echo "VM is not up even after 2 minutes. Something is wrong" + # printing server information for debugging + openstack server show ovn-migration-server-{{ resource_suffix }}-$i exit 1 fi done @@ -86,6 +88,8 @@ do if [ $num_attempts -gt 24 ] then echo "Port is not up even after 2 minutes. Something is wrong" + # printing port information for debugging + openstack port show $port_id exit 1 fi done @@ -140,6 +144,9 @@ do if [ $num_attempts -gt 60 ] then echo "VM is not pingable. Something is wrong." + # printing server information for debugging + server_id=$(openstack server list -f value | grep $server_ip | awk '{print $1}') + openstack console log show $server_id exit 1 fi fi @@ -147,6 +154,16 @@ do ssh -i {{ ovn_migration_temp_dir }}/ovn_migration_ssh_key -o StrictHostKeyChecking=no \ -o UserKnownHostsFile=/dev/null cirros@$server_ip date + rc=$? + if [ "$rc" != "0" ] + then + echo "VM not accessible via ssh. Something went wrong. Exiting with rc=$rc" + # printing server information for debugging purposes + server_id=$(openstack server list -f value | grep $server_ip | awk '{print $1}') + openstack console log show $server_id + exit $rc + fi + done echo "Done with the resource creation : exiting" diff --git a/tools/ovn_migration/tripleo_environment/playbooks/roles/resources/create/templates/create-resources.sh.j2 b/tools/ovn_migration/tripleo_environment/playbooks/roles/resources/create/templates/create-resources.sh.j2 index bf5ebc936e..0827f2acd3 100644 --- a/tools/ovn_migration/tripleo_environment/playbooks/roles/resources/create/templates/create-resources.sh.j2 +++ b/tools/ovn_migration/tripleo_environment/playbooks/roles/resources/create/templates/create-resources.sh.j2 @@ -78,6 +78,8 @@ do if [ $num_attempts -gt 24 ] then echo "Port is not up even after 2 minutes. Something is wrong" + # printing port information for debugging + openstack port show ovn-migration-server-port-{{ resource_suffix }} exit 1 fi done @@ -120,7 +122,9 @@ do if [ $num_attempts -gt 60 ] then echo "VM is not reachable. Something is wrong." - # Even though something seems wrong, lets try and ping. + # printing server information for debugging + server_id=$(openstack server list -f value | grep $server_ip | awk '{print $1}') + openstack console log show $server_id exit 1 fi fi @@ -132,4 +136,6 @@ ssh -i {{ ovn_migration_temp_dir }}/ovn_migration_ssh_key -o StrictHostKeyChecki rc=$? echo "Done with the resource creation : exiting with $rc" +# printing server information for debugging +[ "$rc" != "0" ] && openstack console log show $(openstack server list -f value | grep $server_ip | awk '{print $1}') exit $rc |