Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1434180

Summary: [RFE] [Undercloud] Delete undercloud without reinstalling
Product: Red Hat OpenStack Reporter: jliberma <jliberma>
Component: rhosp-directorAssignee: Angus Thomas <athomas>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 11.0 (Ocata)CC: aschultz, dbecker, ggrimaux, kecarter, mburns, morazi, rurena
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-18 18:01:44 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 jliberma@redhat.com 2017-03-20 22:33:42 UTC
Description of problem:

There are several scenarios where an operator may need to completely uninstall the undercloud without reinstalling the host or vm where it runs.

Currently there is a KB article: https://access.redhat.com/solutions/2210421

AFAIK this process is not QA or tracked across releases, so it can get out of date. Also, I am not aware that anyone in engineering has signed off on this process. 

We need: 
1. a openstack undercloud command that deletes the undercloud completely from a host (RFE)
2. documentation for manually deleting an undercloud (DOC)

Additional info:

Here is a quick and dirty script I distilled for the Kbase and my own field experience.

The networking section has not been tested extensively.

#!/usr/env bash
# from: https://access.redhat.com/solutions/2210421

# services
declare -a services=(
neutron-dhcp-agent.service
neutron-openvswitch-agent.service
neutron-ovs-cleanup.service
neutron-server.service
openstack-ironic-inspector-dnsmasq.service
openstack-nova-compute.service
openstack-nova-conductor.service
openstack-nova-scheduler.service
openstack-swift-account-reaper.service
openstack-swift-account.service
openstack-swift-container-updater.service
openstack-swift-container.service
openstack-swift-object-updater.service
openstack-swift-object.service
openstack-swift-proxy.service
openstack-zaqar.service
openstack-zaqar
keepalived
)

# files
declare -a files=(
/home/stack/.instack
/home/stack/stackrc
/home/stack/undercloud-passwords.conf
/root/stackrc
/root/tripleo-undercloud-passwords
/var/lib/ironic-inspector
/var/lib/mysql
/var/lib/rabbitmq
/var/opt/undercloud-stack
)

# directories
declare -a dirs=(
/etc/ceilometer
/etc/heat
/etc/glance 
/etc/horizon 
/etc/ironic
/etc/ironic-inspector
/etc/keystone
/etc/neutron 
/etc/nova 
/etc/swift 
/etc/haproxy
)

# packages
declare -a pkgs=(
rabbitmq-server 
mariadb
haproxy
openvswitch
keepalived 
$(rpm -qa | grep openstack)
$(rpm -qa | grep neutron)
$(rpm -qa | grep swift)
)

source stackrc
env | grep OS_

# delete swift containers
for i in $(swift list); do swift delete $i; done

# stop openstack services
for i in ${services[*]}; do sudo systemctl stop $i; done
for i in ${services[*]}; do sudo systemctl status $i; done

# remove files and directories
for i in ${files[*]}; do sudo rm -rf $i; done
for i in ${dirs[*]}; do sudo rm -rf $i; done

# remove pkgs
for i in ${pkgs[*]}; do sudo yum remove -y $i; done

# restore networking
mv  /etc/os-net-config/config.json  /etc/os-net-config/config.json.orig
mv /etc/sysconfig/network-scripts/ifcfg-br-ctlplane /etc/sysconfig/network-scripts/orig.ifcfg-br-ctlplane

##EOF

Comment 2 Kevin Carter 2020-11-18 18:01:44 UTC
With the introduction of the containerized undercloud, this is now possible without running through all of the mentioned steps. This RFE is being closed.