Symptoms
You're trying to execute kolla-ansible post-deploy, however encountered the error as follows:
[root@vhi-node3 ~]# su - vstoradmin
Last login: Thu Jun 13 16:48:52 JST 2024
[vstoradmin@vhi-node3 ~]$ kolla-ansible post-deploy
Post-Deploying Playbooks : ansible-playbook -i /etc/kolla/vstorage-backend.py -e CONFIG_DIR=/etc/kolla -e @/etc/kolla/versions.yml /usr/share/kolla-ansible/ansible/post-deploy.yml
[WARNING]: * Failed to parse /etc/kolla/vstorage-backend.py with script plugin: Inventory script (/etc/kolla/vstorage-backend.py) had an execution error: Unexpected HTTP code 502 returned from
backend
[WARNING]: Unable to parse /etc/kolla/vstorage-backend.py as an inventory source
ERROR! No inventory was parsed, please check your configuration and options.
Command failed ansible-playbook -i /etc/kolla/vstorage-backend.py -e CONFIG_DIR=/etc/kolla -e @/etc/kolla/versions.yml /usr/share/kolla-ansible/ansible/post-deploy.yml
[vstoradmin@vhi-node3~]$ python3 /etc/kolla/vstorage-backend.py
Usage: /etc/kolla/vstorage-backend.py --list
[vstoradmin@vhi-node3 ~]$ python3 /etc/kolla/vstorage-backend.py --list
Unexpected HTTP code 502 returned from backend
[vstoradmin@vhi-node3 ~]$
Cause
It is most likely you're running the command not in the primary node.
In case you're not sure which one is your primary node, issue vinfra node list command and look under the column of is_primary
[root@vhi-node3 ~]# vinfra node list
Authentication user 'admin' on https://backend-api.svc.vstoragedomain:8888:
Password:
+--------------------------------------+--------------------------+------------+-----------+-------------+----------+
| id | host | is_primary | is_online | is_assigned | is_in_ha |
+--------------------------------------+--------------------------+------------+-----------+-------------+----------+
| 15e3bd8d-a134-5220-60e4-9f3ed99f1b43 | vhi-node1.vstoragedomain | True | True | True | True |
| 69e57ec1-c40a-8b7a-b16a-b3485324ee22 | vhi-node3.vstoragedomain | False | True | True | True |
| d6fe4fb2-6f1c-78c1-e847-78be02db375e | vhi-node2.vstoragedomain | False | True | True | True |
+--------------------------------------+--------------------------+------------+-----------+-------------+----------+
[root@vhi-node3 ~]#
Resolution
- Re-run the command again in the primary node.