During upgrade from Q to R, rename ceph-ansible fetch directory tarball in Swift

Bug #1795513 reported by John Fulton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
John Fulton

Bug Description

tripleo-common fixes for LP bug 1769769 store a tarball in Swift with different names for different OpenStack versions. For example:

Q: temporary_dir-20180915-191756.tar.gz
R: temporary_dir.tar.gz

During upgrade from Q to R, TripleO should check if the Swift container ceph_ansible_fetch_dir on the undercloud contains a tarball whose name contains a timestamp and if so, it should rename it to remove the timestamp.

Revision history for this message
John Fulton (jfulton-org) wrote :

Extra background info on the timestamp.

It was originally used in Queens:

 https://github.com/openstack/tripleo-common/blob/master/tripleo_common/actions/files.py#L111-L112

but had to be removed in Rocky so that we could refer to the tarball with consistent GET/PUT URL:

 https://github.com/openstack/tripleo-common/commit/5a55202258c009d65885170080885d16645144ee

More info on the timestamp format below:

1. Python:
"""
(undercloud) [stack@undercloud ~]$ python
Python 2.7.5 (default, Apr 11 2018, 07:36:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from tripleo_common.utils import time_functions as timeutils
>>> 'temporary_dir-%s.tar.gz' % timeutils.timestamp()
'temporary_dir-20180915-190055.tar.gz'
>>>
"""

2. YAQL
"""
yaql> concat('temporary_dir-', now().format("%Y%m%d-%H%M%S"), '.tar.gz')
"temporary_dir-20180915-191756.tar.gz"
yaql>
"""

3. Ansible
"""
{{ ansible_date_time.date }}
{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}
{{ ansible_date_time.hour }}{{ ansible_date_time.minute }}{{ ansible_date_time.second }}
"""

tags: added: rocky-backport-potential
removed: upgrade
Revision history for this message
John Fulton (jfulton-org) wrote :

It seems I can add a new task to this workflow within this workbook to check if the old file format is present and if so, rename it. The task must be idempotent.

https://github.com/openstack/tripleo-common/blob/master/workbooks/plan_management.yaml#L244

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (master)

Fix proposed to branch: master
Review: https://review.openstack.org/607764

Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.openstack.org/607764
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=9cb8175139cfe29e83a9273705de9be297414a7d
Submitter: Zuul
Branch: master

commit 9cb8175139cfe29e83a9273705de9be297414a7d
Author: John Fulton <email address hidden>
Date: Thu Oct 4 01:35:48 2018 +0000

    Change ceph-ansible fetch directory format on upgrade from Q to R

    If the name of the tarball containing the ceph-ansible fetch directory
    matches the format found in Queens, then rename it to match the format
    expected in Rocky. I.e if temporary_dir-20180915-191756.tar.gz is found
    then rename it to temporary_dir.tar.gz. This workflow is idempotent and
    should be run before upgrading from Queens to Rocky.

    Change-Id: I048a5697fed269a6a27e82aca884cb9076fa0785
    Fixes-Bug: #1795513

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/611406

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (stable/rocky)

Reviewed: https://review.openstack.org/611406
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=eb2b7dc166ba0e55168d3a8bfbcd25c43edbbfe3
Submitter: Zuul
Branch: stable/rocky

commit eb2b7dc166ba0e55168d3a8bfbcd25c43edbbfe3
Author: John Fulton <email address hidden>
Date: Thu Oct 4 01:35:48 2018 +0000

    Change ceph-ansible fetch directory format on upgrade from Q to R

    If the name of the tarball containing the ceph-ansible fetch directory
    matches the format found in Queens, then rename it to match the format
    expected in Rocky. I.e if temporary_dir-20180915-191756.tar.gz is found
    then rename it to temporary_dir.tar.gz. This workflow is idempotent and
    should be run before upgrading from Queens to Rocky.

    Change-Id: I048a5697fed269a6a27e82aca884cb9076fa0785
    Fixes-Bug: #1795513
    (cherry picked from commit 9cb8175139cfe29e83a9273705de9be297414a7d)

tags: added: in-stable-rocky
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.