Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1495545 - Wrong setting etcd_backup_tag variable when create etcd backup file
Wrong setting etcd_backup_tag variable when create etcd backup file
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Upgrade (Show other bugs)
3.7.0
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Jan Chaloupka
liujia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-26 05:36 EDT by liujia
Modified: 2017-11-28 17:13 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
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)


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 liujia 2017-09-26 05:36:00 EDT
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 07:44:29 EDT
Upstream PR: https://github.com/openshift/openshift-ansible/pull/5549
Comment 2 openshift-github-bot 2017-09-28 02:11:22 EDT
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 03:29:30 EDT
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 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.