Bug 1495545 - Wrong setting etcd_backup_tag variable when create etcd backup file
Summary: Wrong setting etcd_backup_tag variable when create etcd backup file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cluster Version Operator
Version: 3.7.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Jan Chaloupka
QA Contact: liujia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-26 09:36 UTC by liujia
Modified: 2017-11-28 22:13 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-28 22:13:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:3188 0 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Container Platform 3.7 security, bug, and enhancement update 2017-11-29 02:34:54 UTC

Description liujia 2017-09-26 09:36:00 UTC
Description of problem:
When backup etcd files during upgrade etcd, there are two etcd backup files generated before and after etcd upgrade as following.

# ls -la /var/lib/etcd/
total 4
drwxr-xr-x.  6 etcd etcd  145 Sep 26 02:51 .
drwxr-xr-x. 39 root root 4096 Sep 26 02:14 ..
drwxr-xr-x.  3 root root   17 Sep 26 01:19 etcd.etcd
drwx------.  4 etcd etcd   29 Sep 26 01:19 member
drwx------.  3 root root   20 Sep 26 02:50 openshift-backup-etcd_backup_tag20170926024958
drwx------.  3 root root   20 Sep 26 02:51 openshift-backup-etcd_backup_tag20170926025100

However,they are should be named by different "etcd_backup_tag" for distinguishing from each other with "pre-upgrade-" and "post-3.0-".

pre backup in $playbooks/common/openshift-cluster/upgrades/etcd/main.yml
- name: Backup etcd before upgrading anything
  include: backup.yml
  vars:
    etcd_backup_tag: "pre-upgrade-"
  when: openshift_etcd_backup | default(true) | bool

post backup in $playbooks/common/openshift-cluster/upgrades/etcd/upgrade.yml
- name: Backup etcd
  include: backup.yml
  vars:
    etcd_backup_tag: "post-3.0-"
  when: openshift_etcd_backup | default(true) | bool

It is because in backup.yml, set variable wrongly.
---
- name: Backup etcd
  hosts: oo_etcd_hosts_to_backup
  roles:
  - role: openshift_etcd_facts
  - role: etcd_common
    r_etcd_common_action: backup
    r_etcd_common_backup_tag: etcd_backup_tag
...

Version-Release number of the following components:
atomic-openshift-utils-3.7.0-0.127.0.git.0.b9941e4.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. Install ocp
2. Do etcd upgrade
3.

Actual results:
etcd_backup_tag variable did not take effect when create etcd backup file

Expected results:
ETCD backup file should named with "pre-upgrade-" and "post-3.0-" prefix.

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 1 Jan Chaloupka 2017-09-27 11:44:29 UTC
Upstream PR: https://github.com/openshift/openshift-ansible/pull/5549

Comment 2 openshift-github-bot 2017-09-28 06:11:22 UTC
Commit pushed to master at https://github.com/openshift/openshift-ansible

https://github.com/openshift/openshift-ansible/commit/dcdf09e0aaae055cad8e01e07aa07a951a81f798
Merge pull request #5549 from ingvagabund/fix-etcd-backup-tag

Automatic merge from submit-queue

evaluate etcd_backup_tag variable

Bug: 1495545

Comment 4 liujia 2017-11-02 07:29:30 UTC
Verified on openshift-ansible-3.7.0-0.189.0.git.0.d497c5e.el7.noarch

# ls -la /var/lib/etcd/
total 4
drwx------.  6 etcd etcd  136 Nov  2 02:40 .
drwxr-xr-x. 31 root root 4096 Nov  2 01:18 ..
drwxr-xr-x.  3 root root   17 Nov  2 01:18 etcd.etcd
drwx------.  4 root root   29 Nov  2 01:19 member
drwx------.  3 root root   20 Nov  2 02:40 openshift-backup-post-3.0-20171102024042
drwx------.  3 root root   20 Nov  2 02:39 openshift-backup-pre-upgrade-20171102023921

Comment 8 errata-xmlrpc 2017-11-28 22:13:02 UTC
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.