Bug 1756342 - OSP14->15: Protect against running data transfer step multiple times
Summary: OSP14->15: Protect against running data transfer step multiple times
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 15.0 (Stein)
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Jiri Stransky
QA Contact: Sasha Smolyak
URL:
Whiteboard:
Depends On:
Blocks: 1727807
TreeView+ depends on / blocked
 
Reported: 2019-09-27 12:47 UTC by Jiri Stransky
Modified: 2023-02-22 23:02 UTC (History)
3 users (show)

Fixed In Version: openstack-tripleo-heat-templates-10.6.2-0.20191106151728.42ba2c6.el8ost.noarch openstack-tripleo-common-10.8.2-0.20191112210509.234efc0.el8ost
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-05 12:00:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 684963 0 'None' MERGED [Stein] Optional flag file for tripleo-transfer to prevent overwriting 2020-10-01 09:07:21 UTC
OpenStack gerrit 685229 0 'None' MERGED Prevent running mysql data transfer twice by accident 2020-10-01 09:07:20 UTC
Red Hat Product Errata RHBA-2020:0643 0 None None None 2020-03-05 12:00:57 UTC

Description Jiri Stransky 2019-09-27 12:47:04 UTC
Description of problem:

The data transfer step copies data from non-bootstrap RHEL 7 controller to bootstrap RHEL 8 controller, overwriting the data on the bootstrap controller. It would be undesirable to overwrite the bootstrap node data by accident, so limit the `openstack overcloud external-upgrade run --tags system_upgrade_transfer_data` step to run just once.

Comment 1 Jiri Stransky 2019-09-27 12:49:03 UTC
If the user wants to re-run the step on purpose, they will have to first remove a flag file which prevents the re-run. The error message on 2nd run looks like:

TASK [tripleo-transfer : fail if flag file exists] *****************************
Thursday 26 September 2019  03:51:11 -0400 (0:00:00.635)       0:01:02.822 **** 
fatal: [undercloud -> 192.168.24.12]: FAILED! => {"changed": false, "msg": "Data transfer to '/var/lib/mysql' was prevented by flag file existence. This means the transfer was attempted before and another one would overwrite the data. If this is desired, remove the flag file at '/var/lib/tripleo/transfer-flags/var-lib-mysql' and re-run the data transfer.\n"}

Comment 6 Jose Luis Franco 2019-12-13 10:20:02 UTC
Working in tht:
(undercloud) [stack@undercloud-0 ~]$ rpm -qa | grep tripleo-heat-templates
openstack-tripleo-heat-templates-10.6.2-0.20191202200455.41d9f8a.el8ost.noarch


TASK [tripleo-transfer : fetch the archive] ************************************
changed: [undercloud -> 192.168.24.23] => {"changed": true, "checksum": "ac50f0405a30a4fb2491f34adb4fd6ecfa027fe7", "dest": "/var/lib/mistral/tripleo-transfer/controller-0/v
ar/lib/mysql.tar.gz", "md5sum": "2f5a8d07f9f15b6cacc6e594837b6b40", "remote_checksum": "ac50f0405a30a4fb2491f34adb4fd6ecfa027fe7", "remote_md5sum": null}
Friday 13 December 2019  05:15:57 -0500 (0:00:11.198)       0:04:04.495 ******* 


TASK [tripleo-transfer : remove tempfile] **************************************
changed: [undercloud -> 192.168.24.23] => {"changed": true, "path": "/tmp/ansible.tripleo-transfer.Q415OA", "state": "absent"}
Friday 13 December 2019  05:15:58 -0500 (0:00:00.593)       0:04:05.089 ******* 

TASK [tripleo-transfer : check flag file existence in destination host] ********
ok: [undercloud -> 192.168.24.16] => {"changed": false, "stat": {"atime": 1576198890.726, "attr_flags": "", "attributes": [], "block_size": 4096, "blocks": 0, "charset": "bi
nary", "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "ctime": 1576198890.726, "dev": 64514, "device_type": 0, "executable": false, "exists": true, "gid": 0, "gr_name": "root", "inode": 92730831, "isblk": false, "ischr": false, "isdir": false, "isfifo": false, "isgid": false, "islnk": false, "isreg": true, "issock": false, "isuid": fal
se, "mimetype": "inode/x-empty", "mode": "0644", "mtime": 1576198890.726, "nlink": 1, "path": "/var/lib/tripleo/transfer-flags/var-lib-mysql", "pw_name": "root", "readable":
 true, "rgrp": true, "roth": true, "rusr": true, "size": 0, "uid": 0, "version": "366940920", "wgrp": false, "woth": false, "writeable": true, "wusr": true, "xgrp": false, "xoth": false, "xusr": false}}
Friday 13 December 2019  05:15:58 -0500 (0:00:00.892)       0:04:05.981 ******* 

TASK [tripleo-transfer : fail if flag file exists] *****************************
fatal: [undercloud -> 192.168.24.16]: FAILED! => {"changed": false, "msg": "Data transfer to '/var/lib/mysql' was prevented by flag file existence. This means the transfer was attempted before and another one would overwrite the data. If this is desired, remove the flag file at '/var/lib/tripleo/transfer-flags/var-lib-mysql' and re-run the data
 transfer.\n"}

NO MORE HOSTS LEFT *************************************************************

PLAY RECAP *********************************************************************

Comment 7 Alex McLeod 2020-02-19 12:44:06 UTC
If this bug requires doc text for errata release, please set the 'Doc Type' and provide draft text according to the template in the 'Doc Text' field. The documentation team will review, edit, and approve the text.

If this bug does not require doc text, please set the 'requires_doc_text' flag to '-'.

Comment 10 errata-xmlrpc 2020-03-05 12:00:15 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/RHBA-2020:0643


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