Description of problem: CI job failing due to file already existing during openstack overcloude node provision command Version-Release number of selected component (if applicable): How reproducible: saw once so far Steps to Reproduce: 1. on installed undercloud run command: openstack overcloud node provision --stack overcloud --network-config \ --output /home/stack/templates/overcloud-baremetal-deployed.yaml \ /home/stack/virt/network/baremetal_deployment.yaml 2. 3. Actual results: error that output file already exists FATAL | fail | localhost | error={"changed": false, "msg": "Output file /home/stack/templates/overcloud-baremetal-deployed.yaml already exists"} Expected results: command succeeds Additional info: Command:
The 'openstack overcloud node provision' command does a check if the file exists and prompts the user for confirmation that the file can be overwritten. In automation the prompt leads to failure, since there is no human to answer 'yes'. You can add the '--yes' option to 'openstack overcloud node provision' command to make it overwrite the file without asking. Alternatively add a step to clean up the file in CI, if we have jobs that provision -> unprovision -> provision it makes sense to clean up this file as part of the unprovision step.
Strange that this did not occur when testing in staging. I will add the '--yes' though and see how it goes. Thank you Harald!
Using '--yes' did not work. I tried to place the '--yes' in several places in the command and always get this: usage: openstack overcloud node provision [-h] [-o OUTPUT] [--stack STACK] [--overcloud-ssh-user OVERCLOUD_SSH_USER] [--overcloud-ssh-key OVERCLOUD_SSH_KEY] [--concurrency CONCURRENCY] [--timeout TIMEOUT] [--network-ports] [--network-config] [--templates TEMPLATES] [--working-dir WORKING_DIR] <baremetal_deployment.yaml> openstack overcloud node provision: error: unrecognized arguments: --yes
hm, that is strange. I can see the option in code: https://opendev.org/openstack/python-tripleoclient/src/branch/stable/wallaby/tripleoclient/v2/overcloud_node.py#L238-L240 https://opendev.org/openstack/python-tripleoclient/src/branch/stable/wallaby/tripleoclient/v2/overcloud_node.py#L297-L305 If you can set up a reproducer I'd be happy to investigate.
Ok, I found the issue. The '--yes' option was added recently, 1 month ago. This is the commit in `rhos-17.0-trunk-patches`: commit 57bcf3b2e3aab8d82fb4c8ec35684a7a0546078c Author: James Slagle <jslagle> Date: Wed Feb 23 15:11:01 2022 -0500 Add --yes to overcloud node provision for output file overwrite Previously, the command did not check if the output file already existed. A check is now added, which can be bypassed with the added --yes argument. Depends-On: I28f0b6399ced8c185c04e2e6a7dd7906e2eaadd4 Change-Id: Ic8c6b37c23bc6df1007f7a3a68cac5ef71a9918e Signed-off-by: James Slagle <jslagle> (cherry picked from commit 34b4d6bfcb1e1d06f01a1842ea971b56c8fa64f5) The patch is not in python3-tripleoclient-16.4.1-0.20220317201057.b7b58c4.el8ost.noarch. I think we need to wait for the next puddle. (Or add a step in the job to clean up the existing file.)
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