Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1496352 - Failed to undeploy Metrics
Failed to undeploy Metrics
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer (Show other bugs)
3.7.0
Unspecified Unspecified
medium Severity medium
: ---
: 3.7.0
Assigned To: ewolinet
Junqi Zhao
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-27 03:20 EDT by Junqi Zhao
Modified: 2017-11-28 17:13 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-11-28 17:13:02 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
uninstall metrics log (688.40 KB, text/plain)
2017-09-27 03:20 EDT, Junqi Zhao
no flags Details
set openshift_metrics_uninstall_metrics=True to undeploy metrics (709.88 KB, text/plain)
2017-09-27 21:35 EDT, Junqi Zhao
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:3188 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Container Platform 3.7 security, bug, and enhancement update 2017-11-28 21:34:54 EST

  None (edit)
Description Junqi Zhao 2017-09-27 03:20:25 EDT
Created attachment 1331319 [details]
uninstall metrics log

Description of problem:
Set openshift_metrics_install_metrics=false did not uninstall metrics, the ansible log seems normal.

Before uninstallation
# oc get po
NAME                         READY     STATUS    RESTARTS   AGE
hawkular-cassandra-1-wg8xk   1/1       Running   1          4m
hawkular-metrics-mkwwm       1/1       Running   0          4m
heapster-mkm74               1/1       Running   0          4m

After installation
# oc get po
NAME                         READY     STATUS    RESTARTS   AGE
hawkular-cassandra-1-wg8xk   1/1       Running   1          15m
hawkular-metrics-mkwwm       1/1       Running   0          15m
heapster-mkm74               1/1       Running   0          15m

Version-Release number of the following components:
# rpm -qa | grep openshift-ansible
openshift-ansible-3.7.0-0.131.0.git.0.9486490.el7.noarch
openshift-ansible-roles-3.7.0-0.131.0.git.0.9486490.el7.noarch
openshift-ansible-docs-3.7.0-0.131.0.git.0.9486490.el7.noarch
openshift-ansible-callback-plugins-3.7.0-0.131.0.git.0.9486490.el7.noarch
openshift-ansible-filter-plugins-3.7.0-0.131.0.git.0.9486490.el7.noarch
openshift-ansible-playbooks-3.7.0-0.131.0.git.0.9486490.el7.noarch
openshift-ansible-lookup-plugins-3.7.0-0.131.0.git.0.9486490.el7.noarch


How reproducible:
Always

Steps to Reproduce:
1. Deploy metrics 3.7 via openshift-ansible
2. After all the pods get ready, undeploy metrics 3.7 via openshift-ansible
3.

Actual results:
Metrics was not uninstalled

Expected results:
Metrics should be uninstalled

Additional info:
# Inventory file
[OSEv3:children]
masters
etcd

[masters]
${MASTER} openshift_public_hostname=${MASTER}

[etcd]
${ETCD} openshift_public_hostname=${ETCD}


[OSEv3:vars]
ansible_ssh_user=root
ansible_ssh_private_key_file="~/libra.pem"
deployment_type=openshift-enterprise
openshift_docker_additional_registries=brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888


# Metrics
openshift_metrics_install_metrics=false
openshift_metrics_hawkular_hostname=hawkular-metrics.${SUB_DOMAIN}
openshift_metrics_project=openshift-infra
openshift_metrics_image_prefix=brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/openshift3/
openshift_metrics_image_version=v3.7
Comment 1 Junqi Zhao 2017-09-27 03:24:54 EDT
typo, change "After installation" to "After uninstallation" in Comment 0
Comment 2 Junqi Zhao 2017-09-27 03:59:55 EDT
same issue when undeploy openshift metrics hawkular agent, set openshift_metrics_install_hawkular_agent=false, openshift metrics hawkular agent can not be undeployed.
Comment 3 Scott Dodson 2017-09-27 13:31:24 EDT
I think this is expected, eric can clarify.
Comment 4 ewolinet 2017-09-27 16:46:25 EDT
This is expected, yes.

Due to logging and metrics installing by default, it made sense to update the logic such that install and uninstall should have separate flags.

To uninstall metrics you should set openshift_metrics_uninstall_metrics=True
Comment 5 Junqi Zhao 2017-09-27 21:33:47 EDT
(In reply to ewolinet from comment #4)
> This is expected, yes.
> 
> Due to logging and metrics installing by default, it made sense to update
> the logic such that install and uninstall should have separate flags.
> 
> To uninstall metrics you should set openshift_metrics_uninstall_metrics=True

Tested with openshift-ansible-playbooks-3.7.0-0.131.0, set openshift_metrics_uninstall_metrics=True, metrics still can not be uninstalled. We usually set openshift_metrics_install_metrics=false to uninstall metrics before, and it can uninstall successfully.
Comment 6 Junqi Zhao 2017-09-27 21:35:17 EDT
# parameters
openshift_metrics_uninstall_metrics=True
openshift_metrics_hawkular_hostname=hawkular-metrics.${SUB_DOMAIN}
openshift_metrics_project=openshift-infra
openshift_metrics_image_prefix=brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/openshift3/
openshift_metrics_image_version=v3.7
Comment 7 Junqi Zhao 2017-09-27 21:35 EDT
Created attachment 1331666 [details]
set openshift_metrics_uninstall_metrics=True to undeploy metrics
Comment 8 ewolinet 2017-09-28 09:26:01 EDT
@Junqi,

I see this at the bottom of the play:

PLAY [OpenShift Metrics] ****************************************************************************************************************************************************************
skipping: no hosts matched


Can you please provide the full inventory you used for testing this?
Comment 9 Junqi Zhao 2017-09-28 20:26:57 EDT
(In reply to ewolinet from comment #8)
> @Junqi,
> 
> I see this at the bottom of the play:
> 
> PLAY [OpenShift Metrics]
> *****************************************************************************
> *****************************************************************************
> ******
> skipping: no hosts matched
> 
> 
> Can you please provide the full inventory you used for testing this?

[OSEv3:children]
masters
etcd

[masters]
${MASTER} openshift_public_hostname=${MASTER}

[etcd]
${ETCD} openshift_public_hostname=${ETCD}


[OSEv3:vars]
ansible_ssh_user=root
ansible_ssh_private_key_file="~/libra.pem"
deployment_type=openshift-enterprise
openshift_docker_additional_registries=brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/


# Metrics
openshift_metrics_uninstall_metrics=True
openshift_metrics_hawkular_hostname=hawkular-metrics.${SUB_DOMAIN}
openshift_metrics_project=openshift-infra
openshift_metrics_image_prefix=brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/openshift3/
openshift_metrics_image_version=v3.7
Comment 10 Junqi Zhao 2017-09-28 22:04:29 EDT
Tested with openshift-ansible-3.7.0-0.128.0, set openshift_metrics_uninstall_metrics=True, metrics could be undeployed, I used openshift-ansible-3.7.0-0.131 when this defect was reported, so there is something wrong with openshift-ansible-3.7.0-0.131
Comment 11 Peter Ruan 2017-09-29 01:54:04 EDT
@ewolinet, will these parameters and the old ones co-exist in the same inventory file?  Currently, our automation tests use a common uninstall inventory with the following parameters set to:

openshift_logging_install_logging=false
openshift_metrics_install_metrics=false

QE needs to test older version of OCP, so it's vital that openshift-ansible can accept both parameters in the inventory and depending on the OCP version, it will pick the correct parameters w/o raising errors.  In short we want to be able to have the following in the inventory so the same inventory will work for all versions of OCP that accepts ansible installation.

### for OCP < 3.7
openshift_logging_install_logging=false
openshift_metrics_install_metrics=false

#### for OCP >= 3.7
openshift_logging_uninstall_logging=true
openshift_logging_uninstall_metrics=true
Comment 14 Junqi Zhao 2017-10-09 04:23:58 EDT
Tested with openshift-ansible-3.7.0-0.143.1, codes are reverted, set openshift_metrics_install_metrics=false can undeploy metrics successfully.

Installer version
# rpm -qa | grep openshift-ansible
openshift-ansible-docs-3.7.0-0.143.1.git.0.89248df.el7.noarch
openshift-ansible-filter-plugins-3.7.0-0.143.1.git.0.89248df.el7.noarch
openshift-ansible-3.7.0-0.143.1.git.0.89248df.el7.noarch
openshift-ansible-lookup-plugins-3.7.0-0.143.1.git.0.89248df.el7.noarch
openshift-ansible-roles-3.7.0-0.143.1.git.0.89248df.el7.noarch
openshift-ansible-callback-plugins-3.7.0-0.143.1.git.0.89248df.el7.noarch
openshift-ansible-playbooks-3.7.0-0.143.1.git.0.89248df.el7.noarch
Comment 18 errata-xmlrpc 2017-11-28 17:13:02 EST
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, 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/RHSA-2017:3188

Note You need to log in before you can comment on or make changes to this bug.