Bug 2216472

Summary: what is the recommended procedure to clean an overcloud deployment?
Product: Red Hat OpenStack Reporter: Osama Elswah <oelswah>
Component: documentationAssignee: Irina <igallagh>
Status: CLOSED CURRENTRELEASE QA Contact: RHOS Documentation Team <rhos-docs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 17.0 (Wallaby)CC: enothen, igallagh, oelswah, rheslop, tkajinam
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-10 11:10:58 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:

Description Osama Elswah 2023-06-21 14:36:47 UTC
Description of problem:
After deleting the ovecloud, what is the recommended procedure to clean the nodes and the undercloud
if I delete the overcloud by "openstack overcloud delete overcloud", how should I proceed? I found out that there are openstack ports still defined (source stackrc; openstack port list) should I delete these ports? 
Should I delete the folder /home/stack/overcloud-deploy? Should I unprovision the baremetal nodes (openstack overcloud node unprovision) should I execute the command metalsmith undeploy? 
The current documentation doesn't clearly identify this





Expected results:


Additional info:

Comment 1 Takashi Kajinami 2023-06-22 11:14:28 UTC
https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/17.0/html/director_installation_and_usage/assembly_performing-basic-overcloud-administration-tasks#proc_removing-an-overcloud-stack_performing-basic-overcloud-administration-tasks

If you follow the documentation and execute `openstack overcloud delete overcloud` with the described option then the command should unprovision baremetal nodes and network ports.
The documentation says "Wait for the overcloud to delete and the nodes and networks to unprovision.", and this clearly states that baremetal nodes and networks should be unprovisioned.
Note that VIF ports created by  baremetal node imports are kept, so if you are seeing these ports then that's expected.

You don't have to delete the /home/stack/overcloud-deploy directory because the files there should be replaced by next overcloud deploy.

However removing the directory does not harm and the next run should recreate it again from scratch (as it does for the first run).
We can probably add the step to remove /home/stack/overcloud-deploy/<stack name> and /home/stack/config-download/<stack name> .

Comment 2 Takashi Kajinami 2023-06-23 04:52:56 UTC
I discussed this with a few team members and we agreed adding the steps to remove the directories would make sense.

I'll convert this to a doc bug to address that.

Please add the following step after step 7.

```
8. Remove the artifacts directories created
 $ rm -rf ~/overcloud-deploy/<stack>
 $ rm -rf ~/config-donwload/<stack>

Note that the directory paths might be different in case any of `--output-dir` and `--working-dir` are used
in the `openstack overcloud deploy` command
```