Bug 1367843

Summary: Deleting deployment doesn't delete associated compute resources / compute profiles / host groups
Product: Red Hat Quickstart Cloud Installer Reporter: Tasos Papaioannou <tpapaioa>
Component: WebUIAssignee: John Matthews <jmatthew>
Status: CLOSED DEFERRED QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.0CC: llasmith
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-25 17:28:57 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:

Description Tasos Papaioannou 2016-08-17 15:47:03 UTC
Description of problem:

Deleting a deployment doesn't delete the associated compute resources, compute profiles, host groups, and activation keys. This can cause failed deployments if the same deployment name is used later.

Version-Release number of selected component (if applicable):

QCI-1.0-RHEL-7-20160815.t.0

How reproducible:

100%

Steps to Reproduce:
1.) Start a deployment for RHV + CFME.
2.) Delete the deployment and host records after it completes or fails.
3.) See under Configure > Host groups, Infrastructure > Compute resources, and Infrastructure > Compute profiles that the associated records still exist.
4.) Create and start a new RHV + CFME deployment with the same name.

Actual results:

The new deployment fails during the CFME installation, with error in /var/log/foreman/production.log:

----
2016-08-16 17:15:21 [foreman-tasks/action] [E] ERF56-1309 [Foreman::FingerprintException]: The remote system presented a public key signed by an unidentified certificate authority. If you are sure the remote system is authentic, go to the compute resource edit page, press the 'Test Connection' or 'Load Datacenters' button and submit (Foreman::FingerprintException)
 | /usr/share/foreman/app/models/compute_resources/foreman/model/ovirt.rb:332:in `rescue in client'
 | /usr/share/foreman/app/models/compute_resources/foreman/model/ovirt.rb:319:in `client'
 | /usr/share/foreman/app/models/compute_resources/foreman/model/ovirt.rb:14:in `clusters'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.1/app/lib/actions/fusor/deployment/rhev/cfme_launch.rb:55:in `create_compute_profile'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.0.1/app/lib/actions/fusor/deployment/rhev/cfme_launch.rb:33:in `run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.11/lib/dynflow/action.rb:506:in `block (3 levels) in execute_run'
[...]
----

Expected results:

Host groups, Compute resources, Compute profiles, and activation keys associated with deployments don't get deleted when deleting the deployment. New deployment with the same label can fail.

Additional info:

The above error from a failed CFME deployment appears to be due to the fact that the CA certificate in the old RHEV compute resource is from the previous deployment, and doesn't work for the new deployment.

Comment 2 Landon LaSmith 2017-01-16 19:32:32 UTC
One a redeployment of RHV+OSP+CFME using the same resources, I encountered the error below on the Openstack::Deploy task.  Prior to starting the deployment, I did delete all entries under "Hosts->All Hosts" in satellite.

2017-01-16 12:21:57 [app] [I] Add DNS A record for all-in-one-overcloud.cfme.lab.eng.rdu2.redhat.com/192.0.2.10
2017-01-16 12:21:57 [foreman-tasks/action] [E] ERF12-2357 [ProxyAPI::ProxyException]: Unable to set DNS entry ([RestClient::Conflict]: 409 Conflict) for Capsule https://dhcp-8-58-229.cfme.lab.eng.rdu2.redhat.com:9090/dns (ProxyAPI::ProxyException)
 | /usr/share/foreman/lib/proxy_api/dns.rb:15:in `rescue in set'
 | /usr/share/foreman/lib/proxy_api/dns.rb:13:in `set'
 | /usr/share/foreman/lib/net/dns/a_record.rb:20:in `create'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/fusor_server-1.1.28/app/lib/actions/fusor/deployment/open_stack/add_osp_hostnames.rb:40:in `run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/action.rb:506:in `block (3 levels) in execute_run'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware/stack.rb:26:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware/stack.rb:26:in `pass'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/middleware.rb:17:in `pass'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/action/progress.rb:30:in `with_progress_calculation'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.3/lib/dynflow/action/progress.rb:16:in `run'


QCI Media Version: QCI-1.1-RHEL-7-20170112.t.0
QCIOOO Media Version: QCIOOO-10.0-RHEL-7-20170113.t.0

Comment 3 Sudhir Mallamprabhakara 2019-02-25 17:28:57 UTC
QCI has sunset. Closing the BZ's